/* emotionless.fi — soft slate-navy fintech, beige accents */
:root, [data-theme="night"] {
  --bg: #0d0e10;
  --bg-2: #0a0a0c;
  --surface: #16171a;
  --surface-2: #1d1f22;
  --surface-3: #26282c;
  --line: rgba(255,255,255,.065);
  --line-2: rgba(255,255,255,.13);
  --text: #f1f2f3;
  --text-dim: #a0a3a8;
  --text-mute: #666a70;
  --up: oklch(0.80 0.15 155);
  --up-soft: oklch(0.70 0.10 152);
  --down: oklch(0.68 0.18 22);
  --down-soft: oklch(0.70 0.12 45);
  --neutral: oklch(0.82 0.09 90);
  --beige: oklch(0.86 0.165 96);
  --beige-deep: oklch(0.80 0.16 92);
  --btc: oklch(0.80 0.13 65);
  --eth: oklch(0.74 0.10 270);
  --sol: oklch(0.76 0.16 300);
  --cash: oklch(0.66 0.015 250);
  --accent: var(--beige);
  --btn-fg: #221d12;
  --glow: color-mix(in oklab, var(--beige) 50%, transparent);
  --sans: "Helvetica Neue", Helvetica, "Hanken Grotesk", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 22px;
  --r-sm: 13px;
  --pad: 20px;
  --maxw: 1120px;
}
[data-theme="day"] {
  --bg: #f2f2f1;
  --bg-2: #e8e8e7;
  --surface: #ffffff;
  --surface-2: #f7f7f6;
  --surface-3: #eeeeed;
  --line: rgba(18,18,20,.09);
  --line-2: rgba(18,18,20,.16);
  --text: #18191b;
  --text-dim: #56585c;
  --text-mute: #8a8c90;
  --up: oklch(0.62 0.15 152);
  --up-soft: oklch(0.66 0.11 150);
  --down: oklch(0.58 0.19 25);
  --down-soft: oklch(0.64 0.13 45);
  --neutral: oklch(0.68 0.11 80);
  --beige: oklch(0.83 0.17 95);
  --beige-deep: oklch(0.70 0.16 92);
  --accent: var(--beige);
  --btn-fg: #2a2316;
  --glow: color-mix(in oklab, var(--beige-deep) 45%, transparent);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; color: inherit; }
::selection { background: color-mix(in oklab, var(--accent) 38%, transparent); color: var(--btn-fg); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* density tweak hook */
[data-density="compact"] { --pad: 15px; --r: 18px; font-size: 14px; }
[data-density="roomy"] { --pad: 26px; }

/* ============ shell ============ */
.app { min-height: 100vh; display: flex; }
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 80% at 80% -10%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 58%),
    radial-gradient(100% 60% at 0% 110%, color-mix(in oklab, var(--accent) 4%, transparent), transparent 55%);
}

/* sidebar (desktop) */
.sidebar {
  width: 232px; flex: none; border-right: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-2) 88%, black);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 5;
}
[data-theme="day"] .sidebar { background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--surface-3), var(--surface)); border: 1px solid var(--line-2); position: relative; }
.brand-mark::after { content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: conic-gradient(from 90deg, #f0616d, #e3b341, #3ecf8e, #f0616d); }
.brand-name { font-family: "Space Grotesk", var(--sans); font-weight: 500; letter-spacing: .04em; font-size: 16px; color: var(--text); }
.brand-name b { color: inherit; font-weight: 500; }
[data-theme="day"] .brand-name b { color: inherit; }
.brand-ring { display: inline-grid; place-items: center; color: var(--text); flex: none; }
.brand-tag { font: 500 10.5px/1 var(--mono); color: var(--text-mute); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; }
.nav-label { font: 600 10px/1 var(--mono); letter-spacing: .14em; color: var(--text-mute); padding: 16px 12px 8px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-dim); border: 1px solid transparent; font-size: 14px; font-weight: 500; background: none; width: 100%; text-align: left; transition: .14s; }
.nav-item:hover { color: var(--text); background: color-mix(in oklab, var(--text) 6%, transparent); }
.nav-item.on { color: var(--text); background: color-mix(in oklab, var(--accent) 14%, transparent); border-color: color-mix(in oklab, var(--accent) 22%, transparent); }
.nav-item.on svg { color: var(--accent); }
.nav-foot { padding: 12px; border-top: 1px solid var(--line); }
.theme-switch { display: flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.theme-opt { flex: 1; display: grid; place-items: center; padding: 7px; border-radius: 8px; border: none; background: none; color: var(--text-mute); transition: .12s; }
.theme-opt:hover { color: var(--text); }
.theme-opt.on { background: var(--surface-3); color: var(--accent); }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); }
.acct:hover { background: var(--surface); }
.acct-av { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font: 600 12px var(--mono); border: 1px solid var(--line-2); }
.acct-meta { font-size: 12.5px; line-height: 1.25; }
.acct-meta b { font-weight: 600; }
.acct-meta span { color: var(--text-mute); font-size: 11px; }

/* main */
.main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.topbar { display: none; }
.deskbar { display: none; }
@media (min-width: 861px) {
  .deskbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 13px clamp(16px, 4vw, 34px); position: sticky; top: 0; z-index: 15;
    background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
}
.market-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim);
  padding: 8px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.market-chip b { font-size: 13px; }

/* account menu */
.acctmenu { position: relative; }
.acctmenu-btn { display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: .14s; }
.acctmenu-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.acctmenu-name { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.acctmenu-name b { font-size: 13px; font-weight: 600; }
.acctmenu-name span { font-size: 10.5px; color: var(--text-mute); letter-spacing: .02em; }
.acctmenu-backdrop { position: fixed; inset: 0; z-index: 50; }
.acctmenu-pop { position: absolute; top: calc(100% + 9px); right: 0; z-index: 51; width: 248px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px;
  box-shadow: 0 18px 44px -14px rgba(0,0,0,.55); animation: popin .14s ease; }
.acctmenu-head { display: flex; gap: 11px; align-items: center; padding: 8px 8px 10px; }
.acctmenu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px; border: none; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; }
.acctmenu-item:hover { background: var(--surface-2); }
.acctmenu-item.danger { color: var(--down); }
.acctmenu-item.danger:hover { background: color-mix(in oklab, var(--down) 10%, transparent); }
.acctmenu-sep { height: 1px; background: var(--line); margin: 5px 0; }
.pro-badge { font: 700 9px var(--mono); letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: color-mix(in oklab, var(--accent) 22%, var(--surface-3)); color: var(--accent); }
@media (max-width: 860px) { .acctmenu-name { display: none; } .acctmenu-btn { padding: 4px; } }
.content { max-width: var(--maxw); margin: 0 auto; padding: 26px clamp(16px, 4vw, 34px) 60px; position: relative; }
/* desktop: comfortable bottom breathing room */
@media (min-width: 861px) {
  .content { padding-bottom: 64px; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-sub { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 9px; white-space: nowrap; }

/* ============ cards ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
[data-theme="night"] .card, :root .card { box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 18px 40px -28px rgba(0,0,0,.7); }
[data-theme="day"] .card { box-shadow: 0 1px 2px rgba(40,35,25,.04), 0 18px 40px -30px rgba(40,35,25,.25); }
.card.pad { padding: var(--pad); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-h .eyebrow { margin: 0; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--text-dim); }
.mute2 { color: var(--text-mute); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ============ buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-sm);
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); transition: .14s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-primary { background: var(--accent); color: var(--btn-fg); border-color: transparent; font-weight: 700; box-shadow: 0 6px 22px -8px var(--glow); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, white); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { color: var(--down); border-color: color-mix(in oklab, var(--down) 40%, transparent); background: color-mix(in oklab, var(--down) 9%, transparent); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.iconbtn { width: 34px; height: 34px; padding: 0; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.iconbtn:hover { background: var(--surface-3); }

/* ============ pills / badges ============ */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .02em;
  padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line-2); text-transform: uppercase; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-up { color: var(--up); border-color: color-mix(in oklab, var(--up) 35%, transparent); }
.pill-down { color: var(--down); border-color: color-mix(in oklab, var(--down) 35%, transparent); }
.pill-neutral { color: var(--text-dim); }
.pill-amber { color: var(--neutral); border-color: color-mix(in oklab, var(--neutral) 35%, transparent); }
.pill.soft.pill-up { background: color-mix(in oklab, var(--up) 10%, transparent); }
.pill.soft.pill-down { background: color-mix(in oklab, var(--down) 10%, transparent); }
.pill.soft.pill-amber { background: color-mix(in oklab, var(--neutral) 10%, transparent); }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }

/* ============ stats ============ */
.stat-label { font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 8px; }
.stat-value { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.stat-value.up { color: var(--up); } .stat-value.down { color: var(--down); }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.statgrid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.statgrid .stat { background: var(--surface); padding: 16px; }

/* ============ modal ============ */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: color-mix(in oklab, var(--bg) 55%, transparent); backdrop-filter: blur(6px); }
.modal { width: 100%; max-width: 540px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: var(--pad); box-shadow: 0 28px 70px -20px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: no-preference) {
  .modal { animation: popin .18s ease; }
}
@keyframes popin { from { transform: translateY(-6px); } to { transform: none; } }
.share-body { display: flex; gap: 18px; align-items: flex-start; }
.share-qr { flex: none; display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 5px 5px 5px 12px; }
.copy-val { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 540px) { .share-body { flex-direction: column; align-items: stretch; } .share-qr { align-self: center; } }

/* ============ Fear & Greed barometer ============ */
.barometer { width: 100%; }
.baro-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.baro-value { font-size: 46px; font-weight: 600; letter-spacing: -.04em; line-height: .9; }
.baro-label { font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; margin-top: 8px; }
.baro-scale { font-size: 11px; color: var(--text-mute); }
.baro-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-mute); letter-spacing: .04em; margin-top: 2px; }

/* ============ tick-wave slider ============ */
.tickslider { position: relative; height: 56px; padding: 6px 4px 0; cursor: grab; touch-action: none; user-select: none; }
.tickslider.dragging { cursor: grabbing; }
.tickbars { display: flex; align-items: center; justify-content: space-between; height: 42px; }
.tickbar { width: 3px; border-radius: 2px; transition: background .12s, opacity .12s; }
.tick-knob { position: absolute; top: 50%; width: 30px; height: 30px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; gap: 2.5px;
  box-shadow: 0 4px 16px -2px var(--glow), 0 0 0 5px color-mix(in oklab, var(--accent) 14%, transparent); transition: box-shadow .14s; }
.tickslider.dragging .tick-knob { box-shadow: 0 4px 20px 0 var(--glow), 0 0 0 8px color-mix(in oklab, var(--accent) 18%, transparent); }
.tick-grip { width: 2.5px; height: 11px; border-radius: 2px; background: var(--accent); }

/* duration readout */
.duration-readout { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.duration-readout .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 14%, var(--surface-3)); color: var(--accent); flex: none; }
.dur-chip { padding: 7px 14px; border-radius: 999px; font: 600 12.5px var(--mono); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-dim); transition: .12s; }
.dur-chip:hover { color: var(--text); border-color: var(--line-2); }
.dur-chip.on { background: var(--accent); color: var(--btn-fg); border-color: transparent; }

/* account picker (builder) */
.acct-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .acct-pick { grid-template-columns: 1fr; } }
.acct-opt { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); text-align: left; transition: .14s; }
.acct-opt:hover { border-color: var(--line-2); background: var(--surface-3); }
.acct-opt.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--surface-2)); }
.acct-opt-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); flex: none; }
.acct-opt-meta { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.acct-opt-meta b { font-size: 13.5px; font-weight: 600; }
.acct-opt-meta span { font-size: 11.5px; color: var(--text-mute); }
.acct-opt-check { color: var(--accent); flex: none; width: 16px; }

/* ============ RSI meter ============ */
.rsi { display: flex; align-items: center; gap: 10px; }
.rsi-track { position: relative; flex: 1; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rsi-zone { position: absolute; top: 0; height: 100%; }
.rsi-zone.os { left: 0; width: 30%; background: color-mix(in oklab, var(--up) 16%, transparent); }
.rsi-zone.ob { right: 0; width: 30%; background: color-mix(in oklab, var(--down) 16%, transparent); }
.rsi-fill { position: absolute; left: 0; top: 0; height: 100%; opacity: .5; }
.rsi-dot { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.rsi-val { font-size: 13px; font-weight: 600; width: 26px; text-align: right; }

/* ============ segmented ============ */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { padding: 7px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: none; border: none; transition: .12s; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.seg-sm .seg-btn { padding: 5px 10px; font-size: 11.5px; }

/* ============ range slider ============ */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 5px; background: var(--surface-3); outline: none; accent-color: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 4px solid var(--surface); box-shadow: 0 2px 10px -1px var(--glow), 0 0 0 1px var(--line-2); cursor: pointer; transition: .12s; }
.range::-webkit-slider-thumb:hover { background: color-mix(in oklab, var(--accent) 86%, white); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }

/* ============ toggle ============ */
.toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); padding: 2px; transition: .16s; }
.toggle.on { background: var(--accent); border-color: transparent; }
.toggle-knob { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: .16s; }
.toggle.on .toggle-knob { transform: translateX(18px); background: var(--btn-fg); }

/* ============ inputs ============ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }
.input, .select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px;
  color: var(--text); font-size: 14px; font-family: inherit; width: 100%; transition: .12s; }
.input.mono { font-family: var(--mono); }
.input:focus, .select:focus { outline: none; border-color: color-mix(in oklab, var(--accent) 60%, var(--line-2)); background: var(--surface-3); }
.input::placeholder { color: var(--text-mute); }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-mute); font: 600 13px var(--mono); }
.input-affix .affix.l { left: 13px; } .input-affix .affix.r { right: 13px; }
.input-affix .input.pl { padding-left: 28px; } .input-affix .input.pr { padding-right: 34px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d626b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ============ table / rows ============ */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: none; }
.row-list { display: flex; flex-direction: column; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-mute); padding: 0 12px 11px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td { padding: 12px; border-top: 1px solid var(--line); }
.tbl tbody tr:hover { background: var(--surface-2); }

/* ============ strategy card ============ */
.strat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); transition: border-color .15s, transform .15s; cursor: pointer; }
.strat:hover { border-color: var(--line-2); background: var(--surface-2); }
.strat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.strat-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }

/* full-width strategy row */
.strat-row { display: flex; align-items: center; gap: 20px; }
.strat-row .strat-row-id { display: flex; align-items: center; gap: 12px; width: 248px; flex: none; }
.strat-row .strat-row-cond { flex: 1; min-width: 120px; }
.strat-row .strat-row-roi { width: 150px; flex: none; display: flex; align-items: center; gap: 12px; }
.strat-row .strat-row-status { width: 96px; flex: none; }
.strat-row .strat-row-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 980px) {
  .strat-row { flex-wrap: wrap; gap: 14px; }
  .strat-row .strat-row-id { width: 100%; }
  .strat-row .strat-row-cond { order: 4; width: 100%; flex: none; }
  .strat-row .strat-row-roi { width: auto; }
  .strat-row .strat-row-status { width: auto; margin-left: auto; }
  .strat-row .strat-row-actions { width: 100%; }
  .strat-row .strat-row-actions .btn { flex: 1; }
}

/* ammunition pacing */
.ammo { background: color-mix(in oklab, var(--accent) 6%, var(--surface)); border-color: color-mix(in oklab, var(--accent) 24%, var(--line)); }
.ammo-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.ammo-pip { width: 14px; height: 8px; border-radius: 2px; background: color-mix(in oklab, var(--accent) 60%, var(--surface-3)); }
.cond-chip { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--mono); padding: 5px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); }
.cond-chip b { color: var(--text); }
.logic-join { font: 700 10px var(--mono); color: var(--text-mute); letter-spacing: .1em; padding: 0 2px; }

/* condition builder */
.cond-builder { display: flex; flex-direction: column; gap: 10px; }
.cond-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.cond-row .select, .cond-row .input { width: auto; }
.logic-toggle { align-self: flex-start; }

/* tiers */
.tier-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.tier-row:first-child { border-top: none; }

/* legend */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend-swatch.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px); }

/* live status banner */
.live-banner { display: flex; align-items: center; gap: 14px; padding: 16px var(--pad); border-radius: var(--r); border: 1px solid var(--line); }
.live-banner.met { background: color-mix(in oklab, var(--up) 8%, var(--surface)); border-color: color-mix(in oklab, var(--up) 30%, transparent); }
.live-banner.unmet { background: var(--surface); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; }
.live-dot.on { background: var(--up); } .live-dot.off { background: var(--text-mute); }
.live-dot.on::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--up); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* alloc bar */
.alloc-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--bg); }
.alloc-seg { height: 100%; }

/* ============ mobile bottom nav ============ */
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .app { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; position: sticky; top: 0; z-index: 20;
    background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .content { padding: 18px 16px 96px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: color-mix(in oklab, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 10px; background: none; border: none; color: var(--text-mute); flex: 1; }
  .tab span { font: 600 9.5px/1 var(--mono); letter-spacing: .02em; }
  .tab.on { color: var(--accent); }
  .tab.fab { color: var(--text); }
  .tab.fab .fab-ic { width: 40px; height: 40px; margin-top: -22px; border-radius: 13px; background: var(--accent); color: var(--btn-fg); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 35%, transparent); }
}

/* ============ login ============ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 408px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 30px; }
.auth-logo .brand-mark { width: 48px; height: 48px; border-radius: 13px; }
.auth-logo .brand-mark::after { width: 18px; height: 18px; }
.slogan { font: 600 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); }
.divider-or { display: flex; align-items: center; gap: 14px; color: var(--text-mute); font: 600 10px var(--mono); letter-spacing: .1em; margin: 18px 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.security-note { display: flex; gap: 11px; padding: 13px; border-radius: var(--r-sm); background: color-mix(in oklab, var(--up) 6%, var(--surface)); border: 1px solid color-mix(in oklab, var(--up) 22%, transparent); font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.security-note svg { color: var(--up); flex: none; margin-top: 1px; }
.security-note b { color: var(--text); font-weight: 600; }
.connect-opt { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); width: 100%; text-align: left; transition: .14s; }
.connect-opt:hover { border-color: var(--accent); background: var(--surface-3); }
.connect-opt .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); flex: none; }
.connect-opt h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.connect-opt p { margin: 0; font-size: 12px; color: var(--text-dim); }
.step-dots { display: flex; gap: 7px; justify-content: center; margin-top: 22px; }
.step-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); transition: .2s; }
.step-dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }

/* fade-in */
/* fade-in: transform-only so content stays visible even if the animation
   clock is paused (e.g. backgrounded iframe). Never gate visibility on opacity. */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade .34s ease; }
  @keyframes fade { from { transform: translateY(6px); } to { transform: none; } }
}
/* responsive grid collapses (override inline grid-template-columns) */
@media (max-width: 920px) {
  [data-row="top"], [data-row="split"] { grid-template-columns: 1fr !important; }
  .builder-grid { grid-template-columns: 1fr !important; }
  .builder-summary { position: static !important; }
}
@media (max-width: 560px) {
  .tier-row { grid-template-columns: 1fr auto 1fr !important; row-gap: 6px; }
  .hide-xs { display: none !important; }
}

.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.wrap { flex-wrap: wrap; } .col { flex-direction: column; } .grow { flex: 1; } .ml-auto { margin-left: auto; }
.tr { text-align: right; } .nowrap { white-space: nowrap; }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fw600 { font-weight: 600; }
.mt4{margin-top:4px;}.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
