[hidden] { display: none !important; }

/* ── Theme ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --text: #1f1f1f;
  --muted: #6e6e6e;
  --line: rgba(31, 31, 31, .09);
  --line-strong: rgba(31, 31, 31, .16);
  --accent: #c50e1f;
  --accent-soft: rgba(197, 14, 31, .08);
  --accent-text: #ffffff;
  --ok: #1f8a4c;
  --warn: #b25e09;
  --bad: #c50e1f;
  /* softer tones for bars and scenario stripes */
  --bar-done: #b9b9b9;
  --bar-ok: #7ccf9c;
  --stripe-best: #7ccf9c;
  --stripe-avg: #c4c4c4;
  --stripe-worst: #f2b77c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .14);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1f1f; --surface: #282828; --surface-2: #2f2f2f; --text: #f1f1f1; --muted: #a3a3a3;
    --line: rgba(241, 241, 241, .08); --line-strong: rgba(241, 241, 241, .16);
    --accent: #e0303f; --accent-soft: rgba(224, 48, 63, .14);
    --ok: #4cc27f; --warn: #e3a04f; --bad: #ff6b76;
    --bar-done: #d6d6d6; --bar-ok: #4cc27f; --stripe-best: #4cc27f; --stripe-avg: #d6d6d6; --stripe-worst: #e3a04f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f1f1f; --surface: #282828; --surface-2: #2f2f2f; --text: #f1f1f1; --muted: #a3a3a3;
  --line: rgba(241, 241, 241, .08); --line-strong: rgba(241, 241, 241, .16);
  --accent: #e0303f; --accent-soft: rgba(224, 48, 63, .14);
  --ok: #4cc27f; --warn: #e3a04f; --bad: #ff6b76;
  --bar-done: #d6d6d6; --bar-ok: #4cc27f; --stripe-best: #4cc27f; --stripe-avg: #d6d6d6; --stripe-worst: #e3a04f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { font-family: Inter, "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px;
  -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; transition: background .2s, color .2s; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
a { color: var(--accent); text-underline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hint, .muted { color: var(--muted); }
.hint { font-size: .87rem; margin: .2rem 0 0; }

/* ── Controls ──────────────────────────────────────────────────────────── */
button, input, select { font: inherit; color: inherit; }
input, select {
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .5rem .7rem; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled { opacity: .45; }
select { appearance: none; padding-right: 2.2rem; cursor: pointer; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"] { appearance: none; width: 18px; height: 18px; padding: 0; border-radius: 6px; border: 1.5px solid var(--line-strong);
  background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; vertical-align: -4px; flex: none; margin: 0; }
input[type="checkbox"]::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-text); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { opacity: 1; }
input.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px var(--accent-soft); }

.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; white-space: nowrap; transition: all .15s; }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: .3rem .7rem; font-size: .8rem; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; transition: all .15s; }
.icon-btn:hover { border-color: var(--line-strong); }
.remove-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: .35rem; border-radius: 8px; display: inline-grid; }
.remove-btn:hover { color: var(--bad); background: var(--accent-soft); }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button { border: none; background: none; padding: .3rem .75rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--muted); }
.segmented button.active { background: var(--text); color: var(--bg); }
.segmented.lg { padding: 4px; background: var(--surface-2); border-color: transparent; }
.segmented.lg button { padding: .55rem 1.1rem; font-size: .95rem; }

#themeBtn svg { display: none; }
#themeBtn[data-mode="light"] .i-sun, #themeBtn[data-mode="dark"] .i-moon, #themeBtn[data-mode="system"] .i-auto { display: block; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem clamp(1rem, 3vw, 2rem); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff;
  font-weight: 800; font-size: .9rem; letter-spacing: -.02em; flex: none; }
.brand h1 { font-size: 1.05rem; font-weight: 700; }
.tagline { margin: 0; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.toolbar { display: flex; align-items: center; gap: .5rem; }
.saved { color: var(--ok); font-size: .8rem; opacity: 0; transition: opacity .3s; margin-right: .3rem; }
.saved.show { opacity: 1; }
.menu { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; }
.popover button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: none; background: none;
  border-radius: 9px; cursor: pointer; text-align: left; }
.popover button:hover { background: var(--surface-2); }
.popover button:disabled { opacity: .45; cursor: default; background: none; }
.popover button.danger { color: var(--bad); }
.popover hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.layout { max-width: 1440px; margin: 0 auto; padding: clamp(1rem, 2.5vw, 1.75rem); display: grid; gap: 1.25rem; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.col-main { display: grid; gap: 1.25rem; min-width: 0; }
.col-main > * { min-width: 0; }
.col-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; border-radius: var(--radius); }
@media (max-width: 1100px) { .columns { grid-template-columns: 1fr; } .col-side { position: static; max-height: none; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1rem, 2vw, 1.4rem); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ── Setup / info ──────────────────────────────────────────────────────── */
.setup-fields { display: flex; gap: 1rem; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 220px; }
.field.grow { flex: 1 1 420px; }
.field.level { min-width: 0; flex: none; }
.field select { font-size: 1.02rem; font-weight: 550; padding: .7rem 2.4rem .7rem .9rem; }
.label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .28rem .7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); max-width: 100%; }
.chip.link { text-decoration: none; }
.chip.link:hover { border-color: var(--accent); color: var(--accent); }
.chip svg { width: 14px; height: 14px; }
details.rules { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
details.rules summary { cursor: pointer; font-weight: 600; font-size: .9rem; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1.2rem; line-height: 1; color: var(--muted); }
details.rules[open] summary::before { transform: rotate(90deg); }
.notes { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .5rem; }
.note { display: flex; gap: .6rem; font-size: .86rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.note::before { content: "i"; flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem;
  font-weight: 700; background: var(--line-strong); color: var(--text); margin-top: 1px; }
.ref { color: var(--muted); font-size: .78rem; white-space: nowrap; margin-left: .35rem; }

/* ── Modules table ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -.4rem; padding-bottom: .2rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
table.modules { width: 100%; border-collapse: separate; border-spacing: 0; }
table.modules th { text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 0 .4rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.modules td { padding: .4rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.modules tbody tr:last-child td { border-bottom: none; }
table.modules tbody tr { transition: background .12s; }
table.modules tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.modules input { background: transparent; }
table.modules input:hover { background: var(--surface-2); }
table.modules input.name { width: 100%; min-width: 170px; font-weight: 500; text-overflow: ellipsis; }
table.modules td.c-name { width: 42%; }
table.modules input.lp { width: 58px; text-align: right; }
table.modules input.grade { width: 72px; text-align: center; font-weight: 650; }
tr.planned input.grade { border: 1px dashed var(--line-strong); }
tr.waived td.c-name, tr.waived td.c-lp, tr.waived td.c-grade, tr.waived td.c-areas { opacity: .5; }
.name-cell { display: flex; align-items: center; gap: .3rem; }
.badge-icon { display: inline-grid; color: var(--muted); opacity: .7; }
.badge-icon svg { width: 15px; height: 15px; }
.badge { flex: none; font-size: .64rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: .05rem .35rem; }
.badge.planned { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.flags { display: flex; flex-direction: column; gap: .3rem; }
.flags label, .tags label { min-width: 0; display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.area-fixed { font-size: .8rem; color: var(--muted); display: inline-block; max-width: 300px; }
details.areas { position: relative; min-width: 170px; max-width: 260px; }
details.areas summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: .35rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); min-height: 36px; align-items: center; }
details.areas summary:hover { border-color: var(--line-strong); }
details.areas summary::-webkit-details-marker { display: none; }
details.areas[open] summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pill { font-size: .74rem; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; border: 1px solid var(--line); }
.pill.none { background: var(--surface-2); color: var(--muted); }
details.areas .dropdown { position: fixed; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; }
details.areas .dropdown label { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .55rem; border-radius: 8px; font-size: .85rem; cursor: pointer; }
details.areas .dropdown label:hover { background: var(--surface-2); }

.thesis { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: .9rem 1rem;
  border-radius: var(--radius-sm); background: var(--surface-2); flex-wrap: wrap; }
.thesis-label { font-weight: 600; margin-right: .5rem; }
.thesis input { width: 110px; background: var(--surface); text-align: center; font-weight: 650; }
.thesis .hint { display: block; margin-top: .15rem; }
.btn.add-row { width: 100%; justify-content: center; margin-top: .8rem; font-weight: 600; }
.locked { margin: .8rem 0 0; padding: 1.4rem 1rem; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--muted); }
.pdf-import { display: flex; align-items: center; gap: .4rem .9rem; flex-wrap: wrap; margin-top: 1rem; }
.pdf-import .hint { margin: 0; flex: 1 1 280px; }
.pdf-import .hint.error { color: var(--bad); }
.pdf-import .hint.done { color: var(--text); }

/* ── LP status ─────────────────────────────────────────────────────────── */
.status-list { display: grid; gap: 1rem; }
.status-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: center; }
.status-row .lbl { font-size: .88rem; font-weight: 550; min-width: 0; }
.status-row .lbl .sub { display: block; font-size: .76rem; font-weight: 400; color: var(--muted); }
.status-row .nums { font-size: .8rem; color: var(--muted); text-align: right; white-space: nowrap; display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.status-row .nums b { color: var(--text); font-weight: 650; }
.status-row .miss { color: var(--bad); font-weight: 650; }
.status-row .done-ok { color: var(--ok); font-weight: 700; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; box-shadow: inset 0 0 0 1px var(--line); }
.bar .d { background: var(--bar-done); transition: width .3s; }
.bar .p { background: repeating-linear-gradient(45deg, var(--muted) 0 4px, transparent 4px 7px); opacity: .75; transition: width .3s; }
.status-row.ok .bar .d { background: var(--bar-ok); }
.status-row.ok .bar .p { background: repeating-linear-gradient(45deg, var(--bar-ok) 0 4px, transparent 4px 7px); }

/* ── Results ───────────────────────────────────────────────────────────── */
.results { display: grid; gap: .8rem; transition: opacity .2s; }
.results.busy { opacity: .45; }
.card.scenario { box-shadow: none; padding: 1rem 1.1rem 1rem 1.25rem; background: var(--surface-2); position: relative; overflow: hidden; border-radius: 14px; }
.scenario::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); }
.scenario.best::before { background: var(--stripe-best); } .scenario.average::before { background: var(--stripe-avg); } .scenario.worst::before { background: var(--stripe-worst); }
.scenario.failed::before { background: var(--bad); }
.sc-head { display: flex; flex-direction: column; gap: .1rem; }
.sc-head h3 { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fill { font-size: .76rem; color: var(--muted); margin: 0; }
.sc-grade { display: flex; align-items: center; gap: .8rem; margin: .45rem 0 .1rem; }
.big { font-size: 2.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.sc-sub { display: flex; flex-direction: column; gap: .1rem; }
.judgement { font-weight: 600; font-size: .92rem; }
.exact { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.sc-open { font-size: .78rem; color: var(--muted); margin: .5rem 0 0; }
.sc-open b { color: var(--text); font-weight: 600; }
.sc-spec { font-size: .84rem; margin: .5rem 0 0; }
.sc-spec .tie { margin: .15rem 0 .45rem; font-size: .76rem; color: var(--muted); }
.spec-opts { display: flex; flex-wrap: wrap; gap: .35rem; }
.spec-opts button { font: inherit; font-size: .78rem; padding: .3rem .7rem; border-radius: 999px; cursor: pointer; text-align: left;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); transition: all .15s; }
.spec-opts button:hover { border-color: var(--text); }
.spec-opts button.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.sc-meta { font-size: .74rem; color: var(--muted); margin: .4rem 0 0; }
.scenario details { margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.scenario summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--muted); list-style: none; padding: .15rem 0; }
.scenario summary::-webkit-details-marker { display: none; }
.scenario summary::before { content: "+ "; }
.scenario details[open] summary::before { content: "– "; }
.scenario summary:hover { color: var(--text); }
.scenario ul { margin: .35rem 0 .2rem; padding-left: 1rem; font-size: .78rem; display: grid; gap: .2rem; }
.scenario .shortfalls { color: var(--bad); }
.error { color: var(--bad); font-size: .86rem; margin: .4rem 0 0; }
.warn-box { color: var(--warn); font-size: .78rem; margin: .5rem 0 0; }
.warnings { color: var(--warn); }
.results .hint { text-align: center; padding: 1.5rem 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { max-width: 1440px; margin: 0 auto; padding: 0 clamp(1rem, 2.5vw, 1.75rem) 2rem; color: var(--muted); font-size: .78rem; }

/* ── Small screens: module rows become cards ──────────────────────────── */
.layout > *, .columns > *, .setup-fields > * { min-width: 0; }
@media (max-width: 760px) {
  .tagline { display: none; }
  .topbar { padding: .6rem .9rem; }
  .field { min-width: 0; width: 100%; }
  .field select { width: 100%; font-size: .95rem; }
  .table-wrap { margin: 0; overflow: visible; }
  table.modules thead { display: none; }
  table.modules, table.modules tbody { display: block; width: 100%; }
  table.modules tr { position: relative; display: grid; grid-template-columns: auto auto 1fr; gap: .35rem .6rem; align-items: center;
    border: 1px solid var(--line); border-radius: 14px; padding: .6rem 2.4rem .7rem .6rem; margin-bottom: .6rem; }
  table.modules td { display: block; border: none !important; padding: 0; min-width: 0; }
  table.modules td.c-name { grid-column: 1 / -1; width: auto; }
  table.modules input.name { min-width: 0; }
  table.modules td.c-flags { grid-column: 3; }
  table.modules td.c-areas, table.modules td.tags { grid-column: 1 / -1; }
  table.modules td.c-del { position: absolute; top: .55rem; right: .45rem; }
  .flags { flex-direction: row; flex-wrap: wrap; gap: .3rem .8rem; }
  details.areas { max-width: none; min-width: 0; }
  .thesis input { width: 100%; }
  .thesis label { flex: 1 1 100%; }
}

/* ── Focus, notices, results details ───────────────────────────────────── */
:where(button, summary, a, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tr.planned input.grade:focus { border-style: solid; border-color: var(--accent); }
.toolbar { margin-left: auto; }
.card-head .btn { white-space: normal; text-align: left; }
.notice { font-size: .86rem; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }
.notice p { margin: 0; }
.notice ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .15rem; }
.notice.bad { color: var(--bad); }
.notice.bad li { color: var(--text); }
.scenario.muted-card { opacity: .8; }
.scenario.failed .btn { margin-top: .7rem; white-space: normal; }
.scenario .shortfalls b { font-weight: 600; }
.sc-split { font-size: .78rem; margin: .5rem 0 0; color: var(--text); }
.scenario .why { font-size: .76rem; color: var(--muted); margin: .3rem 0 0; }
.scenario s { color: var(--muted); }
.warnings { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; font-size: .78rem; }
.warnings .warn.strong { color: var(--bad); font-weight: 600; }
.status-row .miss { white-space: nowrap; }
.legend { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin: 0; }
.legend .key { display: inline-block; width: 18px; height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.legend .key.d { background: var(--bar-ok); }
.legend .key.p { background: repeating-linear-gradient(45deg, var(--bar-ok) 0 4px, transparent 4px 7px); margin-left: .6rem; }
@media (max-width: 760px) {
  #autoPlan { width: 100%; justify-content: center; }
  .status-row { grid-template-columns: 1fr; }
  .status-row .nums { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .segmented button, .remove-btn { min-height: 32px; }
  .flags label, .tags label { min-height: 28px; }
}
.scenario .start { font-size: .86rem; margin: .45rem 0 0; }
