/* Portfolio Intelligence: graphite and cool grey with one blue accent,
   orange only for Bitcoin, green for "placed" and "buy". Geist, tabular figures.
   Phone: floating tab bar. Wide screens: dark sidebar and two columns. */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --well: #e8eaee;
  --line: #e3e5ea;
  --line-soft: #eef0f3;
  --ink: #0d1017;
  --ink-2: #3b414d;
  --muted: #5a6170;
  --faint: #8a909c;
  --accent: #3047f5;
  --accent-ink: #ffffff;
  --accent-soft: #e8ebfe;
  --good: #0e7c55;
  --good-soft: #e1f4ec;
  --warn: #9a5b00;
  --warn-soft: #fcefd9;
  --bad: #c2412d;
  --bad-soft: #fbe5e1;
  --btc-soft: #fdebd3;
  --btc-text: #b85f00;
  --violet-soft: #f1eafb;
  --violet-text: #6b3fb0;
  --hero: #0d1017;
  --hero-track: #2a2f3a;
  --side-active: #1e232d;
  --tabbar: rgba(255, 255, 255, 0.86);
  --shadow: 0 10px 30px rgba(13, 16, 23, 0.12);
  --font: 'Geist', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0b0d12;
    --surface: #151922;
    --surface-2: #1a1f29;
    --well: #1f2430;
    --line: #262c38;
    --line-soft: #202530;
    --ink: #eceef2;
    --ink-2: #c9cdd6;
    --muted: #9aa1ae;
    --faint: #6b7280;
    --accent: #7086ff;
    --accent-ink: #0b0d12;
    --accent-soft: #1d2442;
    --good: #4cd29a;
    --good-soft: #13301f;
    --warn: #f0b45a;
    --warn-soft: #34260f;
    --bad: #ff8a78;
    --bad-soft: #3a1c18;
    --btc-soft: #3a2611;
    --btc-text: #f5b267;
    --violet-soft: #2a1f3d;
    --violet-text: #c6a6f5;
    --hero: #1a1f2a;
    --hero-track: #2d3340;
    --side-active: #1a1f29;
    --tabbar: rgba(21, 25, 34, 0.86);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ground: #0b0d12;
  --surface: #151922;
  --surface-2: #1a1f29;
  --well: #1f2430;
  --line: #262c38;
  --line-soft: #202530;
  --ink: #eceef2;
  --ink-2: #c9cdd6;
  --muted: #9aa1ae;
  --faint: #6b7280;
  --accent: #7086ff;
  --accent-ink: #0b0d12;
  --accent-soft: #1d2442;
  --good: #4cd29a;
  --good-soft: #13301f;
  --warn: #f0b45a;
  --warn-soft: #34260f;
  --bad: #ff8a78;
  --bad-soft: #3a1c18;
  --btc-soft: #3a2611;
  --btc-text: #f5b267;
  --violet-soft: #2a1f3d;
  --violet-text: #c6a6f5;
  --hero: #1a1f2a;
  --hero-track: #2d3340;
  --side-active: #1a1f29;
  --tabbar: rgba(21, 25, 34, 0.86);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
code,
pre {
  font-family: var(--mono);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
  line-height: 1.45;
}
.strong {
  font-weight: 600;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stack-xs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.row.between {
  justify-content: space-between;
  flex-wrap: nowrap;
}
.row.top {
  align-items: flex-start;
}

/* --- Layout. */

.side {
  display: none;
}
.content {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 20px
    calc(env(safe-area-inset-bottom, 0px) + 120px);
}
.tab {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.kicker {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}
.count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 6px;
}
.cols {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.col {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.col.wide {
  flex: 3 1 480px;
}
.col.narrow {
  flex: 2 1 300px;
}

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
  }
  .side {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 18px;
    background: #0d1017;
    color: #fff;
  }
  .content {
    width: 100%;
    padding: 36px clamp(20px, 4vw, 48px) 56px;
  }
  .tabs {
    display: none !important;
  }
  h1 {
    font-size: 40px;
  }
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #a5abb8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.side-nav button[aria-current='page'] {
  background: var(--side-active);
  color: #fff;
  font-weight: 600;
}
.side-nav button:hover {
  color: #fff;
}
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #a5abb8;
}
.side-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-dark {
  border: 0;
  background: none;
  padding: 0;
  color: #c9cdd6;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  display: inline-block;
  flex: none;
}
.dot.live {
  background: #3bdb8a;
}
.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #3047f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.small-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

/* --- Floating tab bar (phone). */

.tabs {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  height: 68px;
  border-radius: 34px;
  background: var(--tabbar);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px;
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
}
.tabs button {
  border: 0;
  border-radius: 28px;
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.tabs button[aria-current='page'] {
  background: var(--ink);
  color: var(--ground);
  font-weight: 600;
}

/* --- Surfaces. */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  min-width: 0;
}
.card.list {
  padding: 6px 18px;
}
.card.dark {
  background: var(--hero);
  color: #e6e8ed;
  border-color: transparent;
}
.card.tint {
  background: var(--accent-soft);
  border-color: transparent;
}
.card.attn {
  background: var(--warn-soft);
  border-color: transparent;
}
.card-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 6px;
}

/* Hero: what to do this week. */
.hero {
  background: var(--hero);
  color: #fff;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: flex-end;
}
.hero-main {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-side {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8ef0b9;
}
.hero-status .dot {
  background: #3bdb8a;
}
.hero-status.wait {
  color: #f6c77d;
}
.hero-status.wait .dot {
  background: #f2a93b;
}
.hero-amount {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero-text {
  font-size: 15px;
  line-height: 1.45;
  color: #c9cdd6;
  max-width: 48ch;
}
.bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--hero-track);
  gap: 2px;
}
.bar.light {
  height: 8px;
  border-radius: 4px;
  background: var(--line-soft);
}
.bar.alloc {
  height: 14px;
  border-radius: 7px;
  background: none;
}
.bar > span {
  display: block;
  height: 100%;
}
.legend {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #c9cdd6;
}
.legend span,
.key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  flex: none;
}
.swatch.btc {
  background: #f2962e;
}
.swatch.buys {
  background: #6f82ff;
}
.swatch.waits {
  background: #4a5060;
}
.bar .btc {
  background: #f2962e;
}
.bar .buys {
  background: #6f82ff;
}
.bar.light .buys {
  background: var(--accent);
}

.accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.account {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account .big {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.note {
  font-size: 12px;
  color: var(--muted);
}
.account .send {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.transfer-tile {
  grid-column: 1 / -1;
}
.transfer-edit {
  display: flex;
  max-width: 320px;
  gap: 8px;
  margin-top: 4px;
}
.transfer-edit input {
  min-height: 38px;
  min-width: 0;
}
.transfer-tile > .btn {
  align-self: flex-start;
  margin-top: 4px;
}
.hero-send {
  font-size: 15px;
  color: #fff;
}
.note.warn {
  color: var(--warn);
  font-weight: 500;
}

/* Rows in a list card. */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.list-head + .item {
  border-top: 0;
}
.item-main {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ticker {
  font-size: 16px;
  font-weight: 600;
}
.sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.why {
  flex-basis: 100%;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.why.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.amount {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
  background: var(--well);
  color: var(--ink);
}
.tile.sm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
}
.tile.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.tile.btc {
  background: var(--btc-soft);
  color: var(--btc-text);
}
.tile.violet {
  background: var(--violet-soft);
  color: var(--violet-text);
}

/* Order cards with a Placed / Skipped switch. */
.orders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.order {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.order.attn {
  border-color: var(--warn);
}
.order-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: var(--ground);
  border-radius: 14px;
  padding: 4px;
}
.switch button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.switch button.on-placed {
  background: var(--good);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.switch button.on-skipped {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.switch button:disabled {
  opacity: 0.6;
}

/* Pills. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--well);
  color: var(--ink-2);
}
.pill.good {
  background: var(--good-soft);
  color: var(--good);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Buttons and inputs. */
.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.btn.big {
  min-height: 52px;
  font-size: 16px;
}
.btn.small {
  min-height: 38px;
  font-size: 14px;
  padding: 0 14px;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.btn.light {
  background: #fff;
  border-color: #fff;
  color: #0d1017;
}
.btn.ghost-dark {
  background: none;
  border: 0;
  color: #a5abb8;
  font-weight: 500;
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.icon-btn:disabled {
  opacity: 0.5;
}
input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 16px;
}
input:focus-visible,
button:focus-visible,
select:focus-visible,
.drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  background: var(--well);
  border-radius: 14px;
  padding: 4px;
}
.segmented.wide {
  max-width: 420px;
}
.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.segmented button[aria-checked='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chips button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chips button[aria-selected='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.ranges button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ranges button[aria-checked='true'] {
  background: var(--ink);
  color: var(--ground);
}
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
}
.drop.chosen {
  border-style: solid;
  border-color: var(--accent);
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.steps li span {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.steps.done li span {
  background: var(--good);
}
.steps.running li span {
  background: var(--accent);
  opacity: 0.4;
}
.confirm {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.log {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #a5abb8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 55vh;
  overflow: auto;
}
.log.light {
  background: var(--ground);
  color: var(--ink-2);
  border-radius: 12px;
  padding: 12px;
  max-height: 240px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #a5abb8;
}
.status.good {
  color: #8ef0b9;
}
.status.bad {
  color: #ff9d8f;
}
.status .dot {
  background: currentColor;
}

/* Watchlist streak. */
.streak {
  display: inline-flex;
  gap: 3px;
}
.streak span {
  width: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.streak span.on {
  background: var(--good);
}
.meta {
  flex-basis: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.meta > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
details.remove summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  min-height: 32px;
  display: flex;
  align-items: center;
}
details.remove summary::-webkit-details-marker {
  display: none;
}
details.remove {
  flex-basis: 100%;
}
details.remove form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Charts. */
.chart {
  position: relative;
  width: 100%;
  touch-action: pan-y;
  cursor: crosshair;
}
.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chart-value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}
.chart-delta {
  font-size: 14px;
  font-weight: 600;
  color: var(--good);
}
.chart-delta.down {
  color: var(--bad);
}
.chart-delta span {
  font-weight: 400;
  color: var(--muted);
}
.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.chart-foot .keys {
  display: inline-flex;
  gap: 12px;
}
.chart-foot .keys span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.line-key {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
}
.dash-key {
  width: 12px;
  height: 0;
  border-top: 2px dashed var(--faint);
  display: inline-block;
}
.svg-grid {
  stroke: var(--line-soft);
}
.svg-label {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}
.svg-value {
  stroke: var(--accent);
}
.svg-area {
  fill: var(--accent);
  fill-opacity: 0.1;
}
.svg-deposits {
  stroke: var(--faint);
}
.svg-dot {
  fill: var(--accent);
  stroke: var(--surface);
}
.svg-cursor {
  stroke: var(--faint);
}
.alloc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.alloc-row .name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alloc-row .pct {
  width: 44px;
  text-align: right;
  font-weight: 600;
}
.change {
  min-width: 58px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--good);
}
.change.down {
  color: var(--bad);
}
.spark {
  flex: none;
}
.spark .up {
  stroke: var(--good);
}
.spark .down {
  stroke: var(--bad);
}

/* Sign-in screen. */
body.signed-out {
  background: #0d1017;
}
.signin {
  min-height: 100vh;
  background: #0d1017;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: calc(env(safe-area-inset-top, 0px) + 72px) 24px
    calc(env(safe-area-inset-bottom, 0px) + 40px);
  max-width: 480px;
  margin: 0 auto;
}
.signin-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.signin-top h1 {
  font-size: 36px;
}
.signin-top p {
  font-size: 16px;
  color: #a5abb8;
  max-width: 300px;
}
.signin-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #a5abb8;
}
.face {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  border: 1.5px solid #2a2f3a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8ef0b9;
}
.signin-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #161a22;
  border: 1px solid #2a2f3a;
  border-radius: 18px;
  padding: 16px;
  color: #c9cdd6;
  font-size: 13px;
}
.setup input {
  background: #0d1017;
  border-color: #2a2f3a;
  color: #fff;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  font-size: 17px;
}
.setup code {
  color: #e6e8ed;
}
.error {
  color: #ff9d8f;
  font-size: 14px;
  min-height: 1.2em;
  text-align: center;
}

/* Full dashboard overlay. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--ground);
  display: flex;
  flex-direction: column;
}
.overlay-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.overlay iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--ground);
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: var(--ground);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 50;
}
@media (min-width: 900px) {
  .toast {
    bottom: 28px;
  }
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}

/* --- Company research page (full screen, scrolls on its own). */
body.locked {
  overflow: hidden;
}
.overlay.page {
  z-index: 30;
}
.overlay-bar .spacer {
  width: 72px;
}
.overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.overlay-body > * {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}
.company-head h1 {
  font-size: 32px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}
ul.plain,
ol.points,
ul.claims {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
}
ul.claims {
  list-style: none;
  padding-left: 0;
}
ul.claims li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.dir {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: var(--well);
  color: var(--muted);
}
.dir.up {
  background: var(--good-soft);
  color: var(--good);
}
.dir.down {
  background: var(--bad-soft);
  color: var(--bad);
}
.cites {
  margin-top: 4px;
}
.cites > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cites > summary::-webkit-details-marker {
  display: none;
}
.cite {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.cite-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data tr[data-company] {
  cursor: pointer;
}
.up {
  color: var(--good);
}
.down {
  color: var(--bad);
}
.fact {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.fact blockquote {
  margin: 4px 0;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.history-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hist {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

/* --- History timeline. */
.week {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.week-head {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.event {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.event:first-child {
  border-top: 0;
}
.event[data-company] {
  cursor: pointer;
}
.ev-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--well);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.ev-icon.go {
  background: var(--good-soft);
  color: var(--good);
}
.ev-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.ev-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.order-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.track-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}
.chart-value.small-value {
  font-size: 30px;
}

/* --- Research funnel. */
.funnel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.funnel > div {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.funnel .big {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.item[data-company] {
  cursor: pointer;
}

/* Reviews are written in short paragraphs and "- " bullets: keep their lines. */
.overlay-body p,
.overlay-body li > span,
.overlay-body ol.points > li > span,
.why,
.ev-main .small {
  white-space: pre-line;
}
