:root {
  color-scheme: dark;
  --bg: #07151d;
  --panel: #0d202b;
  --panel-raised: #102833;
  --line: #203b47;
  --ink: #e6f0f2;
  --muted: #90a5ad;
  --teal: #45d6be;
  --yellow: #f3c969;
  --red: #ff777b;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button, select { color: inherit; }
.app { width: min(1440px, 100% - 48px); margin: 0 auto; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--teal); color: var(--teal); font-weight: 800; }
.brand strong, .brand small { display: block; letter-spacing: .08em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.top-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.online, .terminal-label > span:first-child { color: var(--teal); letter-spacing: .08em; font-size: 10px; }
.online i, .terminal-label i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 9px #45d6be80; }
select { padding: 7px 9px; border: 1px solid var(--line); background: var(--panel); }
.quiet-button { padding: 7px 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.intro { padding: 35px 0 25px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .13em; }
.intro .eyebrow span { color: var(--teal); }
h1 { margin: 10px 0 5px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.06em; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--line); background: var(--panel); }
.metrics article { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.metrics article:last-child { border: 0; }
.metrics article > span, .metrics small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .07em; }
.metrics strong { display: block; overflow: hidden; margin: 8px 0 4px; font-size: clamp(17px, 2vw, 23px); text-overflow: ellipsis; white-space: nowrap; }
.metrics small { letter-spacing: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 285px; border: 1px solid var(--line); background: var(--panel); }
.console-panel { min-width: 0; padding: 17px; border-right: 1px solid var(--line); }
.side-panel { padding: 17px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
h2 { margin: 5px 0 0; font-size: 15px; letter-spacing: -.02em; }
.system-state { color: var(--teal); font-size: 10px; }
.system-state.degraded { color: var(--yellow); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; }
th, td { padding: 10px 8px; border-bottom: 1px solid #1b333e; }
td { font-size: 10px; }
td:first-child { color: var(--teal); }
.status-pill { display: inline-block; padding: 3px 6px; border: 1px solid #32746a; color: var(--teal); font-size: 9px; }
.status-pill.hold { border-color: #7a6437; color: var(--yellow); }
.empty { padding: 20px 8px; color: var(--muted); font-size: 11px; }
.log-heading { display: flex; justify-content: space-between; margin: 18px 0 7px; }
.log-heading > span:last-child { color: var(--teal); font-size: 9px; }
.event-log { display: flex; min-height: 85px; max-height: 145px; flex-direction: column-reverse; overflow-y: auto; gap: 7px; padding: 11px; border: 1px solid var(--line); background: #091921; }
.event-line { color: var(--muted); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.event-line b { margin-right: 8px; color: var(--teal); font-weight: 400; }
.event-line.warning { color: var(--yellow); }
.event-line.error { color: var(--red); }
.incident-area { margin-top: 15px; }
.incident-list { display: grid; gap: 7px; margin-top: 8px; }
.incident { padding: 9px 10px; border-left: 2px solid var(--yellow); background: var(--panel-raised); font-size: 10px; line-height: 1.5; }
.incident strong { display: block; color: var(--yellow); }
.incident button { margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 9px; }
.shift-clock { padding: 12px; border: 1px solid var(--line); background: #091921; }
.shift-clock > span, .shift-clock small { display: block; color: var(--muted); font-size: 9px; }
.shift-clock strong { display: block; margin: 10px 0; color: var(--teal); font-size: 23px; font-weight: 500; }
.progress { height: 3px; margin-bottom: 8px; background: var(--line); }
.progress i { display: block; width: 0; height: 100%; background: var(--teal); transition: width .4s linear; }
.shortcut-title { margin: 20px 0 9px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.shortcuts { display: grid; gap: 5px; }
.shortcuts button { display: flex; justify-content: space-between; gap: 6px; padding: 9px 7px; border: 1px solid transparent; background: #0a1b24; cursor: pointer; text-align: left; }
.shortcuts button:hover { border-color: var(--line); }
kbd { color: var(--teal); font-size: 9px; }
.shortcuts button span { color: var(--muted); font-size: 9px; }
.hint { margin-top: 16px; color: var(--muted); font-size: 9px; line-height: 1.7; }
.terminal { margin-top: 15px; border: 1px solid var(--line); background: #091921; }
.terminal-label { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.terminal-label > span:last-child { letter-spacing: .08em; }
#command-form { display: flex; align-items: center; min-height: 55px; gap: 10px; padding: 0 12px; }
#command-form label { color: var(--ink); white-space: nowrap; font-size: 12px; }
#command-form label span { padding-left: 5px; color: var(--teal); }
#command-input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
#command-input::placeholder { color: #536b74; }
#command-form button { padding: 8px 12px; border: 1px solid #28796c; background: #103b3a; color: var(--teal); cursor: pointer; font-size: 10px; }
#command-form button span { margin-left: 5px; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 17px 0 24px; color: var(--muted); font-size: 9px; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 240px; }
  .app { width: min(100% - 28px, 720px); }
}
@media (max-width: 650px) {
  .app { width: calc(100% - 24px); }
  .topbar { align-items: flex-start; padding: 13px 0; }
  .top-meta { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .online { width: 100%; text-align: right; }
  .top-meta > label { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 1fr; }
  .console-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .side-panel { padding: 12px; }
  .side-panel > .panel-heading { margin-bottom: 10px; }
  .shortcuts { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
