/* Alphaplan KI-Assistent – design tokens derived from alphaplan.ch
   (brand red #CA1932, Roboto / Roboto Slab, white + warm greys) */
:root {
  --brand: #ca1932; --brand-600: #ad1429; --brand-50: #fcf0f2; --brand-100: #f7d9de; --on-brand: #fff;
  --bg: #f6f5f3; --surface: #fff; --surface-2: #faf9f7; --surface-3: #f1efec;
  --ink: #1c1c1e; --ink-2: #44444a; --muted: #6f6f77; --line: #e7e4e0; --line-2: #f0eeea;
  --ok: #1e7b4f; --ok-soft: #e7f4ed; --warn: #9a5800; --warn-soft: #fdf2df;
  --bad: #b42318; --bad-soft: #fdecea; --info: #42566e; --info-soft: #eef1f5;
  --shadow-sm: 0 1px 2px rgba(28, 28, 30, .05);
  --shadow: 0 1px 3px rgba(28, 28, 30, .06), 0 6px 16px -8px rgba(28, 28, 30, .10);
  --shadow-lg: 0 24px 60px -12px rgba(28, 28, 30, .28);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Roboto Slab", Georgia, serif;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #e5485f; --brand-600: #f0637a; --brand-50: #3a1a20; --brand-100: #52232c; --on-brand: #fff;
    --bg: #111113; --surface: #19191c; --surface-2: #1f1f23; --surface-3: #26262b;
    --ink: #ececef; --ink-2: #c4c4cb; --muted: #9a9aa3; --line: #2d2d33; --line-2: #24242a;
    --ok: #4cc488; --ok-soft: #15301f; --warn: #f2ae47; --warn-soft: #382a12;
    --bad: #ff7a6e; --bad-soft: #3b1a17; --info: #a9bdd6; --info-soft: #222a35;
    --shadow-sm: none; --shadow: 0 0 0 1px rgba(255,255,255,.02); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 15px; }
h3 { font-size: 15px; }
a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 13.5px/1 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 14px; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.lg { padding: 12px 22px; font-size: 14.5px; border-radius: 10px; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.icon { padding: 8px; }
.btn.danger:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
select, input[type=search], textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 12px; min-height: 38px; transition: border-color .15s, box-shadow .15s; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6f77' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 16px;
  background: var(--surface); border-right: 1px solid var(--line); }
.logo { display: block; padding: 0 10px; margin-bottom: 6px; }
.logo img { width: 148px; height: auto; display: block; }
.appname { padding: 0 10px; margin-bottom: 18px; font: 500 13px var(--font); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-50); padding: 2px 7px; border-radius: 99px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); font: 500 14px var(--font); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--brand-50); color: var(--brand); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-item .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; text-align: center; background: var(--surface-3); color: var(--ink-2); }
.nav-item.active .count { background: var(--brand); color: var(--on-brand); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status.bad .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.privacy svg.i { width: 14px; height: 14px; margin-top: 1px; }
.content { min-width: 0; padding: 32px 40px 64px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.lead { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card.pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-2); }
.card-title { margin-bottom: 12px; }

/* ---------- upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.step { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.step:first-child { margin-top: 0; }
.step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 600 12px var(--font); background: var(--ink); color: var(--surface); }
.modcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.modcard { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.modcard:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.modcard input { position: absolute; opacity: 0; }
.modcard:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.modicon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); transition: inherit; }
.modicon svg.i { width: 20px; height: 20px; }
.modtext { display: flex; flex-direction: column; gap: 2px; }
.modtext b { font-weight: 600; font-size: 14.5px; }
.modtext span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.modcard:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.modcard:has(input:checked) .modicon { background: var(--brand); color: var(--on-brand); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, var(--line)); border-radius: var(--r); background: var(--surface-2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop p { margin: 0; }
.drop .link { color: var(--brand); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.drop-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); margin-bottom: 8px; }
.drop-icon svg.i { width: 22px; height: 22px; }
.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.filelist:empty { display: none; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; }
.filelist li .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist li svg.i { color: var(--muted); width: 16px; height: 16px; }
.options { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; }
.profilebox { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.profilebox ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.profilebox li { display: flex; gap: 8px; align-items: baseline; }
.actions { display: flex; justify-content: flex-end; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.queue { position: sticky; top: 24px; }
.queue-list { display: flex; flex-direction: column; padding: 6px; max-height: calc(100vh - 140px); overflow: auto; }
.qitem { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 12px; border-radius: var(--r-sm); cursor: pointer; transition: background .15s; }
.qitem:hover { background: var(--surface-2); }
.qicon { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); }
.qicon svg.i { width: 17px; height: 17px; }
.qtitle { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qmeta { grid-column: 2; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qside { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.progress { grid-column: 2 / 4; height: 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.progress::after { content: ""; display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--brand); animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }

/* ---------- chips / badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1; padding: 5px 9px; border-radius: 99px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.run { background: var(--brand-50); color: var(--brand); }
.badge.run::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.chip svg.i { width: 14px; height: 14px; }

/* ---------- evaluation ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-top svg.i { width: 16px; height: 16px; }
.kpi .v { font: 600 28px/1 var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi.accent .v { color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-bottom: 20px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.spacer { flex: 1; }
.pills { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 10px; flex-wrap: wrap; }
.pill { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pill .n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill:hover { color: var(--ink); }
.pill.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.search { position: relative; display: flex; align-items: center; }
.search svg.i { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; width: 220px; }
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
#jobs tbody tr { cursor: pointer; transition: background .12s; }
#jobs tbody tr:hover { background: var(--surface-2); }
.tablewrap.flat .table th { background: none; padding: 8px 10px; }
.tablewrap.flat .table td { padding: 10px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.dim { opacity: .55; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg.i { width: 28px; height: 28px; color: color-mix(in srgb, var(--muted) 60%, transparent); }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; background: rgba(20, 20, 22, .42); backdrop-filter: blur(2px); animation: fade .18s ease-out; }
.drawer { width: min(1480px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-lg); animation: slide .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dtitle { font: 600 18px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.pane { overflow: auto; padding: 20px 24px 40px; }
.pane.source { background: var(--surface-2); border-right: 1px solid var(--line); padding-bottom: 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 9px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 500 13px var(--font); color: var(--muted); cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.srcbody iframe { display: block; width: 100%; height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.srcbody img { max-width: 100%; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 14px; display: block; background: #fff; }
.imgcap { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 14px 16px; font: 12px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-height: 70vh; overflow: auto; color: var(--ink-2); }

.reviewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.reviewbar .label { font-weight: 600; font-size: 13px; margin-right: 2px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button svg.i { width: 15px; height: 15px; }
.seg button:hover { color: var(--ink); }
.seg button.sel-korrekt { background: var(--ok); color: #fff; }
.seg button.sel-teilweise { background: var(--warn); color: #fff; }
.seg button.sel-falsch { background: var(--bad); color: #fff; }
.rerun { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.rerun select { min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.rerun .switch { font-size: 13px; }
.reviewbar textarea { flex-basis: 100%; min-height: 56px; resize: vertical; background: var(--surface-2); }

.callouts { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.callouts li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.45; }
.callouts li svg.i { width: 16px; height: 16px; margin-top: 1px; }
.callouts .fehler { background: var(--bad-soft); color: var(--bad); }
.callouts .pruefen { background: var(--warn-soft); color: var(--warn); }
.callouts .info { background: var(--info-soft); color: var(--info); }

.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; overflow-x: auto; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-head svg.i { width: 16px; height: 16px; color: var(--brand); }
.section-head h4 { font-size: 14px; }
.section ul.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.section ul.list li { position: relative; padding-left: 16px; }
.section ul.list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.section ul.checks li::before { width: 10px; height: 10px; top: .38em; left: 0; border-radius: 3px; background: none; border: 1.5px solid var(--muted); }
.mask { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
.mask dt, .mask dd { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.mask dt { color: var(--muted); font-size: 12.5px; padding-right: 12px; }
.mask dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.mask dd.empty-val { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.mask dt:last-of-type, .mask dd:last-of-type { border-bottom: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.score { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ring { --p: 0; --c: var(--brand); width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { font: 600 19px var(--font-head); }
.score-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.note { font-size: 12.5px; color: var(--muted); }
.summary-text { margin: 14px 0 0; line-height: 1.6; color: var(--ink-2); }
.disclosure { margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.disclosure summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary svg.i { width: 15px; height: 15px; color: var(--muted); }
.disclosure[open] summary { border-bottom: 1px solid var(--line-2); }
.disclosure pre { border: 0; border-radius: 0 0 var(--r) var(--r); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.stats span { display: inline-flex; gap: 5px; align-items: center; }
.stats svg.i { width: 13px; height: 13px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--surface); font-size: 13.5px; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; max-width: 380px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast svg.i { width: 17px; height: 17px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .upload-grid { grid-template-columns: 1fr; }
  .queue { position: static; }
  .modcards { grid-template-columns: 1fr; }
  .modcard { flex-direction: row; align-items: center; }
}
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; overflow: auto; }
  .pane { overflow: visible; }
  .pane.source { border-right: 0; border-bottom: 1px solid var(--line); }
  .srcbody iframe { height: 70vh; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { padding: 0; margin: 0; } .logo img { width: 104px; }
  .appname, .nav-label, #moduleNav, .privacy { display: none; }
  .nav { flex-direction: row; margin-left: auto; }
  .nav-item { padding: 8px 10px; } .nav-item.active::before { display: none; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; width: 100%; }
  .content { padding: 22px 16px 48px; }
  h1 { font-size: 22px; }
  .card.pad { padding: 18px; }
  .search input { width: 100%; } .search { flex: 1; }
  .mask { grid-template-columns: 110px minmax(0, 1fr); }
  .drawer-head, .pane { padding-left: 16px; padding-right: 16px; }
  .rerun { margin-left: 0; }
}

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--brand-50), transparent 70%), var(--bg); }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { display: flex; flex-direction: column; gap: 16px; padding: 36px 32px 28px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.login-logo img { width: 170px; height: auto; display: block; margin: 0 auto 6px; }
.login-card h1 { text-align: center; font-size: 22px; }
.login-card .lead { text-align: center; margin: -8px 0 6px; font-size: 13.5px; }
.login-card input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
.login-card .field { min-width: 0; }
.login-card .btn { justify-content: center; margin-top: 4px; }
.login-error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.login-note { justify-content: center; text-align: center; margin-top: 4px; }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--brand-50); color: var(--brand); font: 600 12px var(--font); }
.userbox .who { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .userbox .who { display: none; } }
