/* Omba owner desk v0: phone-first, light and dark from the same tokens. */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --line: #e2e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #74736e;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: #e5effb;
  --series-1: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --bad: #d03b3b;
  --bad-ink: #b42323;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .04);
  --radius: 14px;
  --gutter: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151514; --surface: #1d1d1c; --surface-2: #262624; --line: #33332f;
    --text: #f4f4f1; --text-2: #c3c2b7; --text-3: #9b9a90;
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #1b2a3d; --series-1: #3987e5;
    --good-ink: #4cc94c; --warn-ink: #fab219; --bad-ink: #f07a7a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151514; --surface: #1d1d1c; --surface-2: #262624; --line: #33332f;
  --text: #f4f4f1; --text-2: #c3c2b7; --text-3: #9b9a90;
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #1b2a3d; --series-1: #3987e5;
  --good-ink: #4cc94c; --warn-ink: #fab219; --bad-ink: #f07a7a;
  --shadow: 0 1px 2px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  font-variant-numeric: tabular-nums; min-height: 100dvh;
}
button, select, textarea, input { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
.noscript { padding: var(--gutter); }

/* ---- shell ---- */
.shell { min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.01em; }
.brand img { width: 24px; height: 24px; }
.brand small { font-weight: 500; color: var(--text-3); }
.top .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pill.good .dot { background: var(--good); } .pill.warn .dot { background: var(--warn); } .pill.bad .dot { background: var(--bad); }
.pill.demo { background: var(--accent-soft); color: var(--accent-ink); }
.iconbtn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 34px; min-width: 34px;
  padding: 0 10px; cursor: pointer; color: var(--text-2); white-space: nowrap; font-size: 13px;
}
@media (max-width: 420px) { .brand small { display: none; } .top { gap: 6px; } .top .pill { padding: 3px 7px; } }
.iconbtn:hover { color: var(--text); }
main { padding: var(--gutter); padding-bottom: calc(84px + env(safe-area-inset-bottom)); max-width: 1180px; width: 100%; margin: 0 auto; }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px;
  color: var(--text-3); text-decoration: none; font-weight: 550;
}
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a[aria-current="page"] { color: var(--accent-ink); }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .top { grid-column: 1 / -1; }
  nav.tabs {
    position: sticky; top: 57px; align-self: start; display: flex; flex-direction: column; gap: 2px;
    border: 0; background: transparent; padding: var(--gutter) 8px;
  }
  nav.tabs a { flex-direction: row; gap: 10px; font-size: 14px; padding: 9px 12px; border-radius: 10px; }
  nav.tabs a[aria-current="page"] { background: var(--accent-soft); }
  main { padding-bottom: 40px; }
}

/* ---- blocks ---- */
h1 { font-size: 22px; letter-spacing: -.02em; margin: 4px 0 2px; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--text-2); font-weight: 650; }
.sub { color: var(--text-3); font-size: 13px; margin: 0 0 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid, .tiles + .grid, .tiles + .card { margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .k { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 24px; font-weight: 680; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.pos { color: var(--good-ink); } .neg { color: var(--bad-ink); } .muted { color: var(--text-3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.banner { border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.banner.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.banner.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* compare: win rate vs expectancy */
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th { white-space: nowrap; text-align: right; color: var(--text-3); font-weight: 600; font-size: 12px; padding: 4px 6px; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare td { text-align: right; padding: 7px 6px; border-top: 1px solid var(--line); white-space: nowrap; }

/* chart */
.chart { position: relative; width: 100%; height: 220px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .base-line { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .axis { fill: var(--text-3); font-size: 11px; }
.chart .series { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .10; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; }
.chart .mark { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 9px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -110%);
}
.tip b { font-size: 14px; }

/* meter */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; position: relative; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.meter.warn > span { background: var(--warn); } .meter.bad > span { background: var(--bad); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 2px; border-top: 1px solid var(--line);
  color: inherit; text-decoration: none; align-items: center;
}
.list li:first-child .row { border-top: 0; }
a.row:hover { background: var(--surface-2); border-radius: 10px; }
.row .t { font-weight: 620; display: flex; align-items: center; gap: 6px 8px; min-width: 0; flex-wrap: wrap; }
.row .m { color: var(--text-3); font-size: 13px; grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; font-weight: 650; grid-row: 1 / span 2; grid-column: 2; }
.row .r small { display: block; font-weight: 500; color: var(--text-3); font-size: 12px; }
.side { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; letter-spacing: .03em; }
.side.BUY { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-ink); }
.side.SELL { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-ink); }
.tag { font-size: 11px; color: var(--text-2); background: var(--surface-2); padding: 1px 7px; border-radius: 6px; font-weight: 550; }
.vtag { font-size: 11px; padding: 1px 7px; border-radius: 6px; font-weight: 650; background: var(--accent-soft); color: var(--accent-ink); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select {
  appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2374736e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 28px 7px 10px; font-size: 14px; flex: 1 1 120px; min-width: 0;
}
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex: 1 1 100%; }
@media (min-width: 600px) { .seg { flex: 0 0 auto; } }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; flex: 1; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: right; font-size: 12px; color: var(--text-3); font-weight: 600; padding: 6px 8px; white-space: nowrap; }
table.data td { text-align: right; padding: 9px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }

/* detail */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.reasons { margin: 0; padding-left: 18px; } .reasons li { margin: 4px 0; }
.thesis { color: var(--text-2); font-size: 14px; margin: 8px 0 0; }
details summary { cursor: pointer; color: var(--accent-ink); font-size: 14px; margin-top: 8px; }
details ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.ids { font-family: var(--mono); font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.excur { position: relative; height: 26px; margin: 10px 0 4px; }
.excur .track { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--line); }
.excur .seg-mae { position: absolute; top: 9px; height: 8px; background: color-mix(in srgb, var(--bad) 55%, transparent); border-radius: 4px 0 0 4px; }
.excur .seg-mfe { position: absolute; top: 9px; height: 8px; background: color-mix(in srgb, var(--good) 55%, transparent); border-radius: 0 4px 4px 0; }
.excur .zero { position: absolute; top: 4px; width: 2px; height: 18px; background: var(--text); }
.excur .res { position: absolute; top: 2px; width: 10px; height: 22px; margin-left: -5px; border: 2px solid var(--text); border-radius: 4px; background: var(--surface); }

/* verdict */
.verdicts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .verdicts { grid-template-columns: repeat(4, 1fr); } }
.verdicts button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 8px; cursor: pointer;
  font-weight: 620; color: var(--text-2);
}
.verdicts button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
textarea {
  width: 100%; margin-top: 10px; min-height: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  background: var(--surface); resize: vertical;
}
.primary {
  border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 650; cursor: pointer;
}
.primary:disabled { opacity: .55; cursor: default; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.saved { font-size: 13px; color: var(--text-3); }

/* arena */
.arena .card { display: flex; flex-direction: column; gap: 6px; }
.arena .alias { font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.arena .off { opacity: .78; }

/* sign-in + boot */
.boot, .signin { min-height: 100dvh; display: grid; place-content: center; text-align: center; padding: var(--gutter); gap: 12px; }
.signin .card { max-width: 380px; padding: 26px 22px; }
.signin img { width: 48px; height: 48px; margin: 0 auto 6px; display: block; }
.signin p { color: var(--text-2); margin: 6px 0 18px; }
.signin .primary { width: 100%; padding: 12px; font-size: 16px; }
.signin .err { color: var(--bad-ink); font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.updated { font-size: 12px; color: var(--text-3); margin-top: 14px; text-align: center; }
.empty { color: var(--text-3); text-align: center; padding: 24px 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
