/* GSI: the black LED panel of an exchange quotation board, edge to edge.
   Amber dot-matrix figures, split-flap tickers. */
:root {
  --panel: #050505;
  --panel-row: #161616;
  --panel-rule: #1a1a1a;
  --hover: #14110a;
  --flap: #1d1d1f;
  --flap-ink: #f4f1e8;
  --amber: #ffb000;
  --up: #3cff7c;
  --down: #ff4330;
  --paper: #e9e6df;
  --label: #8d877a;
  --muted: #6f6a60;
  --dots: "Doto", "Courier New", monospace;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--panel);
  color: var(--paper);
  font-family: var(--cond);
  font-size: 17px;
  line-height: 1.4;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  padding-block: 20px 24px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Heading ---------- */
.head { padding: 0 16px 16px; border-bottom: 2px solid var(--panel-rule); }
.head h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0.5px;
  color: #fff;
  text-wrap: balance;
}
.head p { margin: 6px 0 0; max-width: 60ch; color: var(--label); font-size: 18px; }

/* ---------- Board ---------- */
.board { background: var(--panel); }

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--panel-rule);
  color: var(--label);
  font-weight: 600;
  font-size: 16px;
}
.status span:empty { display: none; }
.live { color: var(--up); display: inline-flex; align-items: center; gap: 8px; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); }

.crawl { overflow: hidden; background: #0b0b0b; border-bottom: 2px solid var(--panel-rule); }
.crawl div {
  display: inline-block;
  white-space: nowrap;
  padding: 8px 0;
  font-family: var(--dots);
  font-weight: 900;
  font-size: 20px;
  color: var(--amber);
  animation: crawl 60s linear infinite;
}
.crawl div:empty { padding: 0; }
.crawl span { margin-right: 40px; }
.crawl span span { margin: 0; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.scroll { overflow-x: auto; }

table { width: 100%; min-width: 1080px; border-collapse: collapse; font-variant-numeric: tabular-nums; }

th {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.6px;
  color: var(--label);
  text-align: right;
  padding: 12px 14px;
  border-bottom: 2px solid var(--panel-rule);
  white-space: nowrap;
}
th:first-child { text-align: left; }

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-row);
  font-family: var(--dots);
  font-weight: 900;
  font-size: 21px;
  color: var(--amber);
  text-align: right;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
sub { font-size: 0.68em; vertical-align: -0.25em; }

tbody tr[data-ca] { cursor: pointer; }
tbody tr[data-ca]:hover td,
tbody tr[data-ca]:focus-within td { background: var(--hover); }

td.tk { text-align: left; font-family: var(--cond); font-weight: 600; font-size: 17px; color: #cfc9bc; }
.tk-in { display: flex; align-items: center; gap: 12px; }
.rk { width: 26px; color: var(--muted); font-size: 15px; flex-shrink: 0; }

.tk-in img, .tk-in .ph {
  width: 30px; height: 30px; border-radius: 3px; object-fit: cover; background: var(--flap); flex-shrink: 0;
}
.tk-in .ph { display: grid; place-items: center; color: var(--label); font-weight: 700; }

.tk-in a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.tk-in a:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 2px; }

.flaps { display: inline-flex; gap: 2px; }
.flaps b {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 30px;
  background: var(--flap);
  color: var(--flap-ink);
  border-radius: 3px;
  font: 700 21px/1 var(--cond);
  text-transform: uppercase;
}
.flaps b::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }

.name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.u { color: var(--up); }
.d { color: var(--down); }
.off { color: var(--muted); }

td.msg { text-align: center; font-family: var(--cond); font-weight: 600; font-size: 18px; color: var(--label); padding: 40px 16px; }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 14px 16px 0;
  border-top: 2px solid var(--panel-rule);
  color: var(--label);
  font-size: 16px;
}

@media (max-width: 640px) {
  .wrap {
    padding-block: 16px 20px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .head p { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) { .crawl div { animation: none; } }
