/* Cotrini EU Registration Tracker. System fonts, neutral palette, one accent. */

:root {
  color-scheme: light dark;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --surface-3: #f1efea;
  --text: #1b1c1e;
  --text-2: #55585f;
  --text-3: #666970; /* 4.78:1 or better on every light surface */
  --line: #e4e1da;
  --line-2: #eeebe5;
  --track: #e9e6df;
  --accent: #2f7a68;
  --accent-strong: #215a4c;
  --accent-soft: #e2efeb;
  --accent-ink: #ffffff;
  --warn-soft: #f5eedb;
  --warn-ink: #73561a;
  --bad-soft: #f6e5e1;
  --bad-ink: #8b3424;
  --shadow: 0 1px 2px rgba(25, 22, 15, 0.04), 0 4px 16px rgba(25, 22, 15, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111213;
    --surface: #1a1b1d;
    --surface-2: #1f2023;
    --surface-3: #25272a;
    --text: #ebebe8;
    --text-2: #a7a9ae;
    --text-3: #8b8e95; /* 4.56:1 or better on every dark surface */
    --line: #2d2f33;
    --line-2: #26282b;
    --track: #2b2d31;
    --accent: #5dbca2;
    --accent-strong: #86d2bd;
    --accent-soft: #1d3530;
    --accent-ink: #0c1916;
    --warn-soft: #362d17;
    --warn-ink: #e3c47c;
    --bad-soft: #3a211c;
    --bad-ink: #f0a594;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent-strong); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }

button, input, select, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.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;
}

.boot, .noscript { text-align: center; color: var(--text-3); padding: 80px 16px; margin: 0; }

/* ------------------------------------------------------------ top bar */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 800px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em;
  min-width: 0;
}
.brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 4px solid var(--accent); border-right-color: var(--track);
  transform: rotate(-45deg);
}
.who { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; flex: none; }
.who-name { font-weight: 550; color: var(--text); }

.linklike {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; font-size: 14px;
}
.linklike:hover { color: var(--accent); }

/* ------------------------------------------------------------- layout */

.page { max-width: 800px; margin: 0 auto; padding: 20px 16px 72px; }
.page > * + * { margin-top: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
@media (max-width: 560px) {
  .card { padding: 18px 16px; border-radius: 14px; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.section-sub { color: var(--text-2); font-size: 14px; margin: 2px 0 14px; }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.count.zero { background: var(--surface-3); color: var(--text-3); }
.eyebrow {
  margin: 0; font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-small { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* -------------------------------------------------------------- forms */

.field { display: block; margin: 0 0 12px; }
.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.4;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--bad-ink); font-size: 14px; margin: 8px 0 0; min-height: 1em; }
.form-msg { font-size: 13.5px; color: var(--text-2); }
.form-msg.error { color: var(--bad-ink); }

.seg { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg label {
  position: relative; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 10px 12px 10px 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.seg label .seg-title { font-weight: 600; font-size: 14.5px; }
.seg label .seg-sub { font-size: 12.5px; color: var(--text-2); }
.seg input { position: absolute; left: 13px; top: 13px; margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .seg { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- login */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 30px 28px; }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lede { color: var(--text-2); margin: 0 0 18px; font-size: 14.5px; }
.auth-card form { margin-top: 18px; }
.auth-card .fine { margin: 18px 0 0; font-size: 13px; color: var(--text-3); }

/* --------------------------------------------------------------- hero */

.hero { padding-top: 26px; }
.hero-top { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
@media (max-width: 600px) {
  .hero-top { grid-template-columns: 1fr; gap: 22px; justify-items: center; }
  .hero-top .products { width: 100%; }
}

.meter { position: relative; }
.ring {
  position: relative; display: block; width: 184px; height: 184px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--text);
}
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--accent); transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.ring-pct { font-size: 50px; font-weight: 680; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-pct small { font-size: 24px; font-weight: 600; letter-spacing: 0; margin-left: 1px; color: var(--text-2); }
.ring-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.ring-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 600px) { .ring { width: 172px; height: 172px; } .ring-pct { font-size: 46px; } }

.pop {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 270px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  display: none;
}
.pop.open { display: block; }
@media (hover: hover) { .meter:hover .pop { display: block; } }
.pop table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pop td { padding: 3px 0; }
.pop td:last-child { text-align: right; font-weight: 600; }
.pop tr.total td { border-top: 1px solid var(--line); padding-top: 7px; }
.pop p { margin: 8px 0 0; color: var(--text-3); font-size: 12.5px; }

.products { display: grid; gap: 18px; min-width: 0; }
.product-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.product-name { font-weight: 600; }
.product-pct { font-weight: 650; font-variant-numeric: tabular-nums; }
.product-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.product-hold { margin-top: 3px; font-size: 12.5px; color: var(--warn-ink); }
.product.on-hold .bar > span { background: var(--text-3); }
.product.on-hold .product-pct { color: var(--text-2); }

.bar { position: relative; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--accent);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar.thin { height: 6px; }

.status-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.status-headline { margin: 6px 0 4px; font-size: 18px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; }
.status-meta { margin: 0; color: var(--text-3); font-size: 13px; }

.stepper-wrap { margin-top: 22px; }
.stepper { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.step { position: relative; text-align: center; padding: 0 4px; min-width: 0; }
.step::before {
  content: ""; position: absolute; top: 12px; left: calc(-50% + 16px); right: calc(50% + 16px);
  height: 2px; background: var(--track); border-radius: 2px;
}
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--accent); }
.step-dot {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 2px solid var(--track); color: var(--text-3); font-variant-numeric: tabular-nums;
}
.step.done .step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.current .step-dot { border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-dot svg { width: 13px; height: 13px; }
.step-name { display: block; margin-top: 7px; font-size: 12.5px; line-height: 1.3; color: var(--text-2); font-weight: 550; }
.step.current .step-name { color: var(--text); font-weight: 650; }
.step-count { display: block; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 1px; }

@media (max-width: 720px) {
  .stepper { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .step { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; column-gap: 12px; text-align: left; padding: 6px 0; }
  .step::before { top: -50%; bottom: 50%; left: 12px; right: auto; width: 2px; height: auto; }
  .step-name { margin: 0; font-size: 14px; }
  .step-count { margin: 0; font-size: 12.5px; }
}

.toggle-row { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-details { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.hero-details h3 { font-size: 15px; margin: 22px 0 10px; }
.hero-details h3:first-child { margin-top: 0; }

.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.md table.breakdown th, .md table.breakdown td { padding: 8px 12px; }
.md table.breakdown th { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.breakdown td.r, .breakdown th.r { text-align: right; white-space: nowrap; }
@media (max-width: 560px) {
  .md table.breakdown th, .md table.breakdown td { padding: 7px 8px; font-size: 13px; }
  .md table.breakdown th { font-size: 11px; }
}
.breakdown tr.total td { font-weight: 650; border-bottom: 0; }
.breakdown .why { display: block; color: var(--text-3); font-size: 12.5px; }
.note { font-size: 13px; color: var(--text-3); margin: 10px 0 0; }

/* -------------------------------------------------- disclosure (details) */

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.chev {
  flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3);
}
.chev::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s; margin-left: -2px;
}
details[open] > summary .chev::before, [aria-expanded="true"] > .chev::before { transform: rotate(45deg); margin-left: 0; margin-top: -3px; }

.acc { border-top: 1px solid var(--line-2); }
.acc:first-of-type { border-top: 0; }
.acc > summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-radius: 8px; }
.acc > summary:hover .acc-title { color: var(--accent-strong); }
.acc-title { font-weight: 600; flex: 1 1 0; min-width: 0; }
.acc-title .faint { font-weight: 500; }
.acc-title.inline-h { font-size: 18px; font-weight: 650; }
.phase-desc { margin-bottom: 12px; color: var(--text-2); }
.acc-meta { display: flex; align-items: center; gap: 12px; flex: none; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.acc-meta .bar { width: 96px; }
.acc-body { padding: 0 0 16px 28px; }
@media (max-width: 560px) {
  .acc > summary { flex-wrap: wrap; row-gap: 6px; }
  .acc-meta.wide { flex: 1 1 100%; padding-left: 28px; }
  .acc-meta.wide .bar { flex: 1 1 auto; width: auto; }
  .acc-body { padding-left: 0; }
}

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; line-height: 1.6;
  background: var(--surface-3); color: var(--text-2);
}
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); vertical-align: 1px; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; justify-content: center; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1.6; border: 1px solid transparent;
  background: var(--surface-3); color: var(--text-2); flex: none;
}
.pill.s-todo { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.pill.s-in_progress { background: var(--surface); border-color: var(--accent); color: var(--accent-strong); }
.pill.s-waiting { background: var(--warn-soft); color: var(--warn-ink); }
.pill.s-blocked { background: var(--bad-soft); color: var(--bad-ink); }
.pill.s-done { background: var(--accent-soft); color: var(--accent-strong); }
.pill.s-dropped { background: var(--surface-3); color: var(--text-3); text-decoration: line-through; }
.pill.d-missing { background: var(--surface); border-color: var(--line); border-style: dashed; color: var(--text-3); }
.pill.d-have_needs_fix { background: var(--warn-soft); color: var(--warn-ink); }
.pill.d-template_ready { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.pill.d-requested { background: var(--surface-3); color: var(--text-2); }
.pill.d-received { background: var(--surface); border-color: var(--accent); color: var(--accent-strong); }
.pill.d-uploaded { background: var(--accent-soft); color: var(--accent-strong); }
.pill.d-accepted { background: var(--accent); color: var(--accent-ink); }

/* -------------------------------------------------------------- tasks */

.task-list { list-style: none; margin: 0; padding: 0; }
.task-list > li + li { border-top: 1px solid var(--line-2); }
.task > summary { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-radius: 8px; }
.task > summary .chev { margin-top: 2px; }
.task > summary:hover .task-title { color: var(--accent-strong); }
.task-main { flex: 1 1 auto; min-width: 0; }
.task-title { font-weight: 550; }
.task.is-done .task-title, .task.is-dropped .task-title { color: var(--text-2); }
.task.is-dropped .task-title { text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.task-meta .overdue { color: var(--bad-ink); font-weight: 600; }
.task-pill { margin-top: 1px; flex: none; min-width: 84px; }
.task-body { padding: 2px 0 18px 28px; }
@media (max-width: 560px) {
  .task-body { padding-left: 0; }
  .task > summary { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; row-gap: 5px; }
  .task > summary .chev { grid-row: 1; grid-column: 1; }
  .task-main { grid-row: 1; grid-column: 2; }
  .task-pill { grid-row: 2; grid-column: 2; min-width: 0; }
}

/* minmax(0, 1fr): a wide table or long word scrolls inside its box instead of widening the page */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.detail > * { min-width: 0; }
.detail-summary { margin: 0; font-size: 15px; color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 16px; margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 650; }
.facts dd { margin: 1px 0 0; font-size: 14px; }
.sub-h { font-size: 13px; font-weight: 650; color: var(--text-2); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.source { margin: 0; font-size: 13.5px; color: var(--text-2); }
.links { margin: 0; padding-left: 18px; font-size: 14px; }
.links li + li { margin-top: 3px; }

.status-edit { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 8px; align-items: start; }
.status-edit textarea { min-height: 38px; height: 38px; }
@media (max-width: 560px) { .status-edit { grid-template-columns: 1fr; } }

.notes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.note-item { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.note-head { font-size: 12.5px; color: var(--text-3); margin-bottom: 3px; }
.note-head strong { color: var(--text-2); font-weight: 650; }
.note-body { white-space: pre-wrap; font-size: 14.5px; }
.add-note { display: grid; gap: 8px; }
.add-note textarea { min-height: 64px; }

.history > summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); font-weight: 600; padding: 4px 0; }
.history ol { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--text-2); }
.history li { padding: 4px 0; border-top: 1px dashed var(--line-2); }
.history li:first-child { border-top: 0; }

.loading { color: var(--text-3); font-size: 14px; padding: 6px 0; }

/* --------------------------------------------------- waiting on you */

.waiting-list { list-style: none; margin: 4px 0 0; padding: 0; }
.waiting-list > li { border-top: 1px solid var(--line-2); padding: 4px 0; }
.waiting-list > li:first-child { border-top: 0; }
.w-row { display: flex; align-items: flex-start; gap: 12px; }
.w-toggle {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: none; border: 0; padding: 10px 0; cursor: pointer; border-radius: 8px;
}
.w-toggle .chev { margin-top: 2px; }
.w-toggle:hover .task-title { color: var(--accent-strong); }
.w-summary { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.w-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.w-meta .task-meta { margin-top: 0; }
.more-row { margin: 6px 0 0 28px; }
.w-later { margin-top: 12px; border-top: 1px solid var(--line-2); }
.w-later .acc-body { padding-left: 0; }
@media (max-width: 560px) { .more-row { margin-left: 0; } }
.w-action { flex: none; padding-top: 8px; }
.w-done-form { margin: 0 0 12px 28px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 10px; }
.w-done-form label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.w-body { padding: 0 0 14px 28px; }
@media (max-width: 560px) {
  .w-row { flex-direction: column; gap: 0; }
  .w-action { padding: 0 0 10px 28px; }
  .w-done-form, .w-body { margin-left: 0; padding-left: 12px; }
  .w-body { padding-left: 0; }
}
.empty { margin: 6px 0 0; padding: 18px; text-align: center; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.w-sub { margin: 16px 0 4px; font-size: 13px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.w-fb { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-2); }
.w-fb:first-of-type { border-top: 0; }
.w-fb a { font-weight: 550; }
.w-fb .faint { font-size: 13px; }

/* ----------------------------------------------------------- documents */

.doc-group > summary { padding: 9px 0; }
.doc-group { border-top: 1px dashed var(--line-2); }
.slots { list-style: none; margin: 0; padding: 0 0 6px; }
.slot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.slot:first-child { border-top: 0; }
.slot-main { min-width: 0; }
.slot-name { font-size: 14.5px; }
.slot-meta { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.nowrap { white-space: nowrap; }
.slot-notes { font-size: 13px; color: var(--text-2); margin-top: 3px; white-space: pre-wrap; }
.raw-head .num { text-transform: none; letter-spacing: 0; }
.raw-head { margin: 14px 0 2px; font-size: 13px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; display: flex; justify-content: space-between; }
.status-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }

/* --------------------------------------------------------------- files */

.file-list { list-style: none; margin: 0; padding: 0 0 6px; }
.file-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.file-list li:first-child { border-top: 0; }
.file-main { min-width: 0; }
.file-title { font-weight: 550; }
.ext { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; margin-right: 4px; vertical-align: 1px; }
.file-meta { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.folder-head { margin: 10px 0 2px; font-size: 12.5px; color: var(--text-3); font-weight: 650; }
@media (max-width: 560px) { .file-list li { flex-direction: column; gap: 1px; } }

/* ------------------------------------------------------------- feedback */

.fb-form { margin-top: 6px; }
.fb-hint { margin: -4px 0 12px; font-size: 13px; color: var(--text-2); padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.fb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.threads-sub { margin: -4px 0 10px; font-size: 13px; color: var(--text-2); }
.threads-h { margin: 26px 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); scroll-margin-top: 16px; }
.thread.unread { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.thread.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: var(--surface); } }
.thread-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.thread-subject { font-weight: 650; }
.thread-meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.thread-body { white-space: pre-wrap; margin: 8px 0 0; font-size: 14.5px; }
.reply { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.reply-head { font-size: 12.5px; color: var(--text-3); margin-bottom: 3px; }
.reply-head strong { color: var(--accent-strong); }
.reply-body { white-space: pre-wrap; font-size: 14.5px; }
.thread-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.reply-form { margin-top: 10px; display: grid; gap: 8px; }
.reply-form p { margin: 0; }
.state { font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.state.unread { background: var(--accent); color: var(--accent-ink); }
.state.resolved { background: var(--accent-soft); color: var(--accent-strong); }
.more > summary { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--text-2); font-weight: 600; padding: 8px 0; }

/* ------------------------------------------------------------- activity */

.activity { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
.activity li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line-2); }
.activity li:first-child { border-top: 0; }
.activity time { flex: none; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 560px) { .activity li { flex-direction: column; gap: 0; } }

/* -------------------------------------------------------------- footer */

.foot { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 26px; }
.foot .linklike { font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); z-index: 50;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: var(--text); color: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad-ink); color: #fff; }

/* ------------------------------------------------------------ markdown */

.md { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .table-wrap { margin: 0 0 0.8em; }
.md h1 { font-size: 22px; margin: 1.2em 0 0.5em; }
.md h2 { font-size: 18px; margin: 1.3em 0 0.5em; }
.md h3 { font-size: 16px; margin: 1.2em 0 0.4em; }
.md h4, .md h5, .md h6 { font-size: 14.5px; margin: 1em 0 0.3em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: 0.2em; }
.md li > ul, .md li > ol { margin: 0.25em 0 0.2em; }
.md code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-3); padding: 0.05em 0.25em; border-radius: 5px; }
.md pre { background: var(--surface-3); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 13px; }
.md blockquote { margin-left: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md th, .md td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 650; }
.md tr:last-child td { border-bottom: 0; }
.md .al-center { text-align: center; }
.md .al-right { text-align: right; }
.md .bad-link { text-decoration: underline dotted; color: var(--text-2); }
.md a { word-break: break-word; }

/* ------------------------------------------------------------ file page */

.page-file .back { margin: 0 0 12px; font-size: 14px; }
.file-card { padding: 28px 30px; }
.file-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.file-head h1 { font-size: 24px; margin: 4px 0 6px; }
.file-head .meta { margin: 0; color: var(--text-3); font-size: 13px; }
.md-file { font-size: 15px; }
@media (max-width: 560px) { .file-card { padding: 20px 16px; } }

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