/* Swing Desk: the look of the designs (one column, made for a phone). No inline styles: the page's security
   policy allows none, so every look is a class here. */
:root {
  --bg: #F6F7F9; --card: #FFFFFF; --ink: #0F172A; --muted: #5B6474; --line: #E3E6EB; --line2: #F1F3F5;
  --accent: #1F5FD6; --accent-ink: #1A4FB4; --accent-soft: #F3F6FD;
  --up: #0A7A43; --down: #B42318; --warn-bg: #FFF7EB; --warn-ink: #8A4B00;
  --you-bg: #EFE9FB; --you-ink: #5B2DB3; --tag-bg: #EEF0F3; --tag-ink: #3B4352;
  --lead-bg: #E7F5EE; --lead-ink: #0A6B3B; --trade-bg: #E6EEFC; --trade-ink: #1A4FB4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1116; --card: #171B22; --ink: #E8EAEE; --muted: #9AA3B2; --line: #2A303A; --line2: #222831;
    --accent: #5B8DEF; --accent-ink: #8FB1F5; --accent-soft: #1A2333;
    --up: #3DBE7A; --down: #F0705F; --warn-bg: #2E2414; --warn-ink: #F2B866;
    --you-bg: #2A2140; --you-ink: #C3A8F5; --tag-bg: #232A34; --tag-ink: #C5CBD5;
    --lead-bg: #15301F; --lead-ink: #7DD3A0; --trade-bg: #1A2740; --trade-ink: #9DB8F2;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); } .bold { font-weight: 600; }
.hidden { display: none !important; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 16px 10px;
       position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px;
       padding-top: calc(14px + env(safe-area-inset-top)); }
.top-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.sub { font-size: 12px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--up); }
.dot.off { background: var(--down); }
.main { flex: 1; padding: 12px 16px 96px; display: flex; flex-direction: column; gap: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
        display: flex; flex-direction: column; gap: 10px; }
.card.tight { gap: 0; padding: 4px 14px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px;
        border-bottom: 1px solid var(--line2); }
.line:last-child { border-bottom: none; }
.line > :last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.big { font-size: 24px; font-weight: 700; }
.small { font-size: 12px; }
.note { font-size: 13px; line-height: 1.45; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.note.warn { background: var(--warn-bg); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; font-size: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-size: 11px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 16px; }
.cell { display: flex; flex-direction: column; }
.cell.end { align-items: flex-end; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
        font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); font-weight: 600; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
       background: var(--tag-bg); color: var(--tag-ink); }
.tag.trade { background: var(--trade-bg); color: var(--trade-ink); }
.tag.lead { background: var(--lead-bg); color: var(--lead-ink); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag.you { background: var(--you-bg); color: var(--you-ink); }
.who { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px;
       background: var(--tag-bg); color: var(--tag-ink); }
.who.you { background: var(--you-bg); color: var(--you-ink); }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0;
            border-bottom: 1px solid var(--line2); min-height: 44px; }
.list-row:last-child { border-bottom: none; }
.list-row .left { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.list-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.sym { font-size: 15px; font-weight: 600; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }

.btn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 14px;
       font-weight: 600; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center;
       gap: 8px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn.danger { color: var(--down); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
            display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn.primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-left: -12px;
        border: none; background: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.inline { display: flex; align-items: baseline; gap: 8px; }
.top-row .cell { flex: 1; min-width: 0; }
.input { height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; background: var(--card);
         width: 100%; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }

.tabs { display: flex; gap: 22px; font-size: 14px; }
.tabs a { padding: 8px 0; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.bar { position: relative; height: 8px; border-radius: 999px; background: var(--tag-bg); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; height: 8px; border-radius: 999px; background: var(--up); width: 0; }

.timeline { display: flex; flex-direction: column; }
.step { display: flex; gap: 10px; }
.step .rail { display: flex; flex-direction: column; align-items: center; width: 12px; }
.step .rail i { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #8A93A3; flex-shrink: 0; }
.step .rail i.you { background: #6B3FD4; }
.step .rail b { flex: 1; width: 2px; background: var(--line); }
.step .body { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; flex: 1; font-size: 13px; }
.step .when { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }

.score { flex-shrink: 0; width: 58px; height: 58px; border-radius: 50%; border: 5px solid var(--muted);
         display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score b { font-size: 18px; line-height: 1; }
.score span { font-size: 9px; font-weight: 700; }
.score.good { border-color: var(--up); } .score.good span { color: var(--up); }
.score.fair { border-color: var(--accent); } .score.fair span { color: var(--accent); }
.score.weak { border-color: var(--warn-ink); } .score.weak span { color: var(--warn-ink); }
.score.poor { border-color: var(--down); } .score.poor span { color: var(--down); }
.answer { white-space: pre-wrap; font-size: 13px; line-height: 1.5; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
       display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom);
       z-index: 10; }
.nav-inner { max-width: 560px; margin: 0 auto; width: 100%; display: contents; }
.nav a { height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
         color: var(--muted); font-size: 11px; font-weight: 500; }
.nav a.on { color: var(--accent); font-weight: 600; }
.nav svg, .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
                  stroke-linejoin: round; }

.switch { width: 50px; height: 30px; border-radius: 999px; border: none; padding: 3px; display: flex;
          background: #C9CED6; justify-content: flex-start; flex-shrink: 0; }
.switch.on { background: var(--accent); justify-content: flex-end; }
.switch i { width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; display: block; }

.center { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 0 12px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: var(--card);
        display: flex; align-items: center; justify-content: center; }
.error { color: var(--down); font-size: 13px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--card);
         padding: 10px 14px; border-radius: 10px; font-size: 13px; z-index: 20; max-width: 90vw; }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
