@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/plex-regular.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/plex-medium.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('./fonts/plex-semibold.ttf') format('truetype'); }
@font-face { font-family: 'Roboto Slab'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/roboto-slab-medium.ttf') format('truetype'); }
:root {
  --bg: #fff; --ink: #1A1A1A; --muted: #666660; --rule: #D9D9D4; --band: #F4F4F1;
  --accent: #1F5F3A; --accent-soft: #E9F2EC; --bad: #A8321E;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--sans); color: var(--ink); background: var(--bg); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; border-top: 4px solid var(--accent); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--accent); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; top: -100px; left: 16px; padding: 10px 16px; background: var(--accent); color: #fff; z-index: 50; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.muted, .neutral { color: var(--muted); }
.positive { color: var(--accent); }
.negative { color: var(--bad); }
.small-text { font-size: 13px; }
.masthead { max-width: 900px; margin: 0 auto; padding: 22px 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font: 500 24px/1.2 'Roboto Slab', Georgia, serif; letter-spacing: -.2px; white-space: nowrap; }
.mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; }
.site-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.site-nav a, .nav-button { background: none; border: 0; color: var(--muted); text-decoration: none; padding: 4px 0; font-size: 14px; }
.site-nav a:hover, .nav-button:hover, .site-nav a.active { color: var(--accent); }
.report { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 25px; font-weight: 600; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 24px 0 5px; }
p { margin: 8px 0; }
.report-head > p { color: var(--muted); margin: 0; }
.league-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 16px 0 24px; }
.league-controls > span { font-size: 13px; }
.league-switch { display: inline-flex; gap: 6px; }
.league-switch button { border: 1px solid var(--rule); border-radius: 3px; background: #fff; color: var(--muted); font-size: 13px; padding: 3px 10px; }
.league-switch button.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.game-nav { display: flex; gap: 25px; border-bottom: 1px solid var(--rule); margin-bottom: 25px; }
.game-nav a { color: var(--muted); text-decoration: none; padding: 0 0 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 14px; }
.game-nav a.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.game-nav a:hover { color: var(--ink); }
.view-heading { margin-bottom: 20px; }
.view-heading h2 { font-size: 20px; }
.view-heading p { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--accent); border-radius: 3px; padding: 8px 16px; font-size: 14px; font-weight: 500; background: #fff; color: var(--accent); }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: #163F28; }
.button.secondary:hover:not(:disabled) { background: var(--accent-soft); }
.button.full { width: 100%; }
.button + .button.full { margin-top: 10px; }
.portfolio-summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 24px; }
.portfolio-summary span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.portfolio-summary strong { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -.4px; }
.portfolio-summary .portfolio-worth strong { font-weight: 600; }
.portfolio-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 22px 0 28px; }
.portfolio-actions > span { margin-left: auto; font-size: 12.5px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--accent); padding-bottom: 7px; margin: 0 0 2px; }
.section-heading h2 { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.section-heading a { font-size: 13px; text-decoration: none; }
.section-heading a:hover { text-decoration: underline; }
.count { color: var(--muted); font-weight: 400; margin-left: 5px; letter-spacing: 0; }
#orders-section { margin-top: 28px; }
.empty-state { padding: 22px 0 26px; border-bottom: 1px solid var(--rule); }
.empty-state h3 { font-size: 15px; margin: 0 0 4px; }
.empty-state p { color: var(--muted); font-size: 14px; margin: 0; }
.portfolio-details { margin-top: 22px; }
details { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-size: 14px; padding: 12px 0; color: var(--muted); }
summary:hover, details[open] > summary { color: var(--accent); }
details > p { font-size: 13px; color: var(--muted); margin: 0 0 15px; }
.qualification { margin: 20px 0 0; font-size: 13px; color: var(--muted); }
.qualification a { white-space: nowrap; }
.chart-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; font-size: 12px; }
.chart-legend { display: flex; gap: 18px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.line-key { display: inline-block; width: 16px; border-top: 2px solid var(--accent); }
.line-key.benchmark { border-top: 2px dashed var(--muted); }
.performance-chart { height: 190px; margin: 15px 0; position: relative; }
.performance-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-empty-note { position: absolute; top: 64px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--rule); padding: 9px 12px; }
td { padding: 13px 12px; font-size: 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th:not(:first-child), td:not(:first-child) { text-align: right; }
th.company, td.company { text-align: left; }
.company-cell { line-height: 1.45; }
.company-cell b { display: block; font-size: 15px; font-weight: 600; }
.company-cell small, .player-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.table-action { background: #fff; border: 1px solid #BFD6C7; border-radius: 3px; color: var(--accent); padding: 5px 12px; font-size: 13px; }
.table-action:hover { background: var(--accent-soft); }
.order-item, .history-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.order-item .details, .history-item .details { flex: 1; min-width: 0; }
.order-item b, .history-item b { font-size: 14px; font-weight: 500; }
.order-item small, .history-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.side-chip { font-size: 12px; color: var(--accent); text-transform: capitalize; min-width: 27px; }
.side-chip.sell { color: var(--bad); }
.history-item:last-child { border-bottom: 0; }
.market-controls { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.search-field { display: block; flex: 1; margin: 0; }
.market-controls select { width: 160px; }
.market-table .sector-column { text-align: left; }
.sector-tag { color: var(--muted); font-size: 13px; }
.data-note { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.leaderboard-table .me { background: var(--accent-soft); }
.leaderboard-table .me td:first-child { padding-left: 7px; }
.leaderboard-table .me td:last-child { padding-right: 7px; }
.rank { color: var(--muted); font-size: 15px; }
.rank.first { color: var(--accent); font-weight: 600; }
.player-name { font-size: 14px; font-weight: 500; }
.pill { font-size: 11px; font-weight: 400; color: var(--accent); margin-left: 6px; }
.score { font-weight: 500; }
.qualifying { color: var(--muted); font-size: 12px; }
.scoring-details { margin-top: 22px; }
.scoring-details p { max-width: 660px; }
.live-not-ready { border-bottom: 1px solid var(--rule); padding: 15px 0 22px; }
.live-not-ready h3 { margin-top: 0; }
.live-not-ready p { color: var(--muted); font-size: 14px; }
.rules { max-width: 680px; }
.rules p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.rules details { margin-top: 22px; }
.page-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-top: 1px solid var(--rule); margin-top: 35px; padding-top: 17px; color: var(--muted); font-size: 12px; }
.page-footer a { white-space: nowrap; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
dialog { width: 420px; max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; border: 1px solid var(--rule); border-radius: 5px; padding: 26px; background: #fff; color: var(--ink); box-shadow: 0 8px 32px #0002; }
dialog::backdrop { background: #0004; }
dialog h2 { font-size: 21px; padding-right: 20px; margin: 0 0 16px; }
dialog p { font-size: 14px; }
dialog p.small-text { font-size: 12.5px; }
.dialog-close { position: absolute; right: 15px; top: 10px; padding: 0 5px; border: 0; background: none; color: var(--muted); font-size: 26px; }
.trade-tabs { display: flex; gap: 8px; margin: 0 0 20px; }
.trade-tabs button { border: 1px solid var(--rule); border-radius: 3px; background: #fff; color: var(--muted); padding: 6px 18px; font-size: 14px; }
.trade-tabs button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.account-tabs { margin-top: 20px; }
label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 7px; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; font-size: 14px; min-width: 0; }
#account-form input { margin-bottom: 16px; }
.quote-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin: 9px 0 22px; }
.quote-row b { color: var(--ink); font-weight: 500; margin-left: 5px; }
.amount-input { display: flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--rule); border-radius: 3px; }
.amount-input span { color: var(--muted); }
.amount-input input { border: 0; border-radius: 0; outline: 0; padding-left: 0; font-size: 18px; }
.amount-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.amount-presets { display: flex; gap: 8px; margin-top: 9px; }
.amount-presets button { border: 1px solid var(--rule); border-radius: 3px; background: #fff; padding: 4px 12px; font-size: 12px; }
.amount-presets button:hover { background: var(--band); }
.order-estimate { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; margin: 20px 0 8px; color: var(--muted); }
.order-estimate b { color: var(--ink); font-weight: 500; }
#order-help { line-height: 1.6; margin-bottom: 20px; }
.confirm-row { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.confirm-row span { color: var(--muted); }
.confirm-row strong { font-weight: 500; text-align: right; }
#confirm-dialog > p { margin: 18px 0; }
.form-error { color: var(--bad); }
.form-error:empty { display: none; }
.error-banner, .notice { font-size: 14px; padding: 10px 12px; margin: 0 0 22px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.error-banner { color: var(--bad); border-color: var(--bad); background: #fbefec; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 14px; z-index: 100; }
.loading { opacity: .55; pointer-events: none; }
@media (max-width: 600px) {
  .masthead { padding-top: 18px; align-items: flex-start; }
  .wordmark { font-size: 21px; gap: 8px; }
  .mark { width: 25px; height: 25px; }
  .site-nav { gap: 10px; font-size: 12px; }
  .site-nav a, .nav-button { font-size: 12px; }
  .report { padding-top: 16px; }
  h1 { font-size: 23px; }
  .report-head > p { font-size: 14px; max-width: 320px; }
  .league-controls { gap: 8px 12px; margin-bottom: 20px; }
  .league-controls > span { font-size: 12px; }
  .game-nav { gap: 22px; }
  .portfolio-summary { gap: 12px; grid-template-columns: 1.15fr 1fr 1fr; }
  .portfolio-summary span { font-size: 11px; }
  .portfolio-summary strong { font-size: 19px; letter-spacing: -.5px; }
  .portfolio-actions { margin: 18px 0 24px; }
  .portfolio-actions > span { width: 100%; margin: 1px 0 0; font-size: 12px; }
  .button { padding: 8px 13px; font-size: 13px; }
  th, td { padding-left: 8px; padding-right: 8px; }
  td { font-size: 13px; }
  .company-cell b { font-size: 14px; }
  .company-cell small, .player-sub { font-size: 11px; }
  .table-action { padding: 4px 8px; font-size: 12px; }
  .section-heading { flex-wrap: wrap; gap: 4px 10px; }
  .section-heading .small-text { font-size: 11px; }
  .market-controls { gap: 8px; }
  .market-controls select { width: 115px; font-size: 12px; padding-left: 8px; }
  .market-controls input { font-size: 13px; }
  .market-table .sector-column { display: none; }
  .leaderboard-table th, .leaderboard-table td { font-size: 12px; }
  .leaderboard-table .equity-column { display: none; }
  .player-name { font-size: 13px; }
  .player-name + .player-sub { max-width: 135px; white-space: normal; }
  .chart-toolbar, .chart-legend { font-size: 11px; gap: 12px; }
  .performance-chart { height: 165px; }
  .chart-empty-note { top: 53px; font-size: 12px; }
  .order-item, .history-item { font-size: 13px; gap: 9px; }
  .order-item small, .history-item small { font-size: 11px; }
  .page-footer { align-items: flex-start; font-size: 11px; }
  dialog { padding: 22px; }
}
@media (max-width: 360px) {
  .wordmark { font-size: 19px; }
  .site-nav { gap: 8px; }
  .site-nav a, .nav-button { font-size: 11px; }
  .portfolio-summary strong { font-size: 17px; }
  .portfolio-summary span { font-size: 10px; }
}
