/* UMLA Factory — one hand washes the other.
   The site's language: flat vermilion, paper, ink, one yellow; Archivo, heavy and wide; hard borders, no shadows. */

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

:root {
  --red: #e9462b;
  --paper: #eae8e3;
  --paper-2: #f5f3ee;
  --ink: #0b0b0b;
  --yellow: #f2ee1c;
  --alert: #b42318;
  --muted: #5d5c57;
  --line: #0b0b0b;
  --soft: #c9c6bd;
  --pad: clamp(14px, 2vw, 28px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --side: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: "Archivo", "Arial Narrow", Arial, Helvetica, sans-serif;
  font-weight: 500;
  font-stretch: 100%;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--yellow); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; }
p { margin: 0 0 10px; }
code, pre, .mono { font-family: var(--mono); font-size: 0.88em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; box-shadow: 0 0 0 5px var(--ink); }
::selection { background: var(--yellow); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.upper { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── layout ──────────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  background: var(--ink);
  color: var(--paper);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: block; font-size: 30px; font-weight: 900; font-stretch: 125%; letter-spacing: -0.02em; text-transform: uppercase; text-decoration: none; padding: 0 8px 4px; line-height: 0.95; }
.brand small { display: block; font-size: 10px; font-stretch: 100%; letter-spacing: 0.18em; color: var(--yellow); margin-top: 6px; font-weight: 800; }
.brand:hover { background: none; }
.nav-group { margin: 18px 8px 4px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 800; color: #8d8b84; }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 8px; text-decoration: none;
  text-transform: uppercase; font-size: 12.5px; font-weight: 800; letter-spacing: 0.05em; border-left: 4px solid transparent; color: var(--paper);
}
.nav-item:hover { background: #1b1b1b; }
.nav-item.active { border-left-color: var(--red); background: #1b1b1b; color: var(--yellow); }
.nav-item .count { margin-left: auto; background: var(--yellow); color: var(--ink); font-size: 11px; padding: 1px 7px; font-weight: 900; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid #333; font-size: 12px; color: #a9a79f; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--yellow); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.main { min-width: 0; }
.page { padding: var(--pad); max-width: 1500px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(30px, 4.6vw, 62px); font-stretch: 112%; }
.page-head .sub { color: var(--muted); font-weight: 600; flex-basis: 100%; margin: 0; max-width: 80ch; }
.crumbs { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

.topbar { display: none; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; align-items: center; }
  .side .nav-group, .side-foot { display: none; }
  .brand { font-size: 22px; padding: 0 10px 0 0; }
  .brand small { display: none; }
  .nav-item { padding: 6px 8px; border-left: 0; border-bottom: 3px solid transparent; }
  .nav-item.active { border-bottom-color: var(--red); }
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.start { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ── surfaces ────────────────────────────────────────────────────────────────── */
.card { background: var(--paper-2); border: 2px solid var(--ink); padding: 16px; }
.card > h3, .card > .h { margin-bottom: 12px; font-size: 15px; letter-spacing: 0.02em; }
.card.flush { padding: 0; }
.card.red { background: var(--red); }
.card.yellow { background: var(--yellow); }
.card.ink { background: var(--ink); color: var(--paper); }
.band { border: 2px solid var(--ink); padding: 14px 16px; margin-bottom: 14px; background: var(--paper-2); }
.band.warn { background: var(--yellow); }
.band.fail { background: var(--alert); color: var(--paper); border-color: var(--alert); }
.band.info { background: var(--paper-2); }
.band h3 { font-size: 14px; margin-bottom: 6px; }
.band ul { margin: 6px 0 0; padding-left: 18px; }
.stat { border: 2px solid var(--ink); padding: 12px 14px; background: var(--paper-2); }
.stat .n { font-size: 34px; font-weight: 900; font-stretch: 115%; line-height: 1; }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: var(--muted); margin-top: 6px; }
.stat.red { background: var(--red); } .stat.red .l { color: var(--ink); }
.stat.yellow { background: var(--yellow); } .stat.yellow .l { color: var(--ink); }
.kv { display: grid; grid-template-columns: minmax(130px, 36%) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { border: 2px dashed var(--ink); padding: 28px; text-align: center; color: var(--muted); font-weight: 600; background: transparent; }
.empty b { display: block; font-size: 20px; color: var(--ink); text-transform: uppercase; margin-bottom: 6px; font-weight: 900; }

/* ── controls ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--paper-2); color: var(--ink); border: 2px solid var(--ink); padding: 8px 14px;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 12.5px; font-weight: 900; text-decoration: none; line-height: 1.1;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.btn:hover { background: var(--yellow); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--red); color: var(--ink); }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--ink); color: var(--paper); }
.btn.danger { background: var(--alert); color: var(--paper); border-color: var(--alert); }
.btn.danger:hover { background: var(--ink); border-color: var(--ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 11px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.link { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; letter-spacing: 0.03em; }
.btn.link:hover { background: var(--yellow); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .lab { font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }
.field .help { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .err { font-size: 12.5px; font-weight: 800; color: var(--alert); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--alert); background: #f6e4e0; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="email"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; background: var(--paper-2); border: 2px solid var(--ink); padding: 9px 10px; border-radius: 0; font-weight: 600; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 13px; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 2px solid var(--ink); background: var(--paper-2); cursor: pointer; font-weight: 600; }
.check:hover, .radio:hover { background: var(--yellow); }
.check input, .radio input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
.check.on, .radio.on { background: var(--ink); color: var(--paper); }
.check.on:hover, .radio.on:hover { background: var(--ink); }
.options { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.seg-ctl { display: inline-flex; border: 2px solid var(--ink); }
.seg-ctl button { background: var(--paper-2); border: 0; border-right: 2px solid var(--ink); padding: 6px 11px; font-weight: 900; font-size: 12px; cursor: pointer; text-transform: uppercase; }
.seg-ctl button:last-child { border-right: 0; }
.seg-ctl button.on { background: var(--ink); color: var(--paper); }
.seg-ctl button:hover:not(.on) { background: var(--yellow); }

/* ── tables, pills, tabs ─────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 2px solid var(--ink); background: var(--paper-2); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: var(--ink); color: var(--paper); text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--soft); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--yellow); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.09em; background: var(--paper-2); white-space: nowrap; line-height: 1.35; }
.pill.ink { background: var(--ink); color: var(--paper); }
.pill.red { background: var(--red); }
.pill.yellow { background: var(--yellow); }
.pill.alert { background: var(--alert); color: var(--paper); border-color: var(--alert); }
.pill.dim { border-color: var(--soft); color: var(--muted); }
.tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 3px solid var(--ink); margin-bottom: 18px; scrollbar-width: thin; }
.tab { padding: 10px 14px; text-decoration: none; text-transform: uppercase; font-weight: 900; font-size: 12.5px; letter-spacing: 0.06em; white-space: nowrap; border: 2px solid transparent; border-bottom: 0; position: relative; top: 3px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); background: var(--yellow); }
.tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tab .count { background: var(--red); color: var(--ink); padding: 0 6px; font-size: 11px; }
.tab.active .count { background: var(--yellow); }

/* ── login: the door ─────────────────────────────────────────────────────────── */
.door { min-height: 100vh; background: var(--red); display: grid; align-items: center; padding: var(--pad); }
.door-inner { max-width: 1100px; margin: 0 auto; width: 100%; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(20px, 5vw, 70px); align-items: end; }
.door h1 { font-size: clamp(64px, 13vw, 190px); font-stretch: 125%; line-height: 0.8; letter-spacing: -0.04em; }
.door .tag { font-weight: 900; text-transform: uppercase; letter-spacing: 0.16em; margin-top: 18px; font-size: 13px; }
.door .card { background: var(--paper); padding: 22px; }
.door .card h2 { font-size: 22px; margin-bottom: 14px; }
@media (max-width: 760px) { .door-inner { grid-template-columns: 1fr; } }

/* ── phases ──────────────────────────────────────────────────────────────────── */
.pipeline { display: flex; gap: 0; border: 2px solid var(--ink); background: var(--paper-2); overflow-x: auto; }
.seg { flex: 1 0 110px; padding: 10px 10px 12px; border-right: 2px solid var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-height: 76px; position: relative; }
.seg:last-child { border-right: 0; }
.seg .t { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; }
.seg .s { font-size: 10.5px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; margin-top: auto; }
.seg.passed { background: var(--ink); color: var(--paper); }
.seg.skipped { background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 6px, var(--soft) 6px, var(--soft) 12px); color: var(--muted); }
.seg.running { background: var(--yellow); }
.seg.awaiting_gate { background: var(--red); }
.seg.failed { background: var(--alert); color: var(--paper); }
.seg.dirty::after { content: "stale"; position: absolute; top: 4px; right: 4px; background: var(--red); color: var(--ink); font-size: 9px; padding: 0 4px; font-weight: 900; text-transform: uppercase; }
.seg.passed.dirty::after { background: var(--yellow); }
.seg:hover { outline: 3px solid var(--yellow); outline-offset: -3px; }
.phase { border: 2px solid var(--ink); background: var(--paper-2); margin-bottom: 14px; }
.phase > header { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.phase > header h3 { font-size: 20px; }
.phase.passed > header { background: var(--ink); color: var(--paper); }
.phase.running > header { background: var(--yellow); }
.phase.awaiting_gate > header { background: var(--red); }
.phase.failed > header { background: var(--alert); color: var(--paper); }
.phase .body { padding: 14px; display: grid; gap: 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.checks .mark { flex: none; width: 18px; height: 18px; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 900; line-height: 1; margin-top: 1px; }
.checks .mark.ok { background: var(--ink); color: var(--paper); }
.checks .mark.bad { background: var(--alert); color: var(--paper); border-color: var(--alert); }
.checks pre { margin: 4px 0 0; white-space: pre-wrap; background: var(--paper); border: 1px solid var(--soft); padding: 8px; max-height: 180px; overflow: auto; }
.progress { height: 14px; border: 2px solid var(--ink); background: var(--paper-2); }
.progress > i { display: block; height: 100%; background: var(--red); }

/* ── sessions ────────────────────────────────────────────────────────────────── */
.session { display: grid; grid-template-rows: auto 1fr auto; height: calc(100vh - 0px); }
.session-head { padding: 12px var(--pad); border-bottom: 3px solid var(--ink); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--paper-2); }
.session-head h1 { font-size: clamp(18px, 2.4vw, 28px); }
.stream { overflow-y: auto; padding: 18px var(--pad) 10px; background: var(--paper); }
.stream-inner { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.msg { border: 2px solid var(--ink); padding: 10px 14px; background: var(--paper-2); max-width: 100%; }
.msg.user { background: var(--ink); color: var(--paper); align-self: flex-end; max-width: 86%; }
.msg.user.factory { background: var(--red); color: var(--ink); }
.msg .who { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; margin-bottom: 4px; opacity: 0.8; }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; font-size: 1.05em; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md code { background: rgba(11, 11, 11, 0.09); padding: 1px 4px; }
.md pre { background: var(--ink); color: var(--paper); padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 8px 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--ink); padding: 4px 8px; }
.md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 4px solid var(--red); color: var(--muted); }
.msg.user .md code { background: rgba(234, 232, 227, 0.18); }
.think { border: 2px dashed var(--soft); padding: 6px 12px; color: var(--muted); font-size: 13px; background: transparent; }
.think summary { cursor: pointer; font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }
.tool { border: 2px solid var(--ink); background: var(--paper-2); font-size: 13px; }
.tool > summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 6px 10px; cursor: pointer; }
.tool > summary::-webkit-details-marker { display: none; }
.tool .nm { font-weight: 900; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; flex: none; background: var(--ink); color: var(--paper); padding: 1px 6px; }
.tool.err .nm { background: var(--alert); }
.tool .sm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.tool .st { flex: none; font-size: 10.5px; font-weight: 900; text-transform: uppercase; }
.tool pre { margin: 0; padding: 8px 10px; border-top: 1px solid var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; background: var(--paper); }
.sysline { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.sysline::before, .sysline::after { content: ""; height: 2px; background: var(--soft); flex: 1; }
.sysline.warn { color: var(--ink); } .sysline.warn span { background: var(--yellow); padding: 1px 8px; }
.sysline.bad span { background: var(--alert); color: var(--paper); padding: 1px 8px; }
.resultline { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 2px 2px 8px; }
.ask { border: 3px solid var(--ink); background: var(--yellow); padding: 14px 16px; }
.ask h3 { font-size: 16px; margin-bottom: 8px; }
.ask .opts { display: grid; gap: 6px; margin: 10px 0; }
.ask .opt { text-align: left; border: 2px solid var(--ink); background: var(--paper); padding: 8px 12px; cursor: pointer; font-weight: 700; }
.ask .opt:hover, .ask .opt.on { background: var(--ink); color: var(--paper); }
.ask .opt .d { display: block; font-weight: 500; font-size: 12.5px; opacity: 0.85; }
.ask.approval { background: var(--red); }
.composer { border-top: 3px solid var(--ink); background: var(--paper-2); padding: 10px var(--pad) 12px; }
.composer .inner { max-width: 980px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 54px; max-height: 200px; }
.live-text { border: 2px dashed var(--ink); padding: 10px 14px; background: var(--paper-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.live-text::after { content: "▍"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.jump { position: sticky; bottom: 8px; align-self: center; }

/* ── misc ────────────────────────────────────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 11, 11, 0.72); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--paper); border: 3px solid var(--ink); width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(980px, 100%); }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--red); border-bottom: 3px solid var(--ink); }
.modal > header h2 { font-size: 18px; }
.modal .mb-body { padding: 16px; }
.modal footer { padding: 12px 16px; border-top: 2px solid var(--ink); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: var(--paper-2); }
.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 28px)); }
.toast { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); padding: 10px 14px; font-weight: 700; }
.toast.err { background: var(--alert); border-color: var(--alert); }
.toast.ok { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 3px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; border-bottom: 2px solid var(--ink); }
.bars .bar { flex: 1; background: var(--ink); min-width: 3px; position: relative; }
.bars .bar.r { background: var(--red); }
.bars .bar:hover { background: var(--yellow); outline: 2px solid var(--ink); }
.bar-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 2px solid var(--ink); padding: 1px 8px; font-size: 12px; font-weight: 800; background: var(--paper-2); }
.tree { font-family: var(--mono); font-size: 13px; }
.tree .it { display: flex; gap: 8px; padding: 3px 6px; cursor: pointer; align-items: baseline; }
.tree .it:hover { background: var(--yellow); }
.tree .it .sz { margin-left: auto; color: var(--muted); font-size: 11.5px; }
pre.code { background: var(--ink); color: var(--paper); padding: 12px 14px; overflow: auto; max-height: 62vh; white-space: pre; font-size: 12.5px; margin: 0; }
.scrollbox { max-height: 360px; overflow: auto; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 7px 0 7px 14px; border-left: 3px solid var(--ink); position: relative; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 12px; width: 11px; height: 11px; background: var(--red); border: 2px solid var(--ink); }
.timeline time { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban .lane { background: var(--paper-2); border: 2px solid var(--ink); min-height: 120px; }
.kanban .lane h4 { padding: 8px 10px; background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: 0.1em; display: flex; justify-content: space-between; }
.kanban .lane .cards { padding: 8px; display: grid; gap: 8px; }
.kanban .kc { border: 2px solid var(--ink); background: var(--paper); padding: 8px 10px; cursor: pointer; }
.kanban .kc:hover { background: var(--yellow); }
.sev { display: inline-block; width: 78px; text-align: center; padding: 2px 0; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; border: 2px solid var(--ink); }
.sev.critical { background: var(--alert); color: var(--paper); border-color: var(--alert); }
.sev.high { background: var(--red); }
.sev.medium { background: var(--yellow); }
.sev.low, .sev.info { background: var(--paper-2); }
.tierbar { display: inline-flex; border: 2px solid var(--ink); }
.tierbar button { border: 0; border-right: 2px solid var(--ink); background: var(--paper-2); padding: 3px 8px; font-weight: 900; font-size: 11px; cursor: pointer; }
.tierbar button:last-child { border-right: 0; }
.tierbar button.on { background: var(--ink); color: var(--paper); }
.tierbar button:hover:not(.on) { background: var(--yellow); }
.wizard-steps { display: flex; gap: 0; border: 2px solid var(--ink); margin-bottom: 20px; overflow-x: auto; }
.wizard-steps div { flex: 1 0 auto; padding: 8px 14px; font-weight: 900; text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; border-right: 2px solid var(--ink); color: var(--muted); white-space: nowrap; }
.wizard-steps div:last-child { border-right: 0; }
.wizard-steps div.on { background: var(--ink); color: var(--paper); }
.wizard-steps div.done { background: var(--yellow); color: var(--ink); }
.tpl { text-align: left; border: 3px solid var(--ink); background: var(--paper-2); padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.tpl:hover { background: var(--yellow); }
.tpl h3 { font-size: 24px; font-stretch: 112%; }
.tpl .tg { font-weight: 600; flex: 1; }
.group-title { font-size: 13px; letter-spacing: 0.16em; padding: 6px 0; border-bottom: 3px solid var(--ink); margin: 22px 0 14px; }
.group-title:first-child { margin-top: 0; }
.file-pick { border: 2px dashed var(--ink); padding: 12px; background: var(--paper-2); }
.file-pick .files { display: grid; gap: 6px; margin-top: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); background: var(--paper); padding: 4px 8px; }
.file-row img { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--ink); }
.list-rows { display: grid; gap: 8px; }
.list-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) auto; gap: 8px; align-items: end; border: 2px solid var(--ink); padding: 8px 10px; background: var(--paper); }
.list-row .field { margin: 0; }

@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .page-head h1 { font-size: 30px; }
  .composer .inner { flex-direction: column; align-items: stretch; }
  .msg.user { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── diffs ───────────────────────────────────────────────────────────────────── */
pre.code.diff { white-space: pre; }
.diff span { display: block; }
.diff .add { background: rgba(60, 180, 75, 0.22); }
.diff .del { background: rgba(233, 70, 43, 0.28); }
.diff .hunk { color: var(--yellow); }
.diff .meta { color: #9a9890; }
