/* ===========================================================================
   MedHub — ISUMS Medical Students' Association
   Same palette and typefaces as isums-msa.com: navy #1B2A4A, champagne gold
   #B98F45, Bricolage Grotesque for display, Instrument Sans for text.
   =========================================================================== */

:root {
  --ink:     #0A1120;
  --ink-2:   #0E182B;
  --slab:    #14203A;
  --slab-2:  #1B2A4A;
  --slab-3:  #223357;
  --line:    #24365A;
  --line-2:  #33497490;
  --hair:    #FFFFFF0A;

  --say:     #EDF1F8;
  --mute:    #9BADCA;
  --faint:   #6A7EA3;

  --gold:    #B98F45;
  --gold-lt: #D8B26B;
  --gold-dk: #8F6C31;
  --gold-w:  #B98F4514;
  --gold-e:  #B98F4538;

  --ok:      #55B48C;
  --warn:    #DDA352;
  --bad:     #D9736B;

  --r:    12px;
  --r-s:  8px;
  --r-xs: 6px;

  --disp: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --side-w: 264px;
  --top-h:  62px;

  --lift:  0 1px 1px #0000004d, 0 10px 30px -8px #00000059;
  --lift-2:0 2px 4px #00000059, 0 24px 60px -12px #00000073;
}

[data-theme="light"] {
  --ink:     #F2F5FA;
  --ink-2:   #E9EEF6;
  --slab:    #FFFFFF;
  --slab-2:  #FFFFFF;
  --slab-3:  #F4F7FC;
  --line:    #DAE2EF;
  --line-2:  #C4D0E2;
  --hair:    #1B2A4A08;

  --say:     #14213C;
  --mute:    #56688A;
  --faint:   #8393B0;

  --gold:    #96702F;
  --gold-lt: #B98F45;
  --gold-dk: #6F521F;
  --gold-w:  #B98F4512;
  --gold-e:  #B98F4540;

  --lift:  0 1px 2px #1b2a4a12, 0 8px 24px -8px #1b2a4a1f;
  --lift-2:0 2px 6px #1b2a4a17, 0 20px 50px -12px #1b2a4a2b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100dvh;
  background: var(--ink);
  color: var(--say);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 480px at 76% -12%, #B98F4514, transparent 68%),
    radial-gradient(760px 420px at 8% 4%, #2A3F6B26, transparent 66%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(900px 480px at 76% -12%, #B98F450f, transparent 68%),
    radial-gradient(760px 420px at 8% 4%, #1b2a4a0a, transparent 66%);
}

a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: var(--gold-lt); }
:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold-e); }

/* ── wordmark ───────────────────────────────────────────────────────────── */
.mark {
  font-family: var(--disp);
  font-weight: 800; font-size: 40px; letter-spacing: -.035em;
  margin: 0; line-height: 1; text-decoration: none; color: var(--say);
}
.auth-head-line {
  font-family: var(--disp); font-weight: 700; font-size: 33px; text-wrap: balance;
  letter-spacing: -.03em; line-height: 1.12; margin: 0; color: var(--say);
}
.crest {
  width: 136px; height: 136px; display: block; margin: 0 0 24px;
  filter: drop-shadow(0 6px 18px #0000004d);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-crest { width: 30px; height: 30px; display: block; }
.boot-crest { width: 72px; height: 72px; display: block; margin-bottom: 22px; }

.mark-sm { font-size: 20px; letter-spacing: -.028em; }
.kicker {
  font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 12px;
}

/* ── boot ───────────────────────────────────────────────────────────────── */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; background: var(--ink); z-index: 90; }
.boot-mark { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin .75s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── auth ───────────────────────────────────────────────────────────────── */
.auth { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 40px 22px; }
.auth-inner { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 400px; gap: 60px; align-items: center; }
.auth-brand { max-width: 390px; }
.auth-sub { color: var(--mute); font-size: 15.5px; margin: 14px 0 0; max-width: 38ch; }

.auth-card {
  background: linear-gradient(180deg, var(--slab-2), var(--slab));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 24px 22px;
  box-shadow: var(--lift-2);
  position: relative;
}
.auth-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-e), transparent);
}

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 3px; margin-bottom: 20px;
}
.seg-btn {
  appearance: none; border: 0; background: transparent; color: var(--mute);
  font: 600 13.5px var(--sans); padding: 9px 6px; border-radius: var(--r-xs);
  cursor: pointer; transition: background .16s, color .16s;
}
.seg-btn.is-on { background: var(--slab-3); color: var(--say); box-shadow: inset 0 1px 0 var(--hair); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--mute); letter-spacing: .01em; }
.field input, .field textarea, .sel select {
  appearance: none; width: 100%;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r-s); color: var(--say);
  font: 400 15px var(--sans); padding: 11px 13px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .sel select:focus {
  outline: none; border-color: var(--gold); background: var(--ink);
  box-shadow: 0 0 0 3px var(--gold-w);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }

.sel { position: relative; }
.sel::after {
  content: ''; position: absolute; right: 14px; top: 50%;
  width: 7px; height: 7px; border-right: 1.6px solid var(--mute); border-bottom: 1.6px solid var(--mute);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.sel select { padding-right: 36px; cursor: pointer; }

.hint { margin: 0; font-size: 12px; color: var(--faint); }
.msg { margin: 0; padding: 10px 12px; border-radius: var(--r-s); font-size: 13px; border: 1px solid; }
.msg.err { color: var(--bad); border-color: #d9736b3d; background: #d9736b12; }
.msg.ok  { color: var(--ok);  border-color: #55b48c3d; background: #55b48c12; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--r-s);
  font: 600 14px var(--sans); padding: 10px 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .16s, border-color .16s, transform .1s, opacity .16s;
  white-space: nowrap; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 12px 18px; font-size: 15px; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  color: #1A1305; border-color: var(--gold-dk);
  box-shadow: inset 0 1px 0 #ffffff40, 0 1px 2px #0003;
}
.btn-gold:hover { background: linear-gradient(180deg, #E2C084, var(--gold-lt)); }
[data-theme="light"] .btn-gold { color: #fff; }

.btn-quiet { background: var(--slab); border-color: var(--line); color: var(--say); }
.btn-quiet:hover { border-color: var(--line-2); background: var(--slab-3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mute); }
.btn-ghost:hover { color: var(--say); background: var(--slab); }
.btn-danger { background: transparent; border-color: #d9736b40; color: var(--bad); }
.btn-danger:hover { background: #d9736b14; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }

.btn-link {
  appearance: none; background: none; border: 0; color: var(--mute);
  font: 500 13px var(--sans); cursor: pointer; padding: 4px;
  text-decoration: underline; text-underline-offset: 3px; justify-self: center;
}
.btn-link:hover { color: var(--say); }

.icon-btn {
  appearance: none; background: transparent; border: 1px solid transparent;
  color: var(--mute); border-radius: var(--r-s); width: 34px; height: 34px;
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: color .16s, background .16s;
}
.icon-btn:hover { color: var(--say); background: var(--slab); }

/* ── gates ──────────────────────────────────────────────────────────────── */
.gate { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 32px 22px; }
.gate-card {
  width: min(450px, 100%); text-align: center;
  background: linear-gradient(180deg, var(--slab-2), var(--slab));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 34px 30px 28px; box-shadow: var(--lift-2);
}
.gate-ico {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; color: var(--gold);
  background: var(--gold-w); border: 1px solid var(--gold-e);
}
.gate-ico svg { width: 22px; height: 22px; }
.gate-card h2 { font-family: var(--disp); font-weight: 700; margin: 0 0 10px; font-size: 22px; letter-spacing: -.02em; }
.gate-card p { color: var(--mute); font-size: 14px; margin: 0 0 12px; }
.gate-card .tiny { color: var(--faint); font-size: 12.5px; }
.gate-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.gate-card .field { text-align: left; margin-bottom: 12px; }

/* ── top bar ────────────────────────────────────────────────────────────── */
.app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 0 18px; height: var(--top-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  position: sticky; top: 0; z-index: 30;
}
.by {
  font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--gold); border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px;
}
.nav-toggle { display: none; }

.search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
#q {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r-s); color: var(--say); font: 400 14px var(--sans);
  padding: 9px 34px 9px 34px; transition: border-color .16s, box-shadow .16s;
}
#q:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-w); }
#q::placeholder { color: var(--faint); }
#q::-webkit-search-cancel-button { display: none; }
.kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 600 10.5px var(--sans); color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; pointer-events: none;
}
.ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: none; }
[data-theme="light"] .ico-sun { display: block; }

.who { position: relative; flex: none; }
.who-btn {
  display: flex; align-items: center; gap: 9px; appearance: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-s);
  padding: 4px 8px 4px 4px; cursor: pointer; color: inherit; transition: background .16s, border-color .16s;
}
.who-btn:hover { background: var(--slab); border-color: var(--line); }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--gold-lt), var(--gold-dk));
  color: #1A1305; font: 700 13px var(--disp); box-shadow: inset 0 1px 0 #ffffff4d;
}
.who-meta { display: grid; text-align: left; line-height: 1.25; }
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.chev { width: 15px; height: 15px; color: var(--faint); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 216px;
  background: var(--slab-2); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--lift-2); padding: 6px; z-index: 40;
}
.menu-head { margin: 0; padding: 8px 10px 10px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); word-break: break-all; }
.menu-item {
  appearance: none; width: 100%; text-align: left; background: none; border: 0;
  color: var(--say); font: 500 13.5px var(--sans); padding: 9px 10px;
  border-radius: var(--r-xs); cursor: pointer; margin-top: 4px;
}
.menu-item:hover { background: var(--slab-3); }

/* ── shell + sidebar ────────────────────────────────────────────────────── */
.shell { display: flex; flex: 1; min-height: 0; }

.side {
  width: var(--side-w); flex: none; border-right: 1px solid var(--line);
  position: sticky; top: var(--top-h); align-self: flex-start;
  height: calc(100dvh - var(--top-h)); overflow-y: auto;
  background: color-mix(in srgb, var(--ink-2) 60%, transparent);
}
.side-inner { padding: 18px 14px 40px; }
.side-cap {
  font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 10px; padding: 0 6px;
}
#manage .side-cap { margin-top: 26px; }

/* batch picker — the control the whole app now turns on */
.batchbox { margin-bottom: 20px; }
.batch-sel select {
  background: linear-gradient(180deg, var(--slab-3), var(--slab-2));
  border-color: var(--gold-e); font-weight: 600; font-size: 13px; padding: 10px 32px 10px 11px;
}
.batch-sel select:hover { border-color: var(--gold); }
.batch-note {
  margin: 9px 2px 0; font-size: 11.5px; color: var(--faint); line-height: 1.45;
}
.batch-note.edit { color: var(--gold); }
.btn-inline {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--gold-lt); font: 600 11.5px var(--sans); text-decoration: underline; text-underline-offset: 2px;
}
.chk-grid { display: grid; gap: 8px; }
.chk {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--ink-2); font-size: 13.5px;
}
.chk:hover { border-color: var(--gold-e); }
.field input[disabled] { opacity: .62; cursor: default; }

/* year pills */
.years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 22px; }
.yr {
  appearance: none; cursor: pointer; position: relative;
  background: var(--slab); border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--mute); font: 600 13px var(--sans); padding: 9px 0;
  transition: border-color .16s, color .16s, background .16s;
}
.yr:hover:not([disabled]) { color: var(--say); border-color: var(--line-2); }
.yr[disabled] { opacity: .34; cursor: default; }
.yr.is-mine::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--gold);
}
.yr.is-on {
  background: linear-gradient(180deg, var(--slab-3), var(--slab-2));
  border-color: var(--gold); color: var(--say);
  box-shadow: inset 0 1px 0 var(--hair), 0 0 0 3px var(--gold-w);
}

/* tree */
.tree { display: grid; gap: 1px; }
.node { display: grid; }
.node-row {
  appearance: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  background: none; border: 0; border-radius: var(--r-xs); color: var(--mute);
  font: 500 13.5px var(--sans); padding: 8px 8px; text-align: left; width: 100%;
  transition: background .14s, color .14s;
}
.node-row:hover { background: var(--slab); color: var(--say); }
.node-row.is-on { background: var(--slab-2); color: var(--say); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); }
.node-ico { width: 18px; height: 18px; flex: none; color: var(--gold); opacity: .9; }
.node-ico svg, .node-ico img { width: 18px; height: 18px; }
.node-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-caret { width: 15px; height: 15px; flex: none; color: var(--faint); transition: transform .16s; }
.node.is-open > .node-row .node-caret { transform: rotate(90deg); }
.node-kids { margin-left: 13px; padding-left: 9px; border-left: 1px solid var(--line); display: none; }
.node.is-open > .node-kids { display: block; }

.side-link {
  appearance: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  background: none; border: 0; border-radius: var(--r-xs); color: var(--mute);
  font: 500 13.5px var(--sans); padding: 8px; width: 100%; text-align: left;
  transition: background .14s, color .14s;
}
.side-link:hover { background: var(--slab); color: var(--say); }
.side-link.is-on { background: var(--slab-2); color: var(--say); box-shadow: inset 2px 0 0 var(--gold); }
.side-link svg { width: 17px; height: 17px; color: var(--faint); }
.side-link.is-on svg { color: var(--gold); }
.pipp {
  margin-left: auto; font: 700 10.5px var(--sans); background: var(--gold);
  color: #1A1305; border-radius: 20px; padding: 1px 7px;
}

/* ── stage ──────────────────────────────────────────────────────────────── */
.stage { flex: 1; min-width: 0; padding: 24px 32px 80px; max-width: 1180px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); margin-bottom: 18px; min-height: 18px; }
.crumbs button { appearance: none; background: none; border: 0; cursor: pointer; color: var(--mute); font: inherit; padding: 2px 3px; border-radius: 4px; }
.crumbs button:hover { color: var(--gold-lt); }
.crumbs .sep { color: var(--line-2); }
.crumbs .here { color: var(--say); font-weight: 500; }

.head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.head-txt { flex: 1; min-width: 0; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 9px; }
.head h1 { font-family: var(--disp); font-weight: 700; font-size: 32px; letter-spacing: -.028em; margin: 0 0 8px; line-height: 1.12; }
.head p { color: var(--mute); margin: 0; font-size: 14.5px; max-width: 64ch; }
.head-acts { display: flex; gap: 8px; flex: none; }

.sect {
  display: flex; align-items: center; gap: 12px; margin: 34px 0 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.sect::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.sect .n { color: var(--gold); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 13px; }
.card {
  appearance: none; text-align: left; cursor: pointer; position: relative;
  background: linear-gradient(180deg, var(--slab-2), var(--slab));
  border: 1px solid var(--line); border-radius: var(--r); padding: 17px;
  display: grid; gap: 11px; color: inherit; box-shadow: var(--lift);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--hair), transparent); }
.card:hover { border-color: var(--gold-e); transform: translateY(-2px); box-shadow: var(--lift-2); }
.card-ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--gold-w); color: var(--gold-lt); border: 1px solid var(--gold-e);
}
.card-ico svg, .card-ico img { width: 20px; height: 20px; }
.card-name { font-family: var(--disp); font-weight: 600; font-size: 16px; letter-spacing: -.012em; }
.card-sub { font-size: 12.5px; color: var(--faint); }
.card.is-draft { border-style: dashed; }

/* resource rows */
.rows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--lift); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--slab); color: inherit; text-decoration: none; transition: background .14s; }
.row:hover { background: var(--slab-2); }
.row-ico { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--ink-2); border: 1px solid var(--line); color: var(--mute); }
.row-ico svg { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; }
.row-title.as-link { appearance: none; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: var(--sans); }
.row-title.as-link:hover { color: var(--gold-lt); }
.row-title.as-link[disabled] { opacity: .5; cursor: wait; }
.field input[type=file] {
  padding: 9px 12px; font-size: 13.5px; cursor: pointer; color: var(--mute);
}
.field input[type=file]::file-selector-button {
  appearance: none; margin-right: 12px; cursor: pointer;
  background: var(--slab-3); border: 1px solid var(--line); color: var(--say);
  font: 600 13px var(--sans); padding: 7px 13px; border-radius: var(--r-xs);
}
.field input[type=file]::file-selector-button:hover { border-color: var(--gold-e); }
.row-title { font-weight: 600; font-size: 14.5px; display: block; text-decoration: none; color: inherit; }
a.row-title:hover { color: var(--gold-lt); }
.row-meta { font-size: 12px; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; }
.row-acts { display: flex; gap: 4px; flex: none; opacity: 0; transition: opacity .14s; }
.row:hover .row-acts, .row:focus-within .row-acts { opacity: 1; }
.row-open { color: var(--faint); flex: none; }
.row:hover .row-open { color: var(--gold-lt); }

.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--mute); }
.tag.final { color: var(--warn); border-color: #dda35240; background: #dda3520f; }
.tag.mid   { color: var(--gold-lt); border-color: var(--gold-e); background: var(--gold-w); }
.tag.ref   { color: var(--faint); }
.tag.pend  { color: var(--warn); border-color: #dda35240; }

/* notices */
.notice { display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--r-s); font-size: 13px; border: 1px solid; margin: 18px 0; }
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.notice.warn { color: var(--warn); border-color: #dda35233; background: #dda3520d; }
.notice.info { color: var(--mute); border-color: var(--line); background: var(--slab); }

.arch-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--slab); }
.arch-txt { font-size: 13px; color: var(--mute); }
.arch-txt strong { color: var(--say); }

.empty { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 40px 26px; text-align: center; }
.empty-ico { width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--gold-w); border: 1px solid var(--gold-e); color: var(--gold); }
.empty h3 { font-family: var(--disp); margin: 0 0 6px; font-size: 16px; color: var(--say); font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 13.5px; color: var(--faint); max-width: 48ch; margin-inline: auto; }

.skel { display: grid; gap: 10px; }
.skel-row { height: 62px; border-radius: var(--r); background: var(--slab); border: 1px solid var(--line); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* admin tables */
.tbl { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--slab); box-shadow: var(--lift); }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); padding: 11px 15px; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--slab-2); }
.tbl .right { text-align: right; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.rolecell { display: grid; gap: 3px; justify-items: start; }
.mutetxt { color: var(--mute); font-size: 14px; }
.btn-link.tiny, .mutetxt.tiny { font-size: 11.5px; justify-self: start; padding: 0; color: var(--faint); }
.btn-link.tiny:hover { color: var(--gold-lt); }

/* tree editor */
.ted { display: grid; gap: 6px; }
.ted-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--slab); border: 1px solid var(--line); border-radius: var(--r-s); }
.ted-row .node-ico { color: var(--gold-lt); }
.ted-name { flex: 1; font-weight: 500; font-size: 14px; }
.ted-kids { margin-left: 18px; padding-left: 12px; border-left: 1px solid var(--line); display: grid; gap: 6px; margin-top: 6px; }
.ted-meta { font-size: 11.5px; color: var(--faint); }

/* ── modal ──────────────────────────────────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; }
.modal-back { position: absolute; inset: 0; background: #000000ad; backdrop-filter: blur(3px); }
.modal {
  position: relative; width: min(560px, 100%); max-height: 88dvh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--slab-2), var(--slab));
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--lift-2);
}
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-top h2 { font-family: var(--disp); font-weight: 700; font-size: 19px; margin: 0; letter-spacing: -.02em; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* icon picker */
.ipick { display: grid; gap: 12px; }
.ipick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; max-height: 218px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--ink-2); }
.ipick-b { appearance: none; cursor: pointer; aspect-ratio: 1; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--mute); display: grid; place-items: center; transition: background .14s, color .14s, border-color .14s; }
.ipick-b:hover { background: var(--slab); color: var(--say); }
.ipick-b.is-on { border-color: var(--gold); background: var(--gold-w); color: var(--gold-lt); }
.ipick-b svg { width: 21px; height: 21px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--slab-2); border: 1px solid var(--line); color: var(--say); padding: 12px 17px; border-radius: var(--r); box-shadow: var(--lift-2); font-size: 13.5px; z-index: 95; max-width: 90vw; }
.toast.err { border-color: #d9736b4d; color: var(--bad); }

.scrim { position: fixed; inset: var(--top-h) 0 0; background: #000000b3; z-index: 20; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .auth-inner { grid-template-columns: 1fr; gap: 32px; max-width: 420px; }
  .auth-brand { text-align: center; margin-inline: auto; }
  .crest { margin-inline: auto; width: 108px; height: 108px; }
  .auth-head-line { font-size: 28px; }
  .auth-sub { margin-inline: auto; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .by { display: none; }
  .who-meta, .chev { display: none; }
  .stage { padding: 20px 18px 64px; }
  /* Drawer geometry lives in the consolidated drawer block further down. */
  .head { flex-direction: column; gap: 14px; }
  .head-acts { width: 100%; }
  .head-acts .btn { flex: 1; }
}

@media (max-width: 560px) {
  #theme-btn { display: none; }
  .top { gap: 9px; padding: 0 12px; }
  .search { max-width: none; }
  .kbd { display: none; }
  .head h1 { font-size: 25px; }
  .crest { width: 92px; height: 92px; }
  .auth-head-line { font-size: 25px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .row { padding: 12px; gap: 11px; }
  .row-acts { opacity: 1; }
  .arch-bar { flex-direction: column; align-items: stretch; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal { max-height: 92dvh; border-radius: var(--r) var(--r) 0 0; width: 100%; }
}
#menu-theme { display: none; }
@media (max-width: 560px) { #menu-theme { display: block; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* ── UX phase 1: dashboard + smarter search ───────────────────────────── */
.home-head { margin-bottom: 18px; }
.home-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.home-panel {
  min-width: 0;
  background: linear-gradient(180deg, var(--slab-2), var(--slab));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--lift);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 {
  font-family: var(--disp);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 0 0 3px;
}
.panel-head p { margin: 0; color: var(--faint); font-size: 12px; }
.panel-empty {
  min-height: 82px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  border-radius: var(--r-s);
  padding: 16px;
}
.home-panel .rows { box-shadow: none; }
.rows.compact .row { padding: 10px 11px; gap: 10px; }
.rows.compact .row-ico { width: 30px; height: 30px; border-radius: 8px; }
.rows.compact .row-title { font-size: 13.5px; }
.rows.compact .row-meta { font-size: 11px; gap: 6px; }
.rows.compact .row-open { display: none; }
.skel-panel { min-height: 138px; }
.browse-head { margin-top: 2px; }
.sect.plain { margin-top: 0; margin-bottom: 12px; }

.search-head { margin-bottom: 14px; }
.search-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.filter-group {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  border-radius: var(--r-s);
  overflow-x: auto;
  max-width: 100%;
}
.filter-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  border-radius: 6px;
  padding: 7px 10px;
  font: 600 12px var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip:hover { color: var(--say); background: var(--slab); }
.filter-chip.is-on {
  color: var(--say);
  background: var(--slab-3);
  box-shadow: inset 0 0 0 1px var(--line);
}
@media (max-width: 760px) {
  .home-panels { grid-template-columns: 1fr; }
  .search-tools { align-items: stretch; }
  .filter-group { width: 100%; }
}


/* ── UX phase 2: premium polish, preview, progress ─────────────────────── */
.stage {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}

.top {
  box-shadow: 0 10px 34px -30px #000;
}

.top-home {
  appearance: none;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--slab) 78%, transparent);
  color: var(--mute);
  font: 600 12.5px var(--sans);
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .12s;
}
.top-home svg { width: 15px; height: 15px; }
.top-home:hover {
  color: var(--say);
  border-color: var(--gold-e);
  background: var(--slab-2);
}
.top-home:active { transform: translateY(1px); }

.home-head {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 2px);
  background:
    radial-gradient(420px 160px at 92% 0%, var(--gold-w), transparent 70%),
    linear-gradient(180deg, var(--slab-2), var(--slab));
  box-shadow: var(--lift);
}
.home-head::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-e), transparent);
}

.home-panel {
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.home-panel:hover {
  border-color: color-mix(in srgb, var(--gold) 26%, var(--line));
  box-shadow: var(--lift-2);
}

.card {
  overflow: hidden;
}
.card:hover .card-ico {
  transform: translateY(-1px);
  border-color: var(--gold);
}
.card-ico { transition: transform .18s, border-color .18s; }

.row {
  min-height: 64px;
}
.row:hover .row-title {
  color: var(--say);
}
.row-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .14s, transform .14s;
}
.row-open-label {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .14s, transform .14s;
}
.row:hover .row-open-label,
.row:focus-within .row-open-label {
  opacity: 1;
  transform: none;
}
.row:hover .row-open { transform: translateX(1px); }

/* upload progress */
.upload-progress {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--ink-2);
}
.upload-progress.is-done { border-color: #55b48c45; }
.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--mute);
  font-size: 12.5px;
}
.progress-copy strong { color: var(--say); font-size: 11.5px; }
.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--slab-3);
  border: 1px solid var(--line);
}
.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dk), var(--gold-lt));
  transition: width .18s ease-out;
}
.progress-detail {
  min-height: 14px;
  color: var(--faint);
  font-size: 11px;
}

/* large in-app document preview */
body.preview-open { overflow: hidden; }
.preview-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 26px;
}
.preview-back {
  position: absolute;
  inset: 0;
  background: #050912cf;
  backdrop-filter: blur(8px);
}
.preview-shell {
  position: relative;
  width: min(1180px, 96vw);
  height: min(860px, 90dvh);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: calc(var(--r) + 4px);
  background: var(--slab);
  box-shadow: 0 34px 100px -22px #000000d9;
}
.preview-top {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px 12px 19px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--slab-2) 92%, transparent);
}
.preview-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.preview-kicker {
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.preview-heading h2 {
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-family: var(--disp);
  font-size: 17px;
  letter-spacing: -.015em;
}
.preview-meta { color: var(--faint); font-size: 11.5px; }
.preview-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}
.preview-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #0a0e16;
}
#preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0a0e16;
}
.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #d9dfeb;
  font-size: 12.5px;
  background: #0a0e16;
}
.preview-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #ffffff24;
  border-top-color: #ffffffc7;
  border-radius: 50%;
  animation: preview-spin .8s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .top-home span { display: none; }
  .top-home { width: 34px; padding: 0; justify-content: center; }
}

@media (max-width: 620px) {
  .by { display: none; }
  .preview-wrap { padding: 0; }
  .preview-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
  .preview-top { min-height: 64px; padding: 10px 10px 10px 14px; }
  .preview-heading h2 { max-width: 54vw; font-size: 15px; }
  #preview-external { padding: 8px 10px; font-size: 12px; }
  .row-open-label { display: none; }
  .home-head { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-spinner { animation-duration: 1.2s; }
}


/* ==========================================================================
   MedHub major UX upgrade
   ========================================================================== */

.search { position: relative; }
.quick-search {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 70;
  overflow: hidden;
  min-width: min(620px, 80vw);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--slab-2);
  box-shadow: var(--lift-2);
}
.quick-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 7px; color: var(--faint);
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.quick-head kbd { font-size: 10px; }
.quick-item, .quick-all {
  width: 100%; appearance: none; border: 0; background: transparent; color: var(--say);
  cursor: pointer; text-align: left;
}
.quick-item {
  display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-top: 1px solid var(--hair);
}
.quick-item:hover, .quick-item.is-on { background: var(--slab-3); }
.quick-ico {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--gold-lt); background: var(--ink-2);
}
.quick-ico svg { width: 16px; height: 16px; }
.quick-main { min-width: 0; display: grid; gap: 2px; }
.quick-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.quick-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 11px; }
.quick-arrow { color: var(--faint); }
.quick-all {
  padding: 11px 12px; border-top: 1px solid var(--line);
  color: var(--gold-lt); font: 600 12px var(--sans);
}
.quick-all:hover { background: var(--gold-w); }
.quick-empty { padding: 18px; color: var(--faint); font-size: 12.5px; text-align: center; }

.panel-more {
  appearance: none; border: 0; background: transparent; color: var(--gold-lt);
  font: 600 11.5px var(--sans); cursor: pointer; padding: 3px 0;
}
.panel-more:hover { text-decoration: underline; }
.home-panels { grid-template-columns: repeat(2, minmax(0,1fr)); }

.resource-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 24px 0 10px;
}
.resource-toolbar .sect { margin: 0; }
.sort-pills {
  display: inline-flex; gap: 3px; padding: 3px;
  border: 1px solid var(--line); background: var(--ink-2); border-radius: 999px;
}
.sort-chip {
  appearance: none; border: 0; background: transparent; color: var(--faint);
  padding: 6px 9px; border-radius: 999px; cursor: pointer; font: 600 11px var(--sans); white-space: nowrap;
}
.sort-chip:hover { color: var(--say); }
.sort-chip.is-on { background: var(--slab-3); color: var(--say); box-shadow: inset 0 0 0 1px var(--line); }

.row-tools {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  opacity: .68; transition: opacity .14s;
}
.row:hover .row-tools, .row:focus-within .row-tools { opacity: 1; }
.save-btn.is-saved { color: var(--gold-lt); background: var(--gold-w); }
.more-btn:hover { color: var(--say); }
.tag.rec { color: var(--gold-lt); border-color: var(--gold-e); background: var(--gold-w); }
.tag.new { color: var(--ok); border-color: #55b48c44; background: #55b48c14; text-transform: uppercase; letter-spacing: .06em; }
.row.is-focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-w), var(--lift);
  animation: resource-focus 1.2s ease-out;
}
@keyframes resource-focus { from { background: var(--gold-w); } }

.action-sheet { display: grid; gap: 4px; margin: -6px; }
.action-row {
  appearance: none; width: 100%; border: 0; border-radius: var(--r-s);
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center;
  background: transparent; color: var(--say); padding: 10px; text-align: left; cursor: pointer;
}
.action-row:hover { background: var(--slab-3); }
.action-row > svg { width: 19px; color: var(--gold-lt); }
.action-row span { display: grid; gap: 2px; }
.action-row strong { font-size: 13px; }
.action-row small { color: var(--faint); font-size: 11.5px; font-weight: 400; }
.action-divider { height: 1px; background: var(--line); margin: 5px 8px; }
.danger-row > svg, .danger-row strong { color: var(--bad); }

.recommend-toggle, .admin-toggle, .access-check {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--ink-2); cursor: pointer;
}
.recommend-toggle input, .admin-toggle input, .access-check input { margin-top: 4px; accent-color: var(--gold); }
.recommend-toggle span, .admin-toggle span, .access-check span { display: grid; gap: 2px; }
.recommend-toggle strong, .admin-toggle strong, .access-check strong { font-size: 13px; }
.recommend-toggle small, .admin-toggle small, .access-check small { color: var(--faint); font-size: 11.5px; font-weight: 400; }

.permission-model {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 0 0 22px;
}
.permission-model > div {
  display: grid; align-content: start; gap: 7px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--slab);
}
.permission-model strong { font-size: 13px; }
.permission-model p { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.45; }
.access-badge {
  display: inline-flex; width: fit-content; align-items: center; min-height: 22px;
  padding: 3px 7px; border-radius: 999px; border: 1px solid; font-size: 10.5px; font-weight: 700;
}
.access-badge.admin { color: var(--gold-lt); border-color: var(--gold-e); background: var(--gold-w); }
.access-badge.editor { color: #87ADEC; border-color: #6f98dc55; background: #6f98dc14; }
.access-badge.student { color: var(--mute); border-color: var(--line); background: var(--ink-2); }

.admin-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 11px; margin-bottom: 22px;
}
.compact-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat-card {
  min-width: 0; display: grid; gap: 3px; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg,var(--slab-2),var(--slab));
  box-shadow: var(--lift);
}
.stat-card > span { color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stat-card strong { font-family: var(--disp); font-size: 25px; line-height: 1.1; letter-spacing: -.03em; }
.stat-card small { color: var(--faint); font-size: 10.5px; }

.admin-section { margin-top: 22px; }
.admin-section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 10px;
}
.admin-section-head h2 { margin: 0 0 3px; font-family: var(--disp); font-size: 17px; }
.admin-section-head p { margin: 0; color: var(--faint); font-size: 12px; }
.mini-search input {
  width: min(260px, 100%); background: var(--ink-2); color: var(--say); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 8px 10px; font: 13px var(--sans);
}
.access-list, .access-table {
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--slab);
}
.access-person {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.access-person:last-child { border-bottom: 0; }
.access-person > div { display: grid; }
.access-person span { color: var(--faint); font-size: 11.5px; }

.access-row {
  display: grid; grid-template-columns: minmax(240px,1.4fr) minmax(110px,.5fr) minmax(190px,.8fr) auto;
  gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.access-row:last-child { border-bottom: 0; }
.access-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar.small { width: 34px; height: 34px; flex: none; font-size: 12px; }
.access-name > div { min-width: 0; display: grid; }
.access-name strong, .access-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-name strong { font-size: 13px; }
.access-name span, .access-class { color: var(--faint); font-size: 11.5px; }
.access-role { display: grid; gap: 4px; justify-items: start; }
.access-role small { color: var(--faint); font-size: 10.5px; }
.access-action { text-align: right; }
.you { display: inline-block; margin-left: 5px; color: var(--faint); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.access-modal-person { display: grid; gap: 2px; padding-bottom: 4px; }
.access-modal-person span { color: var(--faint); font-size: 12px; }
.access-warning {
  padding: 10px 12px; border: 1px solid #dda35238; border-radius: var(--r-s);
  background: #dda3520e; color: var(--warn); font-size: 11.5px;
}
.modal-subhead { display: grid; gap: 2px; margin-top: 2px; }
.modal-subhead strong { font-size: 13px; }
.modal-subhead span { color: var(--faint); font-size: 11.5px; }
.access-checks { display: grid; gap: 7px; max-height: 260px; overflow-y: auto; }

.report-list { display: grid; gap: 8px; }
.report-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--slab);
}
.report-main { min-width: 0; display: grid; gap: 5px; }
.report-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.report-title-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.report-main p { margin: 0; color: var(--mute); font-size: 12px; }
.report-main small { color: var(--faint); font-size: 10.5px; }
.issue-badge {
  flex: none; padding: 3px 7px; border-radius: 999px; border: 1px solid #d9736b45;
  color: var(--bad); background: #d9736b10; font-size: 10px; font-weight: 700;
}
.report-actions { display: flex; gap: 7px; flex: none; }
.resolved-list {
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--slab);
}
.resolved-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.resolved-list > div:last-child { border-bottom: 0; }
.resolved-list strong { font-size: 12.5px; }
.resolved-list span { color: var(--faint); font-size: 11px; }

.data-window {
  display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--ink-2); color: var(--faint); font-size: 11px; font-weight: 600;
}
.chart-grid {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px;
}
.chart-card {
  min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg,var(--slab-2),var(--slab)); box-shadow: var(--lift);
}
.chart-card.wide { grid-column: span 2; }
.chart-head { margin-bottom: 12px; }
.chart-head h2 { margin: 0 0 3px; font-family: var(--disp); font-size: 16px; }
.chart-head p { margin: 0; color: var(--faint); font-size: 11.5px; }
.chart-canvas { position: relative; height: 280px; min-height: 0; }
.analytics-note {
  margin-top: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--faint); background: var(--ink-2); font-size: 11.5px;
}

.review-row .always { opacity: 1; }

.mobile-tabs { display: none; }
.offline-banner {
  position: fixed; z-index: 110; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 8px 12px; border-radius: 999px; background: var(--warn); color: #21180a;
  font-size: 11.5px; font-weight: 700; box-shadow: var(--lift-2);
}

@media (max-width: 1050px) {
  .admin-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .compact-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .access-row { grid-template-columns: minmax(220px,1.2fr) minmax(120px,.5fr) minmax(170px,.8fr) auto; }
}
@media (max-width: 800px) {
  .permission-model { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: auto; }
  .access-row {
    grid-template-columns: 1fr auto; gap: 8px 12px;
  }
  .access-class, .access-role { grid-column: 1; }
  .access-action { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .report-card { align-items: flex-start; flex-direction: column; }
  .resource-toolbar { align-items: flex-start; flex-direction: column; }
  .sort-pills { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 620px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .home-panels { grid-template-columns: 1fr; }
  .quick-search {
    position: fixed; top: var(--top-h); left: 8px; right: 8px; min-width: 0; max-height: calc(100dvh - 86px);
    overflow-y: auto;
  }
  .admin-stats, .compact-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card strong { font-size: 22px; }
  .admin-section-head { align-items: stretch; flex-direction: column; }
  .mini-search input { width: 100%; }
  .access-row { padding: 12px; }
  .report-actions { width: 100%; }
  .report-actions .btn { flex: 1; }
  .mobile-tabs {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4,1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: color-mix(in srgb,var(--ink-2) 94%,transparent);
    backdrop-filter: blur(14px);
  }
  .mobile-tabs button {
    appearance: none; border: 0; background: transparent; color: var(--faint);
    display: grid; justify-items: center; gap: 3px; padding: 3px; font: 600 9.5px var(--sans); cursor: pointer;
  }
  .mobile-tabs svg { width: 19px; height: 19px; }
  .mobile-tabs button:hover, .mobile-tabs button:focus-visible { color: var(--gold-lt); }
  .offline-banner { bottom: calc(76px + env(safe-area-inset-bottom)); }
}


/* ==========================================================================
   MedHub refinement hotfix — calmer, cleaner, less "dashboard-card" heavy
   ========================================================================== */

[data-theme="light"] {
  --ink:     #F7F9FC;
  --ink-2:   #F3F6FA;
  --slab:    #FFFFFF;
  --slab-2:  #FFFFFF;
  --slab-3:  #F7F9FC;
  --line:    #E3E8F0;
  --line-2:  #D4DCE8;
  --hair:    #14213C08;
  --say:     #17233B;
  --mute:    #5F6F8A;
  --faint:   #8A98AF;
  --gold:    #9A7130;
  --gold-lt: #B98F45;
  --gold-dk: #75531E;
  --gold-w:  #B98F450D;
  --gold-e:  #B98F452B;
  --lift:    0 1px 2px #14213c0a;
  --lift-2:  0 10px 28px -18px #14213c38;
}

[data-theme="light"] body::before { display: none; }

.top {
  background: color-mix(in srgb, var(--slab) 94%, transparent);
  box-shadow: none;
  border-bottom-color: var(--line);
}
.top-home {
  border: 0;
  background: transparent;
  border-radius: var(--r-s);
  padding-inline: 9px;
}
.top-home:hover {
  background: var(--ink-2);
  border-color: transparent;
}
#q {
  background: var(--slab-3);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}
#q:focus {
  background: var(--slab);
  box-shadow: 0 0 0 3px var(--gold-w), inset 0 0 0 1px var(--gold);
}

/* The black strip was the browser's native sidebar scrollbar. Keep scrolling,
   but make the scrollbar visually disappear. */
.side {
  width: 254px;
  background: color-mix(in srgb, var(--ink-2) 72%, var(--slab));
  border-right-color: var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.side::-webkit-scrollbar { width: 0; height: 0; display: none; }
.side-inner { padding: 20px 12px 48px; }
.side-cap { letter-spacing: .13em; color: var(--faint); }
.side-link, .node-row { border-radius: 8px; }
.side-link.is-on, .node-row.is-on {
  background: var(--slab);
  box-shadow: inset 2px 0 0 var(--gold);
}
.batch-sel select {
  background: var(--slab);
  border-color: var(--line);
  box-shadow: none;
}
.batch-sel select:hover { border-color: var(--line-2); }
.yr {
  background: var(--slab);
  border-color: var(--line);
  box-shadow: none;
}
.yr.is-on {
  background: var(--slab);
  border-color: var(--gold);
  box-shadow: none;
}

/* Main canvas */
.stage {
  max-width: 1360px;
  padding: 34px 42px 88px;
}

/* Welcome should read like a page heading, not another large card. */
.home-head {
  padding: 4px 2px 24px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.home-head::after { display: none; }
.home-head .eyebrow { margin-bottom: 5px; }
.home-head h1 {
  font-size: clamp(30px, 3vw, 39px);
  letter-spacing: -.045em;
  margin-bottom: 5px;
}
.home-head p { max-width: 720px; }

/* Dashboard sections: flatter, quieter, more editorial. */
.home-panels {
  gap: 14px;
  margin: 12px 0 34px;
}
.home-panel {
  padding: 17px 18px 16px;
  background: var(--slab);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.home-panel:hover {
  transform: none;
  border-color: var(--line-2);
  box-shadow: none;
}
.panel-head {
  margin-bottom: 10px;
}
.panel-head h2 {
  font-size: 15.5px;
  letter-spacing: -.02em;
}
.panel-head p { font-size: 11.5px; }
.panel-more { color: var(--gold); }
.panel-empty {
  min-height: 64px;
  padding: 16px 8px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faint);
}
.home-panel .rows {
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.home-panel .rows.compact {
  gap: 7px;
}
.home-panel .rows.compact .row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--slab);
}
.home-panel .rows.compact .row:hover {
  border-color: var(--line-2);
  background: var(--slab-3);
}

/* Less bulky year cards. */
.browse-head {
  margin-top: 0;
}
.browse-head .sect {
  margin-bottom: 12px;
}
.browse-head + .grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 11px;
}
.browse-head + .grid .card {
  min-height: 118px;
  padding: 15px 16px;
  gap: 8px;
  background: var(--slab);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}
.browse-head + .grid .card::before { display: none; }
.browse-head + .grid .card:hover {
  transform: none;
  border-color: var(--gold-e);
  background: color-mix(in srgb, var(--slab) 94%, var(--gold-w));
  box-shadow: none;
}
.browse-head + .grid .card-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gold-w);
}
.browse-head + .grid .card-name { font-size: 15px; }
.browse-head + .grid .card-sub { font-size: 11.5px; }

/* Normal resources */
.rows {
  box-shadow: none;
  border-color: var(--line);
  background: var(--line);
}
.row {
  min-height: 60px;
  padding: 12px 14px;
}
.row-clickable { cursor: pointer; }
.row-clickable:hover { background: var(--slab-3); }
.row-title { font-size: 14px; }
.row-open-label { font-size: 11px; }

/* Preview */
#preview-external.is-disabled {
  pointer-events: none;
  opacity: .45;
}
.preview-shell {
  border-color: color-mix(in srgb, var(--line-2) 85%, transparent);
  box-shadow: 0 28px 80px -26px #000000bf;
}
.preview-top {
  background: var(--slab);
}
.preview-body {
  background: #111620;
}

/* General cards should be quieter. */
.card {
  box-shadow: none;
}
.card:hover {
  transform: none;
  box-shadow: none;
}

/* Admin cards/analytics also follow the same quieter visual system. */
.stat-card,
.chart-card {
  box-shadow: none;
  background: var(--slab);
}
.permission-model > div,
.report-card,
.access-list,
.access-table,
.resolved-list {
  box-shadow: none;
}

/* Mobile */
@media (max-width: 900px) {
  .stage { padding: 24px 18px 82px; }
}
@media (max-width: 620px) {
  .home-head { padding-top: 0; }
  .home-panels { gap: 10px; }
  .home-panel { padding: 15px; }
}


/* ==========================================================================
   MedHub mobile sidebar + dark mode refinement
   ========================================================================== */

/* Dark theme: less blue/black, higher contrast, calmer academic palette. */
:root {
  --ink:     #101725;
  --ink-2:   #151E2E;
  --slab:    #192334;
  --slab-2:  #1D293C;
  --slab-3:  #243249;
  --line:    #2C3A51;
  --line-2:  #3A4A64;
  --hair:    #FFFFFF0B;

  --say:     #F3F5F9;
  --mute:    #B2BDD0;
  --faint:   #8190A9;

  --gold:    #C29A55;
  --gold-lt: #D9B774;
  --gold-dk: #8B672D;
  --gold-w:  #C29A5518;
  --gold-e:  #C29A5540;

  --lift:    0 1px 2px #00000030, 0 12px 28px -18px #0000008A;
  --lift-2:  0 12px 38px -18px #000000B8;
}

/* Remove the strong navy glow from dark mode. */
html:not([data-theme="light"]) body::before {
  background:
    radial-gradient(760px 360px at 82% -8%, #C29A550B, transparent 72%),
    radial-gradient(620px 340px at 4% -6%, #FFFFFF05, transparent 70%);
}

/* Dark-mode surfaces should separate by tone, not by harsh borders. */
html:not([data-theme="light"]) .top {
  background: #111A2AEB;
  border-bottom-color: #27354B;
}
html:not([data-theme="light"]) .side {
  background: #151F31;
  border-right-color: #2A3951;
}
html:not([data-theme="light"]) .mobile-tabs {
  background: #111A2AF2;
  border-top-color: #29384E;
}
html:not([data-theme="light"]) .home-panel,
html:not([data-theme="light"]) .card,
html:not([data-theme="light"]) .stat-card,
html:not([data-theme="light"]) .chart-card,
html:not([data-theme="light"]) .access-list,
html:not([data-theme="light"]) .access-table,
html:not([data-theme="light"]) .report-card {
  background: #192334;
  border-color: #2A3950;
}
html:not([data-theme="light"]) .row {
  background: #192334;
}
html:not([data-theme="light"]) .row-clickable:hover {
  background: #202D42;
}
html:not([data-theme="light"]) .yr,
html:not([data-theme="light"]) .batch-sel select {
  background: #1A2639;
  border-color: #30415B;
}
html:not([data-theme="light"]) .yr.is-on {
  background: #202D42;
  border-color: var(--gold);
}
html:not([data-theme="light"]) .side-link.is-on,
html:not([data-theme="light"]) .node-row.is-on {
  background: #202D42;
}
html:not([data-theme="light"]) #q {
  background: #182337;
  box-shadow: inset 0 0 0 1px #2A3B55;
}
html:not([data-theme="light"]) #q:focus {
  background: #1B273B;
}

/* Avatars: readable letters in both themes. */
.avatar {
  background: linear-gradient(145deg, #C59C50, #8F6726);
  color: #FFF9ED;
  text-shadow: 0 1px 1px #0000002E;
}
.access-name .avatar.small {
  color: #FFF9ED !important;
  font-weight: 800;
  text-shadow: 0 1px 1px #00000038;
}
[data-theme="light"] .avatar,
[data-theme="light"] .access-name .avatar.small {
  color: #FFFFFF;
  background: linear-gradient(145deg, #BC9146, #8A6322);
}

/* ==========================================================================
   MOBILE NAVIGATION DRAWER — single authoritative implementation.
   Do not add drawer rules anywhere else in this file.

   How it works:
   - The drawer is fixed between the top bar and the bottom tab bar.
   - The drawer element itself owns the scroll. .side-inner is plain content
     and must never become a second scroller, or iOS gets two nested scroll
     areas and neither behaves.
   - max-height is what makes it scrollable. Without it the drawer grows to
     its content height, scrollHeight equals clientHeight, the browser offers
     no scroll, and the lower items sit off-screen.
   ========================================================================== */

@media (max-width: 900px) {
  :root { --tabs-h: calc(60px + env(safe-area-inset-bottom)); }

  .side {
    position: fixed;
    top: var(--top-h);
    left: 0;
    bottom: var(--tabs-h);
    width: 272px;
    height: auto;
    max-height: calc(100dvh - var(--top-h) - var(--tabs-h));
    z-index: 25;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-width: none;

    background: var(--ink-2);
    border-right: 1px solid var(--line);

    transform: translate3d(-102%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), visibility .22s;
  }

  .side::-webkit-scrollbar { width: 0; height: 0; display: none; }

  .side.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: var(--lift-2);
  }

  /* Plain content. No positioning, no scrolling, no fixed height. */
  .side-inner {
    position: static;
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 18px 14px calc(26px + env(safe-area-inset-bottom));
  }

  /* Freeze the page behind the drawer without repositioning the body:
     moving a fixed body on iOS drags fixed descendants off-screen with it. */
  html.drawer-open,
  body.drawer-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
}

@media (max-width: 620px) {
  :root { --tabs-h: calc(64px + env(safe-area-inset-bottom)); }

  .side { width: min(86vw, 330px); }

  /* Tighter spacing so more of the menu fits without feeling cramped. */
  .side-cap { margin-bottom: 8px; }
  .batchbox { margin-bottom: 17px; }
  .years { margin-bottom: 18px; }
  #manage .side-cap { margin-top: 22px; }

  .mobile-tabs { min-height: 64px; }
}

/* ==========================================================================
   RECOVERY PATCH — theme isolation + real iOS drawer scrolling
   This block intentionally comes last.
   ========================================================================== */

/*
  Theme isolation:
  A previous patch added a late :root palette, which had the same CSS
  specificity as [data-theme="light"] and therefore overrode the light theme.
  These selectors are deliberately more specific so light and dark cannot
  overwrite each other again.
*/
html[data-theme="light"] {
  --ink:     #F7F9FC;
  --ink-2:   #F2F5F9;
  --slab:    #FFFFFF;
  --slab-2:  #FFFFFF;
  --slab-3:  #F6F8FB;
  --line:    #E1E7EF;
  --line-2:  #D2DAE6;
  --hair:    #14213C08;

  --say:     #17233B;
  --mute:    #5F6F8A;
  --faint:   #8A98AF;

  --gold:    #9A7130;
  --gold-lt: #B98F45;
  --gold-dk: #75531E;
  --gold-w:  #B98F450D;
  --gold-e:  #B98F452B;

  --lift:    0 1px 2px #14213c0a;
  --lift-2:  0 10px 28px -18px #14213c30;
}

html:not([data-theme="light"]) {
  --ink:     #101725;
  --ink-2:   #151E2E;
  --slab:    #192334;
  --slab-2:  #1D293C;
  --slab-3:  #243249;
  --line:    #2C3A51;
  --line-2:  #3A4A64;
  --hair:    #FFFFFF0B;

  --say:     #F3F5F9;
  --mute:    #B2BDD0;
  --faint:   #8190A9;

  --gold:    #C29A55;
  --gold-lt: #D9B774;
  --gold-dk: #8B672D;
  --gold-w:  #C29A5518;
  --gold-e:  #C29A5540;

  --lift:    0 1px 2px #00000030, 0 12px 28px -18px #0000008A;
  --lift-2:  0 12px 38px -18px #000000B8;
}

html[data-theme="light"] body::before {
  display: none !important;
}

html[data-theme="light"] .top {
  background: #FFFFFFF2;
  border-bottom-color: var(--line);
}

html[data-theme="light"] .side {
  background: #F2F5F9;
  border-right-color: var(--line);
}

html[data-theme="light"] .mobile-tabs {
  background: #FFFFFFF2;
  border-top-color: var(--line);
}

/* Keep the initials high contrast in both themes. */
.avatar,
.access-name .avatar.small {
  color: #FFFFFF !important;
  font-weight: 800;
  text-shadow: 0 1px 1px #00000035;
}

/* ── bulk file picker ──────────────────────────────────────────────────── */
.bulk-toggle { margin-bottom: 4px; }
/* The toggle lives inside a .field, whose inputs are width:100%. Undo that
   for the checkbox itself or it stretches across the whole modal. */
.bulk-toggle input[type="checkbox"],
.recommend-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  flex: none;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.filelist {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--ink-2);
  overflow: hidden;
  max-height: 210px;
  overflow-y: auto;
}
.filelist-cap {
  margin: 0; padding: 9px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); border-bottom: 1px solid var(--line);
}
.filelist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--line);
}
.filelist-row:last-of-type { border-bottom: 0; }
.filelist-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--say);
}
.filelist-size { flex: none; font-size: 12px; color: var(--faint); }
.filelist-row.is-bad .filelist-name,
.filelist-row.is-bad .filelist-size { color: var(--bad); }
.filelist-warn {
  margin: 0; padding: 9px 12px; font-size: 12px; color: var(--warn);
  border-top: 1px solid var(--line); background: #dda3520d;
}

/* ── multi-select ──────────────────────────────────────────────────────── */
.pick {
  width: 17px; height: 17px; min-width: 17px; flex: none;
  margin: 0; padding: 0; accent-color: var(--gold); cursor: pointer;
}
.pick-spacer { width: 17px; flex: none; }
.row-pick { margin-right: 2px; }

.pickbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 12px; padding: 11px 15px;
  border: 1px solid var(--gold-e); border-radius: var(--r);
  background: var(--gold-w);
  position: sticky; top: calc(var(--top-h) + 8px); z-index: 15;
  backdrop-filter: blur(8px);
}
.pickbar-count { font-size: 13.5px; font-weight: 600; color: var(--gold-lt); }
.pickbar-acts { display: flex; align-items: center; gap: 10px; }
.pickbar-acts .btn { padding: 7px 13px; font-size: 13px; }

/* ── destructive confirmation ──────────────────────────────────────────── */
.del-line { margin: 0 0 10px; font-size: 14.5px; color: var(--mute); line-height: 1.55; }
.del-line strong { color: var(--say); }
.del-line:last-of-type { margin-bottom: 0; }
.del-warn {
  padding: 11px 13px; border-radius: var(--r-s);
  border: 1px solid #d9736b40; background: #d9736b12; color: var(--bad);
}
.del-warn strong { color: var(--bad); }
.del-ok { color: var(--faint); }

@media (max-width: 560px) {
  .pickbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .pickbar-acts { justify-content: space-between; }
}
