/* ---- fonts (self-hosted, SIL OFL 1.1; no third-party requests) ---- */
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url("font-archivo-black-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("font-space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("font-space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("font-space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("font-space-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("font-space-mono-700.woff2") format("woff2"); }

/* ---- theme tokens: light (default) and dark ([data-theme="dark"] on <html>, set by theme.js) ---- */
:root {
  color-scheme: light;
  /* AIRA One · neo-brutalist palette (sampled from the AIRA logo and team portraits) */
  --bg: #F2EADB; --card: #FBF6EC; --text: #1A1A1A; --muted: #5c564d; --line: #1A1A1A; --line-soft: #e3d8c3;
  --card-border: #1A1A1A; --hover-border: #1A1A1A; --input-bg: #FFFDF7; --focus: #DA7C75;
  --primary: #DA7C75; --primary-d: #c96a62; --link: #1A1A1A; --on-primary: #1A1A1A;
  --nav-active-bg: #DEC593; --nav-active-fg: #1A1A1A;
  --danger-bg: #f6d5cf; --danger: #9a2f12; --danger-border: #CC5A1E; --badge: #CC5A1E;
  --warn-bg: #DEC593; --warn-fg: #1A1A1A; --warn-border: #1A1A1A; --up: #b04a12; --ok: #3d6b2e;
  --notice-bg: #d5dbe2; --notice-border: #1A1A1A;
  --tag-bg: #efe6d4; --pending-bg: #DEC593; --approved-bg: #c8d5b0; --rejected-bg: #e9a59f; --withdrawn-bg: #c9ccd1;
  --role-bg: #909DAA; --role-fg: #1A1A1A; --avatar-bg: #DA7C75; --avatar-fg: #1A1A1A;
  --unreliable-fg: #8a8378; --unreliable-bg: #ece3d2;
  --band-base: #b9b2a5; --band-base-mid: #1A1A1A; --band-scen: #e9a59f; --band-scen-mid: #CC5A1E;
  --bar: #26285A; --bar-neg: #CC5A1E; --track: #e8dfcc; --zero: #1A1A1A; --bar-text: #1A1A1A;
  --spinner: #d8cdb8; --login-glow-1: #DEC593; --login-glow-2: #DA7C75;
  --overlay: rgba(26, 26, 26, .6); --shadow-pop: 8px 8px 0 #1A1A1A;
  --radius: 0; --shadow: 6px 6px 0 #1A1A1A;
  --ink: #1A1A1A; --paper: #F2EADB; --shadow-sm: 3px 3px 0 #1A1A1A; --shadow-md: 5px 5px 0 #1A1A1A;
  --accent-2: #DEC593; --accent-3: #909DAA; --accent-4: #B49C6E; --on-accent: #1A1A1A;
  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A1A1A; --card: #242220; --text: #F2EADB; --muted: #b3aa9b; --line: #F2EADB; --line-soft: #3a3631;
  --card-border: #F2EADB; --hover-border: #F2EADB; --input-bg: #1f1d1b; --focus: #DA7C75;
  --primary: #DA7C75; --primary-d: #e8928b; --link: #F2EADB; --on-primary: #1A1A1A;
  --nav-active-bg: #DEC593; --nav-active-fg: #1A1A1A;
  --danger-bg: #4a2018; --danger: #f2a58f; --danger-border: #CC5A1E; --badge: #CC5A1E;
  --warn-bg: #DEC593; --warn-fg: #1A1A1A; --warn-border: #F2EADB; --up: #f0a060; --ok: #a9c98f;
  --notice-bg: #2d3540; --notice-border: #F2EADB;
  --tag-bg: #34302b; --pending-bg: #6b5a2c; --approved-bg: #3d4f2e; --rejected-bg: #6e2f29; --withdrawn-bg: #3e434a;
  --role-bg: #909DAA; --role-fg: #1A1A1A; --avatar-bg: #DA7C75; --avatar-fg: #1A1A1A;
  --unreliable-fg: #7d766b; --unreliable-bg: #201e1c;
  --band-base: #5c564d; --band-base-mid: #F2EADB; --band-scen: #8a4a44; --band-scen-mid: #DA7C75;
  --bar: #909DAA; --bar-neg: #CC5A1E; --track: #34302b; --zero: #F2EADB; --bar-text: #F2EADB;
  --spinner: #3a3631; --login-glow-1: #2a2620; --login-glow-2: #2a2620;
  --overlay: rgba(0, 0, 0, .7); --shadow-pop: 8px 8px 0 #F2EADB;
  --shadow: 6px 6px 0 #F2EADB;
  --ink: #F2EADB; --paper: #1A1A1A; --shadow-sm: 3px 3px 0 #F2EADB; --shadow-md: 5px 5px 0 #F2EADB;
  --accent-2: #DEC593; --accent-3: #909DAA; --accent-4: #B49C6E; --on-accent: #1A1A1A;
  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
a { color: var(--link); }
:where(input:not([type=range]):not([type=checkbox]):not([type=radio]), select, textarea) {   /* :where = no specificity */
  color: var(--text); background-color: var(--input-bg); border: 1px solid var(--line); border-radius: 6px;
}
input[type=range], input[type=checkbox] { accent-color: var(--primary); }
code { color: inherit; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.01em; }
.brand-lg { font-size: 1.25rem; margin-bottom: 1.5rem; }
.btn { border: 0; border-radius: 8px; padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); background: var(--tag-bg); }
.btn-primary { background: var(--primary); color: var(--on-primary); width: 100%; margin-top: 1.25rem; padding: .75rem; }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--hover-border); }
/* top bar tools: guided tour + theme toggle */
.tool-btn { width: 34px; height: 34px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.tool-btn:hover { color: var(--text); border-color: var(--hover-border); }
.tool-btn:focus-visible, .btn:focus-visible, .link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* login */
.page-login { background: radial-gradient(1200px 600px at 10% -10%, var(--login-glow-1) 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--login-glow-2) 0, transparent 55%), var(--bg); }
.login-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.25rem 2rem; border: 1px solid var(--line); }
.login-card h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.login-card p { margin: 0 0 1.25rem; }
.login-card label { display: block; font-size: .85rem; font-weight: 600; margin: .9rem 0 .35rem; }
.login-card input { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--input-bg); }
.login-card input:focus, .select:focus { outline: 2px solid var(--focus); border-color: var(--primary); }
.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.login-foot { margin-top: 1.25rem; font-size: .8rem; }
/* dashboard */
.page-dashboard { display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-right form { margin: 0; }
.select { padding: .45rem 2rem .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--input-bg); min-width: 12rem; }
.user { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-fg); display: grid; place-items: center; font-weight: 700; }
.dash { flex: 1; position: relative; padding: .75rem; min-height: 0; }
.dash-frame { height: calc(100vh - 54px - 1.5rem); min-height: 480px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.dash-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--card); }
.status { position: absolute; inset: .75rem; display: flex; gap: .75rem; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; }
.status.error { color: var(--danger); }
.status.hidden { display: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--spinner); border-top-color: var(--primary); animation: spin 1s linear infinite; }
.status.error .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { max-width: 520px; margin: 4rem auto; text-align: center; background: var(--card); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--line); }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: .5rem .75rem; }
  .topbar-center { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .select { flex: 1; min-width: 0; }
  .user-name { display: none; }
  .dash { padding: .4rem; }
  .dash-frame { height: calc(100vh - 100px); border-radius: 8px; }
}

/* ---- v2: navigation, what-if, proposals, admin ---- */
.nav { display: flex; gap: 4px; margin-left: 18px; }
.nav a { padding: 6px 10px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 14px; }
.nav a.active, .nav a:hover { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--badge); color: #fff; font-size: 11px; text-align: center; }
.role-tag { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--role-bg); color: var(--role-fg); font-size: 11px; }
.banner { position: sticky; top: 0; z-index: 5; padding: 8px 16px; background: var(--warn-bg); color: var(--warn-fg); border-bottom: 1px solid var(--warn-border); font-weight: 600; text-align: center; }
.page { padding: 16px 20px; max-width: 1500px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.whatif-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
/* grid items default to min-width:auto, so the outputs table pushed its card into the drivers column */
.whatif-grid > * { min-width: 0; }
@media (max-width: 1280px) {
  .whatif-grid { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.6fr); }
  .whatif-grid > .drivers { grid-column: 1 / -1; }
  .drivers #importance { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 24px; }
}
@media (max-width: 860px) { .whatif-grid { grid-template-columns: 1fr; } }
.sp { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.sp-head { display: flex; justify-content: space-between; }
.sp-row { display: flex; gap: 6px; align-items: center; }
.sp-range { flex: 1; }
.sp-num { width: 90px; }
.sp-scale { display: flex; justify-content: space-between; }
.sp.extrapolating .sp-num { border-color: var(--badge); background: var(--danger-bg); }
.sp-warn { color: var(--danger); font-size: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-align: left; }
.outputs, .list { width: 100%; border-collapse: collapse; font-size: 14px; }
.outputs th, .outputs td, .list th, .list td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--up); } .delta.down { color: var(--ok); }
tr.unreliable td { color: var(--unreliable-fg); background: var(--unreliable-bg); }
tr.unreliable svg.band { opacity: .35; }
.table-wrap { overflow-x: auto; }
.outputs th { white-space: nowrap; }
.outputs .range { display: block; }
.outputs th.band-col, .outputs td.band-col { width: 32%; }
svg.band { display: block; width: 100%; min-width: 72px; height: 24px; }
.band-base { fill: var(--band-base); } .band-base-mid { fill: var(--band-base-mid); }
.band-scen { fill: var(--band-scen); } .band-scen-mid { fill: var(--band-scen-mid); }
.drivers h3 { margin: 14px 0 6px; }
.drivers h4 { margin: 12px 0 4px; font-size: 14px; }
.hbars { display: grid; gap: 4px; font-size: 12px; color: var(--bar-text); margin-bottom: 6px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(48px, 1fr) max-content; gap: 8px; align-items: center; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; height: 10px; background: var(--track); border-radius: 2px; }
.hbar-track.signed::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--zero); }
.hbar-fill { position: absolute; top: 0; bottom: 0; background: var(--bar); border-radius: 2px; }
.hbar-fill.neg { background: var(--bar-neg); }
.hbar-value { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
/* narrow drivers column (3-column layout): long sensitivity values go next to the label, bar below */
@media (min-width: 1281px) {
  .hbars.stacked { gap: 7px; }
  .hbars.stacked .hbar { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "label value" "track track"; row-gap: 3px; }
  .hbars.stacked .hbar-label { grid-area: label; }
  .hbars.stacked .hbar-value { grid-area: value; }
  .hbars.stacked .hbar-track { grid-area: track; height: 8px; }
}
/* recommendation card (left column, under the setpoints) */
.whatif-col { display: flex; flex-direction: column; min-width: 0; }
.recommend h3 { margin: 12px 0 6px; }
.rec-row { display: grid; gap: 6px; align-items: center; margin-bottom: 6px; }
.rec-goal { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.rec-limit { grid-template-columns: minmax(0, 1fr) auto 5.5rem auto auto; }
.recommend select, .recommend input[type=number] { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); min-width: 0; }
.rec-target { width: 100%; }
.rec-unit { white-space: nowrap; }
.btn-x { padding: 2px 8px; line-height: 1.2; }
.btn-small { padding: 2px 8px; font-size: 12px; }
.rec-options { margin: 12px 0 0; }
.rec-options summary { cursor: pointer; color: var(--link); }
.rec-options label { display: grid; gap: 2px; margin: 8px 0; }
.rec-fixed { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.rec-fixed label { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
#rec-result { margin-top: 10px; }
.rec-status { margin: 4px 0 8px; font-weight: 600; font-size: 14px; }
.rec-status.ok { color: var(--ok); } .rec-status.warn { color: var(--up); }
.rec-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.rec-table th, .rec-table td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.rec-table th:not(:first-child), .rec-table td.num { text-align: right; }
.rec-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rec-table tr.fixed td { color: var(--unreliable-fg); }
.rec-table tr.better td:last-child { color: var(--ok); }
.rec-table tr.violated td { color: var(--danger); }
.rec-tradeoffs tr.current-rec td { font-weight: 600; }
.rec-apply { margin-top: 0; }
.rec-notes { padding-left: 18px; margin: 10px 0 0; }
.rec-notes li { margin-bottom: 4px; }
.proposal-form { display: grid; gap: 6px; margin-top: 12px; }
.proposal-form textarea { width: 100%; font: inherit; }
.status-tag { padding: 1px 6px; border-radius: 4px; font-size: 12px; background: var(--tag-bg); }
.status-pending { background: var(--pending-bg); } .status-approved { background: var(--approved-bg); } .status-rejected { background: var(--rejected-bg); } .status-withdrawn { background: var(--withdrawn-bg); }
form.review, form.inline { display: flex; gap: 4px; margin: 2px 0; }
.notice { padding: 8px 12px; background: var(--notice-bg); border: 1px solid var(--notice-border); border-radius: 6px; margin-bottom: 12px; }
.hidden { display: none !important; }

/* ---- guided tour (tour.js + vendored OnboardJS) ---- */
.tour { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.tour[hidden], .tour [hidden] { display: none; }
.tour-dim { position: fixed; inset: 0; background: var(--overlay); }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px var(--overlay); outline: 2px solid var(--primary); outline-offset: 0; transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease; }
.tour-pop { position: fixed; pointer-events: auto; width: min(360px, calc(100vw - 24px)); background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 16px 16px 12px; }
.tour-progress { height: 3px; margin: 0 28px 10px 0; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.tour-progress-bar { height: 100%; background: var(--primary); transition: width .2s ease; }
.tour-count { margin: 0 0 2px; }
.tour-title { font-size: 16px; margin: 0 0 6px; }
.tour-text { margin: 0 0 14px; font-size: 14px; line-height: 1.45; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tour-actions .btn { white-space: nowrap; }
.tour-actions .tour-next { margin-left: auto; }
.tour-actions .spacer { flex: 1; }
.tour-actions .btn { padding: 6px 12px; font-size: 14px; }
.tour-actions .btn-primary { width: auto; margin-top: 0; }
.tour-actions .btn:disabled { opacity: .45; cursor: default; }
.tour-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.tour-close:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-progress-bar { transition: none; } }

/* ---- admin: sub navigation + data sources (datasource_routes.py) ---- */
.subnav { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 6px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.subnav a.active, .subnav a:hover { color: var(--text); border-bottom-color: var(--primary); }
.btn-accent { background: var(--primary); color: var(--on-primary); }
.btn-accent:hover { background: var(--primary-d); }
.btn-accent:disabled, .btn-ghost:disabled, .btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.ds-form { display: grid; gap: 10px; max-width: 900px; }
.ds-form label { display: grid; gap: 3px; font-size: 14px; }
.ds-form label.check, .ds-form label.radio { display: flex; gap: 6px; align-items: center; }
.ds-form input:not([type=checkbox]):not([type=radio]):not([type=file]), .ds-form select, .ds-form textarea,
.danger-zone input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--text); min-width: 0; }
.ds-form input:focus, .ds-form select:focus, .ds-form textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.ds-form fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: grid; gap: 4px; }
.ds-form legend { font-size: 14px; padding: 0 4px; }
.ds-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.ds-row > label { flex: 1 1 160px; }
.ds-row > label.check { flex: 0 0 auto; padding-bottom: 6px; }
textarea.code, pre.log, .ds-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre.log { max-height: 320px; overflow: auto; background: var(--line-soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px; white-space: pre-wrap; word-break: break-word; margin: 4px 0 8px; }
pre.log-error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.form-error { padding: 8px 12px; background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: 6px; margin-bottom: 10px; white-space: pre-wrap; }
.warn-text { color: var(--up); font-weight: 600; }
.ds-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: start; }
.ds-head h2 { display: flex; gap: 8px; align-items: center; }
.ds-head p { margin: 4px 0; }
.ds-actions { display: grid; gap: 4px; justify-items: end; }
.ds-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ds-grid > * { min-width: 0; }
@media (max-width: 1100px) { .ds-grid { grid-template-columns: 1fr; } }
.card h3 { font-size: 14px; margin: 14px 0 6px; }
.run-details summary { cursor: pointer; color: var(--link); }
.run-details { min-width: 0; max-width: 46rem; }
.status-queued, .status-running { background: var(--pending-bg); }
.status-succeeded { background: var(--approved-bg); }
.status-failed { background: var(--rejected-bg); }
.nowrap { white-space: nowrap; }
.danger-zone { border-color: var(--danger-border); }
.danger-zone form { align-items: center; gap: 8px; }
.danger-zone input[name=confirm_name] { width: 22rem; max-width: 100%; }
.csv-preview { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.spinner-inline { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--spinner); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; }

/* =====================================================================
   AIRA One · neo-brutalist layer (overrides the base rules above).
   Thick ink borders, hard offset shadows, square corners, flat colour.
   Every colour goes through a token (see test_every_colour_token_has_a_dark_value).
   ===================================================================== */
body { font-family: inherit; }
h1, h2, .brand, .tour-title, .empty h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
a { text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--primary); }
code, .role-tag, .status-tag, .badge, .tour-count { font-family: var(--font-mono); }

/* brand */
.brand { gap: .55rem; text-transform: uppercase; font-size: 1.05rem; }
.brand img { border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }
.brand-lg { font-size: 1.6rem; }

/* top bar */
.topbar { background: var(--bg); border-bottom: 3px solid var(--ink); }
.nav { gap: 6px; }
.nav a { border: 2px solid transparent; border-radius: 0; font-weight: 700; padding: 5px 10px; }
.nav a.active, .nav a:hover { background: var(--nav-active-bg); color: var(--nav-active-fg); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.badge { border-radius: 0; border: 1.5px solid var(--ink); background: var(--badge); color: var(--on-accent); font-weight: 700; }
.role-tag { border-radius: 0; border: 1.5px solid var(--ink); text-transform: uppercase; font-weight: 700; letter-spacing: .5px; }
.avatar { border-radius: 0; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }

/* buttons */
.btn { border-radius: 0; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); font-weight: 700; transition: transform .1s ease, box-shadow .1s ease; }
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary, .btn-accent { background: var(--primary); color: var(--on-primary); text-transform: uppercase; letter-spacing: .5px; }
.btn-primary:hover, .btn-accent:hover { background: var(--primary); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--ink); }
.tool-btn { border-radius: 0; border: 2px solid var(--ink); color: var(--text); background: var(--card); box-shadow: var(--shadow-sm); }
.tool-btn:hover { background: var(--accent-2); color: var(--on-accent); border-color: var(--ink); }
.tool-btn:focus-visible, .btn:focus-visible, .link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* inputs */
:where(input:not([type=range]):not([type=checkbox]):not([type=radio]), select, textarea) { border: 2px solid var(--ink); border-radius: 0; }
.login-card input, .select, .recommend select, .recommend input[type=number],
.ds-form input:not([type=checkbox]):not([type=radio]):not([type=file]), .ds-form select, .ds-form textarea, .danger-zone input {
  border: 2px solid var(--ink); border-radius: 0;
}
.login-card input:focus, .select:focus, .ds-form input:focus, .ds-form select:focus, .ds-form textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--primary);
}
.ds-form fieldset { border: 2px solid var(--ink); border-radius: 0; }

/* surfaces */
.card, .login-card, .empty, .dash-frame, .tour-pop {
  border: 3px solid var(--card-border); border-radius: 0; box-shadow: var(--shadow);
}
.card { padding: 16px 18px; margin-bottom: 22px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card h3 { text-transform: uppercase; letter-spacing: .3px; }
.page { padding: 22px 24px; }
.dash { padding: 14px 18px 18px 14px; }
.dash-frame { height: calc(100vh - 60px - 2rem); }
.banner { border-bottom: 3px solid var(--ink); font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .3px; }
.alert, .notice, .form-error { border-radius: 0; border-width: 2px; border-color: var(--ink); }

/* tables */
.list th, .outputs th { background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; border-bottom: 0; }
.list td, .outputs td { border-bottom: 1.5px solid var(--line-soft); }
.rec-table th { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; border-bottom: 2px solid var(--ink); }
.status-tag { border-radius: 0; border: 1.5px solid var(--ink); text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .4px; }

/* sub navigation (admin) */
.subnav { border-bottom: 3px solid var(--ink); gap: 6px; }
.subnav a { border: 2px solid transparent; border-bottom: 0; margin-bottom: 0; font-weight: 700; color: var(--text); }
.subnav a.active, .subnav a:hover { background: var(--accent-2); color: var(--on-accent); border-color: var(--ink); }

/* what-if bars */
.hbar-track { border-radius: 0; border: 1px solid var(--ink); }
.hbar-fill { border-radius: 0; }
pre.log { border-radius: 0; border: 2px solid var(--ink); }

/* spinner: rotating square */
.spinner, .spinner-inline { border-radius: 0; border-color: var(--ink); border-top-color: var(--primary); }

/* guided tour */
.tour-spot { border-radius: 0; outline: 3px solid var(--primary); }
.tour-progress { border-radius: 0; border: 1.5px solid var(--ink); height: 8px; }
.tour-progress-bar { background: var(--primary); }

/* login: flat paper with the triangles of the AIRA logo */
.page-login { background: var(--bg); position: relative; overflow-x: hidden; }
.page-login::before, .page-login::after {
  content: ""; position: fixed; width: 0; height: 0; border-left: 90px solid transparent; border-right: 90px solid transparent;
  border-bottom: 156px solid var(--primary); filter: drop-shadow(6px 6px 0 var(--ink)); z-index: 0;
}
.page-login::before { left: 6vw; bottom: 8vh; transform: rotate(-8deg); }
.page-login::after { right: 7vw; top: 9vh; border-bottom-color: var(--accent-2); transform: rotate(12deg); }
.login-wrap { position: relative; z-index: 1; }
.login-card { max-width: 420px; padding: 2.25rem 2rem 2rem; }
.login-card h1 { font-size: 1.9rem; text-transform: uppercase; }
.login-card label { font-family: var(--font-mono); text-transform: uppercase; font-size: .75rem; letter-spacing: .6px; }
.login-foot { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .5px; }
@media (max-width: 720px) {
  .page-login::before, .page-login::after { display: none; }
  .dash-frame { height: calc(100vh - 110px); }
}
