/* PhD Compass — visual system
   Layout: a deep lapis sidebar and hero bands carrying a faint girih lattice; an airy,
   cool-white work surface; cards only where they group a piece of work.
   Motif: the eight-point star of Central Asian tilework, which doubles as a compass rose.
   Palette: lapis (primary), tile turquoise (progress, done), saffron (current step, attention). */

:root {
  --ink: #13203d;
  --ink-2: #374462;
  --muted: #5b6784;
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --surface-3: #e9eef8;
  --line: #dde3ef;
  --line-2: #c5cee0;
  --primary: #1d3f91;
  --primary-hover: #183679;
  --primary-ink: #1a3a86;
  --primary-soft: #e5ecfb;
  --on-primary: #ffffff;
  --deep: #0c1f52;
  --deep-2: #132d6b;
  --on-deep: #e8eefc;
  --on-deep-muted: #a9b8de;
  --ok: #0e8478;
  --ok-soft: #d9f1ed;
  --accent: #d8891a;
  --accent-ink: #8a540a;
  --accent-soft: #fcefd8;
  --warn: #a5520b;
  --warn-soft: #fdead6;
  --danger: #b22d3d;
  --danger-soft: #fbe3e6;
  --info: #22579f;
  --info-soft: #e2ecf9;
  --focus: #3c72f2;
  --shadow: 0 1px 2px rgba(15, 30, 70, .05), 0 3px 10px rgba(15, 30, 70, .05);
  --shadow-lg: 0 18px 44px rgba(10, 25, 65, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Alegreya Variable', Alegreya, Georgia, 'Times New Roman', serif;
  --font-ui: 'Onest Variable', Onest, 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --topbar-h: 60px;
  --sidebar-w: 248px;
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.1'%3E%3Cpath d='M21.5 21.5h29v29h-29z'/%3E%3Cpath d='M36 15.5 56.5 36 36 56.5 15.5 36z'/%3E%3Cpath d='M36 0v15.5M72 36H56.5M36 72V56.5M0 36h15.5M0 0l21.5 21.5M72 0 50.5 21.5M72 72 50.5 50.5M0 72l21.5-21.5'/%3E%3C/g%3E%3C/svg%3E");
  --girih-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%231d3f91' stroke-opacity='.07' stroke-width='1.1'%3E%3Cpath d='M21.5 21.5h29v29h-29z'/%3E%3Cpath d='M36 15.5 56.5 36 36 56.5 15.5 36z'/%3E%3Cpath d='M36 0v15.5M72 36H56.5M36 72V56.5M0 36h15.5M0 0l21.5 21.5M72 0 50.5 21.5M72 72 50.5 50.5M0 72l21.5-21.5'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e7ecf7; --ink-2: #c2cbe0; --muted: #94a1bf; --bg: #0a1120; --surface: #111a2e; --surface-2: #152038; --surface-3: #1b2843;
    --line: #24324f; --line-2: #33456b; --primary: #8fb0ff; --primary-hover: #a9c2ff; --primary-ink: #aac2ff; --primary-soft: #1a2a50; --on-primary: #0a1120;
    --deep: #071534; --deep-2: #0d2149; --on-deep: #e3eafb; --on-deep-muted: #93a6d3;
    --ok: #4fcfbe; --ok-soft: #10302c; --accent: #f1b357; --accent-ink: #f5c57f; --accent-soft: #352610; --warn: #f4a35e; --warn-soft: #382213;
    --danger: #f28995; --danger-soft: #3a1920; --info: #92b8ee; --info-soft: #162846; --focus: #7ea6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
    --girih-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%238fb0ff' stroke-opacity='.06' stroke-width='1.1'%3E%3Cpath d='M21.5 21.5h29v29h-29z'/%3E%3Cpath d='M36 15.5 56.5 36 36 56.5 15.5 36z'/%3E%3Cpath d='M36 0v15.5M72 36H56.5M36 72V56.5M0 36h15.5M0 0l21.5 21.5M72 0 50.5 21.5M72 72 50.5 50.5M0 72l21.5-21.5'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e7ecf7; --ink-2: #c2cbe0; --muted: #94a1bf; --bg: #0a1120; --surface: #111a2e; --surface-2: #152038; --surface-3: #1b2843;
  --line: #24324f; --line-2: #33456b; --primary: #8fb0ff; --primary-hover: #a9c2ff; --primary-ink: #aac2ff; --primary-soft: #1a2a50; --on-primary: #0a1120;
  --deep: #071534; --deep-2: #0d2149; --on-deep: #e3eafb; --on-deep-muted: #93a6d3;
  --ok: #4fcfbe; --ok-soft: #10302c; --accent: #f1b357; --accent-ink: #f5c57f; --accent-soft: #352610; --warn: #f4a35e; --warn-soft: #382213;
  --danger: #f28995; --danger-soft: #3a1920; --info: #92b8ee; --info-soft: #162846; --focus: #7ea6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
  --girih-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%238fb0ff' stroke-opacity='.06' stroke-width='1.1'%3E%3Cpath d='M21.5 21.5h29v29h-29z'/%3E%3Cpath d='M36 15.5 56.5 36 36 56.5 15.5 36z'/%3E%3Cpath d='M36 0v15.5M72 36H56.5M36 72V56.5M0 36h15.5M0 0l21.5 21.5M72 0 50.5 21.5M72 72 50.5 50.5M0 72l21.5-21.5'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01'; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.005em; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3, .h3 { font-size: 1rem; font-weight: 650; }
.h2 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; }
.h4, h4 { font-size: .9rem; font-weight: 650; color: var(--ink-2); }
p { margin: 0 0 .75em; }
a { color: var(--primary-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
code { font-family: var(--font-mono); font-size: .9em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.block { display: block; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { font-style: italic; color: var(--ink-2); }
blockquote.quote { margin: .5em 0; padding-left: .8em; border-left: 3px solid var(--line-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { flex: none; vertical-align: -0.2em; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); background: var(--bg); }
.noscript { padding: 2rem; text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem .8rem; border-radius: 6px; box-shadow: var(--shadow-lg); }
.skip:focus { left: 8px; }
.tabular, .stat-n, .due, .progress-label, .table td { font-variant-numeric: tabular-nums; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 42px; padding: .55rem 1.05rem; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-sm { min-height: 34px; padding: .32rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: .75rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 2px 6px rgba(29, 63, 145, .25); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.btn-accent { background: var(--accent); color: #241400; }
.btn-accent:hover { filter: brightness(1.06); color: #241400; }
.btn-on-deep { background: rgba(255, 255, 255, .1); color: var(--on-deep); border-color: rgba(255, 255, 255, .22); }
.btn-on-deep:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { border: 0; background: none; color: var(--primary-ink); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; } }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; min-width: 0; }
.field label, .copy-field label, .label-row label { font-weight: 600; font-size: .87rem; color: var(--ink-2); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.req { color: var(--danger); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: .6rem .75rem; width: 100%; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.hint { color: var(--muted); font-size: .84rem; margin: 0; }
.error-text { color: var(--danger); font-size: .85rem; font-weight: 600; margin: 0; }
.form-error { display: flex; gap: .5rem; align-items: flex-start; background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: .7rem .85rem; margin-bottom: 1rem; font-weight: 600; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; margin: .4rem 0; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: .2rem; accent-color: var(--primary); flex: none; }
.check label { display: flex; flex-direction: column; cursor: pointer; font-weight: 500; }
.check small { color: var(--muted); }
fieldset.roles { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0 0 1rem; }
fieldset.roles.has-error { border-color: var(--danger); }
legend { font-weight: 600; font-size: .87rem; color: var(--ink-2); padding: 0 .3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.select-sm { width: auto; min-height: 34px; padding: .25rem .55rem; font-size: .85rem; border-radius: 8px; }
.copy-field { margin: .5rem 0; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { font-family: var(--font-mono); font-size: .85rem; }
.switch { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch input { appearance: none; width: 42px; height: 24px; min-height: 0; border-radius: 99px; background: var(--line-2); border: 0; padding: 0; position: relative; cursor: pointer; flex: none; margin-top: .1rem; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.switch label { cursor: pointer; display: flex; flex-direction: column; font-weight: 600; }
.switch small { color: var(--muted); font-weight: 400; }
.code-input input { font-family: var(--font-mono); letter-spacing: .3em; font-size: 1.25rem; text-align: center; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; color: var(--ink); letter-spacing: .005em; }
.brand-text small { color: var(--muted); font-size: .74rem; }
.logo-mark { width: 34px; height: 34px; flex: none; display: block; }
.logo-mark .lm-tile { fill: var(--deep); }
.logo-mark .lm-star { fill: none; stroke: #ffffff; stroke-width: 1.4; stroke-linejoin: round; opacity: .92; }
.logo-mark .lm-n { fill: var(--accent); }
.logo-mark .lm-s { fill: #ffffff; opacity: .9; }
.logo-lg .logo-mark, .logo-mark.lg { width: 56px; height: 56px; }
.on-deep .brand, .on-deep .brand-text strong { color: #fff; }
.on-deep .brand-text small { color: var(--on-deep-muted); }

/* ---- segmented controls ---- */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .82rem; padding: .3rem .65rem; border-radius: 8px; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; min-height: 30px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.on-deep .seg { background: rgba(255, 255, 255, .1); }
.on-deep .seg button { color: var(--on-deep-muted); }
.on-deep .seg button.on { background: rgba(255, 255, 255, .95); color: #0c1f52; }

/* ---- app shell ---- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--topbar-h) 1fr; }
.topbar { grid-column: 2; display: flex; align-items: center; gap: .8rem; padding: 0 1.4rem; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; }
.topbar .brand { display: none; }
.menu-btn { display: none; }
.spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); padding: .25rem .55rem .25rem .3rem; border-radius: 99px; border: 1px solid transparent; }
.user-chip:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; flex: none; font-size: .92rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .78rem; }
.avatar.c1 { background: #dcefff; color: #164c87; } .avatar.c2 { background: #dff5ef; color: #0d6a5f; } .avatar.c3 { background: #fcefd8; color: #8a540a; }
.avatar.c4 { background: #f3e5fb; color: #6b2a8c; } .avatar.c5 { background: #fde3e4; color: #9c2433; }
.sidebar { grid-row: 1 / span 2; grid-column: 1; background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); padding: 1rem .8rem 1rem; display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 31; }
.sidebar-brand { padding: .3rem .4rem .8rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar-brand .brand-text strong { color: #fff; }
.sidebar-brand .brand-text small { color: var(--on-deep-muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 10px; color: var(--on-deep-muted); text-decoration: none; font-weight: 550; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--on-deep-muted); padding: .2rem .8rem; opacity: .8; }
.nav-count { margin-left: auto; background: var(--accent); color: #241400; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.sidebar .btn-primary { background: var(--accent); color: #241400; box-shadow: none; }
.sidebar .btn-primary:hover { filter: brightness(1.06); color: #241400; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; }
.nav-logout { display: flex; align-items: center; gap: .65rem; border: 0; background: none; color: var(--on-deep-muted); font: inherit; padding: .6rem .8rem; border-radius: 10px; cursor: pointer; }
.nav-logout:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.mode-box { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: .55rem; }
.mode-box .nav-section { padding: 0 .3rem .35rem; }
.mode-box .seg { width: 100%; background: rgba(0, 0, 0, .18); }
.mode-box .seg button { flex: 1; justify-content: center; color: var(--on-deep-muted); }
.mode-box .seg button.on { background: #fff; color: #0c1f52; }
.scrim { display: none; }
main { min-width: 0; outline: none; grid-column: 2; }
.page { max-width: 1180px; margin: 0 auto; padding: 1.7rem 1.6rem 4rem; }
.page-narrow { max-width: 840px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head h1 { margin-bottom: .15rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.section-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .9rem; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent-ink); margin: 0 0 .4rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); text-decoration: none; font-size: .88rem; margin-bottom: .6rem; }
.back-link:hover { color: var(--ink); }

/* ---- hero bands ---- */
.hero { position: relative; background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); border-radius: 18px; padding: 1.6rem 1.7rem; margin-bottom: 1.4rem; overflow: hidden; display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.hero::after { content: ""; position: absolute; inset: auto -60px -90px auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%); pointer-events: none; }
.hero h1 { color: #fff; margin: 0 0 .25rem; font-size: 1.9rem; }
.hero p { color: var(--on-deep-muted); margin: 0; }
.hero .hero-main { flex: 1 1 320px; min-width: 0; position: relative; z-index: 1; }
.hero .hero-side { position: relative; z-index: 1; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.hero .eyebrow { color: var(--accent); }
.hero a:not(.btn) { color: #fff; }
.hero-stats { display: flex; gap: .6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: .6rem .9rem; min-width: 110px; }
.hero-stat strong { display: block; font: 700 1.6rem/1.1 var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .78rem; color: var(--on-deep-muted); }
.hero-stat.hl strong { color: var(--accent); }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-track { stroke: rgba(255, 255, 255, .14); }
.ring .ring-fill { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring-label strong { font: 700 1.45rem/1 var(--font-display); color: #fff; }
.ring-label small { display: block; font-size: .66rem; color: var(--on-deep-muted); margin-top: .15rem; }
.light-ring .ring-track { stroke: var(--surface-3); }
.light-ring .ring-fill { stroke: var(--ok); }
.light-ring .ring-label strong { color: var(--ink); }
.light-ring .ring-label small { color: var(--muted); }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; font-size: 1rem; }
.card-head h2 .icon { color: var(--primary-ink); background: var(--primary-soft); border-radius: 8px; padding: 5px; width: 28px; height: 28px; }
.card-body { padding: 1rem 1.15rem; }
.card-body > :last-child { margin-bottom: 0; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { border-bottom: 0; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.card-flat { box-shadow: none; }

/* ---- badges, progress ---- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .58rem; border-radius: 99px; font-size: .76rem; font-weight: 650; white-space: nowrap; line-height: 1.5; }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-gold { background: var(--accent-soft); color: var(--accent-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-navy { background: var(--primary-soft); color: var(--primary-ink); }
.level { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .6rem; border-radius: 7px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.level::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: currentColor; border-radius: 1px; }
.level-phd { color: var(--primary-ink); background: var(--primary-soft); }
.level-masters { color: var(--ok); background: var(--ok-soft); }
.level-bachelor { color: var(--accent-ink); background: var(--accent-soft); }
.hero .level, .on-deep .level { background: rgba(255, 255, 255, .12); color: #fff; }
.progress-wrap { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0 .6rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 65%, var(--primary))); border-radius: 99px; transition: width .5s; }
.progress-label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.mini-bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; width: 84px; margin-top: .3rem; }
.mini-bar span { display: block; height: 100%; background: var(--ok); }
.due { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.due-soon { color: var(--warn); font-weight: 600; }
.due-over { color: var(--danger); font-weight: 650; }
.save-state { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); }
.save-saved { color: var(--ok); }
.save-error { color: var(--danger); font-weight: 600; }

/* ---- banners, empty, toasts ---- */
.banner { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: .92rem; }
.banner > .icon { margin-top: .15rem; }
.banner > div { flex: 1; display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; min-width: 0; }
.banner-info { background: var(--info-soft); color: var(--info); }
.banner-gold { background: var(--accent-soft); color: var(--accent-ink); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-ok { background: var(--ok-soft); color: var(--ok); }
.banner-ok > div { display: block; }
.banner-muted { background: var(--surface-3); color: var(--ink-2); }
.empty { text-align: center; padding: 2.6rem 1.25rem; background: var(--surface) var(--girih-ink) center / 72px 72px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto .9rem; background: var(--deep); color: var(--accent); box-shadow: var(--shadow); }
.empty h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.empty p { color: var(--muted); max-width: 560px; margin-inline: auto; }
.empty-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; align-items: center; margin-top: 1rem; }
.empty-actions .hint { flex-basis: 100%; }
.empty-inline { padding: 1rem; text-align: center; color: var(--muted); }
.loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); padding: 2rem; justify-content: center; }
.error-state { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem; text-align: center; color: var(--danger); }
.error-state p { color: var(--ink); }
.toasts { position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); right: calc(1rem + env(safe-area-inset-right, 0px)); z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: .6rem; background: var(--deep); color: #fff; padding: .75rem .85rem .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; font-size: .92rem; border: 1px solid rgba(255, 255, 255, .08); }
.toast .icon { color: var(--accent); }
.toast-error { background: var(--danger); }
.toast-error .icon { color: #fff; }
.toast span { flex: 1; }
.toast-x { background: none; border: 0; color: inherit; opacity: .8; cursor: pointer; padding: 2px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 18, 45, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 1rem; z-index: 150; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; border: 1px solid var(--line); }
.modal-sm { width: min(460px, 100%); }
.modal-lg { width: min(780px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem .5rem; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.modal-body { padding: .5rem 1.25rem 1rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.code-box { text-align: center; }
.code-big { font: 700 1.9rem/1.2 var(--font-mono); letter-spacing: .08em; color: var(--primary-ink); background: var(--primary-soft); border-radius: 12px; padding: .75rem; margin: .3rem 0 1rem; overflow-wrap: anywhere; }
.code-box .copy-field { text-align: left; }

/* ---- lists ---- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li + li { border-top: 1px solid var(--line); }
.item-list a, .item-list .li-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .35rem; color: var(--ink); text-decoration: none; flex-wrap: wrap; border-radius: 8px; }
.item-list a:hover { background: var(--surface-2); }
.item-list .grow { flex: 1 1 200px; }
.people { list-style: none; padding: 0; margin: 0 0 .5rem; }
.people li { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.chips li { background: var(--surface-3); border-radius: 99px; padding: .15rem .6rem; font-size: .8rem; color: var(--ink-2); }
.row-actions { display: inline-flex; gap: 2px; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; padding: .45rem 0; position: relative; font-size: .9rem; }
.timeline li + li::before { content: ""; position: absolute; left: 5px; top: -.45rem; height: .9rem; border-left: 2px solid var(--line); }
.tl-dot { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); background: var(--line-2); margin-top: .4rem; flex: none; }
.tl-dot.ev-approved, .tl-dot.ev-issue_resolved { background: var(--ok); }
.tl-dot.ev-revision_requested, .tl-dot.ev-reopened, .tl-dot.ev-issue_raised { background: var(--warn); }
.tl-dot.ev-submitted { background: var(--info); }
.tl-dot.ev-review_started { background: var(--accent); }

/* ---- dashboard ---- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.span-2 { grid-column: 1 / -1; }
.next-list { list-style: none; margin: 0; padding: 0; }
.next a { display: flex; align-items: center; gap: .85rem; padding: .75rem .45rem; text-decoration: none; color: var(--ink); border-radius: 12px; }
.next a:hover { background: var(--surface-2); }
.next + .next { border-top: 1px solid var(--line); }
.next-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.next-revise .next-icon, .next-action .next-icon { background: var(--warn-soft); color: var(--warn); }
.next-overdue_task .next-icon, .next-overdue_milestone .next-icon { background: var(--danger-soft); color: var(--danger); }
.next-milestone .next-icon, .next-plan .next-icon { background: var(--ok-soft); color: var(--ok); }
.next-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; font-weight: 550; overflow-wrap: anywhere; }
.next-text small { font-weight: 400; }
.next-text .due { margin-top: .1rem; }
.chev { color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.project-grid.archived { opacity: .75; }
.project-card { position: relative; display: flex; flex-direction: column; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem 1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; overflow: hidden; }
.project-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--primary); }
.project-card.lv-masters::before { background: var(--ok); }
.project-card.lv-bachelor::before { background: var(--accent); }
.project-card:hover { border-color: var(--line-2); color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15, 30, 70, .09); }
.project-card h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: .25rem 0 .1rem; line-height: 1.25; }
.pc-top, .ph-badges, .pc-chips, .row-badges { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.row-badges { margin-top: .3rem; }
.pc-meta { margin: 0; display: grid; gap: .35rem; font-size: .87rem; }
.pc-meta div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.pc-meta dt { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.pc-meta dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
.stat-n { font: 700 2rem/1.05 var(--font-display); color: var(--ink); }
.stat-l { color: var(--muted); font-size: .85rem; }
.stat-gold .stat-n { color: var(--accent-ink); }
.stat-warn .stat-n { color: var(--warn); }
.stat-danger .stat-n { color: var(--danger); }
.stat-ok .stat-n { color: var(--ok); }
.filters { display: flex; flex-wrap: wrap; gap: 0 .8rem; align-items: flex-end; }
.filters .field { margin-bottom: .8rem; min-width: 150px; }
.filters .f-grow { flex: 1 1 220px; }
.filters .check { margin-bottom: 1.1rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover strong { text-decoration: underline; }
.announce { display: flex; gap: .7rem; align-items: flex-start; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1.2rem; font-weight: 550; }

/* ---- project page ---- */
.project-head { margin-bottom: 1rem; }
.project-head h1 { margin: .4rem 0 .35rem; font-size: 1.85rem; }
.ph-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .9rem; margin: 0; }
.tabs { margin-bottom: 1.3rem; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); }
.tabs ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
@media (max-width: 900px) { .tabs ul { flex-wrap: nowrap; min-width: max-content; } }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; font-size: .9rem; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--primary-ink); border-bottom-color: var(--accent); }
.tab-count { background: var(--accent); color: #241400; font-size: .7rem; border-radius: 99px; padding: 0 .42rem; font-weight: 700; }
.tab-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab-toolbar > p { flex: 1 1 320px; margin: 0; }
.workflow { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: 0; }
.workflow li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; font-size: .8rem; color: var(--muted); position: relative; }
.workflow li + li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.workflow li.done + li::before { background: var(--ok); }
.wf-dot { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .85rem; position: relative; isolation: isolate; z-index: 1; }
.wf-dot::before { content: ""; position: absolute; inset: 4px; transform: rotate(45deg); border-radius: 7px; background: var(--surface-3); box-shadow: 0 0 0 3px var(--surface); z-index: -1; }
.workflow li.done .wf-dot { color: #fff; }
.workflow li.done .wf-dot::before { background: var(--ok); }
.workflow li.current .wf-dot { color: #241400; }
.workflow li.current .wf-dot::before { background: var(--accent); box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent-soft); }
.workflow li.current { color: var(--ink); font-weight: 650; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.kv { margin: .4rem 0 0; display: grid; gap: .5rem; font-size: .9rem; }
.kv div { display: grid; grid-template-columns: 10em 1fr; gap: .5rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* plan */
.plan-parts { display: grid; gap: 1rem; }
.plan-part { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; box-shadow: var(--shadow); }
.plan-part h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.plan-part h3 label { color: inherit; font-size: inherit; }
.plan-part-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.plan-part textarea { margin-top: .5rem; min-height: 90px; }
.numbered { margin: .3rem 0 .6rem; padding-left: 1.4rem; }
.numbered li { padding: .3rem 0; overflow-wrap: anywhere; }
.numbered li .row-actions { float: right; }
.inline-edit { display: flex; gap: .4rem; flex-wrap: wrap; }
.inline-edit input { flex: 1 1 240px; }
.add-row { display: flex; gap: .5rem; margin-top: .6rem; }
.add-row input { flex: 1; }
.send-box { margin-top: 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.send-box .hint { color: var(--on-deep-muted); }
.send-box .btn-primary { background: var(--accent); color: #241400; box-shadow: none; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }

/* outline */
.outline-list { list-style: none; margin: 0; padding: 0; }
.outline-list.root { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem .7rem; }
.outline-list .outline-list { padding-left: 1.4rem; border-left: 2px solid var(--line); margin-left: .6rem; }
.outline-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .2rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.outline-title { flex: 1 1 220px; font-weight: 650; }
.depth-1 > .outline-row .outline-title, .depth-2 > .outline-row .outline-title { font-weight: 500; }
.outline-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.outline-notes { margin: .2rem 0 .4rem .2rem; font-size: .85rem; }
.add-sub { margin: .4rem 0 .6rem 1.4rem; }

/* milestones */
.milestones { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.milestone { display: flex; gap: .95rem; padding: .85rem 1.05rem; align-items: flex-start; flex-wrap: wrap; }
.milestone + .milestone { border-top: 1px solid var(--line); }
.ms-marker { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .78rem; flex: none; position: relative; isolation: isolate; margin-top: .05rem; }
.ms-marker::before { content: ""; position: absolute; inset: 4px; transform: rotate(45deg); border-radius: 6px; background: var(--surface-3); z-index: -1; }
.ms-done .ms-marker { color: #fff; }
.ms-done .ms-marker::before { background: var(--ok); }
.ms-in_progress .ms-marker { color: #241400; }
.ms-in_progress .ms-marker::before { background: var(--accent); }
.ms-skipped { opacity: .6; }
.ms-skipped .ms-title { text-decoration: line-through; }
.ms-overdue .ms-marker { color: var(--danger); }
.ms-overdue .ms-marker::before { background: var(--danger-soft); }
.ms-main { flex: 1 1 260px; min-width: 0; }
.ms-title { font-weight: 600; }
.ms-meta { margin-top: .2rem; }
.ms-side { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* tasks */
.chip-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: .35rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; min-height: 34px; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-n { opacity: .7; margin-left: .2rem; }
.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.meeting .tasks { box-shadow: none; }
.task { display: flex; gap: .75rem; padding: .75rem 1.05rem; align-items: flex-start; }
.task + .task { border-top: 1px solid var(--line); }
.task-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; margin-top: .12rem; color: #fff; padding: 0; }
.task-check:hover:not(:disabled) { border-color: var(--ok); }
.task-check:disabled { cursor: not-allowed; opacity: .5; }
.task-done .task-check { background: var(--ok); border-color: var(--ok); }
.task-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.task-title { font-weight: 550; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }

/* submissions */
.legend { flex: 1 1 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; font-size: .9rem; }
.legend summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.legend p { margin: .5rem 0 0; }
.sub-group { margin-bottom: 1.2rem; }
.sub-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 .8rem; box-shadow: var(--shadow); }
.sub-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: .6rem; }
.sub-head h2 { margin: .35rem 0 .2rem; }
.sub-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.status-track { list-style: none; display: flex; margin: .4rem 0 1.1rem; padding: .85rem .4rem .7rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.status-track li { flex: 1 1 0; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .76rem; color: var(--muted); text-align: center; position: relative; padding: 0 .2rem; }
.status-track li + li::before { content: ""; position: absolute; top: 7px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.st-dot { width: 15px; height: 15px; border-radius: 4px; transform: rotate(45deg); background: var(--surface-3); border: 2px solid var(--line-2); z-index: 1; }
.status-track li.done .st-dot { background: var(--ok); border-color: var(--ok); }
.status-track li.current { color: var(--ink); font-weight: 700; }
.status-track li.current .st-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status-track li.current.st-approved .st-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status-track li.current.st-revision_requested .st-dot { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.sub-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
textarea.writing { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.72; min-height: 320px; padding: .95rem 1.05rem; }
.files { list-style: none; padding: 0; margin: .3rem 0 .7rem; }
.files li { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; flex-wrap: wrap; }
.files a, .file-name { font-weight: 600; overflow-wrap: anywhere; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: .95rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.dropzone.drag { border-color: var(--focus); background: var(--info-soft); }
.versions { list-style: none; margin: 0; padding: 0; }
.version + .version { border-top: 1px solid var(--line); }
.version-head { width: 100%; display: flex; align-items: center; gap: .8rem; border: 0; background: none; padding: .75rem .2rem; font: inherit; color: var(--ink); cursor: pointer; text-align: left; flex-wrap: wrap; }
.version-head .icon:last-child { margin-left: auto; }
.version-body { padding: 0 .2rem 1rem; }
.version-note { background: var(--surface-2); border-radius: 10px; padding: .55rem .75rem; font-size: .9rem; }
.frozen { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1.05rem; max-height: 420px; overflow-y: auto; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.68; margin-bottom: .7rem; }
.diff { margin-top: .8rem; }
.diff-body { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1.05rem; max-height: 480px; overflow-y: auto; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.72; }
.diff ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; border-bottom: 2px solid var(--ok); }
.diff del { background: var(--danger-soft); color: var(--danger); }
.comments, .replies { list-style: none; margin: 0; padding: 0; }
.comment { padding: .8rem 0; }
.comments > .comment + .comment { border-top: 1px solid var(--line); }
.replies { margin: .5rem 0 0 1.2rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.replies .comment { padding: .5rem 0; }
.comment-head { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-bottom: .3rem; }
.comment-body { font-size: .94rem; }
.comment-action { border-left: 3px solid var(--warn); padding-left: .75rem !important; }
.comment-action.comment-addressed { border-left-color: var(--accent); }
.comment-action.comment-resolved { border-left-color: var(--ok); }
.comment-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.composer { margin-top: .8rem; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.history > summary h2 { margin: 0; display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.history > summary h2 .icon { color: var(--primary-ink); }

/* references, meetings */
.refs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ref { display: flex; gap: .8rem; padding: .85rem 1.05rem; align-items: flex-start; }
.ref + .ref { border-top: 1px solid var(--line); }
.ref-main { flex: 1; min-width: 0; }
.ref-cite { margin: 0 0 .35rem; overflow-wrap: anywhere; font-family: var(--font-display); font-size: 1.04rem; }
.ref-meta { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.ref-example { background: var(--accent-soft); }
.meetings { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.meeting + .meeting { border-top: 1px solid var(--line); }
.meeting-head { width: 100%; display: flex; gap: .8rem; align-items: center; padding: .85rem 1.05rem; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; flex-wrap: wrap; }
.meeting-date { display: inline-flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .9rem; min-width: 10.5em; }
.meeting-body { padding: 0 1.05rem 1rem; }
.meeting-body h4 { margin-top: .8rem; }

/* wizard */
.stepper { list-style: none; display: flex; gap: .6rem; margin: 0 0 1.4rem; padding: 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.stepper li + li::before { content: ""; width: 26px; height: 2px; background: var(--line-2); margin-right: .2rem; }
.step-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-size: .8rem; }
.stepper li.current { color: var(--ink); }
.stepper li.current .step-n { background: var(--primary); color: var(--on-primary); }
.stepper li.done .step-n { background: var(--ok); color: #fff; }
.level-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: .8rem; }
.level-card { text-align: left; display: flex; flex-direction: column; gap: .5rem; padding: 1.15rem; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.level-card:hover { border-color: var(--line-2); }
.level-card.on { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.lc-head { display: flex; justify-content: space-between; align-items: center; color: var(--ok); }
.level-card strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.lc-blurb { color: var(--ink-2); font-size: .9rem; }
.lc-depth { color: var(--muted); font-size: .8rem; margin-top: auto; border-top: 1px solid var(--line); padding-top: .5rem; }
.template-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.template-list { margin: .3rem 0 .8rem; padding-left: 1.3rem; font-size: .9rem; color: var(--ink-2); }
.template-list li { padding: .1rem 0; }
.outline-preview ul { padding-left: 1.1rem; }

/* invitations, settings */
.invite-card { display: flex; gap: .9rem; padding: .9rem 0; }
.invite-card + .invite-card { border-top: 1px solid var(--line); }
.invite-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--deep); color: var(--accent); display: grid; place-items: center; flex: none; }
.code-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.code-form .field { flex: 1 1 240px; margin-bottom: 0; }
.code-form input { font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.code-form + .form-error { margin-top: .8rem; }
.settings { display: grid; gap: 0; }
.button-stack { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.method-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.method-list li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.method-list li:first-child { border-top: 0; }
.method-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; font-weight: 800; font-size: .85rem; }

/* ---- public pages: landing & sign-in ---- */
.pub { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.pub-nav { display: flex; align-items: center; gap: .8rem; padding: .9rem max(16px, env(safe-area-inset-right, 0px)) .9rem max(16px, env(safe-area-inset-left, 0px)); max-width: 1200px; width: 100%; margin: 0 auto; }
.pub-nav-wrap { background: var(--deep) var(--girih) 0 0 / 72px 72px; }
.pub-nav-wrap .pub-nav { color: var(--on-deep); }
.lp-hero { background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); position: relative; overflow: hidden; }
.lp-hero::before { content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -120px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%); pointer-events: none; }
.lp-hero-in { position: relative; max-width: 1200px; margin: 0 auto; padding: 2.5rem max(16px, env(safe-area-inset-right, 0px)) 3.5rem max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2.5rem; align-items: center; }
.lp-hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: .2rem 0 1rem; letter-spacing: -.01em; }
.lp-hero h1 em { font-style: italic; color: var(--accent); }
.lp-lead { font-size: 1.12rem; color: var(--on-deep-muted); max-width: 34em; }
.lp-tracks-inline { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 1.4rem; }
.role-cards { display: grid; gap: .9rem; }
.role-card { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.2rem; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none; transition: background .15s, transform .15s, border-color .15s; }
.role-card:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .3); color: #fff; transform: translateY(-2px); }
.role-card .rc-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: #fff; color: var(--deep); flex: none; }
.role-card.teacher .rc-ico { background: var(--accent); color: #241400; }
.role-card strong { display: block; font: 700 1.3rem/1.2 var(--font-display); }
.role-card small { color: var(--on-deep-muted); font-size: .88rem; }
.role-card .chev { margin-left: auto; color: var(--on-deep-muted); }
.lp-section { max-width: 1200px; margin: 0 auto; padding: 3.2rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px)); width: 100%; }
.lp-section h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: .4rem; }
.lp-section > p.muted { max-width: 46em; font-size: 1.02rem; }
.track-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.track-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .55rem; position: relative; overflow: hidden; }
.track-card::after { content: ""; position: absolute; right: -24px; top: -24px; width: 110px; height: 110px; background: var(--girih-ink) center / 72px 72px; opacity: .9; }
.track-card h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin: .1rem 0 0; }
.track-card .tc-num { display: flex; gap: 1.2rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.track-card .tc-num div { display: flex; flex-direction: column; }
.track-card .tc-num strong { font: 700 1.6rem/1 var(--font-display); color: var(--ink); }
.track-card .tc-num span { font-size: .78rem; color: var(--muted); }
.steps-flow { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.steps-flow li { position: relative; padding: 1.1rem 1.1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.steps-flow .sf-n { width: 36px; height: 36px; border-radius: 10px; transform: rotate(45deg); background: var(--deep); color: var(--accent); display: grid; place-items: center; font-weight: 800; margin: .3rem 0 .9rem .3rem; }
.steps-flow .sf-n span { transform: rotate(-45deg); }
.steps-flow strong { display: block; font-size: 1.02rem; margin-bottom: .2rem; }
.steps-flow p { margin: 0; color: var(--muted); font-size: .92rem; }
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.trust div { display: flex; gap: .8rem; align-items: flex-start; }
.trust .icon { color: var(--ok); background: var(--ok-soft); border-radius: 10px; padding: 7px; width: 34px; height: 34px; }
.lp-cta { margin: 3rem auto 0; max-width: 1200px; width: calc(100% - 32px); background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); border-radius: 20px; padding: 2rem; display: flex; gap: 1.2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lp-cta h2 { color: #fff; font-family: var(--font-display); font-size: 1.7rem; margin: 0; }
.pub-foot { margin-top: auto; padding: 2.2rem max(16px, env(safe-area-inset-right, 0px)) calc(1.6rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-width: 1200px; width: 100%; margin-inline: auto; display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.pub-foot a { color: var(--muted); }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); background: var(--bg); }
.auth-side { background: var(--deep) var(--girih) 0 0 / 72px 72px; color: var(--on-deep); padding: 2rem 3rem; display: flex; flex-direction: column; gap: 2rem; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; left: -160px; bottom: -220px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%); pointer-events: none; }
.auth-side-body { margin: auto 0; position: relative; z-index: 1; }
.auth-side h2 { color: #fff; font: 700 clamp(1.8rem, 3vw, 2.5rem)/1.12 var(--font-display); margin: .3rem 0 1rem; }
.auth-side .eyebrow { color: var(--accent); }
.auth-points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 1rem; max-width: 460px; }
.auth-points li { display: flex; gap: .8rem; align-items: flex-start; color: #dbe3f6; }
.auth-points .icon { color: var(--accent); margin-top: .2rem; }
.auth-main { display: flex; flex-direction: column; padding: 1.1rem max(16px, env(safe-area-inset-right, 0px)) 1.6rem max(16px, env(safe-area-inset-left, 0px)); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.auth-card { width: min(460px, 100%); margin: auto; padding: 1.5rem 0; }
.auth-card h1 { font-size: 2rem; margin-bottom: .35rem; }
.auth-card > .lead { color: var(--muted); margin-bottom: 1.4rem; }
.auth-mobile-brand { display: none; }
.provider-list { display: grid; gap: .6rem; }
.provider-btn { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 50px; padding: .6rem 1rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s; }
.provider-btn:hover { border-color: var(--primary); background: var(--surface-2); color: var(--ink); }
.provider-btn .pv-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font-weight: 800; font-size: .82rem; flex: none; }
.provider-btn .pv-ico.oneid { background: var(--primary); color: var(--on-primary); font-size: .7rem; letter-spacing: .02em; }
.provider-btn .chev { margin-left: auto; }
.tg-slot { min-height: 50px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-2); border-radius: 12px; padding: .3rem; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .82rem; margin: 1.2rem 0; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { margin-top: 1.1rem; text-align: center; font-size: .92rem; }
.auth-switch { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-size: .9rem; }
.auth-forgot { margin-top: .6rem; text-align: center; font-size: .88rem; }
.auth-forgot .hint { margin-top: .4rem; }
.chooser { display: grid; gap: 1rem; }
.chooser .role-card { background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.chooser .role-card:hover { border-color: var(--primary); color: var(--ink); background: var(--surface); }
.chooser .role-card .rc-ico { background: var(--deep); color: #fff; }
.chooser .role-card.teacher .rc-ico { background: var(--accent); color: #241400; }
.chooser .role-card small { color: var(--muted); }
.chooser .role-card .chev { color: var(--muted); }
.pending-card { max-width: 620px; margin: 2rem auto; text-align: center; }
.pending-card .empty-icon { width: 72px; height: 72px; }

/* ---- admin console ---- */
.adm { min-height: 100vh; background: var(--bg); }
.adm-top { background: #0b1324; color: #dce4f5; display: flex; align-items: center; gap: 1rem; padding: .7rem max(16px, env(safe-area-inset-right, 0px)) .7rem max(16px, env(safe-area-inset-left, 0px)); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; flex-wrap: wrap; }
.adm-top .brand-text strong { color: #fff; }
.adm-top .brand-text small { color: #8d9bbb; }
.adm-tag { background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border-radius: 6px; padding: .12rem .45rem; }
.adm-nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.adm-nav button { border: 0; background: none; color: #a8b5d3; font: inherit; font-weight: 600; font-size: .9rem; padding: .45rem .75rem; border-radius: 8px; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.adm-nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav button.on { background: rgba(255, 255, 255, .12); color: #fff; }
.adm-body { max-width: 1240px; margin: 0 auto; padding: 1.5rem max(16px, env(safe-area-inset-right, 0px)) 4rem max(16px, env(safe-area-inset-left, 0px)); }
.adm-login { min-height: 100vh; display: grid; place-items: center; background: #0b1324; padding: 1rem; }
.adm-login .card { width: min(420px, 100%); }
.adm-login h1 { font-size: 1.5rem; }
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 140px; padding-top: .6rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 38px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar b { font-size: .78rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars .bar span { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.hbars { display: grid; gap: .55rem; }
.hbar { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 3em; gap: .6rem; align-items: center; font-size: .88rem; }
.hbar .track { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.sys-list { list-style: none; padding: 0; margin: 0; }
.sys-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sys-list li:first-child { border-top: 0; }
.qr { background: #fff; border-radius: 12px; padding: 8px; display: inline-block; border: 1px solid var(--line); }
.qr img { display: block; width: 200px; height: 200px; }

.adm-top .adm-brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-family: var(--font-display); font-size: 1.15rem; }
.adm-nav a { color: #a8b5d3; text-decoration: none; font-weight: 600; font-size: .9rem; padding: .45rem .75rem; border-radius: 8px; display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; }
.adm-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav a.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.adm-tools { display: flex; align-items: center; gap: .5rem; }
.adm-warn { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); padding: .6rem max(16px, env(safe-area-inset-right, 0px)) .6rem max(16px, env(safe-area-inset-left, 0px)); font-weight: 600; font-size: .9rem; }
.adm-warn span { flex: 1 1 240px; }
.adm-login-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.adm-login-brand strong { display: block; font: 700 1.25rem/1.1 var(--font-display); }
.adm-login-brand .adm-tag { display: inline-block; margin-top: .25rem; }
.adm-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; padding: .8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.adm-kv div { grid-template-columns: 11em 1fr; }
.adm-body .modal .h4, .modal .h4 { margin: 1rem 0 .3rem; }
.card-pending { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-pending .card-head { background: var(--accent-soft); border-radius: var(--radius) var(--radius) 0 0; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.stat-link:hover { border-color: var(--accent); color: inherit; transform: translateY(-1px); }
.link-plain { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.link-plain:hover strong { text-decoration: underline; }
code.secret { font-size: .95rem; letter-spacing: .08em; background: var(--surface-3); padding: .15rem .4rem; border-radius: 6px; overflow-wrap: anywhere; }
.hb-gold .hbar .track i { background: var(--accent); }
.bars .bar i { border-radius: 4px 4px 0 0; }
.on-deep .icon-btn { color: var(--on-deep-muted); }
.on-deep .icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: #fff; }
.seg-wide { display: flex; width: 100%; margin-bottom: 1rem; }
.seg-wide button { flex: 1; justify-content: center; min-height: 38px; }
.auth-note { display: flex; gap: .5rem; align-items: flex-start; color: var(--muted); font-size: .86rem; margin: 1rem 0 0; padding: .7rem .8rem; background: var(--surface-2); border-radius: 10px; }
.auth-note .icon { color: var(--ok); margin-top: .15rem; }
.code-sent { font-size: .92rem; color: var(--ink-2); }
.center { text-align: center; }
.hint.center { margin-top: .7rem; }
.lp-small { color: var(--on-deep-muted); font-size: .86rem; margin: .2rem 0 0; }
.provider-btn .pv-ico.google { background: #fff; color: #1d3f91; border: 1px solid var(--line-2); font-family: var(--font-ui); }
.provider-btn .pv-ico.tg { background: #2a9fd8; color: #fff; }
.tg-wrap .hint { margin-top: .35rem; }
.tg-slot { background: var(--surface); }
.shell-note { padding-bottom: 0; }
.shell-note + .page { padding-top: 1rem; }
.pending-facts { text-align: left; margin: 1rem 0; }
.pending-card h1 { font-size: 1.7rem; }
.auth-side .brand-text strong { color: #fff; }
.auth-side .brand-text small { color: var(--on-deep-muted); }
.auth-top .spacer { flex: 1; }
.auth-top { gap: .5rem; }
.pub-nav .spacer { flex: 1; }
.lp-hero .pub-nav { position: relative; z-index: 2; }
.on-deep .brand-text strong { color: #fff; }
.on-deep .brand-text small { color: var(--on-deep-muted); }

.on-deep .logo-mark .lm-tile, .sidebar .logo-mark .lm-tile, .adm-top .logo-mark .lm-tile { fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.brand-text strong { white-space: nowrap; }
.track-card .level { align-self: flex-start; position: relative; z-index: 1; }
.trust > div > div { display: block; }
.trust > div > div strong { display: block; margin-bottom: .15rem; }
.tg-slot .tg-loading { color: var(--muted); font-size: .88rem; }
.tg-slot:has(iframe) .tg-loading { display: none; }
.tg-slot:has(iframe) { border-style: solid; border-color: transparent; background: transparent; }

.sidebar-brand .brand-text small { display: none; }
@media (min-width: 901px) { .app { background: linear-gradient(to right, var(--deep) var(--sidebar-w), var(--bg) var(--sidebar-w)); } }

.cred > div { display: block; }
.cred strong.block { margin-bottom: .3rem; }
.cred .copy-field { margin: .5rem 0; }
.cred .copy-row input { flex: 1; }
.cred .copy-row input { background: var(--surface); }
textarea.cred-msg { font-family: var(--font-mono); font-size: .85rem; background: var(--surface); min-height: 0; }
.cred .form-actions { margin-top: .4rem; justify-content: flex-start; }

/* ---- print documents ---- */
.print-shell { background: var(--surface-3); min-height: 100vh; padding: 1.5rem 1rem 3rem; }
.print-bar { max-width: 210mm; margin: 0 auto 1rem; display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.doc { background: #fff; color: #000; max-width: 210mm; margin: 0 auto; padding: 20mm 15mm 20mm 30mm; box-shadow: var(--shadow-lg);
  font-family: "Times New Roman", Times, serif; font-size: 14pt; line-height: 1.5; }
.doc h1, .doc h2, .doc h3 { color: #000; font-family: "Times New Roman", Times, serif; }
.doc-head { text-align: center; margin-bottom: 1.5em; }
.doc-inst { margin: 0; text-transform: uppercase; font-size: 12pt; }
.doc-title { font-size: 16pt; font-weight: 700; margin: 1.2em 0 .3em; text-transform: uppercase; }
.doc-topic { font-weight: 700; margin-bottom: 1em; }
.doc-meta { margin: 0 auto; border-collapse: collapse; text-align: left; font-size: 13pt; }
.doc-meta th { font-weight: 400; padding: .1em .8em .1em 0; vertical-align: top; color: #333; }
.doc-meta td { padding: .1em 0; }
.doc h2 { font-size: 14pt; font-weight: 700; margin: 1.1em 0 .4em; }
.doc-text { text-indent: 1.25cm; text-align: justify; white-space: pre-wrap; margin: 0 0 .5em; }
.doc ol { margin: 0 0 .5em; padding-left: 1.6em; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12pt; margin-bottom: .6em; }
.doc-table th, .doc-table td { border: 1px solid #000; padding: .2em .4em; text-align: left; vertical-align: top; }
.doc-note { font-size: 11pt; font-style: italic; color: #333; }
.doc-foot { margin-top: 2em; font-size: 10pt; color: #555; border-top: 1px solid #999; padding-top: .4em; }
@page { size: A4; margin: 20mm 15mm 20mm 30mm; }
@media print {
  body { background: #fff; }
  .no-print, .toasts { display: none !important; }
  .print-shell { padding: 0; background: #fff; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
  .doc h2 { break-after: avoid; }
  .doc-table tr { break-inside: avoid; }
}

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .sub-layout { grid-template-columns: minmax(0, 1fr); }
  .workflow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1rem; }
  .workflow li:nth-child(5)::before { display: none; }
  .steps-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { grid-column: 1; padding: 0 .9rem; }
  .topbar .brand { display: flex; }
  main { grid-column: 1; }
  .menu-btn { display: inline-grid; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 86vw); height: auto; z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); padding-top: calc(1rem + env(safe-area-inset-top, 0px)); padding-left: calc(.8rem + env(safe-area-inset-left, 0px)); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 18, 45, .5); z-index: 55; }
  .dash-grid, .overview-grid, .template-cols, .level-cards, .track-cards, .trust { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-hero-in { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; padding-top: 1.5rem; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .btn { white-space: normal; text-align: center; height: auto; }
  .send-box .btn { width: 100%; }
  .page { padding: 1rem 1rem 3rem; }
  h1 { font-size: 1.6rem; }
  .hero { padding: 1.2rem; border-radius: 14px; }
  .hero h1 { font-size: 1.5rem; }
  .project-head h1 { font-size: 1.45rem; }
  .user-name { display: none; }
  .topbar .brand-text small { display: none; }
  .grid-2, .grid-3, .check-grid { grid-template-columns: minmax(0, 1fr); }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow li::before { display: none; }
  .steps-flow { grid-template-columns: minmax(0, 1fr); }
  .card-body, .card-head { padding-inline: .9rem; }
  .kv div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hbar { grid-template-columns: 7em minmax(0, 1fr) 2.5em; }
  .students-table thead, .adm-table thead { display: none; }
  .students-table, .students-table tbody, .students-table tr, .students-table td,
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; width: 100%; }
  .students-table tr, .adm-table tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .students-table td, .adm-table td { border: 0; padding: .2rem 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
  .students-table td::before, .adm-table td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; min-width: 8.5em; }
  .students-table td:first-child, .adm-table td:first-child { display: block; }
  .students-table td:first-child::before, .adm-table td:first-child::before { display: none; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .sub-actions { width: 100%; }
  .sub-actions .btn { flex: 1 1 auto; }
  .head-actions .btn { flex: 1 1 auto; }
  .doc { padding: 10mm; font-size: 12pt; }
  .milestone { gap: .6rem; }
  .ms-side { width: 100%; justify-content: space-between; }
  .add-row { flex-wrap: wrap; }
  .add-row input { flex: 1 1 100%; }
  .add-row .btn { flex: 1 1 auto; }
  .numbered li .row-actions { float: none; display: flex; margin-top: .2rem; }
  .toasts { left: 1rem; right: 1rem; max-width: none; }
  .lp-cta { padding: 1.4rem; }
  .pub-nav .brand-text small { display: none; }
  .adm-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 640px) {
  .topbar > .icon-btn:not(.menu-btn) { display: none; }
  .topbar .brand { overflow: hidden; }
  .hero .hero-side { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-items: center; }
  .hero .hero-side:has(.ring) { grid-template-columns: 76px minmax(0, 1fr); }
  .hero .hero-side > .btn { grid-column: 1 / -1; }
  .hero .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .hero .hero-side:has(.ring) .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stat { min-width: 0; padding: .45rem .55rem; border-radius: 10px; }
  .hero-stat strong { font-size: 1.25rem; }
  .hero-stat span { display: block; font-size: .7rem; line-height: 1.25; }
  .ring { width: 76px !important; height: 76px !important; }
  .ring-label strong { font-size: 1.1rem; }
  .ring-label small { font-size: .6rem; }
  .topbar { gap: .45rem; padding: 0 .7rem; }
  .topbar .brand { gap: .45rem; }
  .topbar .brand-text strong { font-size: 1.08rem; }
  .user-chip { padding: .2rem; }
  .pub-nav > .icon-btn { display: none; }
  .pub-nav { gap: .5rem; }
  .adm-tools { margin-left: auto; }
  .adm-tools > .icon-btn { display: none; }
  .adm-tools .btn span { display: none; }
  .adm-top { gap: .6rem; }
  .hero-side > .btn { width: 100%; }
  .qr img { width: 180px; height: 180px; }
}
code.secret { display: inline-block; margin: .2rem 0 .8rem; }

/* ---- demo build only ---- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .55rem max(16px, env(safe-area-inset-right, 0px)) .55rem max(16px, env(safe-area-inset-left, 0px)); background: var(--accent-soft); color: var(--accent-ink); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: .85rem; }
.demo-tag { background: var(--accent); color: #241400; font-weight: 800; border-radius: 6px; padding: .1rem .5rem; letter-spacing: .06em; text-transform: uppercase; font-size: .7rem; }
.demo-note { flex: 1 1 260px; min-width: 0; }
.demo-users { display: flex; flex-wrap: wrap; gap: .35rem; }
.demo-user { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface); color: var(--ink); border-radius: 9px; padding: .25rem .6rem; font: inherit; cursor: pointer; line-height: 1.25; }
.demo-user small { color: var(--muted); font-size: .72rem; }
.demo-user.on { background: var(--deep); border-color: var(--deep); color: #fff; }
.demo-user.on small { color: var(--on-deep-muted); }
.demo-reset { border: 0; background: none; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; padding: .2rem; }
@media (max-width: 640px) { .demo-note { display: none; } }
