:root {
  --bg: #14110c;
  --bg-2: #1d1810;
  --ink: #f4ead4;
  --muted: #9a8d76;
  --line: #3a3226;
  --amber: #e8a317;
  --up: #8fbf6a;
  --down: #d45c4a;
  --ticket: #efe4c8;
  --ticket-ink: #2a2116;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

body {
  background:
    radial-gradient(1200px 500px at 10% -10%, #2a2218 0%, transparent 55%),
    radial-gradient(800px 400px at 110% 0%, #3a2a12 0%, transparent 50%),
    var(--bg);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 8;
}

.mast {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  gap: 1.5rem;
  align-items: end;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.mast::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--amber) 20%, #c45c2a 70%, transparent);
}

.kicker {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  font-style: italic;
}

.tote {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}

.tote div { min-width: 7rem; }
.tote dt {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.tote dd {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.session {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  padding: 0.55rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.lamp {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(154, 141, 118, 0.15);
}
.session.open .lamp {
  background: var(--up);
  box-shadow: 0 0 12px var(--up);
}
.session.closed .lamp {
  background: var(--down);
  box-shadow: 0 0 10px rgba(212, 92, 74, 0.4);
}

.queue {
  margin: 1.25rem 2rem 0;
  display: grid;
  gap: 0.75rem;
}
.ticket {
  background: var(--ticket);
  color: var(--ticket-ink);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  transform: rotate(-0.3deg);
}
.ticket h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
}
.ticket p { font-size: 0.78rem; margin-top: 0.25rem; }

.floor {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 0;
  min-height: calc(100vh - 8rem);
}

.blotter {
  padding: 1.5rem 2rem 3rem;
  border-right: 1px solid var(--line);
}

.tape {
  padding: 1.5rem 1.25rem 3rem 1.5rem;
  background: linear-gradient(180deg, rgba(29, 24, 16, 0.5), transparent 18%);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.section-head h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 1.6rem;
}
.section-head p {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.62rem;
  padding: 0.35rem 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 0.62rem 0.5rem;
  border-bottom: 1px solid rgba(58, 50, 38, 0.7);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
tr:hover td { background: rgba(232, 163, 23, 0.05); }

.st-OPEN, .st-OPEN_HALF { color: var(--amber); }
.st-CLOSED { color: var(--up); }
.st-SKIPPED { color: var(--muted); }

.has-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
}
.has-tip:hover::after,
.has-tip:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  width: max-content;
  max-width: 22rem;
  padding: 0.55rem 0.7rem;
  background: var(--ticket);
  color: var(--ticket-ink);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.35;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.up { color: var(--up); }
.down { color: var(--down); }

.watch {
  list-style: none;
  margin-bottom: 0.85rem;
}
.watch li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}
.watch li.off { color: var(--muted); }
.watch em { font-style: normal; color: var(--muted); font-size: 0.65rem; }
.watch button {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}
.watch button:hover { border-color: var(--amber); color: var(--amber); }
.watch-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
}
.watch-form input, .watch-form select, .watch-form button {
  font: inherit;
  font-size: 0.75rem;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.45rem;
}
.watch-form button {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
}
.watch-err { color: var(--down); font-size: 0.72rem; margin-top: 0.4rem; }

.signals {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: calc(100vh - 22rem);
  overflow: auto;
  padding-right: 0.4rem;
}
.signals li {
  border-left: 2px solid var(--amber);
  padding: 0.15rem 0 0.15rem 0.75rem;
}
.signals .meta {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sym, .signals a {
  color: var(--ink);
  text-decoration: none;
}
.sym:hover, .signals a:hover { color: var(--amber); }
.signals .body {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.35;
}
.chip {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--amber);
  padding: 0.05rem 0.3rem;
}

@media (max-width: 960px) {
  .mast, .floor { grid-template-columns: 1fr; }
  .blotter { border-right: 0; border-bottom: 1px solid var(--line); }
}
