/* Layout: a fixed top bar, then a centred 1120px column. The new-evaluation
   wizard is a 260px step rail beside one content card with a sticky action bar. */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --sunk: #EEF1F5;
  --ink: #121A24;
  --ink-2: #2B3644;
  --muted: #5E6A7A;
  --line: #DCE1E8;
  --line-strong: #C6CDD8;
  --accent: #2346C4;
  --accent-ink: #FFFFFF;
  --accent-weak: #E6EBFC;
  --crit: #B42318; --crit-weak: #FDECEA;
  --warn: #8A5A00; --warn-weak: #FFF3D9;
  --ok: #1F6B43; --ok-weak: #E3F2E9;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 32px -18px rgba(16,24,40,.25);
  --radius: 12px;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E131A; --surface: #151C26; --sunk: #1B2430; --ink: #E7EBF1; --ink-2: #C9D1DC; --muted: #96A3B4;
    --line: #283241; --line-strong: #34404F; --accent: #8EA6FF; --accent-ink: #0E131A; --accent-weak: #1F2846;
    --crit: #FF9086; --crit-weak: #3A1C1B; --warn: #F2C063; --warn-weak: #362A11; --ok: #7BD3A0; --ok-weak: #163024;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px -18px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.12; letter-spacing: -.01em; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; font-family: var(--font-body); font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1120px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--font-display); color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font: 700 13px var(--font-mono); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 7px; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--ink); background: var(--sunk); text-decoration: none; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who form { margin: 0; }

.page { max-width: 1120px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { font: 500 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px var(--font-body); padding: 10px 16px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .06s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { text-decoration: none; box-shadow: 0 6px 16px -8px var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { box-shadow: none; background: var(--sunk); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); box-shadow: none; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--crit-weak); box-shadow: none; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-weak); color: var(--ok); }
.pill.bad { background: var(--crit-weak); color: var(--crit); }
.pill.warn { background: var(--warn-weak); color: var(--warn); }
.pill.info { background: var(--accent-weak); color: var(--accent); }
.pill.idle { background: var(--sunk); color: var(--muted); }
.pill.live::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.tag { font: 500 11.5px var(--font-mono); padding: 3px 7px; border-radius: 5px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.code { background: var(--ok-weak); color: var(--ok); }
.tag.ai { background: var(--accent-weak); color: var(--accent); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font: 15px/1.45 var(--font-body); transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.input.invalid { border-color: var(--crit); box-shadow: 0 0 0 3px var(--crit-weak); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.err-text { color: var(--crit); font-size: 13px; }

/* Wizard */
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.wizard > * { min-width: 0; }
.rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.rail-progress { display: none; }
.step-link { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border-radius: 10px; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: default; }
.step-link .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--font-mono); border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); transition: all .2s; }
.step-link .t { font-weight: 600; font-size: 14px; color: var(--muted); }
.step-link .s { font-size: 12.5px; color: var(--muted); }
.step-link.done { cursor: pointer; }
.step-link.done:hover { background: var(--sunk); }
.step-link.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-link.done .t { color: var(--ink); }
.step-link.current { background: var(--surface); box-shadow: var(--shadow); }
.step-link.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); }
.step-link.current .t { color: var(--ink); }
.wiz-card { overflow: hidden; }
.wiz-step { display: none; padding: 28px; flex-direction: column; gap: 22px; animation: rise .25s ease; }
.wiz-step.active { display: flex; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wiz-step header { display: flex; flex-direction: column; gap: 6px; }
.wiz-step header p { color: var(--muted); max-width: 62ch; }
.wiz-actions { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.wiz-actions .count { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .wiz-step { animation: none; } .pill.live::before { animation: none; } }

/* Dropzone */
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--sunk); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-weak); }
.drop .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); color: var(--accent); }
.drop input[type=file] { display: none; }
.filecard { display: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; gap: 14px; align-items: flex-start; }
.filecard.show { display: flex; }
.filecard .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-weak); color: var(--accent); display: grid; place-items: center; flex: none; font: 700 11px var(--font-mono); }
.filecard .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.filecard .name { font-weight: 600; overflow-wrap: anywhere; }
.stats-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sample-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* List editor */
.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-items { display: flex; flex-direction: column; gap: 8px; counter-reset: li; }
.list-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; counter-increment: li; animation: rise .2s ease; }
.list-item::before { content: counter(li); font: 600 12px var(--font-mono); color: var(--muted); text-align: center; }
.list-item .input { padding: 9px 11px; }
.list-item textarea.input { min-height: 0; resize: none; overflow: hidden; display: block; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--crit-weak); color: var(--crit); }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.empty-hint { font-size: 13px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--line); border-radius: 9px; }

.list-item .prov, .list-item .flag { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted); margin: -3px 0 2px; overflow-wrap: anywhere; }
.list-item .prov q { color: var(--ink-2); }
.list-item .flag { color: var(--warn); }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.opt { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 4px; }

/* Drafting */
.draft-wait { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--sunk); font-size: 14px; }
.draft-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-weak); font-size: 14px; }
.draft-banner .tag { flex: none; margin-top: 1px; }
.suggest { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.sugg-items { display: flex; flex-direction: column; gap: 10px; }
.sugg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.sugg .st { font-weight: 500; overflow-wrap: anywhere; }
.sugg .hint { margin-top: 3px; }
.sugg .hint .tag { margin-right: 4px; }
.sugg q { color: var(--ink-2); }
@media (max-width: 560px) { .sugg { grid-template-columns: minmax(0, 1fr); } .sugg .row { justify-content: flex-start !important; } }

/* Chips input */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); min-height: 44px; cursor: text; }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); font-size: 13.5px; font-weight: 500; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.chips input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 15px var(--font-body); padding: 5px; }

details.more { border: 1px solid var(--line); border-radius: var(--radius); }
details.more summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font: 400 20px var(--font-mono); color: var(--muted); }
details.more[open] summary::after { content: "–"; }
details.more .inner { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 18px; }

/* Review summary */
.summary { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary section { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.summary section:last-child { border-bottom: 0; }
.summary .k { font-weight: 600; font-size: 14px; }
.summary .v { font-size: 14px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.summary .v ol { margin: 0; padding-left: 18px; }
.estimate { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-weak); color: var(--ink); font-size: 14px; }

/* Tables and lists */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font: 500 11px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--sunk); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Run page */
.tracker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 24px; }
.tracker .st { display: flex; flex-direction: column; gap: 8px; }
.tracker .bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tracker .st.done .bar { background: var(--accent); }
.tracker .st.now .bar { background: linear-gradient(90deg, var(--accent) 40%, var(--line) 40%); background-size: 250% 100%; animation: slide 1.6s linear infinite; }
@keyframes slide { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tracker .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tracker .st.done .lbl, .tracker .st.now .lbl { color: var(--ink); }
.progress { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.log { margin: 0; white-space: pre-wrap; font: 12.5px/1.65 var(--font-mono); background: var(--sunk); border-radius: 10px; padding: 14px; max-height: 300px; overflow: auto; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--accent-weak); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.checks { display: flex; flex-direction: column; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check.off .ct { color: var(--muted); }
.check .ct { font-weight: 600; }
.check .cmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.check details { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.check details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.check details .body { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; background: var(--sunk); border-radius: 8px; }
.group-title { padding: 12px 22px; font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--sunk); border-bottom: 1px solid var(--line); }

/* Switch */
.switch { position: relative; width: 40px; height: 24px; flex: none; margin-top: 1px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.sticky-bar { position: sticky; bottom: 16px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.sticky-bar .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; }
.notice.warn { background: var(--warn-weak); color: var(--warn); }
.notice.bad { background: var(--crit-weak); color: var(--crit); }
.notice.ok { background: var(--ok-weak); color: var(--ok); }
.notice.info { background: var(--accent-weak); color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kpi b { display: block; font: 700 24px var(--font-display); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }

.copybox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--sunk); font: 13px var(--font-mono); overflow-wrap: anywhere; }
.copybox code { flex: 1; min-width: 0; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(420px, 100%); }

@media (max-width: 880px) {
  .wizard { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rail { position: static; flex-direction: row; align-items: center; gap: 4px; max-width: 100%; }
  .step-link { grid-template-columns: 30px; padding: 2px; flex: none; }
  .step-link > span:last-child { display: none; }
  .step-link.current { background: transparent; box-shadow: none; }
  .rail-progress { display: block; flex: 1; min-width: 0; font-size: 13px; color: var(--muted); padding-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .summary section { grid-template-columns: minmax(0, 1fr) auto; }
  .summary .v { grid-column: 1 / -1; grid-row: 2; }
  .tracker .lbl { font-size: 11px; }
  .wiz-step { padding: 20px; }
  .topbar .inner { gap: 12px; }
  .nav a { padding: 6px 8px; }
  .who .org { display: none; }
}
