/* Case review, in the Virtarix brand.
   Tokens follow virtarix.com (design-tokens.css): primary #020281, secondary #174EA6, logo blue #4169F4,
   logo indigo #35329A, success #007a68, warning #b45309, surfaces #f9fafe / #eff5ff, pill buttons, 8px cards.
   Type is Mona Sans (SIL OFL, bundled in fonts/), the open fallback the Virtarix site itself names. */

@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/mona-sans-latin-wght-normal.74c4838e4577.woff2") format("woff2-variations"), url("fonts/mona-sans-latin-wght-normal.74c4838e4577.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/mona-sans-latin-ext-wght-normal.b39e337b11f9.woff2") format("woff2-variations"), url("fonts/mona-sans-latin-ext-wght-normal.b39e337b11f9.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f9fafe;
  --bg-wash: #eff5ff;
  --panel: #ffffff;
  --ink: #2c2e31;
  --heading: #252525;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #d6dde8;
  --brand: #020281;
  --brand-2: #174EA6;
  --brand-bright: #4169F4;
  --brand-ink: #ffffff;
  --accent: #020281;
  --accent-soft: #eff5ff;
  --kicker-bg: #eaf1ff;
  --win: #007a68;
  --win-soft: #e6f4f1;
  --grow: #b45309;
  --grow-soft: #fdf3e6;
  --info: #174EA6;
  --info-soft: #eaf1ff;
  --gap: #35329A;
  --gap-soft: #eeedf9;
  --bad: #b42318;
  --chart: #020281;
  --chart-hi: #4169F4;
  --shadow: 0 2px 3px rgba(2, 2, 129, .02), 0 12px 28px -22px rgba(2, 2, 129, .20);
  --font: "Mona Sans", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #02040f; --bg-wash: #021343; --panel: #081023; --ink: #e6e9f2; --heading: #f2f4fa; --muted: #9ca8bd;
    --line: #1c2540; --line-strong: #27324f;
    --brand: #3a5be8; --brand-2: #8ea6ff; --brand-bright: #6f8cff; --brand-ink: #ffffff;
    --accent: #8ea6ff; --accent-soft: #101c45; --kicker-bg: #101c45;
    --win: #3fd0b3; --win-soft: #0b2a2a; --grow: #f0a65a; --grow-soft: #2e1f0c;
    --info: #8ea6ff; --info-soft: #0f1d40; --gap: #b3aef5; --gap-soft: #1d1a3d; --bad: #f2867a;
    --chart: #6f8cff; --chart-hi: #00e4c0;
    --shadow: 0 12px 28px -22px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); line-height: 1.55;
  background: var(--bg) linear-gradient(180deg, var(--bg-wash) 0, var(--bg) 28rem) no-repeat;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--brand-2); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand-bright); outline-offset: 2px;
}
.wrap { max-width: 66rem; margin: 0 auto; padding: 0 1rem; }

/* Header */
header.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: saturate(1.4) blur(6px); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-block: .65rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--brand); }
.brand:hover { color: var(--brand); }
.brand-mark { width: 30px; height: auto; display: block; }
.brand-word { font-size: 1.45rem; font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--brand); }
@media (prefers-color-scheme: dark) { .brand-word { color: #ffffff; } }
.brand-app { margin-left: .35rem; padding: .15rem .6rem; border-radius: var(--pill); background: var(--kicker-bg); color: var(--brand-2); font-size: .78rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
nav.main { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin-left: auto; align-items: center; }
nav.main a, nav.main button { color: var(--ink); text-decoration: none; font: inherit; font-size: .93rem; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
nav.main a:hover { color: var(--accent); }
nav.main form button { border: 1px solid var(--line-strong); border-radius: var(--pill); padding: .3rem .85rem; }
nav.main form button:hover { border-color: var(--accent); color: var(--accent); }

main { padding-block: 1.6rem 4rem; }
h1, h2, h3 { line-height: 1.22; text-wrap: balance; color: var(--heading); font-weight: 500; }
h1 { font-size: 2.1rem; letter-spacing: -.02em; margin: .2rem 0 .4rem; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; margin: 2.4rem 0 .6rem; }
h3 { font-size: 1.04rem; font-weight: 600; margin: 0 0 .35rem; }
p { margin: .4rem 0; max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 600; color: var(--brand-2); margin: 0; }
.flash { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.flash li { padding: .65rem .9rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--line); }
.flash li.error { background: var(--grow-soft); }

/* Surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.2rem; min-width: 0; box-shadow: var(--shadow); }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.stats { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); }
.stats.six { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat .n { font-size: .8rem; color: var(--muted); }

/* Opening of a review */
.lead { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--bg-wash) 0%, var(--panel) 72%); border: 1px solid var(--line-strong); border-radius: calc(var(--radius) + 6px); padding: 1.5rem 1.5rem 1.25rem; }
.lead::after { content: ""; position: absolute; inset: 0 0 auto auto; width: 18rem; height: 18rem; transform: translate(35%, -45%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand-bright) 16%, transparent), transparent 70%); pointer-events: none; }
.lead h2 { margin-top: .2rem; font-size: 1.7rem; letter-spacing: -.02em; background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: dark) { .lead h2 { background: none; color: #ffffff; } }
.lead p { font-size: 1.05rem; }
.lead .eyebrow { font-size: .72rem; }
.lead > * { position: relative; z-index: 1; }
.wins { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin-top: 1rem; }
.win { border-left: 3px solid var(--win); }
.win h3 { display: flex; gap: .45rem; align-items: flex-start; }
.win h3::before { content: ""; flex: 0 0 1.15rem; height: 1.15rem; margin-top: .05rem; border-radius: 50%; background: var(--win); -webkit-mask: url("img/check.99fdc0140f2c.svg") center / 85% no-repeat; mask: url("img/check.99fdc0140f2c.svg") center / 85% no-repeat; }
blockquote { margin: .5rem 0 0; padding: .55rem .8rem; background: var(--bg); border-left: 2px solid var(--line-strong); border-radius: 0 6px 6px 0; font-size: .92rem; white-space: pre-line; max-height: 14rem; overflow: auto; }

/* Tags and deltas */
.tag { display: inline-block; font-size: .74rem; font-weight: 500; padding: .1rem .55rem; border-radius: var(--pill); border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tag.draft { color: var(--grow); border-color: currentColor; background: var(--grow-soft); }
.tag.published { color: var(--win); border-color: currentColor; background: var(--win-soft); }
.tag.good { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, transparent); background: var(--win-soft); }
.tag.watch { color: var(--grow); border-color: color-mix(in srgb, var(--grow) 45%, transparent); background: var(--grow-soft); }
.delta { font-size: .78rem; font-weight: 500; margin-left: .25rem; white-space: nowrap; }
.delta.good { color: var(--win); }
.delta.watch { color: var(--grow); }
.delta.flat { color: var(--muted); }
.section-intro { color: var(--muted); max-width: 68ch; }

/* Findings */
.finding { border-left: 3px solid var(--line-strong); }
.finding.consistency { border-left-color: var(--info); }
.finding.quality { border-left-color: var(--grow); }
.finding.digest { border-left-color: var(--brand-bright); }
.finding.gap { border-left-color: var(--gap); }
.finding .count { font-size: 1.4rem; font-weight: 600; color: var(--muted); float: right; margin-left: .5rem; font-variant-numeric: tabular-nums; }
.suggest { margin-top: .6rem; padding: .55rem .75rem; border-radius: 6px; background: var(--accent-soft); font-size: .93rem; }
.try { margin-top: .5rem; padding: .55rem .75rem; border-radius: 6px; background: var(--win-soft); font-size: .93rem; white-space: pre-line; }
.examples { margin: .6rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.examples li { font-size: .9rem; }
.examples .ex-q { display: block; margin-top: .25rem; padding: .45rem .65rem; background: var(--bg); border-radius: 6px; white-space: pre-line; }
details { margin-top: .5rem; }
summary { cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 500; }
.responses { margin-top: .6rem; display: grid; gap: .45rem; }
.resp { background: var(--bg); border-radius: 6px; padding: .5rem .7rem; font-size: .92rem; white-space: pre-line; }
.resp .who { font-size: .78rem; color: var(--muted); display: block; white-space: normal; }

/* Forms and buttons */
form.inline { display: grid; gap: .4rem; margin-top: .5rem; }
label { font-size: .88rem; font-weight: 500; }
textarea, input[type=text], input[type=password], input[type=file], select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: .55rem .7rem; width: 100%; }
textarea:focus, input:focus, select:focus { border-color: var(--brand-bright); }
textarea { min-height: 4.5rem; resize: vertical; }
button, .btn { font: inherit; font-size: .93rem; font-weight: 500; border-radius: var(--pill); padding: .5rem 1.15rem; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; display: inline-block; transition: background-color .15s, border-color .15s, color .15s; }
button:hover, .btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { button:hover, .btn:hover { background: #2f4fd6; border-color: #2f4fd6; } }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
button.ghost:hover, .btn.ghost:hover { background: var(--accent-soft); color: var(--accent); }
button.warn { background: transparent; color: var(--bad); border-color: var(--bad); }
button.warn:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Goals */
.goal { display: grid; gap: .3rem; }
.goal .status { justify-self: start; }
.goal.done { opacity: .82; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--chart); }
.chart .bar.hi { fill: var(--chart-hi); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--chart); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; background: var(--chart); }
.sw.hi { background: var(--chart-hi); }
.meter { display: inline-block; width: 8rem; height: .55rem; background: var(--line); border-radius: var(--pill); vertical-align: middle; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); border-radius: var(--pill); }
.meter-val { margin-left: .5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.scores { display: grid; gap: .45rem; }
.scores div { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Tables and threads */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.thread { display: grid; gap: .6rem; }
.msg { border-radius: var(--radius); padding: .7rem .9rem; border: 1px solid var(--line); background: var(--panel); white-space: pre-line; max-width: 52rem; overflow-wrap: anywhere; }
.msg.staff { background: var(--accent-soft); border-color: color-mix(in srgb, var(--brand-bright) 25%, var(--line)); margin-left: clamp(0rem, 6vw, 4rem); }
.msg .meta { display: block; font-size: .78rem; color: var(--muted); white-space: normal; margin-bottom: .2rem; }
.toc { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .88rem; margin: .9rem 0 0; }
.toc a { text-decoration: none; padding: .2rem .7rem; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-weight: 500; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.manager-box { border: 1px dashed var(--grow); background: var(--grow-soft); box-shadow: none; }
.errorlist { color: var(--bad); margin: .3rem 0; padding-left: 1.1rem; font-size: .9rem; }

/* Sign-in page */
body.auth { background: radial-gradient(60rem 40rem at 85% -10%, rgba(65, 105, 244, .45), transparent 60%), linear-gradient(160deg, #021343 0%, #020281 70%, #174EA6 140%); min-height: 100vh; color: #ffffff; }
body.auth header.top { display: none; }
body.auth main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 2rem; }
.auth-brand { display: flex; align-items: center; gap: .55rem; color: #ffffff; text-decoration: none; margin-bottom: 1.4rem; }
.auth-brand img { width: 44px; height: auto; }
.auth-brand span { font-size: 2.1rem; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.login { width: min(100%, 24rem); background: #ffffff; color: #2c2e31; border: 0; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); padding: 1.5rem 1.5rem 1.3rem; }
.login h1 { font-size: 1.5rem; color: #252525; }
.login .muted { color: #64748b; }
.login input[type=text], .login input[type=password] { background: #ffffff; color: #2c2e31; border-color: #d6dde8; }
.login button { width: 100%; background: #020281; border-color: #020281; color: #ffffff; padding-block: .6rem; }
.login button:hover { background: #174EA6; border-color: #174EA6; }
.auth-foot { margin-top: 1.1rem; font-size: .82rem; color: rgba(255, 255, 255, .72); }
.auth .flash li { color: #2c2e31; }
.login .errorlist { color: #b42318; }
.login label { color: #2c2e31; }

@media (max-width: 40rem) {
  h1 { font-size: 1.7rem; }
  .lead { padding: 1.1rem; }
  .lead h2 { font-size: 1.4rem; }
  .brand-word { font-size: 1.3rem; }
}
@media print {
  header.top, form, .no-print, .toc { display: none !important; }
  body { background: #fff; }
  .card, .stat, .tw { box-shadow: none; }
}

section[id] { scroll-margin-top: 4.5rem; }
