/* КриптоВилки — design system v062
   Full CSS from Claude Design handoff (onyx palette, token-driven).
   Replace old Sora/Altera palette with Golos Text + JetBrains Mono + onyx tokens. */

/* ============ BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --font-ui: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --pad: 18px;
  --gap: 12px;
  --t: 160ms cubic-bezier(.4,0,.2,1);
}
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  background: #0a0b0d;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
#root { height: 100vh; }
.root {
  height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--text);
  transition: background var(--t), color var(--t);
}
.root::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: var(--aurora);
  pointer-events: none;
  transition: background var(--t);
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
b { font-weight: 700; }
.mono, .roi-val, .ov-hero-metric .roi-val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* hidden utility — must beat all element/class display rules */
[hidden] { display: none !important; }

/* kill ugly number-input spinner arrows everywhere */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ============ APP LAYOUT ============ */
.app {
  height: 100vh;
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 372px 1px 1fr;
}
.split-div { background: var(--border); }

/* ============ FEED (LEFT) ============ */
.feed {
  display: flex; flex-direction: column;
  background-color: var(--panel);
  min-height: 0;
  transition: background var(--t);
}
.feed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad) 14px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(158deg, #2a2622, #141216);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(255,255,255,0.05), 0 6px 16px -6px rgba(0,0,0,0.7);
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(135% 95% at 26% -12%, rgba(255,255,255,0.18), transparent 52%);
}
.brand-mark .brand-fork::before {
  content: "\22D4";
  font-size: 22px; line-height: 1; font-weight: 800;
  color: #f6f3ee; position: relative; z-index: 1;
}
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; }
.brand-mark-lg .brand-fork::before { font-size: 34px; }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.045em; color: var(--text-2); }
.brand-accent { color: var(--text); font-weight: 800; }
.feed-head-r { display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  color: var(--text-2); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: color var(--t), background var(--t), transform var(--t), box-shadow var(--t);
}
.theme-toggle:hover { color: var(--text); background: var(--card-hover); transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--border-strong); }
.theme-toggle:active { transform: translateY(0); }
.online {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-2);
  padding: 5px 9px; border-radius: 999px;
  background: oklch(1 0 0 / 0.08);
  backdrop-filter: blur(7px) saturate(1.4);
  -webkit-backdrop-filter: blur(7px) saturate(1.4);
  box-shadow: inset 1.5px 1.5px 1px oklch(1 0 0 / 0.40), inset -1px -1px 1px 1px oklch(1 0 0 / 0.18), 0 6px 14px -8px oklch(0 0 0 / 0.5);
}
.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent), transparent 40%); }
  70% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent), transparent 100%); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* tabs */
.feed-tabs { display: flex; gap: 4px; padding: 12px var(--pad) 0; }
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 0; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text-3);
  transition: all var(--t);
}
.tab:hover { color: var(--text-2); background: var(--card); }
.tab.is-on { color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tab-count {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: var(--panel-2); color: var(--text-3);
}
.tab.is-on .tab-count { background: var(--accent-soft); color: var(--accent); }

/* filters */
.filters { margin: 12px var(--pad) 0; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.filters-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; }
.filters-title { font-size: 13px; font-weight: 700; }
.filters-meta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.chev { transition: transform var(--t); font-size: 14px; }
.chev-up { transform: rotate(180deg); }
.filters-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 13px; border-top: 1px solid var(--border); margin-top: 0; padding-top: 13px; }
.filt-row { display: flex; flex-direction: column; gap: 7px; }
.filt-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; }
.seg-btn {
  padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--panel-2);
  box-shadow: inset 0 0 0 1px transparent; transition: all var(--t);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-on { color: var(--accent-ink); background: var(--accent); }
.slider { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; background: var(--panel-2); outline: none; width: 100%; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.slider::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--accent); cursor: pointer; }
.check { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.check input { display: none; }
.check-box { width: 17px; height: 17px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--border-strong); transition: all var(--t); position: relative; flex: none; }
.check input:checked + .check-box { background: var(--accent); box-shadow: none; }
.check input:checked + .check-box::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ink); font-size: 11px; font-weight: 900; }

/* Inline filter selects and inputs (compact styling for native controls) */
.filters-body select,
.filters-body input[type="number"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color var(--t);
  width: 100%;
}
.filters-body select:focus,
.filters-body input[type="number"]:focus {
  border-color: var(--accent);
}
.filters-body input[type="checkbox"] {
  display: none;
}
.filters-body label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2); font-weight: 500;
  cursor: pointer;
}

/* feed list */
.feed-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px var(--pad) 14px; display: flex; flex-direction: column; gap: var(--gap); }
.empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 40px 0; }
.empty-hist span { font-size: 12px; opacity: 0.7; }

/* signal card */
.sig-card {
  position: relative; text-align: left; width: 100%;
  background-color: var(--card); border-radius: var(--r);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 9px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background var(--t), box-shadow var(--t), transform var(--t);
}
.sig-card:hover { background-color: var(--card-hover); box-shadow: inset 0 0 0 1px var(--border-strong); transform: translateY(-3px) scale(1.012); }
.sig-card.is-active { box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow); background-color: var(--card-hover); }
.sig-card.is-fat { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent), transparent 55%); }
.glow-on .sig-card.is-fat.is-active { box-shadow: var(--glow), var(--shadow); }
.sig-fat-rail { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 999px; background: var(--accent); }
.sig-card.is-fresh { animation: freshFlash 0.9s ease; }
@keyframes freshFlash {
  0% { box-shadow: inset 0 0 0 1.5px var(--accent-strong), 0 0 24px -6px var(--accent); }
  100% { box-shadow: inset 0 0 0 1px var(--border); }
}
.sig-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sig-teams { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.sig-vs { color: var(--text-3); font-weight: 500; }
.sig-mid { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sig-profit { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 13px; }
.sig-dot { color: var(--text-3); }
.sig-market { color: var(--text-2); font-weight: 500; }
.sig-bot { display: flex; align-items: center; justify-content: space-between; }
.sig-badges { display: flex; gap: 6px; }
.sig-age { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); font-weight: 500; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.02em; white-space: nowrap; }
.badge-meta { background: var(--panel-2); color: var(--text-3); text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.05em; }
.badge-live { background: color-mix(in oklch, var(--danger), transparent 84%); color: var(--danger); }
.badge-pre { background: var(--panel-2); color: var(--text-2); }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }

/* roi pill */
.roi-pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); letter-spacing: -0.01em; }
.roi-pill.roi-fat { background: var(--accent); color: var(--accent-ink); }
.roi-flame { font-size: 10px; }
.roi-pill.roi-xl { font-size: 28px; padding: 0; background: none; letter-spacing: -0.03em; line-height: 0.9; }
.roi-xl .roi-val { color: var(--num); }
.roi-xl .roi-flame { color: var(--accent); }
.roi-pill.roi-xl.roi-fat { background: none; }
.glow-on .roi-pill.roi-xl.roi-fat { filter: none; }
.roi-xl .roi-flame { display: none; }

/* feed status */
.feed-status { display: flex; align-items: center; gap: 9px; padding: 11px var(--pad); border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 11px; color: var(--text-3); flex-wrap: wrap; }
.fs-conn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.fs-item b { color: var(--text-2); }
.fs-sep { width: 1px; height: 11px; background: var(--border-strong); }

/* ============ DETAIL (RIGHT) ============ */
.detail { min-height: 0; overflow: hidden; background: transparent; }
.detail-scroll { height: 100%; overflow-y: auto; padding: 26px clamp(20px, 3vw, 40px) 40px; }
.detail-empty { display: grid; place-items: center; height: 100%; }
.detail-empty-in { text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.detail-empty-in p { font-size: 15px; line-height: 1.5; }

/* overview */
.overview { max-width: 1100px; margin: 0 auto; }
.ov-head { margin-bottom: 22px; }
.ov-match { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.ov-vs { color: var(--text-3); font-weight: 500; }
.ov-badges { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ov-age { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); margin-left: 2px; }

.ov-hero {
  display: flex; align-items: center; gap: clamp(24px, 4vw, 56px);
  padding: 24px 28px; margin-bottom: 18px;
  background-color: var(--panel); border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--border);
}
.ov-hero-metric { display: flex; flex-direction: column; gap: 8px; }
.ov-hero-lab { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.ov-hero-div { width: 1px; align-self: stretch; background: var(--border); margin: 4px 0; }
.ov-profit { font-family: var(--font-mono); font-size: clamp(26px, 2.4vw, 36px); font-weight: 800; color: var(--num); letter-spacing: -0.03em; line-height: 0.9; }
.ov-profit.is-fat { color: var(--accent-strong); }

/* legs */
.ov-legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; margin-bottom: 18px; }
.ov-legs-x { display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); font-weight: 700; }
.ov-legs-x span { padding: 9px 12px; border-radius: 999px; background: oklch(1 0 0 / 0.08); backdrop-filter: blur(8px) saturate(1.4); -webkit-backdrop-filter: blur(8px) saturate(1.4); box-shadow: inset 1.5px 1.5px 1px oklch(1 0 0 / 0.40), inset -1px -1px 1px 1px oklch(1 0 0 / 0.16); }
.leg {
  background-color: var(--panel); border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: inset 0 0 0 1px var(--border);
  border-top: 2px solid transparent;
  display: flex; flex-direction: column; gap: 14px;
}
.leg--fonbet { border-top-color: var(--fonbet); }
.leg--poly { border-top-color: var(--poly); }
.leg-head { display: flex; align-items: center; justify-content: space-between; }
.leg-depth { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.leg-outcome { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.leg-figure { display: flex; align-items: baseline; gap: 10px; }
.leg-figure-val { font-family: var(--font-mono); font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.leg--fonbet .leg-figure-val { color: var(--fonbet); }
.leg--poly .leg-figure-val { color: var(--poly); }
.leg-figure-lab { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.leg-stats { display: flex; gap: 10px; }
.leg-stat { flex: 1; background: var(--card); border-radius: var(--r-sm); padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; box-shadow: inset 0 0 0 1px var(--border); }
.ls-lab { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.ls-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }

/* leg tag */
.leg-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.leg-swatch { width: 8px; height: 8px; border-radius: 2px; }
.leg-fonbet { color: var(--fonbet); } .leg-fonbet .leg-swatch { background: var(--fonbet); }
.leg-poly { color: var(--poly); } .leg-poly .leg-swatch { background: var(--poly); }

/* CTA */
.cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 17px; border-radius: var(--r-lg);
  position: relative; overflow: hidden;
  background: oklch(1 0 0 / 0.08); color: var(--text);
  backdrop-filter: blur(13px) saturate(1.4);
  -webkit-backdrop-filter: blur(13px) saturate(1.4);
  font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  box-shadow: inset 2px 2px 1px oklch(1 0 0 / 0.40), inset -1px -1px 1px 1px oklch(1 0 0 / 0.20), 0 0 16px -5px color-mix(in oklch, var(--accent), transparent 64%), 0 12px 28px -14px oklch(0 0 0 / 0.55);
}
.cta > span { position: relative; z-index: 1; }
.cta::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, oklch(1 0 0 / 0.32), transparent);
  transform: skewX(-18deg); pointer-events: none;
  animation: ctaSheen 3.4s ease-in-out infinite;
}
@keyframes ctaSheen { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.cta:hover { transform: translateY(-2px) scale(1.008); background: oklch(1 0 0 / 0.13); box-shadow: inset 2px 2px 1px oklch(1 0 0 / 0.45), inset -1px -1px 1px 1px oklch(1 0 0 / 0.20), 0 0 24px -3px color-mix(in oklch, var(--accent), transparent 52%), 0 18px 38px -14px oklch(0 0 0 / 0.6); }
.cta:active { transform: translateY(0); }
.cta-roi { font-family: var(--font-mono); font-weight: 800; padding: 3px 10px; border-radius: 999px; background: oklch(1 0 0 / 0.16); color: var(--text); }

/* supporting grid */
.detail-grid { max-width: 1100px; margin: 22px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel-block { background-color: var(--panel); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--border); }
.pb-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.pb-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.pb-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }

/* snapshot */
.snap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.snap-cell { background: var(--card); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 5px; box-shadow: inset 0 0 0 1px var(--border); }
.snap-lab { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.snap-val { font-family: var(--font-mono); font-size: 19px; font-weight: 700; }
.snap-accent { background: var(--accent-soft); box-shadow: none; }
.snap-accent .snap-val { color: var(--accent); }
.snap-accent .snap-lab { color: var(--accent); opacity: 0.8; }

/* order book */
.book { display: flex; flex-direction: column; gap: 3px; }
.book-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: 12.5px; padding: 4px 0; }
.book-head-row { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); padding-bottom: 7px; margin-bottom: 3px; }
.book-head-row span:nth-child(2), .book-head-row span:nth-child(3), .book-vol, .book-usd { text-align: right; }
.book-price { position: relative; padding: 4px 8px; border-radius: 6px; overflow: hidden; display: flex; }
.book-depth { position: absolute; left: 0; top: 0; bottom: 0; background: var(--poly-soft); border-radius: 6px; }
.book-price-t { position: relative; color: var(--poly); font-weight: 700; }
.book-vol { color: var(--text-2); }
.book-usd { color: var(--text); font-weight: 600; }

/* arb check */
.arb-eq { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 30px); padding: 14px 0 18px; flex-wrap: wrap; }
.arb-term { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.arb-term-v { font-family: var(--font-mono); font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.02em; }
.arb-term-v.is-good { color: var(--accent); }
.arb-term-l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.arb-op { font-family: var(--font-mono); font-size: 24px; color: var(--text-3); font-weight: 500; }
.arb-edge { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--accent-soft); border-radius: var(--r); }
.arb-edge-pill { flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.arb-edge-text { font-size: 12.5px; line-height: 1.5; color: var(--text-2); text-wrap: pretty; }

/* bar */
.bar { display: block; flex: 1; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width var(--t); }
.bar-fill.bar-fonbet { background: var(--fonbet); }
.bar-fill.bar-poly { background: var(--poly); }

/* ============ CALCULATOR POPUP (standalone window) ============
   The calc lives in a real popup window (calc.html), not a modal scrim.
   We apply the design's modal panel look without the scrim overlay. */
.calc-popup-root {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  padding: 24px 26px 28px;
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-eyebrow { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.modal-title { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin-top: 5px; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); font-size: 13px; transition: all var(--t); flex: none; }
.modal-x:hover { color: var(--text); background: var(--card-hover); }

.calc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.cm { background-color: var(--card); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; box-shadow: inset 0 0 0 1px var(--border); }
.cm-lab { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.cm-val { font-family: var(--font-mono); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.cm-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.cm-accent { background: var(--accent-soft); box-shadow: none; }
.cm-accent .cm-val { color: var(--accent); }
.cm-accent .cm-val.is-fat { color: var(--accent-strong); }
.cm-accent .cm-lab { color: var(--accent); opacity: 0.85; }

.calc-lock { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.calc-lock-lab { font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg-lock .seg-btn { padding: 7px 16px; font-size: 13px; }

.calc-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.cleg { background-color: var(--card); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--border); border-top: 2px solid transparent; display: flex; flex-direction: column; gap: 13px; }
.cleg--fonbet { border-top-color: var(--fonbet); }
.cleg--poly { border-top-color: var(--poly); }
.cleg.is-locked { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cleg-head { display: flex; align-items: center; justify-content: space-between; }
.cleg-pin { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.cleg-auto { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.cleg-outcome { font-size: 14px; font-weight: 700; }
.cleg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-lab { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.field-in { font-family: var(--font-mono); font-size: 17px; font-weight: 700; padding: 9px 11px; border-radius: var(--r-sm); background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); outline: none; transition: box-shadow var(--t); width: 100%; }
.field-in:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.field-in:disabled { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.field-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.cleg-row { display: flex; align-items: center; gap: 10px; }
.cleg-row-lab { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; width: 34px; }
.cleg-row-val { font-family: var(--font-mono); font-size: 12px; font-weight: 700; width: 34px; text-align: right; }
.cleg-payout { display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.cleg-payout b { font-family: var(--font-mono); font-size: 15px; color: var(--text); }

.calc-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--border); }
.calc-rate { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.calc-rate b { color: var(--text-2); }
.calc-foot-actions { display: flex; gap: 10px; }
.btn-ghost { padding: 11px 18px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-strong); transition: all var(--t); }
.btn-ghost:hover { color: var(--text); background: var(--card); }
.btn-primary { padding: 11px 24px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 800; background: var(--cta-bg); color: var(--cta-ink); box-shadow: 0 5px 16px -8px var(--cta-glow); transition: transform var(--t), filter var(--t); animation: btnPulse 2.8s ease-in-out infinite; }
.btn-primary:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.05); }
@keyframes btnPulse { 0%, 100% { box-shadow: 0 5px 16px -8px var(--cta-glow); } 50% { box-shadow: 0 8px 26px -6px var(--cta-glow); } }

/* FX rate row in calc popup */
.calc-fx-row { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); padding-top: 14px; border-top: 1px solid var(--border); }
.calc-fx-row b { color: var(--text-2); }
.calc-fx-input {
  width: 70px; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); color: var(--text);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  padding: 4px 8px; outline: none; transition: border-color var(--t);
}
.calc-fx-input:focus { border-color: var(--accent); }
.calc-fx-badge { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.calc-fx-badge.own { background: var(--poly-soft); color: var(--poly); }
.calc-fx-reset { font-size: 11px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; text-decoration: underline; font-family: var(--font-mono); }

/* Popup links to platforms */
.calc-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.calc-link { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--t); box-shadow: inset 0 0 0 1px var(--border); background: var(--card); color: var(--text-2); }
.calc-link:hover { box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text); }
.calc-link.calc-link--fonbet { color: var(--fonbet); }
.calc-link.calc-link--fonbet:hover { box-shadow: inset 0 0 0 1px var(--fonbet); }
.calc-link.calc-link--poly { color: var(--poly); }
.calc-link.calc-link--poly:hover { box-shadow: inset 0 0 0 1px var(--poly); }
.calc-link[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Popup status / loading */
.calc-loading { color: var(--text-3); text-align: center; padding: 60px 20px; font-size: 14px; font-family: var(--font-mono); }
.calc-live-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============ DENSITY ============ */
.density-compact { --pad: 14px; --gap: 8px; }
.density-compact .sig-card { padding: 10px 12px; gap: 7px; }
.density-compact .sig-teams { font-size: 13.5px; }
.density-compact .ov-hero { padding: 18px 22px; }
.density-comfy { --pad: 22px; --gap: 16px; }
.density-comfy .sig-card { padding: 16px 17px; gap: 11px; }

/* ============ SCROLLBARS ============ */
.feed-list::-webkit-scrollbar, .detail-scroll::-webkit-scrollbar, .calc-popup-root::-webkit-scrollbar { width: 9px; }
.feed-list::-webkit-scrollbar-thumb, .detail-scroll::-webkit-scrollbar-thumb, .calc-popup-root::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.feed-list::-webkit-scrollbar-thumb:hover, .detail-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* glossy sheen on glass surfaces (driven by --sheen per palette) */
.feed, .sig-card, .ov-hero, .leg, .panel-block, .cm, .cleg {
  background-image: var(--sheen, none);
  background-repeat: no-repeat;
}

/* hover-grow micro-interaction on cards */
.panel-block, .leg, .cm, .cleg { transition: transform var(--t), box-shadow var(--t), background var(--t); }
.panel-block:hover, .leg:hover, .cm:hover, .cleg:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow);
}

/* ============ HISTORY LIST ============ */
.hist-row {
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: pointer;
  transition: background var(--t), box-shadow var(--t);
  display: flex; flex-direction: column; gap: 5px;
}
.hist-row:hover { background: var(--card-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.hist-row.is-active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.hist-teams { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.hist-meta { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); flex-wrap: wrap; }
.hist-roi-pos { color: var(--accent); font-weight: 700; }
.hist-roi-zero { color: var(--text-3); }
.hist-time { margin-left: auto; }

/* ============ FROZEN / EDGE-GONE / ARCHIVE STATES ============ */
.sig-card.is-frozen { box-shadow: inset 0 0 0 1px var(--accent); opacity: 0.85; }
.sig-card.is-closed-frozen { opacity: 0.55; }
.sig-card.is-stale { opacity: 0.5; }
.sig-card.is-edge-gone { opacity: 0.55; }

.badge-frozen { background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.04em; white-space: nowrap; }
.badge-warn { background: color-mix(in oklch, oklch(0.75 0.12 70), transparent 80%); color: oklch(0.75 0.12 70); font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.badge-closed-edge { background: var(--panel-2); color: var(--text-3); font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }

/* archive/frozen/edge-gone info bars in detail */
.archive-bar, .frozen-bar, .edge-gone-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r);
  font-size: 12.5px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border);
}
.archive-bar { background: var(--panel); color: var(--text-2); }
.archive-bar svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-3); }
.frozen-bar { background: var(--accent-soft); color: var(--accent); display: none; }
.frozen-bar.visible { display: flex; }
.edge-gone-bar { background: color-mix(in oklch, oklch(0.75 0.12 70), transparent 88%); color: oklch(0.75 0.12 70); }

/* ============ DETAIL EMPTY ============ */
.detail-full { height: 100%; display: grid; place-items: center; }

/* ============ DETAIL ACTIONS (freeze/refresh) ============ */
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ic-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 14px;
  color: var(--text-2); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: all var(--t);
}
.ic-btn:hover { color: var(--text); background: var(--card-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ic-btn.is-frozen { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* ============ MOBILE / RESPONSIVE ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .split-div { display: none; }
  .detail { display: none; }
  .detail.is-visible { display: block; position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: var(--bg); }
  .feed.is-hidden { display: none; }
}
