/* VINC Global design system.
   The same family as vinc-lab.com and lms.vinc-lab.com: cream paper, dark ink, the amber brand,
   teal for "live" things, and Lora / DM Sans / DM Mono. Light and dark follow the system,
   and the moon button pins one (data-theme on <html>). */
:root {
  --paper: #F7F0E3;
  --paper-2: #EFE2CC;
  --card: #FFF9EF;
  --card-2: #FBF3E4;
  --ink: #2B1A10;
  --ink-2: #5E4634;
  --muted: #6E5442;
  --line: #DCCBAE;
  --grid: rgba(43, 26, 16, 0.06);
  --amber: #D98A1C;
  --amber-ink: #9A5B0A;
  --amber-soft: #F6DFB5;
  --rust: #C2502A;
  --rust-soft: #F3D3C5;
  --teal: #1F6F66;
  --teal-2: #2A8378;
  --teal-soft: #CFE6E1;
  --plum: #8C3557;
  --plum-soft: #EED0DC;
  --olive: #4C7424;
  --olive-soft: #DCE8CC;
  --band: #2B1A10;
  --on-band: #F7F0E3;
  --band-accent: #F0B44C;
  --focus: #1F6F66;
  --ok: #3E7B2A;
  --warn: #B26A00;
  --bad: #B23A2A;
  --shadow: 0 14px 34px -18px rgba(43, 26, 16, 0.45);
  --shadow-sm: 0 6px 16px -10px rgba(43, 26, 16, 0.4);
  --shadow-lg: 0 30px 70px -30px rgba(43, 26, 16, 0.55);
  --glow: rgba(217, 138, 28, 0.16);
  --scrim: rgba(27, 19, 13, 0.55);
  --radius: 22px;
  --radius-sm: 14px;
  --wrap: 1180px;
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t-label: 0.8125rem;
  --t-small: 0.9375rem;
  --t-body: 1.0625rem;
  --t-lead: 1.25rem;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-1: 140ms;
  --dur-2: 240ms;
  --dur-3: 420ms;
  --dur-4: 700ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B130D; --paper-2: #231910; --card: #2B1F16; --card-2: #33251A;
    --ink: #F4EADB; --ink-2: #DCCBB4; --muted: #BBA58B; --line: #47352A; --grid: rgba(244, 234, 219, 0.05);
    --amber: #E09A35; --amber-ink: #F0B44C; --amber-soft: #4A3216; --rust: #E0714A; --rust-soft: #45261A;
    --teal: #3FB3A4; --teal-2: #4FC1B1; --teal-soft: #193D38; --plum: #D06A93; --plum-soft: #3E2030;
    --olive: #8DBB5A; --olive-soft: #2C3A1C; --band: #F4EADB; --on-band: #2B1A10; --band-accent: #9A5B0A;
    --focus: #F0B44C; --ok: #8DBB5A; --warn: #F0B44C; --bad: #E57A66;
    --shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7); --shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.85); --glow: rgba(240, 180, 76, 0.12); --scrim: rgba(8, 5, 3, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1B130D; --paper-2: #231910; --card: #2B1F16; --card-2: #33251A;
  --ink: #F4EADB; --ink-2: #DCCBB4; --muted: #BBA58B; --line: #47352A; --grid: rgba(244, 234, 219, 0.05);
  --amber: #E09A35; --amber-ink: #F0B44C; --amber-soft: #4A3216; --rust: #E0714A; --rust-soft: #45261A;
  --teal: #3FB3A4; --teal-2: #4FC1B1; --teal-soft: #193D38; --plum: #D06A93; --plum-soft: #3E2030;
  --olive: #8DBB5A; --olive-soft: #2C3A1C; --band: #F4EADB; --on-band: #2B1A10; --band-accent: #9A5B0A;
  --focus: #F0B44C; --ok: #8DBB5A; --warn: #F0B44C; --bad: #E57A66;
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7); --shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.85); --glow: rgba(240, 180, 76, 0.12); --scrim: rgba(8, 5, 3, 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-body)/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.3rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: .5em 1em; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--t-small); }
.mono { font-family: var(--mono); }
.label { font: 500 var(--t-label)/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber-ink); margin: 0 0 0.75rem; }
.lead { font-size: var(--t-lead); color: var(--ink-2); max-width: 36em; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

@keyframes vg-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes vg-fade { from { opacity: 0; } }
@keyframes vg-pop { from { opacity: 0; scale: .92; } }
@keyframes vg-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ping, var(--olive)) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes vg-spin { to { transform: rotate(360deg); } }
@keyframes vg-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes vg-shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg.wordmark { height: 32px; width: auto; display: block; }
.brand .wm-amber { fill: var(--amber); }
.brand .wm-teal { fill: var(--teal); }
.brand .wm-teal2 { fill: var(--teal-2); }
.brand .wm-ink { fill: var(--ink); }
.brand .wm-ink-s { stroke: var(--ink); }
.brand .global { font: 500 .78rem/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--teal); padding: .45em .2em .45em .7em; border-left: 2px solid var(--line); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 46px; padding: 0.7em 1.25em; border-radius: 999px; border: 2px solid transparent; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap; background: none;
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) ease, color var(--dur-2) ease, box-shadow var(--dur-2) ease, border-color var(--dur-2) ease, opacity var(--dur-2) ease; }
.btn svg { width: 18px; height: 18px; flex: none; transition: translate var(--dur-2) var(--ease-out); }
.btn:hover { transform: translateY(-2px); }
.btn:hover svg.arrow { translate: 3px 0; }
.btn:active { transform: translateY(0) scale(.97); transition-duration: var(--dur-1); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal); color: #fff; }
.btn-amber { background: var(--amber); color: #2B1A10; box-shadow: var(--shadow-sm); }
.btn-amber:hover { background: var(--band-accent); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-2); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-soft { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { border-color: var(--ink-2); }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { min-height: 36px; padding: 0.4em 0.9em; font-size: var(--t-small); }
.btn-xs { min-height: 30px; padding: .25em .7em; font-size: .85rem; border-width: 1.5px; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: vg-spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color var(--dur-2) ease, transform var(--dur-1) ease, background-color var(--dur-2) ease; position: relative; }
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Theme button: sun in dark mode, moon in light mode. */
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

/* Sound button: three bars that dance while the ambience plays. */
.sound-btn .bars { display: flex; align-items: end; gap: 2.5px; height: 16px; }
.sound-btn .bars i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; transition: height var(--dur-3) var(--ease-out); }
.sound-btn .bars i:nth-child(1) { height: 6px; } .sound-btn .bars i:nth-child(2) { height: 12px; } .sound-btn .bars i:nth-child(3) { height: 16px; } .sound-btn .bars i:nth-child(4) { height: 9px; }
.sound-btn.on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-ink); }
.sound-btn.on .bars i { animation: vg-eq 1.1s var(--ease-in-out) infinite alternate; }
.sound-btn.on .bars i:nth-child(2) { animation-delay: -.4s; animation-duration: .9s; }
.sound-btn.on .bars i:nth-child(3) { animation-delay: -.8s; animation-duration: 1.3s; }
.sound-btn.on .bars i:nth-child(4) { animation-delay: -.2s; animation-duration: 1s; }
@keyframes vg-eq { from { height: 4px; } to { height: 16px; } }
.sound-nudge { position: fixed; z-index: 90; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 12px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 14px 12px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: vg-rise var(--dur-4) var(--ease-out) 1.2s backwards; }
.sound-nudge.top { left: auto; right: 16px; bottom: auto; top: 76px; animation-name: vg-fade; }
.sound-nudge p { margin: 0; font-size: var(--t-small); line-height: 1.35; }
.sound-nudge .x { border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px; }
.sound-nudge .wave { width: 38px; height: 38px; border-radius: 12px; background: var(--amber-soft); display: grid; place-items: center; flex: none; color: var(--amber-ink); }

/* ---------- Chips & status ---------- */
.chip { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.22em 0.7em; border-radius: 999px; font: 500 var(--t-label)/1.4 var(--mono); background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--olive-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.chip.bad { background: var(--rust-soft); color: var(--bad); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.plum { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.chip.live .dot { --ping: var(--teal); animation: vg-ping 2s var(--ease-out) infinite; }
.live-chip { display: inline-flex; align-items: center; gap: .6em; padding: .45em 1em; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: var(--t-small); box-shadow: var(--shadow-sm); }
.live-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--olive); animation: vg-ping 2s var(--ease-out) infinite; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px); box-shadow: var(--shadow-sm); position: relative; }
.card.glowy { overflow: hidden; }
.card.glowy::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 62%); opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.card.glowy:hover::before { opacity: 1; }
.card h3 { margin-bottom: .35em; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3, .card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.stat { display: grid; gap: 4px; }
.stat .k { font: 500 var(--t-label)/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .v { font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat .s { font-size: var(--t-small); color: var(--ink-2); }
.stat-tile { border-left: 4px solid var(--c, var(--amber)); }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field > label { font-weight: 700; font-size: var(--t-small); }
.field .hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.input, input[type="text"].input, select.input, textarea.input { width: 100%; min-height: 46px; padding: .65em .95em; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card-2); color: var(--ink); transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease, background-color var(--dur-2) ease; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 18%, transparent); background: var(--card); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input.mono { font-family: var(--mono); letter-spacing: .04em; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.form-error { color: var(--bad); font-size: var(--t-small); min-height: 1.4em; margin: 0 0 10px; }
.check { display: inline-flex; align-items: center; gap: .5em; font-size: var(--t-small); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 48px; }
.pwd-wrap button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; border: none; background: none; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.pwd-wrap button:hover { background: var(--paper-2); }
.meter { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; width: var(--p, 0%); background: var(--c, var(--rust)); border-radius: 6px; transition: width var(--dur-3) var(--ease-out), background-color var(--dur-3) ease; }

/* Segmented control with a sliding pill */
.seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); position: relative; isolation: isolate; flex-wrap: wrap; }
.seg button { border: none; background: none; border-radius: 999px; padding: .45em 1em; font-weight: 700; cursor: pointer; color: var(--ink-2); position: relative; z-index: 1; transition: color var(--dur-3) var(--ease-out); font-size: var(--t-small); display: inline-flex; gap: .45em; align-items: center; }
.seg button[aria-pressed="true"] { color: var(--paper); }
.seg .seg-ind { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 999px; background: var(--ink); box-shadow: var(--shadow-sm); pointer-events: none; transition: translate var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out); }

/* Drop zone */
.drop { display: grid; place-items: center; gap: 6px; text-align: center; padding: 26px 18px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card-2); cursor: pointer; transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, transform var(--dur-2) var(--ease-out); }
.drop:hover, .drop.over { border-color: var(--teal); background: color-mix(in srgb, var(--teal-soft) 40%, var(--card)); }
.drop.over { transform: scale(1.01); }
.drop svg { width: 34px; height: 34px; color: var(--teal); }
.drop b { font-size: 1.02rem; }
.drop .file-name { font: 500 var(--t-small) var(--mono); color: var(--teal); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
table.t th { text-align: left; font: 500 var(--t-label)/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr { transition: background-color var(--dur-2) ease; }
table.t tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--line); display: block; margin: 0 auto 8px; }

/* ---------- Toasts & dialogs ---------- */
.toasts { position: fixed; z-index: 400; top: 16px; right: 16px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 16px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); border-left: 4px solid var(--c, var(--teal)); animation: vg-toast-in var(--dur-4) var(--ease-spring); font-size: var(--t-small); }
.toast.bad { --c: var(--bad); } .toast.ok { --c: var(--ok); }
.toast.out { animation: vg-toast-out var(--dur-2) var(--ease-in) forwards; }
@keyframes vg-toast-in { from { opacity: 0; translate: 30px 0; scale: .96; } }
@keyframes vg-toast-out { to { opacity: 0; translate: 30px 0; } }
dialog.dlg { border: none; padding: 0; border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.dlg::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
dialog.dlg[open] { animation: vg-pop var(--dur-3) var(--ease-out); }
dialog.dlg .dlg-body { padding: 24px; }
dialog.dlg .dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; flex-wrap: wrap; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; translate: 0 22px; transition: opacity .8s var(--ease-out), translate .8s var(--ease-out); transition-delay: var(--rd, 0ms); }
.reveal.in { opacity: 1; translate: 0 0; }

/* ---------- Viewer (PDF / Excel / link / image), opens in a container on the page ---------- */
.viewer { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: clamp(0px, 2.4vw, 28px); background: var(--scrim); backdrop-filter: blur(6px); animation: vg-fade var(--dur-3) var(--ease-out); }
.viewer.closing { animation: vg-viewer-out var(--dur-2) var(--ease-in) forwards; }
@keyframes vg-viewer-out { to { opacity: 0; } }
.viewer-box { width: min(1180px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: vg-viewer-in var(--dur-4) var(--ease-out); }
@keyframes vg-viewer-in { from { opacity: 0; translate: 0 26px; scale: .98; } }
@media (max-width: 640px) { .viewer { padding: 0; } .viewer-box { border-radius: 0; border: none; } }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.viewer-bar .vt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.viewer-bar .vt b { font-family: var(--display); font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .vtools { display: flex; align-items: center; gap: 6px; }
.viewer-bar .vtools .zoom { font: 500 .85rem var(--mono); min-width: 3.4em; text-align: center; }
.viewer-close { display: inline-flex; align-items: center; gap: .45em; border: none; background: var(--ink); color: var(--paper); border-radius: 999px; padding: .55em 1em .55em .8em; font-weight: 700; cursor: pointer; transition: background-color var(--dur-2) ease, transform var(--dur-1) ease; }
.viewer-close:hover { background: var(--rust); color: #fff; }
.viewer-close:active { transform: scale(.95); }
.viewer-close svg { width: 18px; height: 18px; transition: rotate var(--dur-3) var(--ease-out); }
.viewer-close:hover svg { rotate: 90deg; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--paper-2); user-select: none; -webkit-user-select: none; }
.viewer-body.frame { overflow: hidden; background: #fff; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.viewer-note { flex: none; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 16px; font-size: .85rem; color: var(--muted); background: var(--card-2); border-top: 1px solid var(--line); }
.viewer-note a { color: var(--teal); font-weight: 700; }
.pdf-pages { display: grid; justify-items: center; gap: 18px; padding: 22px 12px 40px; }
.pdf-page { position: relative; background: #fff; box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; }
.pdf-page canvas { display: block; }
.pdf-page .pg { position: absolute; right: 8px; bottom: 8px; font: 500 .72rem var(--mono); background: rgba(43, 26, 16, .7); color: #fff; padding: 2px 8px; border-radius: 999px; }
.watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.watermark span { position: absolute; white-space: nowrap; font: 600 15px/1 var(--mono); color: rgba(154, 91, 10, .13); rotate: -28deg; letter-spacing: .08em; }
.viewer-img { display: grid; place-items: center; min-height: 100%; padding: 20px; position: relative; }
.viewer-img img { max-width: 100%; max-height: 80vh; box-shadow: var(--shadow); border-radius: 6px; background: #fff; }
.sheet-tabs { display: flex; gap: 6px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; z-index: 3; }
.sheet-tabs button { border: 1.5px solid var(--line); background: var(--card-2); border-radius: 10px; padding: .3em .9em; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.sheet-tabs button[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: #fff; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: .86rem; background: var(--card); min-width: 100%; }
.sheet th, .sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 10px; white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.sheet thead th { position: sticky; top: 52px; background: var(--paper-2); font: 500 .75rem var(--mono); color: var(--muted); z-index: 2; text-align: center; }
.sheet tbody th { position: sticky; left: 0; background: var(--paper-2); font: 500 .75rem var(--mono); color: var(--muted); z-index: 1; text-align: right; }
.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.b { font-weight: 700; }
.viewer-loading { display: grid; place-items: center; gap: 14px; height: 100%; min-height: 320px; color: var(--muted); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--amber); animation: vg-spin .9s linear infinite; }

/* Kind badges for files */
.kind { width: 46px; height: 54px; border-radius: 8px 16px 8px 8px; display: grid; place-items: end center; padding-bottom: 7px; font: 700 .68rem var(--mono); color: #fff; background: var(--k, var(--rust)); flex: none; position: relative; box-shadow: var(--shadow-sm); letter-spacing: .04em; }
.kind::before { content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px; background: color-mix(in srgb, #fff 35%, transparent); border-bottom-left-radius: 6px; }
.kind.pdf { --k: var(--rust); } .kind.excel { --k: var(--olive); } .kind.link { --k: var(--teal); } .kind.img { --k: var(--plum); }

/* ---------- App shell (advisor and admin) ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; background: linear-gradient(90deg, var(--card) 263px, var(--line) 263px 264px, transparent 264px); }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 20px 16px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; z-index: 60; }
.side .brand { padding: 4px 8px 10px; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: .62em .9em; border-radius: 14px; text-decoration: none; font-weight: 600; color: var(--ink-2); position: relative; transition: background-color var(--dur-2) ease, color var(--dur-2) ease, translate var(--dur-2) var(--ease-out); }
.side nav a svg { width: 20px; height: 20px; flex: none; }
.side nav a:hover { background: var(--paper-2); color: var(--ink); translate: 3px 0; }
.side nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.side nav a[aria-current="page"] svg { color: var(--band-accent); }
.side nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: #2B1A10; font: 700 .75rem/22px var(--mono); text-align: center; }
.side nav .badge:empty, .side nav .badge[data-n="0"] { display: none; }
.side .side-foot { margin-top: auto; display: grid; gap: 10px; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--paper-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: #2B1A10; font: 700 1rem var(--display); flex: none; }
.avatar.teal { background: var(--teal); color: #fff; }
.me .who { min-width: 0; line-height: 1.25; }
.me .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font: 500 .75rem var(--mono); color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.topbar .ttl { flex: 1; min-width: 0; }
.topbar .ttl h1 { font-size: 1.35rem; margin: 0; }
.topbar .ttl p { margin: 0; font-size: .85rem; color: var(--muted); }
.topbar .tools { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.content { padding: clamp(18px, 3vw, 34px) clamp(18px, 3vw, 34px) 110px; display: grid; gap: 22px; align-content: start; }
.view { display: grid; gap: 22px; animation: vg-rise var(--dur-4) var(--ease-out); }
.view[hidden] { display: none; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.section-title p { margin: 4px 0 0; color: var(--muted); }
.side-scrim { display: none; }
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); translate: -105% 0; transition: translate var(--dur-3) var(--ease-out); box-shadow: var(--shadow-lg); }
  .app.nav-open .side { translate: 0 0; }
  .app.nav-open .side-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 55; animation: vg-fade var(--dur-2) ease; }
  .menu-toggle { display: inline-grid; }
}
@media (max-width: 520px) { .topbar .tools .hide-sm { display: none; } }

/* Hello banner on dashboards */
.hello { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); padding: clamp(22px, 3.4vw, 36px); background: var(--band); color: var(--on-band); isolation: isolate; }
.hello .label { color: var(--band-accent); }
.hello h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: .25em; }
.hello p { color: color-mix(in srgb, var(--on-band) 78%, transparent); max-width: 40em; margin: 0; }
.hello canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hello::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(color-mix(in srgb, var(--on-band) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--on-band) 6%, transparent) 1px, transparent 1px); background-size: 38px 38px; mask-image: radial-gradient(ellipse at 80% 20%, #000 20%, transparent 70%); }
.hello .hello-row { display: flex; gap: 18px; justify-content: space-between; align-items: end; flex-wrap: wrap; }
.hello .chip { background: color-mix(in srgb, var(--on-band) 12%, transparent); color: var(--on-band); border-color: color-mix(in srgb, var(--on-band) 22%, transparent); }

/* ---------- Access timeline (72-hour window) ---------- */
.access { display: grid; gap: 18px; }
.access-top { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.countdown { display: flex; gap: 8px; }
.countdown div { min-width: 64px; text-align: center; padding: 8px 6px; background: var(--paper-2); border-radius: 14px; border: 1px solid var(--line); }
.countdown b { display: block; font: 700 1.6rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.countdown b.tick { animation: vg-tick .5s var(--ease-out); }
@keyframes vg-tick { from { translate: 0 -6px; opacity: .3; } }
.tl { position: relative; padding: 34px 0 10px; }
.tl-track { position: relative; height: 10px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); overflow: visible; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 10px; background: linear-gradient(90deg, var(--olive), var(--amber) 55%, var(--rust)); transition: width 2.2s var(--ease-out); }
.tl-fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 200% 100%; animation: vg-shimmer 2.8s linear infinite; }
.tl-now { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; translate: -50% -50%; border-radius: 50%; background: var(--card); border: 4px solid var(--teal); --ping: var(--teal); animation: vg-ping 2s var(--ease-out) infinite; transition: left 2.2s var(--ease-out); z-index: 2; }
.tl-now .tag { position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 0; white-space: nowrap; font: 700 .72rem var(--mono); background: var(--teal); color: #fff; padding: 3px 8px; border-radius: 999px; }
.tl-now .tag::after { content: ""; position: absolute; top: 100%; left: 50%; translate: -50% 0; border: 5px solid transparent; border-top-color: var(--teal); }
.tl-marks { position: relative; height: 54px; margin-top: 10px; }
.tl-mark { position: absolute; top: 0; translate: -50% 0; text-align: center; font-size: .8rem; line-height: 1.25; width: 120px; }
@media (max-width: 640px) { .tl-mark:not(:first-child):not(:last-child) span { display: none; } .tl-mark { width: 96px; } .tl-marks { height: 62px; } }
.tl-mark:first-child { translate: 0 0; text-align: left; }
.tl-mark:last-child { translate: -100% 0; text-align: right; }
.tl-mark::before { content: ""; display: block; width: 2px; height: 10px; background: var(--line); margin: -16px auto 6px; }
.tl-mark:first-child::before { margin-left: 0; } .tl-mark:last-child::before { margin-right: 0; }
.tl-mark b { display: block; font: 500 .72rem var(--mono); text-transform: uppercase; color: var(--amber-ink); letter-spacing: .04em; }
.tl-mark.done b { color: var(--ok); }
.access.permanent .perm { display: flex; align-items: center; gap: 18px; }
.infinity { width: 92px; height: 46px; flex: none; }
.infinity path { fill: none; stroke-width: 6; stroke-linecap: round; }
.infinity .bg { stroke: var(--paper-2); }
.infinity .fg { stroke: var(--teal); stroke-dasharray: 40 200; animation: vg-inf 3s linear infinite; }
@keyframes vg-inf { to { stroke-dashoffset: -240; } }

/* Gate screens (pending, expired) */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; isolation: isolate; }
.gate::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); }
.gate canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.gate-card { width: min(620px, 100%); text-align: center; animation: vg-rise var(--dur-4) var(--ease-out); }
.gate-card h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.gate-art { width: 150px; height: 150px; margin: 0 auto 18px; position: relative; }
.gate-art .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--ink) 22%, transparent); animation: vg-spin 30s linear infinite; }
.gate-art .ring.r2 { inset: 18px; border-style: solid; border-color: color-mix(in srgb, var(--amber) 45%, transparent); border-top-color: var(--amber); animation-duration: 3s; }
.gate-art .core { position: absolute; inset: 36px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, var(--card), var(--paper-2)); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.gate-art .core img { width: 56%; }
.steps-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0; text-align: left; }
.steps-mini div { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: .88rem; }
.steps-mini b { display: block; font: 500 .72rem var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.steps-mini .done b { color: var(--ok); }
.steps-mini .now { border-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 45%, var(--card)); }
.steps-mini .now b { color: var(--amber-ink); }
@media (max-width: 520px) { .steps-mini { grid-template-columns: 1fr; } }

/* ---------- Ask the Founder ---------- */
.ask-fab { position: fixed; z-index: 120; right: clamp(14px, 2.4vw, 28px); bottom: clamp(14px, 2.4vw, 28px); display: inline-flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; border: none; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg); animation: vg-rise var(--dur-4) var(--ease-spring) .6s backwards; transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) ease; }
.ask-fab:hover { transform: translateY(-3px); background: var(--teal); color: #fff; }
.ask-fab .face { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); flex: none; }
.ask-fab .face::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--band-accent); border-right-color: var(--teal-2); animation: vg-spin 2.4s linear infinite; }
.ask-fab .face svg { width: 24px; height: 24px; color: #2B1A10; }
.ask-fab .txt { display: grid; text-align: left; line-height: 1.15; }
.ask-fab .txt small { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.ask-fab .txt span { font-family: var(--display); font-size: 1.08rem; }
.ask-fab .txt span .cursor { display: inline-block; width: 2px; height: 1em; background: currentColor; margin-left: 2px; vertical-align: -2px; animation: vg-blink 1s steps(1) infinite; }
@keyframes vg-blink { 50% { opacity: 0; } }
.ask-fab .unread { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--rust); color: #fff; font: 700 .78rem/24px var(--mono); text-align: center; box-shadow: 0 0 0 3px var(--paper); animation: vg-pop var(--dur-3) var(--ease-spring); }
.ask-fab.open { opacity: 0; pointer-events: none; transform: scale(.9); }
.ask-fab::after { content: ""; position: absolute; inset: 0; border-radius: inherit; --ping: var(--amber); animation: vg-ping 2.6s var(--ease-out) infinite; pointer-events: none; }
@media (max-width: 520px) { .ask-fab { padding: 6px; } .ask-fab .txt { display: none; } }

.chat-panel { position: fixed; z-index: 130; right: clamp(0px, 2.4vw, 28px); bottom: clamp(0px, 2.4vw, 28px); width: min(410px, 100vw); height: min(640px, 100dvh); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; transform-origin: bottom right; animation: vg-chat-in var(--dur-4) var(--ease-spring); }
@keyframes vg-chat-in { from { opacity: 0; scale: .7; translate: 20px 30px; } }
.chat-panel.closing { animation: vg-chat-out var(--dur-2) var(--ease-in) forwards; }
@keyframes vg-chat-out { to { opacity: 0; scale: .85; translate: 10px 20px; } }
@media (max-width: 520px) { .chat-panel { border-radius: 0; border: none; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--band); color: var(--on-band); flex: none; position: relative; overflow: hidden; }
.chat-head .avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--on-band) 18%, transparent); }
.chat-head .who { flex: 1; line-height: 1.25; }
.chat-head .who b { font-family: var(--display); font-size: 1.1rem; display: block; }
.chat-head .who span { font: 500 .74rem var(--mono); opacity: .8; }
.chat-head .x { border: none; background: color-mix(in srgb, var(--on-band) 14%, transparent); color: inherit; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: rotate var(--dur-3) var(--ease-out), background-color var(--dur-2) ease; }
.chat-head .x:hover { rotate: 90deg; background: var(--rust); color: #fff; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: 18px 18px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: .96rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: vg-msg-in var(--dur-3) var(--ease-out); box-shadow: var(--shadow-sm); }
@keyframes vg-msg-in { from { opacity: 0; translate: 0 8px; scale: .97; } }
.msg time { display: block; font: 500 .68rem var(--mono); opacity: .65; margin-top: 3px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-day { align-self: center; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--paper); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); margin: 6px 0; }
.chat-empty { margin: auto; text-align: center; max-width: 280px; color: var(--ink-2); }
.chat-empty .bubbles { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.chat-empty .bubbles i { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); animation: vg-float 1.4s var(--ease-in-out) infinite; }
.chat-empty .bubbles i:nth-child(2) { animation-delay: .15s; background: var(--teal); }
.chat-empty .bubbles i:nth-child(3) { animation-delay: .3s; background: var(--plum); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.chat-suggest button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: .3em .8em; font-size: .85rem; cursor: pointer; transition: border-color var(--dur-2) ease, translate var(--dur-2) var(--ease-out); }
.chat-suggest button:hover { border-color: var(--teal); translate: 0 -2px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); flex: none; align-items: end; }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: .6em .9em; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card-2); line-height: 1.4; }
.chat-form textarea:focus { outline: none; border-color: var(--teal); }
.chat-form button { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--amber); color: #2B1A10; display: grid; place-items: center; cursor: pointer; flex: none; transition: transform var(--dur-2) var(--ease-spring), background-color var(--dur-2) ease; }
.chat-form button:hover { transform: rotate(-12deg) scale(1.06); background: var(--band-accent); }
.chat-form button svg { width: 20px; height: 20px; }
.chat-status { font: 500 .7rem var(--mono); color: var(--muted); text-align: center; padding: 0 0 6px; background: var(--card); }

/* Admin chat (two panes) */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); height: min(70dvh, 680px); }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox-list button { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: none; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: none; cursor: pointer; align-items: center; transition: background-color var(--dur-2) ease; }
.inbox-list button:hover { background: var(--paper-2); }
.inbox-list button[aria-pressed="true"] { background: color-mix(in srgb, var(--amber-soft) 55%, var(--card)); }
.inbox-list .meta { min-width: 0; flex: 1; line-height: 1.3; }
.inbox-list .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-list .meta span { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-list .n { background: var(--rust); color: #fff; font: 700 .72rem/20px var(--mono); min-width: 20px; height: 20px; border-radius: 999px; text-align: center; padding: 0 6px; }
.inbox-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.inbox-side .inbox-list { border-right: none; flex: 1; min-height: 0; }
.inbox-tools { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.inbox-tools .input { min-height: 40px; }
.inbox-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.inbox-filters button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: .2em .75em; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink-2); transition: all var(--dur-2) ease; }
.inbox-filters button span { font-family: var(--mono); opacity: .75; }
.inbox-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.inbox-list .meta i { font-style: normal; opacity: .8; }
.inbox-list .side-meta { display: grid; justify-items: end; gap: 4px; flex: none; }
.reply-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); --ping: var(--amber); animation: vg-ping 2s var(--ease-out) infinite; }
.chat-note { display: flex; gap: 8px; align-items: center; padding: 8px 14px; font-size: .85rem; background: var(--amber-soft); color: var(--amber-ink); border-bottom: 1px solid var(--line); }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 0; background: var(--card); border-top: 1px solid var(--line); }
.quick button { flex: none; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1.5px solid var(--line); background: var(--card-2); border-radius: 999px; padding: .3em .85em; font-size: .82rem; cursor: pointer; transition: border-color var(--dur-2) ease, translate var(--dur-2) var(--ease-out); }
.quick button:hover { border-color: var(--teal); translate: 0 -2px; }
.quick + .chat-form { border-top: none; }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.inbox-thread .chat-log { background-color: var(--paper); }
@media (max-width: 760px) { .inbox { grid-template-columns: minmax(0, 1fr); height: auto; } .inbox-side { border-right: none; border-bottom: 1px solid var(--line); } .inbox-side .inbox-list { max-height: 280px; } .inbox-thread { height: 70dvh; } }

/* Drawer (admin member detail) */
dialog.drawer { border: none; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(680px, 100vw); background: var(--paper); color: var(--ink); box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); }
dialog.drawer::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
dialog.drawer[open] { animation: vg-drawer-in var(--dur-4) var(--ease-out); }
@keyframes vg-drawer-in { from { translate: 56px 0; opacity: 0; } }
.drawer-inner { padding: 22px clamp(18px, 4vw, 32px) 40px; display: grid; gap: 18px; }
.drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; position: sticky; top: 0; background: var(--paper); padding: 6px 0 12px; z-index: 2; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.6rem; }

/* Log / activity list */
.log { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 10px; }
.log::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.log li { position: relative; font-size: var(--t-small); }
.log li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 3px solid var(--c, var(--amber)); }
.log li time { display: block; font: 500 .72rem var(--mono); color: var(--muted); }

/* News */
.news-list { display: grid; gap: 14px; }
.news-item { display: grid; gap: 6px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); border-left: 4px solid var(--amber); transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out); }
.news-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.news-item.pinned { border-left-color: var(--teal); }
.news-item .nm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font: 500 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.news-item h3 { margin: 0; font-size: 1.2rem; }
.news-item p { margin: 0; color: var(--ink-2); white-space: pre-wrap; }

/* Document cards */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.doc { display: flex; gap: 14px; align-items: start; text-align: left; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), border-color var(--dur-2) ease; animation: vg-rise var(--dur-4) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms); width: 100%; }
.doc:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--amber); }
.doc:hover .kind { animation: vg-wiggle .5s var(--ease-out); }
@keyframes vg-wiggle { 30% { rotate: -6deg; } 60% { rotate: 4deg; } }
.doc .dm { min-width: 0; flex: 1; }
.doc .dm b { display: block; font-family: var(--display); font-size: 1.05rem; line-height: 1.25; margin-bottom: 4px; }
.doc .dm p { margin: 0 0 8px; font-size: .88rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc .dm .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: .38em .95em; font-weight: 700; font-size: var(--t-small); cursor: pointer; color: var(--ink-2); transition: all var(--dur-2) var(--ease-out); }
.filter:hover { border-color: var(--ink-2); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* KYC checklist */
.kyc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kyc-step { padding: 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--card); display: grid; gap: 8px; position: relative; overflow: hidden; }
.kyc-step .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); }
.kyc-step .ic svg { width: 18px; height: 18px; }
.kyc-step b { font-size: .95rem; line-height: 1.25; }
.kyc-step.submitted { border-color: var(--amber); } .kyc-step.submitted .ic { background: var(--amber-soft); color: var(--amber-ink); }
.kyc-step.verified { border-color: var(--ok); } .kyc-step.verified .ic { background: var(--olive-soft); color: var(--ok); animation: vg-pop var(--dur-4) var(--ease-spring); }
.kyc-step.rejected { border-color: var(--bad); } .kyc-step.rejected .ic { background: var(--rust-soft); color: var(--bad); }
.ring-progress { --p: 0; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--paper-2) 0); transition: --p 1s; position: relative; flex: none; }
.ring-progress::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring-progress b { position: relative; font: 700 1.5rem var(--display); }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }

/* Share price ticker */
.price-live { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.price-live .pv { font: 700 clamp(2.2rem, 4.4vw, 3.2rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.price-live .pv.flash { animation: vg-flash 1.2s var(--ease-out); }
@keyframes vg-flash { 0% { color: var(--teal); text-shadow: 0 0 24px var(--teal-soft); } }
.chart-box { position: relative; height: 320px; }
@media (max-width: 640px) { .chart-box { height: 260px; } }
.cert { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card-2); }
.cert .seal { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(from 0deg, var(--amber), var(--band-accent), var(--amber)); color: #2B1A10; box-shadow: var(--shadow-sm); animation: vg-spin 18s linear infinite; }
.cert .seal svg { width: 24px; height: 24px; animation: vg-spin 18s linear infinite reverse; }
.cert .cm { flex: 1; min-width: 0; }
.cert .cm b { display: block; font-family: var(--display); }

/* Generated ID card */
.id-card { position: relative; padding: 22px; border-radius: var(--radius); background: var(--band); color: var(--on-band); overflow: hidden; animation: vg-pop var(--dur-4) var(--ease-spring); }
.id-card::before { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; top: -90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--band-accent) 45%, transparent), transparent 70%); }
.id-card .uid { font: 500 clamp(1.4rem, 3vw, 2rem) var(--mono); letter-spacing: .08em; color: var(--band-accent); margin: 6px 0 10px; word-break: break-all; }
.id-card .label { color: color-mix(in srgb, var(--on-band) 70%, transparent); }

/* Big choice buttons (admin: PDF / Excel / Link) */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 14px; align-items: center; text-align: left; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); cursor: pointer; transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-2) ease, box-shadow var(--dur-3) var(--ease-out), background-color var(--dur-2) ease; }
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.choice[aria-pressed="true"] { border-color: var(--k); background: color-mix(in srgb, var(--k) 9%, var(--card)); box-shadow: var(--shadow); }
.choice.pdf { --k: var(--rust); } .choice.excel { --k: var(--olive); } .choice.link { --k: var(--teal); }
.choice b { display: block; font-family: var(--display); font-size: 1.15rem; }
.choice > span:not(.kind) span { font-size: .86rem; color: var(--muted); }

/* Confidential documents are view only: nothing prints while the viewer is open. */
@media print {
  body.viewing > * { display: none !important; }
  body.viewing::after { content: "Printing is turned off for confidential VINC documents."; display: block; padding: 40px; font: 600 18px/1.4 sans-serif; }
}

/* ---------- Joining VINC: the queue, the doorway and the welcome intro ---------- */
.qs { position: relative; height: 210px; overflow: hidden; }
.qs-floor { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 12px, transparent 12px 22px); }
.qs-spill { position: absolute; bottom: 8px; left: 0; right: 0; height: 40px; pointer-events: none; }
.qs-door { position: absolute; bottom: 27px; width: 96px; height: 146px; translate: -50% 0; perspective: 420px; z-index: 1; }
.qs-door::after { content: ""; position: absolute; left: 50%; bottom: -16px; width: 210px; height: 34px; translate: -50% 0; border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--band-accent) 55%, transparent), transparent 70%); opacity: 0; transition: opacity .8s var(--ease-out); pointer-events: none; }
.qs-door.open::after { opacity: .8; }
.qs-inside { position: absolute; inset: 0; border-radius: 48px 48px 6px 6px; border: 5px solid var(--ink); overflow: hidden; background: radial-gradient(circle at 50% 70%, #FFF3D6, var(--band-accent) 55%, var(--amber) 100%); box-shadow: 0 0 0 0 transparent; transition: box-shadow .6s var(--ease-out); }
.qs-door.open .qs-inside { box-shadow: 0 0 46px 6px color-mix(in srgb, var(--band-accent) 60%, transparent); }
.qs-door.pulse .qs-inside { animation: qs-pulse .6s var(--ease-out); }
@keyframes qs-pulse { 40% { box-shadow: 0 0 70px 16px color-mix(in srgb, var(--band-accent) 80%, transparent); filter: brightness(1.15); } }
.qs-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg at 50% 70%, rgba(255,255,255,.35) 0 8deg, transparent 8deg 22deg); animation: vg-spin 14s linear infinite; opacity: .7; }
.qs-panel { position: absolute; inset: 5px; border-radius: 43px 43px 3px 3px; background: linear-gradient(160deg, var(--teal-2), var(--teal)); transform-origin: left center; transition: transform 1s var(--ease-out); display: grid; place-items: center; box-shadow: inset 0 0 0 3px color-mix(in srgb, #000 12%, transparent); }
.qs-panel::before { content: ""; position: absolute; inset: 14px 12px 50% 12px; border-radius: 30px 30px 4px 4px; border: 2px solid color-mix(in srgb, #fff 25%, transparent); }
.qs-panel::after { content: ""; position: absolute; inset: 56% 12px 12px 12px; border-radius: 4px; border: 2px solid color-mix(in srgb, #fff 25%, transparent); }
.qs-panel .knob { position: absolute; right: 12px; top: 54%; width: 8px; height: 8px; border-radius: 50%; background: var(--band-accent); }
.qs-door.open .qs-panel { transform: rotateY(-108deg); }
.qs-wait { width: 26px; height: 26px; color: #fff; position: relative; z-index: 1; display: grid; place-items: center; animation: qs-wait 2.4s var(--ease-in-out) infinite; }
.qs-wait svg { width: 24px; height: 24px; }
@keyframes qs-wait { 0%, 100% { opacity: .55; scale: .92; } 50% { opacity: 1; scale: 1.06; } }
.intro:focus { outline: none; }
.qs-sign { position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); font: 700 .78rem var(--mono); letter-spacing: .14em; white-space: nowrap; }
.qs-sign img { width: 22px; height: 22px; border-radius: 6px; }
.pp { position: absolute; left: 0; bottom: 26px; width: 34px; margin-left: -17px; z-index: 2; will-change: transform; }
.pp.you { width: 42px; margin-left: -21px; z-index: 3; }
.pp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pp .torso, .pp .arm rect { fill: var(--c); }
.pp .leg rect { fill: color-mix(in srgb, var(--ink) 78%, var(--c)); }
.pp .leg, .pp .arm { transform-box: fill-box; transform-origin: 50% 8%; }
.pp.walking .pp-svg { animation: pp-bob .34s var(--ease-in-out) infinite alternate; }
.pp.walking .leg.l, .pp.walking .arm.r { animation: pp-swing .34s var(--ease-in-out) infinite alternate; }
.pp.walking .leg.r, .pp.walking .arm.l { animation: pp-swing .34s var(--ease-in-out) infinite alternate-reverse; }
.pp:not(.walking) .pp-svg { animation: pp-idle 2.4s var(--ease-in-out) infinite; animation-delay: var(--d, 0s); }
@keyframes pp-bob { from { translate: 0 0; } to { translate: 0 -3px; } }
@keyframes pp-swing { from { rotate: -20deg; } to { rotate: 20deg; } }
@keyframes pp-idle { 0%, 100% { translate: 0 0; scale: 1 1; } 50% { translate: 0 -1px; scale: 1 1.015; } }
.pp-shadow { position: absolute; left: 50%; bottom: -4px; width: 30px; height: 7px; translate: -50% 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.pp.you .pp-shadow { width: 44px; background: color-mix(in srgb, var(--amber) 45%, transparent); animation: pp-glow 1.6s var(--ease-in-out) infinite; }
@keyframes pp-glow { 50% { box-shadow: 0 0 14px 4px color-mix(in srgb, var(--amber) 50%, transparent); } }
.pp-tag { position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; white-space: nowrap; font: 700 .72rem var(--mono); background: var(--amber); color: #2B1A10; padding: 3px 9px; border-radius: 999px; box-shadow: var(--shadow-sm); animation: pp-tag 1.8s var(--ease-in-out) infinite; }
.pp-tag::after { content: ""; position: absolute; top: 100%; left: 50%; translate: -50% 0; border: 5px solid transparent; border-top-color: var(--amber); }
.pp-tag.wait { background: var(--card); color: var(--ink-2); border: 1px solid var(--line); animation: vg-fade .4s var(--ease-out); }
.pp-tag.wait::after { display: none; }
@keyframes pp-tag { 50% { translate: -50% -4px; } }
.qs-bit { position: absolute; bottom: 90px; width: 8px; height: 8px; border-radius: 2px; z-index: 4; pointer-events: none; }

.intro { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px 16px; background: var(--paper); overflow: hidden; isolation: isolate; }
.intro::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 55%, #000 30%, transparent 75%); }
.intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.intro-box { width: min(860px, 100%); text-align: center; }
.intro-box > * { animation: vg-rise var(--dur-4) var(--ease-out) backwards; }
.intro-box > :nth-child(2) { animation-delay: 80ms; } .intro-box > :nth-child(3) { animation-delay: 160ms; } .intro-box > :nth-child(4) { animation-delay: 240ms; }
.intro-title { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: .2em; }
.intro-sub { color: var(--ink-2); font-size: var(--t-lead); max-width: 34em; margin: 0 auto 10px; }
.intro-scene { margin: 6px auto 0; }
.intro-extra { min-height: 44px; opacity: 0; transition: opacity .6s var(--ease-out); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.intro-extra.show { opacity: 1; }
.intro-skip { position: absolute; right: 18px; bottom: 18px; }
.gate-queue { width: min(560px, 100%); margin: 0 auto 6px; }

/* Toggle switch */
.switch { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background-color var(--dur-2) ease; margin-top: 2px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); transition: translate var(--dur-3) var(--ease-spring); }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { translate: 20px 0; }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Reduce motion (same rule as the VINC Lab LMS): every animation ends at once and each element falls back
   to its un-animated style, which is always a complete picture. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
