/* Adam Capitals NOP — blue & white */
:root {
  color-scheme: light;
  --bg: #F3F7FD; --surface: #FFFFFF; --sunk: #EAF1FC; --ink: #0B1526; --muted: #5A6B85; --line: #DCE6F5;
  --brand: #0A63F0; --brand-2: #1AA3F7; --brand-deep: #0640B8;
  --brand-grad: linear-gradient(135deg, #1AA3F7 0%, #0A63F0 55%, #0640B8 100%);
  --pos: #0E8A4F; --neg: #D92D1C; --warn-bg: #FDECEA;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 40, 100, .06), 0 6px 20px rgba(10, 60, 160, .07);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); font-size: 15px; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

/* login */
.login { max-width: 380px; margin: 0 auto; padding: 48px 16px; }
.login .logo { display: block; width: 120px; height: auto; margin: 0 auto 12px; }
.login h1 { text-align: center; font-size: 22px; margin: 0 0 4px; letter-spacing: -0.02em; }
.login p { text-align: center; margin: 0 0 20px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.field { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 17px; color: var(--ink); }
.field:focus, .pct:focus, .allpct:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 99, 240, .12); }
.primary { width: 100%; border: 0; border-radius: var(--radius-sm); padding: 14px; margin-top: 20px; background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 16px; }
.primary:disabled { opacity: .6; }
.err { color: var(--neg); font-size: 14px; margin-top: 12px; min-height: 1.4em; }

/* top bar */
.bar { display: flex; align-items: center; gap: 10px; padding: 12px 0; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.bar .mark { width: 32px; height: auto; flex: none; }
.bar h1 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.02em; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px rgba(14, 138, 79, .15); }
.live.stale .dot { background: var(--neg); box-shadow: 0 0 0 3px rgba(217, 45, 28, .15); }
.live.stale { color: var(--neg); font-weight: 600; }
.ghost { border: 0; background: var(--surface); box-shadow: var(--shadow); padding: 7px 12px; border-radius: 999px; color: var(--brand); font-weight: 700; font-size: 14px; white-space: nowrap; }
.ghost:active { background: var(--sunk); }
.testtag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #FFF1D6; color: #8A5A00; }

.banner { background: var(--warn-bg); color: var(--neg); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.banner[hidden] { display: none; }

/* summary */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.card .ra { text-align: right; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.card.hero { background: var(--brand-grad); color: #fff; }
.card h2 { font-size: 13px; font-weight: 700; margin: 0 0 8px; letter-spacing: .02em; text-transform: uppercase; opacity: .85; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.card .lbl { font-size: 12px; opacity: .8; }
.card.hero .pos, .card.hero .neg { color: #fff; }
.card .sub { display: flex; gap: 14px; font-size: 13px; margin-top: 6px; opacity: .9; }

/* controls */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.setall { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.allpct { width: 64px; padding: 7px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); text-align: right; color: var(--ink); }
.search { flex: 1 1 160px; min-width: 140px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.search:focus { outline: none; border-color: var(--brand); }
.spacer { flex: 1; }

/* table */
.tablebox { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #F8FAFE; font-weight: 700; white-space: nowrap; }
td.r, th.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.acct { font-weight: 700; }
.nm { color: var(--muted); font-size: 13px; }
.sym-inline { display: none; }
.net, .cover { font-weight: 700; white-space: nowrap; }
.side { font-size: 11px; font-weight: 700; margin-left: 4px; opacity: .8; }
.pct { width: 70px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: #FBFCFF; text-align: right; color: var(--ink); }
.pctwrap { white-space: nowrap; }
.pctwrap span { color: var(--muted); margin-left: 2px; }
tfoot td { background: var(--sunk); font-weight: 800; border-bottom: 0; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.foot { font-size: 12px; color: var(--muted); margin-top: 10px; }

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .bar h1 { font-size: 17px; }
  .col-sym, .col-name { display: none; }
  .sym-inline { display: block; color: var(--muted); font-size: 12px; }
  th, td { padding: 9px 8px; }
  .pct { width: 58px; }
  .card .big { font-size: 22px; }
  .live .lt { display: none; }
}
.narrow { display: none; }
@media (max-width: 640px) {
  .wide { display: none; } .narrow { display: inline; }
  table { font-size: 14px; }
  .side, .pctwrap span { display: none; }
  .pct { width: 48px; padding: 5px 6px; }
  th, td { padding: 9px 6px; } th:first-child, td:first-child { padding-left: 12px; } th:last-child, td:last-child { padding-right: 12px; }
  .nm, .sym-inline { font-size: 12px; }
  .testtag { font-size: 10px; padding: 2px 6px; }
  .bar { gap: 8px; } .bar .mark { width: 26px; }
  .search { order: 5; flex-basis: 100%; }
}
@media (max-width: 640px) {
  .bar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
  .live { margin-left: 0; font-size: 12px; }
  .ghost { padding: 6px 10px; font-size: 13px; }
}
