/* Lane F — dark, dense, terminal-adjacent. An instrument, not a landing page. */
:root {
  --bg: #05070a;
  --panel: #0b0f14;
  --line: #1b2530;
  --ink: #cfe3d0;
  --dim: #7f93a0;
  --green: #58d19c;
  --amber: #e0b155;
  --red: #e0655f;
  --mono: "DejaVu Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 14px; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h2, h3 { font-weight: 600; letter-spacing: 0.02em; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: 0.06em; }
.prompt { color: var(--green); }
.tagline { color: var(--dim); font-size: 12px; }
.spacer { flex: 1; }
.ghost { color: var(--dim); font-size: 12px; margin-left: auto; }

/* Single column so the VM spans the FULL width; the audit panel stacks below it
   instead of eating a right-hand column. Minimal padding = no dead margin. */
main { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 8px; align-items: start; }

.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.dot[data-state="booting"] { background: var(--amber); animation: pulse 1s infinite; }
.dot[data-state="ready"] { background: var(--green); }
.dot[data-state="error"] { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }
.meta { color: var(--dim); }

/* Fill the viewport: VM area is as tall as the window minus the top bar, the
   stage header and the serial controls, so the desktop is effectively full screen. */
.screen-wrap { position: relative; min-height: calc(100vh - 160px); background: #010305; }
#vm { width: 100%; height: calc(100vh - 160px); border: 0; display: block; background: #010305; }
#launch-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
/* The `hidden` attribute must win over the flex display above (an id selector
   otherwise beats the UA [hidden] rule), or the overlay covers the booted VM. */
#launch-overlay[hidden] { display: none; }
#launch { background: var(--green); color: #04120c; border: 0; padding: 12px 22px; font-family: var(--mono); font-weight: 700; font-size: 15px; border-radius: 4px; cursor: pointer; letter-spacing: 0.04em; }
#launch:hover { filter: brightness(1.08); }
.hint { color: var(--dim); max-width: 52ch; font-size: 12px; line-height: 1.5; }
.hint.warn { color: var(--amber); }
.err { color: var(--red); }

#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: #02040733; display: flex; align-items: center; }
#progress-bar { height: 3px; background: var(--green); width: 2%; transition: width 0.3s; position: absolute; top: 0; left: 0; }
#progress-text { padding-left: 12px; font-size: 12px; color: var(--dim); }

.stage-controls { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stage-controls input { flex: 1; min-width: 180px; background: #02040a; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; font-family: var(--mono); }
button { background: #12202a; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 7px 12px; font-family: var(--mono); cursor: pointer; font-size: 13px; }
button:hover:not(:disabled) { border-color: var(--green); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.danger { border-color: #4a2020; color: var(--red); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.panel h2 small { color: var(--dim); font-weight: 400; font-size: 11px; }
.audit { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.audit .muted { color: var(--dim); }
.audit-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #070b10; }
.audit-row .badge { grid-row: 1; font-size: 10px; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; align-self: start; }
.audit-row .a-label { grid-row: 1; font-weight: 600; }
.audit-row .a-detail { grid-column: 1 / -1; color: var(--dim); font-size: 12px; line-height: 1.45; }
.state-active .badge { background: #10361f; color: var(--green); }
.state-inactive .badge { background: #3a2c12; color: var(--amber); }
.state-unverifiable .badge { background: #3a1c1a; color: var(--red); }
.fine { color: var(--dim); font-size: 11px; line-height: 1.5; margin-top: 10px; }

footer { border-top: 1px solid var(--line); margin-top: 8px; padding: 18px 16px; }
footer .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 1000px; }
@media (max-width: 720px) { footer .cols { grid-template-columns: 1fr; } }
footer p { color: var(--dim); font-size: 12px; line-height: 1.55; max-width: 60ch; }
footer code { color: var(--ink); background: #0d1620; padding: 1px 4px; border-radius: 3px; }
.footer-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.modal-scrim { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; width: min(440px, 92vw); }
.modal input { width: 100%; margin: 10px 0 6px; background: #02040a; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 9px; font-family: var(--mono); }
.strength { font-size: 11px; color: var(--dim); min-height: 15px; }
.strength.strong { color: var(--green); } .strength.fair { color: var(--amber); } .strength.weak, .strength.short { color: var(--red); }
.modal-err { color: var(--red); font-size: 12px; min-height: 15px; margin: 6px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #10361f; color: var(--green); border: 1px solid #1d4a2e; padding: 10px 16px; border-radius: 5px; font-size: 13px; z-index: 60; max-width: 90vw; }
.toast.err { background: #3a1c1a; color: var(--red); border-color: #5a2a26; }
