/* Nameplate Forge — the Reliquary design, on the Deadknee Labs design system tokens. */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --dk-green-100: #dff7ea; --dk-green-200: #b9edd3; --dk-green-300: #7fe3ae; --dk-green-400: #4bdb92;
  --dk-green-500: #2fbf71; --dk-green-600: #1f9a58; --dk-green-700: #177a45; --dk-green-800: #123f28; --dk-green-900: #0c2419;
  --dk-bg-0: #060b09; --dk-bg-1: #0a120f; --dk-bg-2: #0f1a15; --dk-bg-3: #15231c; --dk-bg-4: #1c2e25;
  --dk-ink-0: #f2f8f4; --dk-ink-1: #c6d5cc; --dk-ink-2: #8ba397; --dk-ink-3: #5a6f64;
  --accent: var(--dk-green-400);
  --surface-page: var(--dk-bg-0); --surface-raised: var(--dk-bg-1); --surface-card: var(--dk-bg-2); --surface-overlay: var(--dk-bg-3);
  --text-heading: var(--dk-ink-0); --text-body: var(--dk-ink-1); --text-muted: var(--dk-ink-2); --text-faint: var(--dk-ink-3);
  --text-on-accent: #06110b;
  --line-1: rgba(223, 247, 234, .14); --line-2: rgba(223, 247, 234, .08); --line-accent: rgba(75, 219, 146, .45);
  --warning: #e0b34f; --danger: #e05d5d;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-brand: 'NP UnifrakturCook', serif;
  --font-numeral: 'NP Cinzel Bold', serif;
  --glow-accent: 0 0 24px rgba(75, 219, 146, .28);
  --shadow-overlay: 0 24px 64px rgba(0, 0, 0, .65);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 120ms; --dur-base: 200ms;
  --scanline: repeating-linear-gradient(0deg, rgba(223, 247, 234, .03) 0 1px, transparent 1px 3px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #050807; color: var(--text-body); font-family: var(--font-body); font-size: 15px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea::selection { background: rgba(75, 219, 146, .3); }
.mono { font-family: var(--font-mono); }

.app { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: var(--dk-bg-0); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; font: 12px var(--font-mono); letter-spacing: .14em; color: var(--text-muted); }
.glow { position: absolute; inset: 0; pointer-events: none; }
.scan { position: absolute; inset: 0; background: var(--scanline); pointer-events: none; }
.stage { position: absolute; }
.np-preview { position: absolute; inset: 0; }
.np-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.np-preview canvas.dragging { cursor: grabbing; }
.no-preview { position: absolute; inset: 0; display: grid; place-items: center; font: 12px var(--font-mono); color: var(--text-faint); }

/* ── design-system components ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; line-height: 1; border: 1px solid transparent; border-radius: 8px; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.btn.sm { padding: 7px 12px; font-size: 13px; } .btn.md { padding: 10px 18px; font-size: 15px; } .btn.lg { padding: 14px 24px; font-size: 17px; }
.btn.primary { background: var(--accent); color: var(--text-on-accent); } .btn.primary:hover:not(:disabled), .btn.primary.glow-on { box-shadow: var(--glow-accent); }
.btn.secondary { background: var(--surface-card); color: var(--text-heading); border-color: var(--line-1); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-overlay); border-color: var(--line-accent); }
.btn.ghost { color: var(--text-body); } .btn.ghost:hover:not(:disabled) { background: var(--surface-card); }
.btn:active:not(:disabled) { filter: brightness(.85); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.fill { width: 100%; } .btn.tall { min-height: 44px; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line-1); background: rgba(10, 18, 15, .85); color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.icon-btn.lg { width: 44px; height: 44px; }
.icon-btn:hover, .icon-btn.on { background: var(--surface-overlay); border-color: var(--line-accent); color: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 10px; border-radius: 999px; border: 1px solid; font: 12px/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.accent { color: var(--accent); border-color: var(--line-accent); background: rgba(75, 219, 146, .09); }
.badge.neutral { color: var(--text-muted); border-color: var(--line-1); background: var(--surface-card); }
.badge.warning { color: var(--warning); border-color: rgba(224, 179, 79, .4); background: rgba(224, 179, 79, .08); }
.badge.danger { color: var(--danger); border-color: rgba(224, 93, 93, .4); background: rgba(224, 93, 93, .08); }
.switch { display: inline-flex; align-items: center; gap: 10px; color: var(--text-body); user-select: none; text-align: left; }
.switch .track { width: 36px; height: 20px; flex: none; border-radius: 999px; background: var(--dk-bg-4); border: 1px solid var(--line-1); position: relative; transition: background var(--dur-base) var(--ease-out); }
.switch .track::after { content: ''; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--dk-ink-2); transition: left var(--dur-base) var(--ease-out); }
.switch.on .track { background: var(--accent); border-color: var(--accent); }
.switch.on .track::after { left: 17px; background: #06110b; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .eyebrow { font: 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.field input, .text-input { background: var(--surface-raised); color: var(--text-heading); border: 1px solid var(--line-1); border-radius: 8px; padding: 10px 12px; font: 15px var(--font-mono); }
.field input:focus, .text-input:focus { border-color: var(--line-accent); box-shadow: 0 0 0 3px rgba(75, 219, 146, .12); }

/* ── shared pieces ────────────────────────────────────────── */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; gap: 32px; padding: 0 28px; border-bottom: 1px solid var(--line-2); background: rgba(6, 11, 9, .9); z-index: 2; }
.brand { font: 26px var(--font-brand); color: var(--text-heading); width: 220px; white-space: nowrap; }
.nav { flex: 1; display: flex; justify-content: center; gap: 28px; font: 11px var(--font-mono); letter-spacing: .14em; }
.nav button { color: var(--text-muted); padding: 4px 0; border-bottom: 1px solid transparent; letter-spacing: inherit; }
.nav button:hover { color: var(--text-heading); }
.nav button.on { color: var(--accent); border-bottom-color: var(--accent); }
.topbar .side { width: 220px; display: flex; justify-content: flex-end; }
.jobbtn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-1); border-radius: 4px; font: 12px var(--font-mono); color: var(--text-heading); white-space: nowrap; }
.jobbtn b { font-weight: 700; }
.jobbtn.on { border-color: var(--line-accent); color: var(--accent); background: rgba(75, 219, 146, .08); }
.tag { font: 10px var(--font-mono); letter-spacing: .14em; color: var(--text-muted); }
.tag.faint { color: var(--text-faint); }
.numeral { font: 700 13px var(--font-numeral); color: var(--accent); margin-right: 6px; letter-spacing: 0; }
.numeral.big { font-size: 15px; margin-right: 0; }
.panel { padding: 14px; background: rgba(10, 18, 15, .85); border: 1px solid var(--line-1); display: flex; flex-direction: column; gap: 10px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.panel.right { padding: 16px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.seg { display: flex; gap: 3px; }
.seg button { flex: 1; text-align: center; padding: 6px 0; border-radius: 4px; font-size: 12px; font-weight: 600; color: var(--text-body); }
.seg button.on { background: var(--accent); color: var(--text-on-accent); }
.dims { font: 11px var(--font-mono); color: var(--text-faint); }
.step { display: flex; align-items: center; gap: 6px; }
.step > span:first-child { flex: 1; font-size: 12px; }
.step button { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-1); border-radius: 3px; color: var(--text-muted); font-size: 12px; }
.step button:hover { border-color: var(--line-accent); color: var(--text-heading); }
.step output { width: 52px; text-align: center; font: 12px var(--font-mono); color: var(--text-heading); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.choices button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 0; border-radius: 4px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--text-body); }
.choices button.on { border-color: var(--line-accent); background: rgba(75, 219, 146, .10); color: var(--accent); }
.choices button.soon { color: var(--text-faint); cursor: default; }
.choices small { font: 400 11px var(--font-mono); color: var(--text-faint); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 400 15px var(--font-mono); color: var(--text-body); white-space: nowrap; }
.stat b.big { font-size: 22px; color: var(--text-heading); }
.stat b.mid { font-size: 20px; color: var(--text-heading); }
.stat b.acc { color: var(--accent); }
.row { display: flex; gap: 20px; }
.note { font-size: 12px; line-height: 1.4; color: var(--text-faint); }
.note.warn { color: var(--warning); } .note.bad { color: var(--danger); }
.corner { position: absolute; right: 28px; bottom: 76px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.corner span { font: 11px var(--font-mono); color: var(--text-faint); }
.bug { position: absolute; right: 20px; bottom: 20px; z-index: 10; display: inline-flex; }
.bug-pop { position: absolute; right: 0; bottom: calc(100% + 8px); width: 300px; z-index: 30; background: var(--dk-bg-2); border: 1px solid var(--line-1); border-radius: 8px; box-shadow: var(--shadow-overlay); padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.bug-pop textarea { width: 100%; resize: none; background: var(--surface-raised); border: 1px solid var(--line-1); border-radius: 8px; padding: 10px 12px; color: var(--text-heading); font-size: 14px; line-height: 1.45; }
.bug-pop .head { display: flex; align-items: center; }
.bug-pop .head .tag { font-size: 11px; flex: 1; }
.x { width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-muted); font-size: 13px; }
.x:hover { color: var(--text-heading); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── forge ────────────────────────────────────────────────── */
.left-col { position: absolute; top: 96px; left: 28px; width: 236px; display: flex; flex-direction: column; gap: 10px; }
.readout { position: absolute; top: 96px; width: 220px; display: flex; flex-direction: column; gap: 10px; }
.readout .panel { gap: 14px; }
.inscription { position: absolute; bottom: 32px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.inscription .tag { letter-spacing: .3em; color: var(--text-faint); }
.band { width: 100%; position: relative; background: rgba(6, 11, 9, .88); border-top: 1px solid var(--line-accent); border-bottom: 1px solid var(--line-accent); padding: 4px 0; }
.band::before, .band::after { content: ''; position: absolute; top: 50%; width: 10px; height: 10px; transform: translateY(-50%) rotate(45deg); border: 1px solid var(--accent); background: var(--dk-bg-0); }
.band::before { left: -6px; } .band::after { right: -6px; }
.band.plain { padding: 2px 0; } .band.plain::before, .band.plain::after { display: none; }
.band input { width: 100%; background: transparent; border: none; text-align: center; color: var(--text-heading); font-size: 32px; padding: 10px 24px; }
.band.plain input { text-align: left; font-size: 26px; padding: 10px 16px; }
.fonts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fonts button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: var(--text-heading); }
.fonts button.on { border-color: var(--line-accent); background: rgba(75, 219, 146, .08); }

/* ── job file panel ───────────────────────────────────────── */
.job { position: absolute; top: 64px; right: 0; bottom: 0; width: 420px; z-index: 3; display: flex; flex-direction: column; background: rgba(6, 11, 9, .97); border-left: 1px solid var(--line-accent); }
.job-head { padding: 16px 20px 12px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line-2); }
.job-head > div { display: flex; align-items: center; gap: 10px; }
.job-head .tag { font-size: 11px; } .job-head .file { font: 13px var(--font-mono); color: var(--text-heading); flex: 1; }
.yaml { flex: 1; min-height: 0; overflow: auto; }
.yaml > div { display: flex; min-width: max-content; min-height: 100%; }
.yaml .nos { padding: 12px 10px 12px 16px; text-align: right; font: 12.5px/20px var(--font-mono); color: var(--text-faint); border-right: 1px solid var(--line-2); user-select: none; }
.yaml .code { position: relative; flex: 1; }
.yaml pre { margin: 0; padding: 12px 16px; font: 12.5px/20px var(--font-mono); white-space: pre; color: var(--text-faint); min-height: 100%; }
.yaml pre .k { color: var(--accent); } .yaml pre .str { color: var(--dk-green-100); } .yaml pre .num { color: var(--text-heading); } .yaml pre .word { color: var(--text-body); }
.yaml textarea { position: absolute; inset: 0; width: 100%; height: 100%; padding: 12px 16px; margin: 0; border: 0; resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: var(--accent); font: 12.5px/20px var(--font-mono); white-space: pre; }
.job-stat { padding: 10px 20px; border-top: 1px solid var(--line-2); font: 12px/1.5 var(--font-mono); color: var(--accent); }
.job-stat.bad { color: var(--danger); }
.job-foot { padding: 12px 20px 72px; display: flex; flex-direction: column; gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── batch ────────────────────────────────────────────────── */
.sidebar { position: absolute; top: 64px; left: 0; bottom: 0; background: rgba(6, 11, 9, .94); border-right: 1px solid var(--line-1); display: flex; flex-direction: column; }
.side-head { padding: 20px 24px 16px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line-2); }
.title-row { display: flex; align-items: baseline; gap: 10px; }
.title-row .tag { font-size: 11px; } .title-row .meta { margin-left: auto; font: 12px var(--font-mono); color: var(--text-body); }
.list { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 4px; border: 1px solid transparent; text-align: left; flex: none; }
.item:hover { background: rgba(75, 219, 146, .04); }
.item.on { border-color: var(--line-accent); background: rgba(75, 219, 146, .08); }
.item .idx { font: 11px var(--font-mono); color: var(--text-faint); }
.item .body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item .name { font-size: 16px; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font: 10px var(--font-mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { display: flex; align-items: center; gap: 8px; font: 12px var(--font-mono); color: var(--text-muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.warning { background: var(--warning); } .dot.danger { background: var(--danger); }
.add-row { padding: 14px 24px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font: 12px var(--font-mono); }
.kv span { color: var(--text-muted); } .kv b { font-weight: 400; color: var(--text-heading); text-align: right; }
.link { font-size: 12px; color: var(--accent); text-align: left; margin-top: 4px; } .link:hover { color: var(--dk-green-300); }
.selected { position: absolute; left: 476px; bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.selected .tag { letter-spacing: .3em; color: var(--text-faint); }
.overrides { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.overrides .tag { font-size: 11px; letter-spacing: 0; }
.chip { padding: 5px 10px; border-radius: 4px; border: 1px solid var(--line-1); font: 11px var(--font-mono); color: var(--text-muted); }
.chip.on { border-color: var(--line-accent); color: var(--accent); } .chip:hover { border-color: var(--line-accent); }

/* ── templates ────────────────────────────────────────────── */
.tpl-main { position: absolute; top: 64px; left: 0; bottom: 0; right: 472px; padding: 32px 28px; display: flex; flex-direction: column; gap: 24px; overflow: auto; }
.tpl-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tpl-head .title-row .tag { font-size: 11px; }
.pills { display: flex; gap: 4px; }
.pills button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-1); color: var(--text-body); font-size: 12px; }
.pills button.on { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); font-weight: 600; }
.tpl-head .grow { flex: 1; }
.tpl-head input { padding: 6px 10px; font-size: 13px; width: 170px; }
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tpl { border: 1px solid var(--line-1); background: var(--dk-bg-1); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.tpl.on { border-color: var(--accent); }
.tpl .art { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 70%, rgba(75, 219, 146, .1), transparent 70%); border-bottom: 1px solid var(--line-2); }
.tpl .plate { padding: 6px 14px; background: #56655d; border-radius: 2px; transform: perspective(300px) rotateX(10deg); max-width: 84%; overflow: hidden; font-size: 17px; white-space: nowrap; color: #e6f2eb; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.tpl .plate.rim { box-shadow: inset 0 0 0 2px #e6f2eb; }
.tpl .plate.engraved { color: #1c2621; text-shadow: 0 1px 0 rgba(230, 242, 235, .25); }
.tpl .foot { width: 78%; height: 10px; margin-top: -1px; background: var(--dk-bg-4); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.tpl .foot.none { width: 0; }
.tpl .info { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tpl .info > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tpl .info b { font-size: 15px; font-weight: 600; color: var(--text-heading); }
.tpl .info small { font: 10px var(--font-mono); color: var(--text-faint); }
.tpl .info span { font: 11px var(--font-mono); color: var(--text-muted); }
.tpl-side { position: absolute; top: 64px; right: 0; bottom: 0; width: 472px; border-left: 1px solid var(--line-1); background: var(--dk-bg-1); display: flex; flex-direction: column; }
.tpl-view { position: relative; height: 400px; flex: none; overflow: hidden; border-bottom: 1px solid var(--line-1); }
.tpl-view .tag { position: absolute; top: 16px; left: 20px; color: var(--text-faint); pointer-events: none; }
.tpl-detail { flex: 1; padding: 24px 24px 72px; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; }
.tpl-detail h2 { margin: 0; font-size: 21px; font-weight: 700; color: var(--text-heading); }
.tpl-detail h2 + span { font: 12px var(--font-mono); color: var(--text-muted); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.kv-grid .kv { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.grow { flex: 1; }

/* ── history ──────────────────────────────────────────────── */
.archive { padding: 20px 12px; overflow: auto; display: block; }
.archive .title-row { padding: 0 12px 12px; }
.day { padding: 14px 12px 6px; font: 10px var(--font-mono); letter-spacing: .2em; color: var(--text-faint); }
.item.run { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 12px; width: 100%; }
.item.run .idx { font-size: 12px; color: var(--text-muted); }
.run-card { position: absolute; left: 488px; right: 28px; bottom: 76px; padding: 20px 24px; background: rgba(10, 18, 15, .9); border: 1px solid var(--line-1); display: flex; flex-direction: column; gap: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.run-card .head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.run-card .head b { font-size: 19px; color: var(--text-heading); }
.run-card .head span { font: 12px var(--font-mono); color: var(--text-muted); }
.log { font: 12px/20px var(--font-mono); background: var(--dk-bg-0); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 14px; overflow: auto; }
.log div { white-space: pre; color: var(--dk-green-100); }
.log .cmd { color: var(--text-faint); } .log .dim { color: var(--text-muted); } .log .bad { color: var(--danger); white-space: pre-wrap; } .log .warn { color: var(--warning); white-space: pre-wrap; }
.run-card .log { max-height: 100px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 40px 24px; font-size: 14px; line-height: 1.6; color: var(--text-muted); }

/* ── dialogs ──────────────────────────────────────────────── */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); }
.dialog { position: absolute; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 580px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; background: var(--dk-bg-2); border: 1px solid var(--line-accent); box-shadow: var(--shadow-overlay); display: flex; flex-direction: column;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.dialog .head { padding: 24px 28px 0; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.dialog .head .tag { letter-spacing: .3em; color: var(--text-faint); }
.dialog .head b { font-size: 24px; color: var(--text-heading); letter-spacing: -.02em; overflow-wrap: anywhere; }
.dialog .body { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.dialog .actions { padding: 0 28px 24px; }
.dialog textarea { width: 100%; min-height: 180px; resize: vertical; background: var(--surface-raised); border: 1px solid var(--line-1); border-radius: 8px; padding: 10px 12px; color: var(--text-heading); font: 13px/1.5 var(--font-mono); }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.cells > div { background: var(--dk-bg-1); padding: 12px; }
.cells .tag { color: var(--text-faint); }
.cells b { display: block; font: 400 15px var(--font-mono); color: var(--text-heading); margin-top: 4px; white-space: nowrap; }
.cells b.acc { color: var(--accent); }
.block { display: flex; flex-direction: column; gap: 8px; }
.block > .tag { font-size: 12px; }
.devs { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line-1); border-radius: 8px; background: var(--dk-bg-1); }
.devs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 7px 0; border-radius: 5px; color: var(--text-body); }
.devs button b { font-size: 13px; font-weight: 600; } .devs button small { font: 10px var(--font-mono); }
.devs button.on { background: var(--accent); color: var(--text-on-accent); }
.dialog .log { min-height: 84px; max-height: 190px; }
.bar { height: 2px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); box-shadow: var(--glow-accent); transition: width 400ms var(--ease-out); }

/* ── mobile ───────────────────────────────────────────────── */
.m { display: flex; flex-direction: column; }
.m-head { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 18px; }
.m-head .brand { font-size: 22px; width: auto; }
.m-head .stack { display: flex; flex-direction: column; min-width: 0; }
.m-head .stack b { font-size: 17px; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .jobbtn { height: 44px; border-radius: 8px; gap: 6px; } .m .jobbtn b { color: var(--accent); }
.m-stage { position: relative; height: 250px; flex: none; overflow: hidden; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.m-stage.short { height: 190px; }
.m-stage .stage { inset: 0; }
.m-stage .cap { position: absolute; left: 14px; bottom: 10px; font: 11px var(--font-mono); color: var(--text-muted); pointer-events: none; }
.m .band { margin: 14px 16px 0; width: auto; padding: 0; flex: none; }
.m .band::before, .m .band::after { display: none; }
.m .band input { height: 52px; font-size: 22px; padding: 0 12px; }
.m-tabs { display: flex; gap: 4px; padding: 8px 16px 0; flex: none; }
.m-tabs button { flex: 1; height: 44px; font: 11px var(--font-mono); letter-spacing: .1em; color: var(--text-muted); border-bottom: 2px solid var(--line-2); }
.m-tabs button.on { color: var(--text-heading); border-bottom-color: var(--accent); }
.m-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.m-opt { min-height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 15px; font-weight: 600; color: var(--text-body); text-align: left; }
.m-opt.on { border-color: var(--line-accent); background: rgba(75, 219, 146, .08); color: var(--accent); }
.m-opt.solid { border-color: transparent; } .m-opt.solid.on { background: var(--accent); color: var(--text-on-accent); }
.m-opt.font { font-size: 18px; font-weight: 400; color: var(--text-heading); justify-content: flex-start; }
.m-opt.font i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-accent); } .m-opt.font.on i { background: var(--accent); }
.m-opt.soon { color: var(--text-faint); } .m-opt small { font: 400 11px var(--font-mono); color: var(--text-faint); }
.m .seg button { height: 44px; border-radius: 8px; font-size: 14px; }
.m .step { gap: 8px; min-height: 48px; flex: none; } .m .step > span:first-child { font-size: 14px; }
.m .step button { width: 44px; height: 44px; border-radius: 8px; font-size: 16px; } .m .step output { width: 64px; font-size: 14px; }
.m .dims { font-size: 12px; padding: 6px 2px; }
.m-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-1); background: var(--dk-bg-1); }
.m-foot .stack { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.m-foot .stack b { font-size: 14px; font-weight: 600; color: var(--text-heading); } .m-foot .stack span { font: 11px var(--font-mono); color: var(--text-muted); }
.m-foot .bug { position: relative; right: auto; bottom: auto; }
.m-nav { flex: none; height: 60px; display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line-2); background: var(--dk-bg-0); font: 10px var(--font-mono); letter-spacing: .12em; }
.m-nav button { color: var(--text-muted); letter-spacing: inherit; } .m-nav button.on { color: var(--accent); }
.m .side-head { padding: 12px 16px 4px; border: 0; }
.m .item { grid-template-columns: 24px minmax(0, 1fr) auto; min-height: 52px; padding: 6px 10px; }
.m .item .name { font-size: 15px; } .m .dot { width: 8px; height: 8px; }
.m .add-row { padding: 8px 12px; border: 0; }
.m .tpl-head { padding: 12px 18px; flex: none; gap: 12px; }
.m .pills button { padding: 8px 14px; font-size: 13px; }
.m .tpl-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px 12px; align-content: start; flex: 1; min-height: 0; overflow: auto; }
.m .tpl .art { height: 92px; background: none; } .m .tpl .plate { padding: 4px 8px; font-size: 12px; transform: none; max-width: 86%; }
.m .tpl .foot { width: 70%; height: 7px; } .m .tpl .foot.none { width: 0; } .m .tpl .info { padding: 10px; gap: 2px; } .m .tpl .info b { font-size: 14px; } .m .tpl .info span { font-size: 10px; }
.m .archive { flex: 1; min-height: 0; padding: 8px 12px 12px; }
.m .item.run { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px; }
.m .item.run .top { display: flex; justify-content: space-between; align-items: center; font: 12px var(--font-mono); color: var(--text-muted); }
.m .item.run .name { font-size: 17px; }
.sheet { position: absolute; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 92%; background: var(--dk-bg-1); border-top: 1px solid var(--line-accent); border-radius: 14px 14px 0 0; display: flex; flex-direction: column; }
.sheet::before { content: ''; width: 40px; height: 4px; border-radius: 2px; background: var(--dk-bg-4); margin: 8px auto 0; flex: none; }
.sheet.job-sheet { height: 76%; }
.sheet .job-head { padding: 8px 8px 8px 18px; } .sheet .x { width: 44px; height: 44px; }
.sheet .yaml .nos { padding: 10px 8px 10px 12px; font: 12px/19px var(--font-mono); }
.sheet .yaml pre, .sheet .yaml textarea { padding: 10px 12px; font: 12px/19px var(--font-mono); }
.sheet .job-stat { padding: 10px 16px; } .sheet .three { padding: 4px 16px 30px; }
.sheet.export { background: var(--dk-bg-2); padding: 0 18px 30px; gap: 16px; overflow: auto; }
.sheet.export .head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sheet.export .head .tag { letter-spacing: .3em; color: var(--text-faint); } .sheet.export .head b { font-size: 20px; color: var(--text-heading); overflow-wrap: anywhere; }
.sheet.export .cells > div { padding: 10px; } .sheet.export .cells b { font-size: 14px; margin-top: 2px; }
.sheet.export .devs button { min-height: 44px; }
.sheet.export .log { font: 11px/18px var(--font-mono); padding: 10px 12px; min-height: 58px; max-height: 130px; flex: none; }
.sheet.export .foot { display: flex; align-items: center; gap: 8px; }
