/* End-of-Day summary table. Shares app.css's true-black tokens and its rule that green
   and red appear ONLY on deltas. Hairlines carry the structure; no shadows, no fills
   beyond one surface step. No currency literal in this file. */
@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #000; --surface: #0c0c0c; --raised: #141414; --text: #fafafa; --muted: #a1a1a1;
  --faint: #8a8a8a; --hair: rgba(255,255,255,.09); --hair-strong: rgba(255,255,255,.16);
  --green: #34d399; --red: #f87171;
  --bar: 56px;
  /* Space Telegram needs at the top inside the Mini App: the notch (the device's own
     env() value, or Telegram's if larger), then the row of Telegram's buttons.
     Zero in a normal browser, where telegram-web-app.js is not loaded. */
  --inset: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px))
    + var(--tg-content-safe-area-inset-top, 0px));
  --bar-total: calc(var(--bar) + var(--inset));
  --band-h: 30px;
  color-scheme: dark;
  scrollbar-color: #333 transparent;
}
* { box-sizing: border-box; }
::selection { background: var(--text); color: var(--bg); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 13px/1.4 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum", "ss01";
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5; height: var(--bar-total);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: var(--inset) 24px 0; background: rgba(0,0,0,.85); border-bottom: 1px solid var(--hair);
  backdrop-filter: saturate(160%) blur(10px);
}
.crumbs { display: flex; gap: 8px; align-items: center; min-width: 0; color: var(--faint); white-space: nowrap; }
.crumbs a { color: var(--muted); transition: color .15s; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 2px; height: 32px; padding: 0 2px;
  border: 1px solid var(--hair); border-radius: 6px; white-space: nowrap; }
.stepper time { padding: 0 8px; font-weight: 500; }
.stepper a, .stepper .off { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; color: var(--muted); }
.stepper a { transition: background .15s, color .15s; }
.stepper a:hover { background: var(--raised); color: var(--text); }
.stepper a:active { background: var(--hair-strong); }
.stepper .off { color: #3a3a3a; }

/* Page */
.sheet { max-width: 1520px; margin: 0 auto; padding: 0 24px; }
.head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
.head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; height: 36px; background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; }
.seg a { display: flex; align-items: center; padding: 0 12px; border-radius: 6px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.seg a:hover { color: var(--text); }
.seg .on { background: var(--text); color: var(--bg); }
.seg button { appearance: none; border: 0; background: none; padding: 0 12px; border-radius: 6px;
  color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.period, .ccy-inline { display: none; }
.seg .on:hover { color: var(--bg); }
.ghost { height: 36px; padding: 0 12px; background: none; border: 1px solid var(--hair-strong); border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer; transition: background .15s; }
.ghost:hover { background: var(--raised); }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--hair); border-radius: 6px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn:active { background: var(--hair-strong); }
.launch { display: grid; place-items: center; min-height: 100vh; padding: 24px; color: var(--muted); text-align: center; }
.signin { max-width: 420px; }
.signin h1 { color: var(--text); margin-bottom: 8px; }
.signin p { margin: 0 0 24px; }
.cta { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 600; }
.cta:hover { opacity: .9; }
.warn { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--hair-strong); border-radius: 6px; color: var(--text); }

/* Headline figures */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 24px; border: 1px solid var(--hair); border-radius: 8px; }
.kpis > div { padding: 16px 20px; border-left: 1px solid var(--hair); min-width: 0; }
.kpis > div:first-child { border-left: 0; }
.kpis dt { color: var(--muted); font-size: 13px; }
.kpis dd { margin: 8px 0 0; font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }

/* Table */
/* App-style page: only the slim top bar stays put; everything below, title included,
   scrolls in one area so the table gets the room. Inside it the table's header rows and
   venue column stay frozen, and the title, tiles and notes stay in place when the table
   scrolls sideways. */
html, body { height: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.bar { flex: none; }
.sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
.head { flex: none; }
.scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 32px; }
/* Spacing sits on the title, not the scroll area, so frozen headers pin flush to its top. */
.scroll > .head { padding-top: 24px; }
.scroll > .head, .scroll > .kpis, .scroll > .warn, .scroll > .notes { position: sticky; left: 0; }
.grid { width: max-content; min-width: 100%; border: 1px solid var(--hair); border-radius: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th, td { height: 36px; padding: 0 12px; text-align: left; font-weight: 400; border-bottom: 1px solid var(--hair); }
thead th { position: sticky; top: 0; z-index: 2; height: auto; padding: 8px 12px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.3; font-weight: 500; vertical-align: bottom; }
.bands th { height: var(--band-h); padding-block: 6px 4px; border-bottom-color: transparent; }
.bands .band { color: var(--text); }
.bands th[rowspan] { border-bottom-color: var(--hair); }
/* 1px overlap with the band row so no data row shows through the seam. */
.bands + tr th { top: calc(var(--band-h) - 1px); }
/* Paint a little above each frozen header cell so no row text shows through its top edge. */
thead th { box-shadow: 0 -8px 0 var(--surface); }
.num { text-align: right; }
.band { border-left: 1px solid var(--hair); }
.venue { position: sticky; left: 0; z-index: 1; min-width: 208px; background: var(--bg); }
thead .venue { z-index: 3; background: var(--surface); }
.ccy { color: var(--faint); }
.venue-link { color: inherit; text-decoration: underline; text-decoration-color: var(--hair-strong);
  text-underline-offset: 3px; transition: text-decoration-color .15s; }
.venue-link:hover { text-decoration-color: var(--text); }
.venue-link:focus-visible { outline-offset: 1px; }
tr[data-href] { cursor: pointer; }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--faint); }
tbody tr:not(.group):not(.total):hover td { background: var(--surface); }
.group th, .group td { height: 40px; padding-top: 12px; border-bottom: 1px solid var(--hair); }
.group th { font-weight: 600; }
.group small { margin-left: 6px; color: var(--faint); font-size: 12px; font-weight: 400; }
.awaiting .venue { color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--hair-strong); border-radius: 999px; color: var(--muted); font-size: 12px; }
.total td { background: var(--surface); font-weight: 600; }
.total .ccy { font-weight: 400; }
.grand td { height: 44px; background: var(--raised); font-weight: 600; border-bottom: 0; }
.grand .ccy { font-weight: 400; }

.notes { max-width: 72ch; margin-top: 20px; color: var(--faint); font-size: 12px; }
.notes p { margin: 0 0 2px; }

/* Wide screens: nothing scrolls sideways, so the header can stick under the bar. */
/* Large screens and TVs: use the width and raise the type so it reads across a room. */
@media (min-width: 1800px) {
  :root { --band-h: 34px; }
  body { font-size: 15px; }
  .sheet { max-width: 2200px; padding: 0 48px; }
  .scroll > .head { padding-top: 32px; }
  h1 { font-size: 34px; }
  th, td { height: 42px; padding: 0 16px; }
  thead th { font-size: 13px; }
  .kpis dd { font-size: 34px; }
  .kpis dt { font-size: 14px; }
}
@media (min-width: 2600px) {
  :root { --band-h: 40px; }
  body { font-size: 18px; }
  .sheet { max-width: 3000px; }
  th, td { height: 50px; }
  thead th { font-size: 15px; }
  .kpis dd { font-size: 44px; }
}
/* Short screens, e.g. a phone held sideways: give the table the room. */
@media (max-height: 520px) {
  .scroll > .head { padding-top: 12px; }
  .head { margin-bottom: 10px; }
  .head p { display: none; }
  h1 { font-size: 20px; }
  .seg { height: 32px; }
  .kpis { margin-bottom: 12px; }
  .kpis > div { padding: 10px 14px; }
  .kpis dd { margin-top: 4px; font-size: 20px; }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis > div { border-left: 0; border-top: 1px solid var(--hair); }
  .kpis > div:nth-child(even) { border-left: 1px solid var(--hair); }
  .kpis > div:nth-child(-n+2) { border-top: 0; }
  .kpis > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Phones (either way up): the table fits the width, one period at a time, and the
     area never scrolls sideways, so a vertical swipe can only move vertically. */
  .scroll { overflow-x: hidden; touch-action: pan-y; }
  .grid { width: auto; }
  table { table-layout: auto; }
  .period { display: inline-flex; }
  [data-period="today"] .p-wtd, [data-period="wtd"] .p-today { display: none; }
  .col-ccy { display: none; }
  .ccy-inline { display: block; margin-top: 1px; color: var(--faint); font-size: 11px; }
  .venue { white-space: normal; }
}
@media (max-width: 640px) {
  .bar { padding: var(--inset) 12px 0; }
  .crumbs > span { display: none; }
  .icon-btn span { display: none; }
  .icon-btn { padding: 0 8px; }
  /* Portrait phones: drop vs Last Year and Share (shown sideways) and tighten spacing. */
  .col-ly, .col-share { display: none; }
  .head { align-items: stretch; }
  .head .seg { width: 100%; }
  .head .seg > * { flex: 1; justify-content: center; }
  .venue { min-width: 0; max-width: none; width: 34%; }
  th, td, thead th { padding-left: 5px; padding-right: 5px; }
  thead th { white-space: normal; }
  table { font-size: 12px; }
  .crumbs a::before { content: "\2039\00a0"; }
  .sheet { padding: 0 12px; }
  .scroll > .head { padding-top: 16px; }
  h1 { font-size: 24px; }
  .kpis dd { font-size: 22px; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #f5f5f5; --raised: #eee; --text: #000; --muted: #444; --faint: #666; --hair: #ddd; --green: #047857; --red: #b91c1c; }
  .bar, .seg { display: none; }
  html, body { height: auto; overflow: visible; display: block; }
  .scroll { overflow: visible; }
  thead th { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
