/* ============================================================
   AFTERBELL app — HUD design
   Flat paper canvas, hairline borders, square corners,
   corner-tick motif. Violet = interaction accent only.
   Green/red = YES/NO outcome semantics. Mono = all chrome.
   ============================================================ */
:root {
  /* Soft Organic / Pastel Editorial palette */
  --bg: #F5F4F7; --surface: #FFFCFA; --surface-2: #FFF5F1;
  --ink: #4A304D; --ink-2: #6B5470; --muted: #857985;
  --line: rgba(74, 48, 77, .12); --line-soft: rgba(74, 48, 77, .06);
  --violet: #FF9148; --violet-ink: #E8732C; --violet-soft: rgba(255, 145, 72, .12);
  --lavender: #B597C2; --lavender-soft: #EEE9FA;
  --peach: #FFD6B4; --cream: #FFE4A1;
  --yes: #22A97E; --yes-soft: rgba(34, 169, 126, .10);
  --no: #E8576B; --no-soft: rgba(232, 87, 107, .09);
  --warn: #C77B2A; --warn-soft: rgba(255, 214, 180, .35);
  --font-display: 'Manrope', 'Big Shoulders Display', sans-serif;
  --font-body: 'Manrope', 'Inter Tight', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-card: 28px; --radius-sm: 14px; --radius-pill: 999px;
  --shadow-soft: 0 20px 50px rgba(78, 52, 74, .08);
  --shadow-hover: 0 26px 60px rgba(78, 52, 74, .13);
  /* legacy token aliases (inline styles in app.js still reference these) */
  --green: var(--yes); --red: var(--no);
  --mesh-violet: var(--violet); --mesh-green: var(--yes);
  --text-dark: var(--ink); --text-muted: var(--muted); --dark-green: var(--ink);
  --bg-light: var(--bg); --panel-bg: var(--surface); --panel: var(--surface);
  --border: var(--line); --white: #fff;
}
html[data-theme="dark"] {
  --bg: #231B24; --surface: #2E232F; --surface-2: #2A2029;
  --ink: #F4ECF4; --ink-2: #D9CCDA; --muted: #9B8A9C;
  --line: rgba(244, 236, 244, .16); --line-soft: rgba(244, 236, 244, .07);
  --violet: #FFB45E; --violet-ink: #FFC98A; --violet-soft: rgba(255, 180, 94, .14);
  --lavender: #B597C2; --lavender-soft: #3A2D3D;
  --peach: #6B4A38; --cream: #5C4A28;
  --yes: #4ADE9E; --yes-soft: rgba(74, 222, 158, .13);
  --no: #FB8B9C; --no-soft: rgba(251, 139, 156, .12);
  --warn: #E8B15E; --warn-soft: rgba(232, 177, 94, .12);
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, .35);
  --shadow-hover: 0 26px 60px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body); color: var(--ink); line-height: 1.55; overflow-x: hidden;
  background: var(--bg);
}
/* film grain over everything — soft paper texture */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--violet); color: #fff; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 1px solid var(--violet); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 300; background: var(--surface); padding: 8px 14px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; }

/* corner-tick motif */
.ticks { position: relative; }
.ticks::before, .ticks::after { content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; transition: border-color .15s; }
.ticks::before { top: -1px; left: -1px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.ticks::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.ticks:hover::before, .ticks:hover::after { border-color: var(--violet); }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: stretch; gap: 28px;
  padding: 0 28px; height: 56px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-mark { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: .05em; }
.live-dot { width: 6px; height: 6px; background: var(--yes); }
.live-dot.err { background: var(--no); }
.live-dot.warn { background: var(--warn); }
.nav-links { display: flex; align-items: stretch; flex: 1; justify-content: center; }
.nav-links a {
  display: flex; align-items: center; position: relative;
  text-decoration: none; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 0 14px; transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--violet); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  transition: border-color .15s, color .15s; position: relative;
}
.icon-btn:hover { border-color: var(--violet); color: var(--violet); }
.icon-btn svg { width: 15px; height: 15px; }
.net-chip { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; white-space: nowrap; }
.btn-connect {
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em;
  background: var(--violet); color: #fff; border: none; padding: 10px 16px;
  transition: filter .15s, transform .12s;
}
.btn-connect:hover { filter: brightness(1.1); }
.btn-connect:active { transform: translateY(1px); }

/* ---------- Session strip ---------- */
.session-strip {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 7px 28px; border-bottom: 1px solid var(--line-soft);
}
.session-strip .dot { width: 6px; height: 6px; background: var(--yes); }
.session-strip .dot.closed { background: var(--warn); }
.session-strip .lbl { color: var(--ink); font-weight: 700; }
.session-strip .sep { color: var(--line); }
.session-strip .tail { margin-left: auto; }

/* ---------- Ticker tape ---------- */
.tape {
  display: flex; gap: 24px; align-items: center;
  padding: 7px 28px; border-bottom: 1px solid var(--line);
  background: var(--surface); overflow-x: auto; scrollbar-width: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; white-space: nowrap;
}
.tape:empty { display: none; }
.tape::-webkit-scrollbar { display: none; }
.tape .ti { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; }
.tape .tt { font-weight: 700; }
.tape .tp { color: var(--muted); }
.tape .up { color: var(--yes); } .tape .dn { color: var(--no); }
.tape .live-tag { color: var(--violet-ink); margin-right: 6px; letter-spacing: .14em; }

/* ---------- Page chrome ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 40px 28px 140px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--violet); border-radius: 50%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 4.5vw, 52px); line-height: .95; letter-spacing: .02em; text-transform: uppercase; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.head-tools { display: flex; gap: 8px; align-items: center; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.search-input {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 12px 9px 12px; transition: border-color .15s, box-shadow .15s;
}
.search-box .search-input { padding-left: 32px; width: 240px; }
.search-input::placeholder { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.search-input:focus, .select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.select {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding: 9px 12px;
}
.sort-select {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding: 9px 12px;
  margin-left: auto;
}

/* ---------- Tabs / chips ---------- */
.tabs { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 16px; border: 1px solid var(--line); width: fit-content; }
.tab {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em; padding: 9px 16px;
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted); transition: all .12s;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { background: var(--ink); color: var(--bg); }
.tab .n { font-size: 9px; opacity: .55; margin-left: 6px; }

.chips { display: contents; }
.chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  padding: 6px 12px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); transition: all .12s;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.active { border-color: var(--violet); color: var(--violet-ink); background: var(--violet-soft); font-weight: 700; }

/* ---------- Panels / tables / stats ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); padding: 22px; box-shadow: 0 1px 0 var(--line-soft), 0 10px 24px -16px color-mix(in srgb, var(--ink) 18%, transparent); }
.panel-title {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.panel-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); padding: 16px; box-shadow: 0 1px 0 var(--line-soft), 0 10px 24px -16px color-mix(in srgb, var(--ink) 18%, transparent); }
.stat-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; }
.stat-sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .mono { font-size: 11px; }
.src, .source-link { font-family: var(--font-mono); font-size: 10.5px; color: var(--violet-ink); text-decoration: none; }
.src:hover, .source-link:hover { text-decoration: underline; }

/* ---------- Ending soon ---------- */
.ending-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--warn); border-left-width: 3px;
  background: var(--warn-soft); padding: 10px 14px; margin-bottom: 22px;
}
.ending-label { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); }
.ending-label svg { width: 13px; height: 13px; }
.ending-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); padding: 6px 10px; font-size: 12px; text-decoration: none; transition: border-color .15s;
}
.ending-chip:hover { border-color: var(--warn); }
.ending-chip .tk { font-family: var(--font-mono); font-weight: 700; font-size: 10.5px; color: var(--violet-ink); }
.ending-chip .cd, .ending-cd { font-family: var(--font-mono); font-size: 10.5px; color: var(--warn); }
.ending-q { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filters-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; }
.result-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Market cards ---------- */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mcard {
  background: var(--surface); border: 1px solid var(--line); padding: 18px;
  cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; text-decoration: none; position: relative; overflow: hidden;
  box-shadow: 0 1px 0 var(--line-soft), 0 10px 24px -14px color-mix(in srgb, var(--ink) 20%, transparent);
  animation: cardIn .4s ease both; animation-delay: calc(var(--i, 0) * 30ms);
}
.mcard:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 1px 0 var(--line-soft), 0 18px 34px -14px color-mix(in srgb, var(--ink) 28%, transparent); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }
/* .mcard has overflow:hidden for the spark canvas — draw corner ticks inside so they are not clipped */
.mcard.ticks::before { top: 0; left: 0; }
.mcard.ticks::after { bottom: 0; right: 0; }
.mcard-edge { position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2; }
.mcard-edge.ending { background: var(--warn); }
.mcard-edge.onchain { background: var(--violet); }
.mcard-spark { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .4; pointer-events: none; animation: sparkFade .9s ease .15s both; }
@keyframes sparkFade { from { opacity: 0; } to { opacity: .4; } }
.live-badge { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn); background: var(--warn-soft); padding: 2px 6px; display: inline-flex; align-items: center; gap: 5px; }
.live-badge::before { content: ""; width: 5px; height: 5px; background: var(--warn); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }
.live-dot { animation: pulse 2.2s infinite; }
.mcard > *:not(.mcard-spark) { position: relative; }
.mcard-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mk-logo, .mcard-logo { width: 20px; height: 20px; object-fit: contain; background: #fff; border: 1px solid var(--line-soft); flex-shrink: 0; }
.mk-logo-fb, .mcard-logo-fb { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: var(--bg); background: var(--ink); }
.mcard-tk { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.mcard-tag { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-soft); padding: 2px 6px; }
.mcard-star { margin-left: auto; background: none; border: none; padding: 4px; color: var(--muted); display: inline-flex; transition: color .15s; flex-shrink: 0; }
.mcard-star svg { width: 15px; height: 15px; }
.mcard-star:hover { color: var(--warn); }
.mcard-star.on { color: var(--warn); }
.mcard-q { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); margin-bottom: 16px; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prob-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.prob-num { font-family: var(--font-display); font-weight: 900; font-size: 38px; line-height: 1; color: var(--yes); font-variant-numeric: tabular-nums; }
.prob-of { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.prob-no { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.prob-no b { color: var(--no); font-weight: 700; }
.odds-bar { display: flex; height: 5px; background: var(--no-soft); margin-bottom: 14px; }
.odds-yes { background: linear-gradient(90deg, var(--yes), color-mix(in srgb, var(--yes) 72%, var(--violet) 28%)); transition: width .45s ease; }
.strike-row {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 8px 0; margin-bottom: 14px; font-family: var(--font-mono); font-size: 10.5px;
}
.strike-row .k { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 8.5px; display: block; }
.strike-row .v { font-weight: 700; font-size: 11.5px; }
.strike-delta { margin-left: auto; font-weight: 700; padding: 3px 8px; font-size: 10px; border: 1px solid; }
.strike-delta.above { color: var(--yes); border-color: var(--yes); background: var(--yes-soft); }
.strike-delta.below { color: var(--no); border-color: var(--no); background: var(--no-soft); }
.mcard-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.btn-outcome {
  flex: 1; font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; padding: 10px; border: 1px solid; transition: all .12s;
}
.btn-outcome:active { transform: translateY(1px); }
.btn-yes { background: var(--yes-soft); color: var(--yes); border-color: var(--yes); }
.btn-yes:hover { background: var(--yes); color: #fff; }
.btn-no { background: var(--no-soft); color: var(--no); border-color: var(--no); }
.btn-no:hover { background: var(--no); color: #fff; }
.btn-outcome.sel { box-shadow: 0 0 0 1px var(--violet); }
.mcard-meta {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: auto; flex-wrap: wrap;
}
.mcard-meta .cd { color: var(--ink); font-weight: 700; }
.mcard-meta .sp { margin-left: auto; }
.mcard-under { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.badge { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid; display: inline-block; }
.badge-trading { color: var(--yes); border-color: var(--yes); }
.badge-closed { color: var(--muted); border-color: var(--line); }
.badge-paused { color: var(--no); border-color: var(--no); }
.badge-warn { color: var(--warn); border-color: var(--warn); }
.badge-resolved_yes, .badge-resolved_no, .badge-resolved { color: var(--violet-ink); border-color: var(--violet); }

/* ---------- Empty state ---------- */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 56px 20px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.empty-state .t { font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; }
.empty-state .d { font-size: 13px; margin-bottom: 18px; }
.empty-state button, .mini-btn {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--violet); color: var(--violet-ink); background: none; padding: 9px 16px; transition: background .12s;
}
.empty-state button:hover, .mini-btn:hover { background: var(--violet-soft); }
.mini-btn.danger { border-color: var(--no); color: var(--no); }
.mini-btn.danger:hover { background: var(--no-soft); }

/* ---------- Market detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.detail-top { grid-column: 1 / -1; }
.detail-main { min-width: 0; }
.detail-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.detail-header { margin-bottom: 8px; }
.detail-head-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-ticker { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.detail-q { font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; line-height: 1.2; margin-bottom: 8px; overflow-wrap: anywhere; }
.detail-meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.prob-head { display: flex; align-items: baseline; gap: 14px; margin: 22px 0 18px; flex-wrap: wrap; }
.prob-big { font-family: var(--font-display); font-weight: 900; font-size: clamp(56px, 7vw, 84px); line-height: .9; color: var(--yes); font-variant-numeric: tabular-nums; }
.prob-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.big-cd { margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: .08em; color: var(--warn); border: 1px solid var(--warn); background: var(--warn-soft); padding: 6px 12px; display: inline-flex; gap: 7px; align-items: center; }
.big-cd svg { width: 13px; height: 13px; }

/* strike track — spot vs strike instrument */
.strike-bar { border: 1px solid var(--line); background: var(--surface); padding: 14px 16px; margin-bottom: 18px; }
.strike-info { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.strike-info .v { font-weight: 700; }
.strike-target { color: var(--muted); }
.strike-track { position: relative; height: 26px; background: var(--surface-2); border: 1px solid var(--line-soft); margin-bottom: 8px; }
.strike-zone { position: absolute; top: 0; bottom: 0; }
.strike-zone.zone-yes { background: var(--yes-soft); }
.strike-zone.zone-no { background: var(--no-soft); }
.strike-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.strike-marker::after { content: "STRIKE"; position: absolute; top: -14px; left: 50%; translate: -50% 0; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .1em; color: var(--muted); }
.strike-dot { position: absolute; top: 50%; width: 10px; height: 10px; translate: -50% -50%; border: 2px solid var(--surface); }
.strike-dot.dot-yes { background: var(--yes); }
.strike-dot.dot-no { background: var(--no); }
.strike-verdict { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.strike-verdict b.yes { color: var(--yes); } .strike-verdict b.no { color: var(--no); }

/* ---------- Trade ticket ---------- */
.ticket .outcome-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.outcome-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.outcome-toggle .btn-yes, .outcome-toggle .btn-no {
  flex: 1; font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; padding: 10px; border: 1px solid; transition: all .12s;
}
.side-note, .side-toggle { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; text-align: center; }
.side-note a, .side-toggle a { color: var(--violet-ink); text-decoration: none; border-bottom: 1px solid var(--violet-ink); }
.trow, .otype-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.trow .seg { display: flex; border: 1px solid var(--line); }
.trow .seg button, .seg button { border: none; border-right: 1px solid var(--line); background: transparent; padding: 5px 10px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.trow .seg button:last-child, .seg button:last-child { border-right: none; }
.trow .seg button.active, .seg button.active { background: var(--ink); color: var(--bg); }
.otype-row select { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding: 5px 8px; }
.amount-input {
  width: 100%; font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; margin-bottom: 8px; box-sizing: border-box;
}
.amount-input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.quick-amounts { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.quick-amounts button { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 5px 10px; }
.quick-amounts button:hover { border-color: var(--ink); color: var(--ink); }
.preview-table { border-top: 1px solid var(--line); margin-bottom: 14px; }
.pr { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11px; flex-wrap: wrap; }
.pr .pk { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 9.5px; }
.trade-submit {
  width: 100%; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; padding: 13px; border: 1px solid; transition: all .12s;
}
.trade-submit:disabled { opacity: .5; cursor: not-allowed; }
.trade-disclaimer { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: var(--muted); text-align: center; margin-top: 10px; text-transform: uppercase; }
.up { color: var(--yes); } .down { color: var(--no); }
.warn-box { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; padding: 9px 12px; border: 1px solid var(--line); margin-bottom: 10px; }
.warn-yellow { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.warn-red { border-color: var(--no); color: var(--no); background: var(--no-soft); }
.limit-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.limit-row input { width: 90px; font-family: var(--font-mono); font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.limit-row label { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.limit-row select { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 6px 8px; }

/* rules / note boxes */
.rules-box { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.rules-box p { margin-bottom: 8px; }
.rules-box code, code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); padding: 1px 5px; border: 1px solid var(--line-soft); }
.note { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line); padding: 10px 14px; margin-top: 14px; }
summary { cursor: pointer; list-style: none; }
.collapsible summary::-webkit-details-marker { display: none; }

/* ---------- Feed (activity) ---------- */
.feed-item { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.feed-item:last-child { border-bottom: none; }
.feed-tag { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--violet-ink); border: 1px solid var(--violet); padding: 2px 7px; flex-shrink: 0; }
.feed-dot { font-size: 9px; flex-shrink: 0; color: var(--violet); }
.feed-text { color: var(--ink-2); }
.feed-text a { color: var(--violet-ink); text-decoration: none; font-weight: 600; }
.feed-text a:hover { text-decoration: underline; }
.feed-time { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ---------- Calendar ---------- */
.cal-day { margin-bottom: 26px; }
.cal-day-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 2px; }
.cal-day-name { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: .03em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.cal-day-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cal-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; transition: background .12s; }
.cal-row:hover { background: var(--surface); }
.cal-tick { font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: .08em; color: var(--violet-ink); width: 56px; flex-shrink: 0; }
.cal-q { font-size: 13.5px; font-weight: 500; flex: 1; min-width: 0; }
.cal-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cal-odds { width: 90px; height: 4px; background: var(--no-soft); }
.cal-odds-fill { height: 100%; background: var(--yes); display: block; }
.cal-pct { font-family: var(--font-mono); font-size: 11px; font-weight: 700; width: 36px; text-align: right; }
.cal-time { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--warn); min-width: 70px; text-align: right; }

/* ---------- Watchlist alert rows ---------- */
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11px; }
.alert-row:last-child { border-bottom: none; }
.alert-row .tk { font-weight: 700; letter-spacing: .08em; width: 56px; flex-shrink: 0; }
.alert-row .q { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-body); font-size: 12px; }
.alert-row input {
  width: 72px; font-family: var(--font-mono); font-size: 11px; padding: 6px 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-align: right;
}
.alert-row input:focus { outline: none; border-color: var(--violet); }

/* ---------- Bottom nav / toasts / notif ---------- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; font-family: var(--font-mono); font-size: 8.5px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 10px 0 8px; border-top: 2px solid transparent;
}
.bottom-nav a svg { width: 18px; height: 18px; }
.bottom-nav a.active { color: var(--violet-ink); border-top-color: var(--violet); }
.toasts, .toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; background: var(--ink); color: var(--bg); border-left: 3px solid var(--violet); padding: 11px 16px; max-width: 340px; animation: toastIn .2s ease; }
.toast.ok { border-left-color: var(--yes); }
.toast.err { border-left-color: var(--no); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }
.notif-badge { position: absolute; top: -5px; right: -5px; background: var(--no); color: #fff; font-size: 8.5px; font-weight: 700; padding: 1px 5px; font-family: var(--font-mono); }
.notif-panel { position: fixed; top: 60px; right: 24px; z-index: 300; width: 320px; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); padding: 14px; display: none; box-shadow: 0 8px 24px rgba(12,18,16,.10); }
.notif-panel.open { display: block; }
.notif-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.notif-head a { color: var(--violet-ink); text-decoration: none; }
.notif-empty { font-size: 12.5px; color: var(--muted); padding: 12px 2px; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.notif-item.unread { background: var(--violet-soft); }
.notif-dot { width: 7px; height: 7px; margin-top: 5px; flex-shrink: 0; background: var(--yes); }
.notif-dot.err { background: var(--no); }
.notif-dot.warn { background: var(--warn); }
.notif-text { flex: 1; line-height: 1.4; }
.notif-ts { font-family: var(--font-mono); font-size: 10px; color: var(--muted); flex-shrink: 0; }

/* ---------- Modal / sheet / search ---------- */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 350;
  align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.modal-backdrop.open { display: flex; }
.modal { width: min(480px, 92vw); max-height: 66vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); padding: 18px; }
.modal .search-input { width: 100%; font-size: 13px; padding: 11px 12px; border: none; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.search-results { padding: 4px 0; }
.search-item { padding: 11px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.search-item:hover { background: var(--violet-soft); }
.search-item .si-t { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--violet-ink); flex-shrink: 0; }
.sheet-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 340; }
.sheet-backdrop.open { display: block; }
.bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 341;
  background: var(--surface); color: var(--ink);
  border-top: 1px solid var(--line); padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .25s ease; max-height: 85vh; overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle { width: 40px; height: 3px; background: var(--line); margin: 0 auto 14px; }

/* ---------- Chart / book / trades ---------- */
.chart-wrap { position: relative; }
.chart-canvas { width: 100%; height: 260px; display: block; }
.chart-ranges { display: flex; gap: 0; margin-top: 10px; align-items: center; border: 1px solid var(--line); width: fit-content; }
.chart-ranges .tab { padding: 5px 12px; font-size: 10px; border-right: 1px solid var(--line); }
.chart-ranges .tab:last-of-type { border-right: none; }
.chart-toggle { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; border: none; }
.ob-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ob-side-title { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.ob-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11.5px; padding: 5px 8px; position: relative; overflow: hidden; }
.ob-row .depth { position: absolute; inset: 0; opacity: .12; pointer-events: none; }
.ob-row span { position: relative; }
.ob-row.ob-h { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 2px; }
.ob-row.ob-h .depth { display: none; }
.ob-ask .depth { background: var(--no); } .ob-bid .depth { background: var(--yes); }
.ob-ask .ob-p { color: var(--no); } .ob-bid .ob-p { color: var(--yes); }
.ob-spread { text-align: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 6px 0; }
.ob-empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 13px; }
.ob-empty-icon { font-size: 26px; margin-bottom: 6px; opacity: .5; }
.ob-empty-sub { font-size: 11px; margin-top: 4px; opacity: .7; }
.trade-row { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.trade-row:last-child { border-bottom: none; }

/* ---------- Oracle rows ---------- */
.oracle-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.oracle-row:last-child { border-bottom: none; }
.oracle-k { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.oracle-v { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.od-ok { color: var(--yes); } .od-warn { color: var(--warn); } .od-bad { color: var(--no); }

/* ---------- Resolution banner ---------- */
.res-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 14px; flex-wrap: wrap; border: 1px solid; }
.res-yes { background: var(--yes-soft); border-color: var(--yes); }
.res-no { background: var(--no-soft); border-color: var(--no); }
.res-outcome { display: flex; align-items: center; gap: 12px; }
.res-check { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: #fff; }
.res-yes .res-check { background: var(--yes); }
.res-no .res-check { background: var(--no); }
.res-title { font-family: var(--font-display); font-size: 20px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }
.res-yes .res-title { color: var(--yes); }
.res-no .res-title { color: var(--no); }
.res-sub { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.res-details { text-align: right; }
.res-price { font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.res-meta { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 560px) { .res-banner { flex-direction: column; align-items: flex-start; } .res-details { text-align: left; } }

/* ---------- Position cards ---------- */
.pos-card { border: 1px solid var(--line); border-left: 3px solid var(--yes); padding: 12px 14px; margin-bottom: 10px; background: var(--yes-soft); }
.pos-card.pos-no { border-left-color: var(--no); background: var(--no-soft); }
.pos-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pos-outcome { font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: .04em; }
.pos-yes .pos-outcome { color: var(--yes); }
.pos-no .pos-outcome { color: var(--no); }
.pos-shares { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.pos-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-bottom: 10px; }
.pos-stats > div { display: flex; justify-content: space-between; font-size: 12px; }
.pos-k { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
.pos-sell { width: 100%; }
.pos-lost { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pos-chain { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; padding: 7px 10px; margin-bottom: 10px; background: var(--violet-soft); border: 1px solid var(--violet); }
.pos-chain .pk { color: var(--violet-ink); font-weight: 600; }

/* ---------- Wallet modal ---------- */
.w-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.w-avatar { width: 42px; height: 42px; flex-shrink: 0; display: inline-block; }
.w-addr { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.w-net { font-size: 10px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.w-bals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.w-bal { background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; text-align: center; }
.w-bal-v { font-size: 18px; font-weight: 700; }
.w-bal-k { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.w-explorer { display: block; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--violet-ink); text-decoration: none; }
.w-explorer:hover { text-decoration: underline; }
.wallet-pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-family: var(--font-body); }
.wallet-pick:hover { border-color: var(--violet); }
.wrap-tab { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; transition: background .15s; }
.wrap-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 6px; }
.wrap-from, .wrap-to { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.wrap-arrow { color: var(--violet); font-weight: 700; font-size: 16px; }
.wrap-bal { text-align: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* ---------- Admin ---------- */
.adm-grid { display: grid; grid-template-columns: 1fr; grid-template-areas: "asset" "question" "strike" "feed" "ends"; gap: 14px 18px; }
.adm-grid > div:nth-child(1) { grid-area: asset; }
.adm-grid > div:nth-child(2) { grid-area: question; }
.adm-grid > div:nth-child(3) { grid-area: strike; }
.adm-grid > div:nth-child(4) { grid-area: feed; }
.adm-grid > div:nth-child(5) { grid-area: ends; }
.adm-grid label { display: block; margin-bottom: 6px; }
.adm-grid .search-input { width: 100%; box-sizing: border-box; }
.field-hint { font-size: 10px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }
@media (min-width: 640px) {
  .adm-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "question question" "asset asset" "strike feed" "ends ends"; }
}
@media (min-width: 1024px) {
  .adm-grid { grid-template-columns: 260px 1fr; grid-template-areas: "asset question" "strike feed" "ends ends"; }
  .adm-grid > div:nth-child(2) .search-input { min-height: 38px; }
}

/* ---------- Misc ---------- */
.backend-banner { position: sticky; top: 0; z-index: 400; background: var(--no); color: #fff; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; padding: 7px 12px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.comment:last-of-type { border-bottom: none; }
.comment-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.comment-ts { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.event-group { margin-bottom: 28px; }
.event-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 2px 12px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.detail-tabs { display: none; }
.detail-section { display: block; }
.sticky-trade { display: none; }
.app-footer { text-align: center; padding: 28px 16px 96px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.app-footer a { color: var(--ink-2); }
.app-footer a:hover { color: var(--violet); }
.foot-links { display: flex; justify-content: center; gap: 22px; margin-bottom: 12px; }
.foot-links a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.foot-links a:hover { color: var(--violet-ink); border-bottom-color: var(--violet); }
.foot-note { color: var(--muted); }
.rpc-status { font-size: 8px; }

/* Skeleton loading */
.skeleton-card { pointer-events: none; min-height: 160px; }
.sk-line { height: 10px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 10px; }
.sk-line.tall { height: 18px; }
.sk-line.w40 { width: 40%; } .sk-line.w80 { width: 80%; } .sk-line.w100 { width: 100%; }
.sk-row { display: flex; gap: 8px; margin-top: 12px; }
.sk-btn { flex: 1; height: 32px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Mobile overflow guards */
.mono, .source-link, .w-addr, .w-explorer, .detail-meta, .mcard-meta, .mcard-under { overflow-wrap: anywhere; word-break: break-word; }
.amount-input, .search-input, #tpAmount, #smAmount, #wrapAmt { width: 100%; box-sizing: border-box; }
.data-table-wrap, .panel { overflow-x: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; } }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .bottom-nav { display: flex; }
  .view { padding: 28px 16px 120px; }
  .net-chip { display: none; }
  .search-box .search-input { width: 160px; }
}
@media (max-width: 768px) {
  .detail-side .trade-panel-desktop { display: none; }
  .sticky-trade {
    position: fixed; bottom: 58px; left: 0; right: 0; z-index: 105;
    display: flex; gap: 10px; padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .sticky-trade .btn-yes, .sticky-trade .btn-no {
    flex: 1; font-family: var(--font-mono); font-weight: 700; font-size: 13px;
    letter-spacing: .1em; text-transform: uppercase; padding: 14px; border: 1px solid; min-width: 0;
  }
  .detail-tabs { display: flex; gap: 0; margin: 16px 0; flex-wrap: nowrap; overflow-x: auto; border: 1px solid var(--line); width: fit-content; max-width: 100%; }
  .detail-section { display: none; }
  .detail-section.visible { display: block; }
  .ob-cols { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .data-table { font-size: 11px; }
  .data-table th:nth-child(n+5), .data-table td:nth-child(n+5) { display: none; }
  .toast-container, .toasts { bottom: 140px; right: 12px; left: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 560px) {
  .tape { display: none; }
  .head-tools { width: 100%; }
  .search-box { flex: 1; }
  .search-box .search-input { width: 100%; }
  .market-grid { grid-template-columns: 1fr; }
  .icon-btn { width: 44px; height: 44px; }
  .tabs { max-width: 100%; overflow-x: auto; }
  .cal-odds { display: none; }
  .cal-q { font-size: 12.5px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .quick-amounts { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, .mcard, .odds-yes { transition: none !important; animation: none !important; } }

/* ============================================================
   SOFT ORGANIC pass — rounded editorial surfaces on HUD layout
   ============================================================ */
/* Corner ticks read as HUD chrome — drop them under the soft style */
.ticks::before, .ticks::after { display: none; }

/* Typography: rounded geometric feel */
.page-title {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
  text-transform: none; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.08;
  margin-bottom: 26px; max-width: 640px;
}
.page-head .page-title { margin-bottom: 0; }
.eyebrow { margin-bottom: 10px; }
.prob-big, .prob-num, .stat-value { font-family: var(--font-display); font-weight: 800; }
.brand-mark { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; }

/* Surfaces */
.panel, .stat-card, .empty-state, .strike-bar, .modal, .notif-panel {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}
.mcard {
  border-radius: var(--radius-card); border-color: var(--line);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
}
.mcard:hover { border-color: transparent; transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.mcard:has(.mcard-edge.ending) { background: linear-gradient(150deg, #FFDCA8 0%, #FFB45E 55%, #FF9148 100%); }
.mcard:has(.mcard-edge.ending) .mcard-q, .mcard:has(.mcard-edge.ending) .mcard-tk { color: #4A304D; }
.mcard:has(.mcard-edge.ending) .mcard-tag, .mcard:has(.mcard-edge.ending) .mcard-meta { color: rgba(74,48,77,.7); }
.mcard:has(.mcard-edge.onchain) { background: linear-gradient(150deg, var(--surface) 30%, var(--lavender-soft) 100%); }
.mcard-edge { display: none; }

/* Ticket panel gets a soft lavender wash */
.panel.ticket { background: linear-gradient(165deg, var(--surface) 40%, var(--lavender-soft) 100%); }

/* Pill controls */
.btn-connect, .mini-btn, .empty-state button, .quick-amounts button,
.btn-outcome, .trade-submit, .pos-sell, .icon-btn, .mcard-star,
.chip, .ending-chip, .mcard-tag, .badge, .live-badge, .tape .ti {
  border-radius: var(--radius-pill);
}
.trade-submit { box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ink) 30%, transparent); }
.btn-outcome.btn-yes:hover { box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--yes) 60%, transparent); }
.btn-outcome.btn-no:hover { box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--no) 60%, transparent); }

/* Segmented controls become capsule groups */
.tabs, .chart-ranges { border-radius: var(--radius-pill); overflow: hidden; border-color: var(--line); }
.tab.active { background: var(--ink); color: var(--surface); }

/* Inputs */
.search-input, .amount-input, .select, .alert-row input,
.limit-row input, .limit-row select, .otype-row select, .search-box {
  border-radius: var(--radius-sm);
}
.search-box .search-input { border-radius: var(--radius-pill); }

/* Bars */
.odds-bar, .cal-odds { height: 8px; border-radius: var(--radius-pill); }
.odds-yes, .cal-odds-fill { border-radius: var(--radius-pill); }
.strike-track { border-radius: var(--radius-pill); overflow: hidden; }
.strike-dot { border-radius: var(--radius-pill); }

/* Nav chrome */
.nav { background: color-mix(in srgb, var(--bg) 80%, transparent); }
.session-strip { background: var(--surface); }
.bottom-nav { border-top-left-radius: 20px; border-top-right-radius: 20px; box-shadow: 0 -10px 30px rgba(78,52,74,.08); }
.bottom-nav a.active { border-radius: var(--radius-sm); }
.bottom-sheet { border-top-left-radius: 28px; border-top-right-radius: 28px; }
.toast { border-radius: var(--radius-sm); }
.res-banner { border-radius: var(--radius-card); }
.mcard-star { border-radius: var(--radius-pill); }

/* Soft table rows */
.data-table th { border-radius: 0; }
.pos-card { border-radius: var(--radius-sm); }

/* Landing-style pill CTA inside app modals */
.wallet-pick { border-radius: var(--radius-sm); }

/* Tape pills */
.tape .ti { background: var(--surface); border: 1px solid var(--line); padding: 4px 14px; }

/* Skeleton + misc */
.skeleton-card { border-radius: var(--radius-card); }
.sk-line, .sk-btn { border-radius: var(--radius-sm); }
.net-chip, .session-strip .dot, .live-dot, .live-badge::before, .oracle-dot { border-radius: var(--radius-pill); }

/* Rounding leftovers */
.rules-box, .warn-box, .note, .w-bal, .wrap-row, .big-cd, .feed-tag,
.mk-logo, .mk-logo-fb, .mcard-logo, .mcard-logo-fb, .skip:focus {
  border-radius: var(--radius-sm);
}
.trow .seg { border-radius: var(--radius-pill); overflow: hidden; }
.detail-tabs { border-radius: var(--radius-pill); }
.rules-box { border-radius: var(--radius-card); }

/* ---------- Mobile polish ---------- */
@media (max-width: 768px) {
  .notif-panel { left: 12px; right: 12px; width: auto; top: 58px; }
  .prob-big { font-size: clamp(44px, 14vw, 72px); }
  .page-title { font-size: clamp(26px, 7.5vw, 34px); }
}
@media (max-width: 560px) {
  .nav { padding: 0 12px; gap: 6px; justify-content: space-between; }
  .nav-brand { flex: 0 0 auto; }
  .nav-right { flex: 0 0 auto; gap: 5px; }
  .brand-logo { height: 28px; }
  .brand-mark { font-size: 16px; }
  .icon-btn { width: 38px; height: 38px; }
  .btn-connect { padding: 8px 11px; font-size: 9.5px; letter-spacing: .06em; }
  .session-strip { padding: 6px 14px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .session-strip::-webkit-scrollbar { display: none; }
  .ending-strip { overflow-x: auto; scrollbar-width: none; }
  .ending-strip::-webkit-scrollbar { display: none; }
  .stat-value { font-size: 24px; }
  .view { padding: 22px 14px 130px; }
  .res-banner { padding: 14px; }
  .detail-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .tabs, .chart-ranges { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .tabs::-webkit-scrollbar, .chart-ranges::-webkit-scrollbar { display: none; }
}
@media (max-width: 400px) {
  .icon-btn { width: 34px; height: 34px; }
  .brand-mark { font-size: 14px; }
}
