/* ══════════════════════════════════════════════════════════
   CertPlatform — design system
   Palette drawn from the subject's own materials: document ink,
   brass foil stamp, wax seal, and warm certificate paper.
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,900&family=Public+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Ink — the navy of an official stamp pad */
  --ink:        #0F2942;
  --ink-deep:   #081A2C;
  --ink-soft:   #1E3F5E;
  --ink-mute:   #5A7189;

  /* Brass — foil stamp, seal ring */
  --brass:      #C08A2E;
  --brass-lite: #E8C77E;
  --brass-pale: #FAF0DC;

  /* Wax seal red — used only for destructive and alerts */
  --seal:       #9B2C2C;
  --seal-pale:  #FDF0F0;

  /* Paper */
  --paper:      #FAF7F0;
  --paper-warm: #F3EEE3;
  --white:      #FFFFFF;
  --rule:       #DFD8C9;
  --rule-soft:  #EDE8DC;

  /* Status */
  --ok:         #1F6F4A;
  --ok-pale:    #ECF7F1;
  --warn:       #8A5A11;
  --warn-pale:  #FDF6E7;

  /* Type */
  --display: 'Fraunces', Georgia, serif;
  --body:    'Public Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  /* Space + shape */
  --r-sm: 6px;  --r: 10px;  --r-lg: 16px;  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15,41,66,.06), 0 2px 6px rgba(15,41,66,.04);
  --shadow:    0 2px 8px rgba(15,41,66,.07), 0 8px 24px -8px rgba(15,41,66,.10);
  --shadow-lg: 0 12px 48px -12px rgba(15,41,66,.22);
  --sidebar-w: 258px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, svg { max-width: 100%; display: block; }
.hide { display: none !important; }

/* Accessible focus that survives the whole app */
:focus-visible {
  outline: 2.5px solid var(--brass);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── TYPE SCALE ─────────────────────────────────────────── */

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-variation-settings: 'SOFT' 20, 'WONK' 1; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.15rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
}

.lede { font-size: clamp(1rem, 2vw, 1.16rem); color: var(--ink-mute); max-width: 56ch; }

.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }

/* ─── BUTTONS ────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-size: .94rem; font-weight: 700;
  padding: .78rem 1.4rem; border-radius: var(--r);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .14s cubic-bezier(.2,.9,.3,1), box-shadow .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--ink-deep); box-shadow: var(--shadow); }

.btn-brass { background: var(--brass); color: var(--ink-deep); box-shadow: 0 4px 14px -4px rgba(192,138,46,.5); }
.btn-brass:hover:not(:disabled) { background: #A8781F; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--white); }

.btn-quiet { background: var(--paper-warm); color: var(--ink-soft); }
.btn-quiet:hover:not(:disabled) { background: var(--rule-soft); }

.btn-danger { background: var(--seal-pale); color: var(--seal); }
.btn-danger:hover:not(:disabled) { background: var(--seal); color: var(--white); }

.btn-sm { padding: .48rem .85rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ─── FORMS ──────────────────────────────────────────────── */

.field { margin-bottom: 1.05rem; }

label, .lbl {
  display: block; font-size: .82rem; font-weight: 700;
  color: var(--ink-soft); margin-bottom: .42rem; letter-spacing: .005em;
}
label .opt { font-weight: 400; color: var(--ink-mute); }
label .req { color: var(--seal); margin-left: 2px; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=url], input[type=date], input[type=number], textarea, select {
  width: 100%; font-family: var(--body); font-size: .95rem; color: var(--ink);
  padding: .74rem .9rem;
  background: var(--white);
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  transition: border-color .16s, box-shadow .16s;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A7189' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.4rem;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3.5px rgba(15,41,66,.09);
}
input::placeholder, textarea::placeholder { color: #A9B6C4; }

.help { font-size: .78rem; color: var(--ink-mute); margin-top: .35rem; }

/* ─── ALERTS ─────────────────────────────────────────────── */

.alert {
  padding: .8rem 1rem; border-radius: var(--r);
  font-size: .88rem; margin-bottom: 1rem;
  border-left: 3px solid;
  display: flex; gap: .6rem; align-items: flex-start;
}
.alert-ok   { background: var(--ok-pale);   color: var(--ok);   border-color: var(--ok); }
.alert-err  { background: var(--seal-pale); color: var(--seal); border-color: var(--seal); }
.alert-warn { background: var(--warn-pale); color: var(--warn); border-color: var(--brass); }
.alert-info { background: #EFF4F9;          color: var(--ink-soft); border-color: var(--ink-soft); }

/* ─── PILLS + BADGES ─────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  padding: .22rem .6rem; border-radius: 100px; text-transform: uppercase;
}
.pill-ok    { background: var(--ok-pale);    color: var(--ok); }
.pill-warn  { background: var(--warn-pale);  color: var(--warn); }
.pill-err   { background: var(--seal-pale);  color: var(--seal); }
.pill-mute  { background: var(--paper-warm); color: var(--ink-mute); }
.pill-brass { background: var(--brass-pale); color: #7A5510; }

/* ─── CARDS ──────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.card-head { margin-bottom: 1.1rem; }
.card-head h3 { font-size: 1.06rem; margin-bottom: .2rem; }
.card-head p  { font-size: .85rem; color: var(--ink-mute); }

/* ══════════════════════════════════════════════════════════
   APP SHELL — sidebar + content
   ══════════════════════════════════════════════════════════ */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--ink-deep); color: var(--paper);
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  display: flex; flex-direction: column;
  padding: 1.2rem .85rem;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: .7rem; padding: .35rem .5rem 1.6rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brass-lite), var(--brass));
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 1.15rem; color: var(--ink-deep);
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.brand-sub  { font-size: .68rem; color: #7E93A8; font-family: var(--mono); letter-spacing: .05em; }

.nav-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .68rem .75rem; margin-bottom: .15rem;
  border: none; background: none; cursor: pointer; text-align: left;
  color: #A9BCCE; font-family: var(--body); font-size: .89rem; font-weight: 600;
  border-radius: var(--r); text-decoration: none;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--paper); }
.nav-item.active { background: var(--brass); color: var(--ink-deep); }
.nav-item .ico { width: 17px; flex-shrink: 0; opacity: .9; }
.nav-item.active .ico { opacity: 1; }
.nav-count {
  margin-left: auto; background: var(--seal); color: #fff;
  font-size: .65rem; font-weight: 800; padding: .1rem .42rem;
  border-radius: 100px; min-width: 18px; text-align: center;
}

.nav-label {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .14em;
  text-transform: uppercase; color: #64798E;
  padding: 1.1rem .78rem .4rem;
}

.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.09); }

.who { display: flex; align-items: center; gap: .65rem; padding: .55rem .5rem .7rem; }
.who-av {
  width: 33px; height: 33px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brass-lite), var(--brass));
  display: grid; place-items: center;
  font-weight: 800; font-size: .82rem; color: var(--ink-deep);
}
.who-info { min-width: 0; }
.who-name { font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-plan { font-size: .68rem; color: var(--brass-lite); font-family: var(--mono); }

/* Content column */
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.topbar {
  display: none; align-items: center; gap: .8rem;
  padding: .8rem 1rem; background: var(--white);
  border-bottom: 1px solid var(--rule-soft);
  position: sticky; top: 0; z-index: 40;
}
.burger {
  width: 40px; height: 40px; border-radius: var(--r);
  border: 1.5px solid var(--rule); background: var(--white);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.burger span { display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
.burger span::before, .burger span::after {
  content: ''; position: absolute; left: 0; width: 17px; height: 2px;
  background: var(--ink); border-radius: 2px;
}
.burger span::before { top: -5.5px; } .burger span::after { top: 5.5px; }
.topbar-title { font-family: var(--display); font-weight: 700; font-size: 1rem; }

.scrim {
  display: none; position: fixed; inset: 0;
  background: rgba(8,26,44,.5); z-index: 50; backdrop-filter: blur(2px);
}
.scrim.on { display: block; }

.wrap { padding: 2rem 2.2rem 4rem; max-width: 1180px; }

.page-head { margin-bottom: 1.8rem; }
.page-head h2 { margin-bottom: .3rem; }
.page-head p { color: var(--ink-mute); font-size: .95rem; }

/* ─── STAT STRIP ─────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: .9rem; margin-bottom: 1.6rem; }
.stat {
  background: var(--white); border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg); padding: 1.1rem 1.2rem; position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(var(--brass-lite), var(--brass));
}
.stat-val {
  font-family: var(--display); font-size: 1.9rem; font-weight: 700;
  line-height: 1; margin-bottom: .25rem; font-variant-numeric: tabular-nums;
}
.stat-lbl { font-size: .74rem; color: var(--ink-mute); font-weight: 600; letter-spacing: .02em; }

/* ─── EVENT GRID ─────────────────────────────────────────── */

.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 1.1rem; }

.ev-card {
  background: var(--white); border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg); padding: 1.3rem;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s, border-color .2s;
  animation: rise .4s cubic-bezier(.2,.9,.3,1) both;
}
.ev-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brass), var(--brass-lite));
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.ev-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--rule); }
.ev-card:hover::before { transform: scaleX(1); }

.ev-seal {
  width: 42px; height: 42px; margin-bottom: .9rem;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--brass-pale); border: 1.5px solid var(--brass-lite);
  font-family: var(--display); font-weight: 900; font-size: 1.05rem; color: var(--brass);
}
.ev-card h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.ev-meta { font-size: .74rem; color: var(--ink-mute); font-family: var(--mono); margin-bottom: .8rem; }
.ev-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .9rem; }
.ev-foot { display: flex; gap: .4rem; padding-top: .85rem; border-top: 1px solid var(--rule-soft); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ─── DRAWER ─────────────────────────────────────────────── */

.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(490px, 100vw);
  background: var(--white); z-index: 70;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.on { transform: none; }
.drawer-head {
  padding: 1.4rem 1.5rem 1.1rem; border-bottom: 1px solid var(--rule-soft);
  display: flex; gap: .9rem; align-items: flex-start;
  position: sticky; top: 0; background: var(--white); z-index: 5;
}
.drawer-head h3 { font-size: 1.12rem; margin-bottom: .2rem; }
.drawer-body { padding: 1.4rem 1.5rem 2.5rem; overflow-y: auto; flex: 1; }
.drawer-sec { margin-bottom: 1.7rem; }
.drawer-sec > h4 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-mute); margin-bottom: .7rem;
}
.x-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1.5px solid var(--rule); background: var(--white);
  cursor: pointer; display: grid; place-items: center; font-size: 1rem; color: var(--ink-mute);
}
.x-btn:hover { background: var(--paper-warm); color: var(--ink); }

.kv { display: flex; gap: .8rem; padding: .68rem .85rem; background: var(--paper); border-radius: var(--r); margin-bottom: .4rem; }
.kv-k { font-size: .72rem; font-weight: 700; color: var(--ink-mute); min-width: 74px; flex-shrink: 0; padding-top: 1px; }
.kv-v { font-size: .82rem; font-weight: 600; word-break: break-word; }
.kv-v a { color: var(--ink-soft); }

.act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.act-grid .span2 { grid-column: span 2; }

/* ─── TABLES ─────────────────────────────────────────────── */

.tbl-wrap { overflow-x: auto; margin: 0 -.4rem; padding: 0 .4rem; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  text-align: left; padding: .6rem .55rem; font-size: .68rem;
  font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute); border-bottom: 1.5px solid var(--rule);
  white-space: nowrap;
}
td { padding: .78rem .55rem; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tbody tr:hover { background: var(--paper); }

/* ─── LIST ROWS ──────────────────────────────────────────── */

.row-item {
  border: 1px solid var(--rule-soft); border-radius: var(--r);
  padding: .95rem 1.1rem; margin-bottom: .55rem; background: var(--white);
  transition: border-color .15s;
}
.row-item:hover { border-color: var(--rule); }
.row-item h4 { font-family: var(--body); font-size: .92rem; font-weight: 700; margin-bottom: .18rem; }
.row-meta { font-size: .74rem; color: var(--ink-mute); font-family: var(--mono); }
.row-acts { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap; }

.empty {
  text-align: center; padding: 2.6rem 1rem; color: var(--ink-mute); font-size: .88rem;
  border: 1.5px dashed var(--rule); border-radius: var(--r-lg); background: var(--paper);
}
.empty strong { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--ink); margin-bottom: .3rem; }

/* ─── FIELD EDITOR ───────────────────────────────────────── */

.fld-list { background: var(--paper); border-radius: var(--r-lg); padding: .9rem; }
.fld {
  background: var(--white); border: 1.5px solid var(--rule-soft); border-radius: var(--r);
  padding: .8rem .95rem; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .8rem; cursor: grab;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.fld:active { cursor: grabbing; }
.fld.dragging { opacity: .4; }
.fld.over { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-pale); }
.fld-grip { color: #C3CDD7; font-size: 1rem; flex-shrink: 0; letter-spacing: -2px; }
.fld-info { flex: 1; min-width: 0; }
.fld-lbl { font-size: .88rem; font-weight: 700; }
.fld-sub { font-size: .72rem; color: var(--ink-mute); font-family: var(--mono); }
.fld-acts { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }

.toggle { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: absolute; inset: 0; background: #CBD5DF; border-radius: 100px;
  cursor: pointer; transition: background .2s;
}
.toggle .track::after {
  content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  background: var(--white); border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(17px); }
.toggle input:focus-visible + .track { outline: 2.5px solid var(--brass); outline-offset: 2px; }

.add-fld {
  width: 100%; padding: .8rem; margin-top: .5rem;
  border: 1.5px dashed var(--rule); border-radius: var(--r);
  background: transparent; color: var(--ink-soft);
  font-family: var(--body); font-size: .87rem; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.add-fld:hover { border-color: var(--brass); background: var(--brass-pale); color: #7A5510; }

/* ─── MODAL ──────────────────────────────────────────────── */

.modal { display: none; position: fixed; inset: 0; z-index: 200; padding: 1rem;
  background: rgba(8,26,44,.55); backdrop-filter: blur(3px); }
.modal.on { display: grid; place-items: center; }
.modal-box {
  background: var(--white); border-radius: var(--r-xl); padding: 1.7rem;
  width: 100%; max-width: 430px; box-shadow: var(--shadow-lg);
  max-height: 92vh; overflow-y: auto;
  animation: pop .22s cubic-bezier(.2,.9,.3,1);
}
.modal-box.wide { max-width: 560px; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-box h3 { margin-bottom: 1.1rem; }
.modal-acts { display: flex; gap: .6rem; margin-top: 1.4rem; }
.modal-acts .btn { flex: 1; }

/* ─── DROPZONE ───────────────────────────────────────────── */

.drop {
  border: 2px dashed var(--rule); border-radius: var(--r-lg);
  padding: 1.6rem 1rem; text-align: center; cursor: pointer;
  background: var(--paper); position: relative;
  transition: border-color .16s, background .16s;
}
.drop:hover, .drop.over { border-color: var(--brass); background: var(--brass-pale); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-ico { font-size: 1.6rem; margin-bottom: .4rem; }
.drop-txt { font-size: .85rem; color: var(--ink-mute); line-height: 1.45; }
.drop-txt b { color: var(--ink-soft); }

.photo-prev { text-align: center; margin-top: .8rem; }
.photo-prev img {
  width: 104px; height: 104px; border-radius: var(--r); object-fit: cover;
  border: 3px solid var(--brass); margin: 0 auto .5rem;
}

/* ─── PROGRESS ───────────────────────────────────────────── */

.bar { height: 7px; background: var(--rule-soft); border-radius: 100px; overflow: hidden; margin: .55rem 0; }
.bar-fill { height: 100%; border-radius: 100px; transition: width .35s ease;
  background: linear-gradient(90deg, var(--brass), var(--brass-lite)); }

.log-line { font-size: .8rem; padding: .28rem 0; font-family: var(--mono); }
.log-ok  { color: var(--ok); }
.log-err { color: var(--seal); }

/* ─── COPY CHIPS ─────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip {
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  padding: .36rem .68rem; border-radius: var(--r-sm);
  background: var(--white); border: 1.5px solid var(--rule);
  cursor: pointer; user-select: none;
  transition: border-color .14s, background .14s, color .14s;
}
.chip:hover { border-color: var(--ink-soft); background: var(--paper-warm); }
.chip.done { border-color: var(--ok); background: var(--ok-pale); color: var(--ok); }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: .7rem; }
.tag-card {
  background: var(--paper); border: 1.5px solid var(--rule-soft);
  border-radius: var(--r); padding: .9rem;
  display: flex; flex-direction: column; gap: .55rem;
  transition: border-color .15s;
}
.tag-card:hover { border-color: var(--brass-lite); }
.tag-code {
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  color: var(--ink); background: var(--brass-pale);
  padding: .5rem .7rem; border-radius: var(--r-sm); cursor: pointer;
  word-break: break-all; transition: background .14s;
}
.tag-code:hover { background: var(--brass-lite); }
.tag-code.img { background: #E9EEF3; }
.tag-desc { font-size: .76rem; color: var(--ink-mute); line-height: 1.45; flex: 1; }

.sheet-block {
  background: var(--paper); border: 1px solid var(--rule-soft);
  border-radius: var(--r); padding: .95rem 1.05rem; margin-bottom: .8rem;
}
.sheet-name { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; font-weight: 700; font-size: .9rem; }

/* ─── CHECKLIST ──────────────────────────────────────────── */

.check {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem .85rem; background: var(--paper);
  border: 1.5px solid var(--rule-soft); border-radius: var(--r);
  margin-bottom: .45rem; cursor: pointer; transition: border-color .14s, background .14s;
}
.check:hover { border-color: var(--rule); }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--ok); flex-shrink: 0; cursor: pointer; }
.check span { font-size: .85rem; line-height: 1.5; }
.check:has(input:checked) { background: var(--ok-pale); border-color: var(--ok); }
.check:has(input:checked) span { color: var(--ok); }

.step { display: flex; gap: .8rem; margin-bottom: .85rem; align-items: flex-start; }
.step-n {
  width: 23px; height: 23px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-size: .74rem; font-weight: 700;
}
.step p { font-size: .87rem; line-height: 1.55; }

.code-block {
  background: var(--ink-deep); color: #9FD4E8;
  padding: .95rem 1.1rem; border-radius: var(--r);
  font-family: var(--mono); font-size: .76rem; line-height: 1.8;
  overflow-x: auto; margin: .8rem 0;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.on { transform: none; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .wrap { padding: 1.3rem 1.1rem 3.5rem; }
  .drawer { width: 100vw; }
  .act-grid { grid-template-columns: 1fr; }
  .act-grid .span2 { grid-column: auto; }
}

@media (max-width: 560px) {
  .ev-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { padding: .9rem; }
  .stat-val { font-size: 1.5rem; }
  .card { padding: 1.15rem; border-radius: var(--r); }
  .modal-box { padding: 1.3rem; border-radius: var(--r-lg); }
  .tag-grid { grid-template-columns: 1fr; }
  .fld { flex-wrap: wrap; }
  .fld-acts { width: 100%; justify-content: flex-end; }
}
