/* Terminal look: near-black ground, off-white text, grey for secondary, one orange accent for losses and warnings. */
:root { --bg: #131313; --rule: #2b2b29; --text: #e6e4df; --bright: #ffffff; --dim: #8f8d87; --accent: #d97757; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
a { color: var(--text); } a:hover { color: var(--bright); }
h2 { margin: 0; font-size: 14px; font-weight: 400; color: var(--bright); }
h2 .p { color: var(--dim); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; }
.wrap > section, .wrap > .grid, .wrap > footer { border-top: 1px solid var(--rule); padding: 18px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dim { color: var(--dim); } .normal { font-weight: 400; }
.up { color: var(--text); } .down { color: var(--accent); } .info { color: var(--bright); font-weight: 700; } .warn { color: var(--accent); }
.b { color: var(--bright); font-weight: 700; }

.top { display: flex; flex-direction: column; gap: 6px; padding-bottom: 18px; }
.brand { color: var(--bright); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 0 24px; }
.chip .tag { color: var(--dim); } .chip.bad, .chip.bad .tag { color: var(--accent); }

.summary { display: flex; flex-direction: column; gap: 2px; }
.summary .row { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: baseline; }
.summary .key { color: var(--dim); min-width: 44px; }
.summary .total { font-weight: 700; min-width: 96px; }
.summary .total.up { color: var(--bright); }
.summary .sub { flex-basis: 100%; color: var(--dim); padding-left: 180px; }

.cmdline { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: center; justify-content: space-between; }
.ranges { display: flex; gap: 4px; }
.ranges button { font: inherit; color: var(--dim); background: transparent; border: 0; min-height: 44px; padding: 0 10px; cursor: pointer; }
.ranges button.on { color: var(--bg); background: var(--text); }
.ranges button:hover { color: var(--bright); } .ranges button.on:hover { color: var(--bg); }
.ranges button:focus-visible { outline: 1px solid var(--bright); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 0 24px; color: var(--dim); }
.legend .item { display: flex; align-items: center; gap: 8px; }
.legend .swatch { display: inline-block; width: 22px; border-top: 2px solid; }

.chart { display: flex; gap: 10px; }
.ylab { display: flex; flex-direction: column; justify-content: space-between; height: 260px; width: 48px; flex: none; text-align: right; font-size: 12px; color: var(--dim); line-height: 1; }
.plot { position: relative; flex: 1 1 auto; min-width: 0; }
.plot svg { display: block; width: 100%; height: 260px; }
#marks .mark { position: absolute; top: 4px; padding-left: 6px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.xlab { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); padding-top: 6px; }
#tapes { position: relative; }
.tape { display: flex; align-items: stretch; gap: 10px; }
.tape .side { width: 48px; flex: none; position: relative; color: var(--dim); }
.tape .side span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; white-space: nowrap; }
.tape .side .g { font-size: 11px; }
.tape .bars { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.tape .line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--rule); }
.tape .line.g { border-top: 1px dashed #3a3a37; }
.tape .slot { flex: 1 1 0; position: relative; min-width: 0; }
.tape .bar { position: absolute; left: 15%; width: 70%; background: #cfcdc8; }
.tape .bar.loss { background: var(--accent); }
.tape .slot.sel .bar { outline: 2px solid var(--bright); outline-offset: 1px; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--bg); border: 1px solid var(--dim); padding: 4px 8px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.tip[hidden] { display: none; }
.tip .strong { font-weight: 700; }

.grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 24px 40px !important; }
.grid > section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.split { display: flex; flex-wrap: wrap; gap: 16px 48px; align-items: flex-start; }
.split > .scroll { flex: 1 1 500px; min-width: 0; }
.split > .days { flex: 1 1 300px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th, td { padding: 2px 10px; text-align: right; font-weight: 400; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { color: var(--dim); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
tbody tr:first-child th, tbody tr:first-child td { padding-top: 8px; }
tbody th { color: var(--bright); }
table.left th, table.left td { text-align: left; }
table.left .num { text-align: right; }

.days { display: flex; flex-direction: column; }
.days .row { display: flex; flex-wrap: wrap; gap: 0 12px; }
.days .who { color: var(--dim); width: 112px; }
.blocks { letter-spacing: -1px; }

.kv { margin: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 2px 12px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; }
.kv.wide { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2px 40px; }
.kv.wide > div { display: flex; gap: 12px; } .kv.wide dt { width: 108px; flex: none; }

.prompt { color: var(--bright); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--text); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.login { max-width: 360px; margin: 14vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 16px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login label { color: var(--dim); }
.login input { font: inherit; font-size: 16px; color: var(--text); background: transparent; border: 1px solid var(--dim); padding: 0 12px; min-height: 48px; width: 100%; }
.login button { font: inherit; color: var(--bg); background: var(--bright); border: 0; min-height: 48px; cursor: pointer; }
.login input:focus-visible, .login button:focus-visible { outline: 1px solid var(--bright); outline-offset: 2px; }
@media (max-width: 520px) { .wrap { padding: 20px 16px 40px; } .ylab, .tape .side { width: 40px; } .summary .sub { padding-left: 0; } }
