/* Instrument-panel styling: cold paper, ink, and one signal colour.
   The dial array is the signature element -- everything else stays quiet. */

:root {
  --paper:   #d7dcdd;
  --panel:   #f7f9f8;
  --line:    #b9c2c3;
  --ink:     #12181a;
  --muted:   #5d6a6c;
  --signal:  #d4a017;
  --up:      #1f6b4a;
  --down:    #a33125;
  --ghost:   #c6cfd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 1;
}

.eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------- top bar */

.bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--panel);
  border-bottom: 3px solid var(--signal);
}
.bar .eyebrow { color: #8e9b9d; }

.bar-id .tick {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}

.bar-gauges { display: flex; gap: 26px; }
.gauge .val { font-size: 17px; font-weight: 600; }
.gauge .val.up   { color: #6fd39f; }
.gauge .val.down { color: #f09a8e; }

.bar-act { margin-left: auto; }

button {
  font: inherit;
  font-weight: 600;
  padding: 7px 13px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--signal);
  color: var(--ink);
  cursor: pointer;
}
button:hover { background: #e8b62c; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- seats */

.seats {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.seat {
  padding: 7px 15px;
  background: var(--paper);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .04em;
}
.seat em { font-style: normal; opacity: .55; font-size: 10px; margin-left: 5px; }
.seat.on { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--signal); }

/* -------------------------------------------------------------- layout */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 20px;
  align-items: start;
}

.holding {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.holding-fig { background: var(--panel); padding: 11px 14px; }
.holding-fig strong { font-size: 19px; font-weight: 700; }

.empty, .quiet { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------ business */

.biz {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.biz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.biz h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.biz .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.pending { color: var(--signal); font-weight: 700; }
.biz-net { text-align: right; }
.biz-net strong { font-size: 19px; }
.biz-net.up strong   { color: var(--up); }
.biz-net.down strong { color: var(--down); }

/* Signature element: the dial array. */
.dials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 5px 20px;
  margin: 15px 0 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dial { display: grid; grid-template-columns: 96px 1fr 26px; align-items: center; gap: 8px; }
.dial-name { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.dial-track { position: relative; height: 7px; background: #e4e9e9; }
.dial-ghost, .dial-fill { position: absolute; inset: 0 auto 0 0; }
.dial-ghost { background: var(--ghost); }
.dial-fill  { background: var(--ink); }
.dial-fill.gained { background: var(--up); }
.dial-fill.lost   { background: var(--down); }
.dial-num { font-size: 11px; font-weight: 700; text-align: right; }

.pnl { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 13px; }
.pnl th { text-align: left; font-weight: 400; color: var(--muted); padding: 3px 10px 3px 0; width: 15%; }
.pnl td { padding: 3px 20px 3px 0; font-weight: 600; }
.pnl .neg  { color: var(--down); }
.pnl .warn { color: var(--signal); }

.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts.stacked { flex-direction: column; }
.acts form { display: flex; gap: 5px; }
.acts.stacked form { width: 100%; }

input, select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
input[type=number] { width: 92px; }
.acts.stacked input { flex: 1; width: auto; }

/* ----------------------------------------------------------- side rail */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 13px 15px;
  margin-bottom: 16px;
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.rank { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank td { padding: 4px 0; border-bottom: 1px solid #e4e9e9; }
.rank .pos { color: var(--muted); width: 20px; }
.rank .num { text-align: right; font-weight: 600; }
.rank .you { background: #fdf4dc; font-weight: 700; }
.rank .dead td { color: var(--muted); text-decoration: line-through; }

.acquire { display: flex; flex-direction: column; gap: 6px; }
.acquire select, .acquire input { width: 100%; }

.log { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.log li { padding: 5px 0; border-bottom: 1px solid #e4e9e9; color: var(--muted); }
.log .log-type {
  display: inline-block;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-right: 6px;
}
.log li.rejected { color: var(--down); }
.log li.done .log-type { color: var(--up); }

@media (max-width: 860px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .bar { flex-wrap: wrap; gap: 18px; }
  .holding { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
