:root {
  --bg:      #0d1117;
  --surf1:   #161b22;
  --surf2:   #1c2128;
  --surf3:   #21262d;

  --border:  #30363d;
  --border2: #21262d;

  --text:    #e6edf3;
  --muted:   #b0bac4;
  --muted2:  #8b949e;

  --blue:     #2f81f7;
  --blue-dim: rgba(47,129,247,.10);

  --green:    #3fb950;  /* matches --low — use for positive data values */
  --accent:   #38d39f;  /* teal — use for UI chrome only (badges, highlights) */

  --high:     #f85149;
  --med:      #d29922;
  --low:      #3fb950;

  /* IV Rank scale — NEUTRAL blue intensity (cheap → expensive). NOT a danger
     light: red/amber/green is reserved for Risk Score only. Bands at 70/45. */
  --iv-hi:    #3b9eff;  /* high IV rank = expensive options */
  --iv-mid:   #5e86b3;  /* moderate */
  --iv-lo:    #717d8a;  /* low IV rank = cheap options */

  --high-dim: rgba(248,81,73,.10);
  --med-dim:  rgba(210,153,34,.10);
  --low-dim:  rgba(63,185,80,.10);

  --radius:  8px;
  --radius2: 6px;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Layout ── */

.wrap {
  width: 97vw;
  max-width: 1920px;
  margin: 20px auto 60px;
}

/* ── Two-column desktop layout ── */
.app-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.app-col-left,
.app-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow-x: hidden;
}

@media (max-width: 960px) {
  .app-cols {
    grid-template-columns: 1fr;
  }
}

.topbar {
  width: 97vw;
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

/* ── Quota banner (free users) ── */
.quota-banner {
  width: 100%;
  background: var(--surf2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 3%;
  font-size: 12px;
  box-sizing: border-box;
}
.quota-banner.hidden { display: none; }
.qb-bar-wrap {
  flex: 1;
  max-width: 160px;
  height: 5px;
  border-radius: 99px;
  background: var(--surf3, var(--border));
  overflow: hidden;
}
.qb-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--blue);
  transition: width .4s ease, background .4s ease;
}
.qb-text { color: var(--muted); white-space: nowrap; }
.qb-upgrade {
  margin-left: auto;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.qb-upgrade:hover { text-decoration: underline; }

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
  cursor: pointer;
}

.brand:hover .logo { background: #388bfd; }
.brand:hover .brand-title { color: var(--blue); }

.logo {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -.5px;
}

.brand-title { font-weight: 600; font-size: 15px; }

/* ── Cards ── */

.card {
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ── Tool cards (single ticker / market scanner) ── */

.tool-card-scan    { border-top: 3px solid #2f81f7; }
.tool-card-scanner { border-top: 3px solid #38d39f; }

/* OR divider between the two cards */
.tools-or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  color: var(--muted2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tools-or-divider::before,
.tools-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Tool badge labels */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.tool-badge-scan    { background: rgba(47,129,247,.12); color: #2f81f7; border: 1px solid rgba(47,129,247,.25); }
.tool-badge-scanner { background: rgba(56,211,159,.10); color: #38d39f; border: 1px solid rgba(56,211,159,.22); }

/* ── Hero ── */

.hero h1 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-scan {
  height: 34px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius2);
  min-width: 90px;
  white-space: nowrap;
  background: var(--blue);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.hero-scan:hover { background: #388bfd; }

.controls {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.caption {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 4px;
}

input, select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,129,247,.08);
}

/* ── Buttons ── */

.btn {
  border-radius: var(--radius2);
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius2);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: border-color .12s, color .12s;
}

.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.btn-ghost.watching {
  border-color: #f0b429;
  color: #f0b429;
  background: rgba(240,180,41,.1);
}

.spinner {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  display: none;
}

.btn.is-loading .spinner {
  display: inline-block;
  animation: spin .65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ── */

.result { margin-top: 12px; }

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.result-left { flex: 1; min-width: 0; overflow-x: hidden; }

.kicker {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.company {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color .3s ease;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.export-btn { }

/* ── Score box ── */

.scorebox {
  min-width: 175px;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex-shrink: 0;
  text-align: center;
}

.scorelabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.scorenum {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  font-variant-numeric: tabular-nums;
}

.scoreband {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.conf {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.score-vol-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
  font-style: italic;
  opacity: .75;
}

.sparkline-wrap { margin-top: 8px; }
.sparkline-label { font-size: 10px; color: var(--muted2); margin-top: 1px; }

/* ── Score ring ── */

.score-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 8px auto 2px;
}

.score-ring {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke: var(--low);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset .65s cubic-bezier(.25,.46,.45,.94), stroke .3s ease;
}

.score-ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Company logo ── */

.company-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Skeleton / scanning state ── */

@keyframes skel-shimmer {
  0%, 100% { opacity: .3; }
  50%       { opacity: .75; }
}

@keyframes ring-spin {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(270deg); }
}

.result.scanning > *:not(.result-top) { visibility: hidden; }

/* Spin the whole SVG — bg is a full circle so rotation is invisible on it;
   only the partial fill arc visibly rotates, making a clear spinner */
.result.scanning .score-ring {
  animation: ring-spin 1.1s linear infinite;
}

.result.scanning .score-ring-fill {
  stroke: var(--blue) !important;
  stroke-dasharray: 82, 244.73 !important;
  stroke-dashoffset: 0 !important;
  transition: none !important;
  animation: none !important;
}

.result.scanning .scorenum,
.result.scanning .scoreband {
  color: var(--muted2) !important;
  animation: skel-shimmer 1.5s ease-in-out infinite;
}

.result.scanning #companyNameText {
  color: var(--muted);
  animation: skel-shimmer 1.5s ease-in-out infinite;
}

/* ── Fundamentals row ── */

.fund-row {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surf2);
  margin-top: 12px;
  overflow: hidden;
}

.fund-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.fund-sep { width: 1px; background: var(--border); align-self: stretch; }

.fund-icon { font-size: 16px; }

.fund-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.fund-value { font-size: 13px; font-weight: 600; margin-top: 2px; }

.fund-in-window { color: var(--high); }
.fund-elevated   { color: var(--med); }
.fund-normal     { color: var(--low); }

/* ── Summary ── */

.summary-wrap {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf2);
}

.summary-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Recommendation ── */

.rec-box {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surf2);
}

.rec-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.rec-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

.rec-strategy {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.rec-headline { font-size: 13px; font-weight: 700; margin-top: 2px; }

.rec-bullets {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-bullets li { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── Sections ── */

.sep { border: 0; height: 1px; background: var(--border); margin: 14px 0; }

h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ── Breakdown — table style ── */

.breakdown {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
}

.break-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border2);
  background: var(--surf2);
}

.break-row:last-child { border-bottom: none; }
.break-row:nth-child(even) { background: var(--surf3); }

/* ── Expandable breakdown rows ── */
.break-details {
  border: none;
  border-radius: 0;
  background: transparent;
  margin-bottom: 0;
}
.break-details:last-child > summary.break-row { border-bottom: none !important; }
.break-details > summary.break-row {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  transition: color .15s, background .15s, border-color .15s;
}
.break-details > summary.break-row:hover {
  color: var(--text);
  background: rgba(47,129,247,.07);
  border-bottom-color: rgba(47,129,247,.4);
}
.break-details[open] > summary.break-row {
  background: rgba(47,129,247,.07);
  border-bottom-color: rgba(47,129,247,.4);
}
.break-chev {
  font-size: 18px;
  color: var(--blue);
  display: inline-block;
  transition: transform .15s;
  margin-left: 6px;
  opacity: 0.85;
  vertical-align: middle;
  line-height: 1;
}
.break-details[open] .break-chev { transform: rotate(180deg); }
.break-items {
  background: rgba(0,0,0,.15);
  padding: 6px 0 8px;
  border-top: 1px solid var(--border2);
}

.break-title { font-size: 12px; font-weight: 600; }

.break-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", monospace;
  font-variant-numeric: tabular-nums;
}

/* ── Timeline ── */

.timeline-section { margin-bottom: 4px; }

.timeline-dates {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted2);
  margin-bottom: 5px;
  font-family: ui-monospace, "SF Mono", monospace;
}

.timeline-track {
  position: relative;
  height: 26px;
  border-radius: var(--radius2);
  background: var(--surf3);
  border: 1px solid var(--border);
  overflow: visible;
}

.timeline-track::after {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
  transform: translateY(-50%);
}

.tl-marker {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 26px;
  z-index: 2;
}

.tl-marker.tl-today  { background: var(--blue); }
.tl-marker.tl-expiry { background: var(--muted2); }

.tl-event {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  z-index: 3;
  cursor: pointer;
  transition: transform .12s;
}

.tl-event:hover { transform: translate(-50%, -50%) scale(1.5); }

.tl-event.tl-news     { background: var(--high); }
.tl-event.tl-clinical { background: var(--med); }
.tl-event.tl-legal    { background: #58a6ff; }
.tl-event.tl-sec      { background: #bc8cff; }
.tl-event.tl-earnings { background: #e3b341; }

.tl-label-today, .tl-label-expiry {
  position: absolute;
  top: 100%; margin-top: 3px;
  font-size: 10px; color: var(--muted2);
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", monospace;
}

.timeline-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 18px;
  font-size: 11px; color: var(--muted);
}

.leg-item { display: flex; align-items: center; gap: 5px; }

.leg-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

.leg-dot.tl-news     { background: var(--high); }
.leg-dot.tl-clinical { background: var(--med); }
.leg-dot.tl-legal    { background: #58a6ff; }
.leg-dot.tl-sec      { background: #bc8cff; }
.leg-dot.tl-earnings { background: #e3b341; }
.leg-dot.tl-today    { background: var(--blue);   border-radius: 1px; width: 2px; height: 8px; }
.leg-dot.tl-expiry   { background: var(--muted2); border-radius: 1px; width: 2px; height: 8px; }

/* ── Accordion ── */

details {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surf2);
  margin-bottom: 6px;
}

details.news-negative { border-color: rgba(248,81,73,.35); }
details.news-negative summary { color: #f85149; }
details.news-negative .chev { color: #f85149; }

details.news-positive { border-color: rgba(63,185,80,.35); }
details.news-positive summary { color: #3fb950; }
details.news-positive .chev { color: #3fb950; }

summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center;
  justify-content: space-between;
  font-weight: 600; font-size: 12px;
  padding: 9px 12px;
  user-select: none;
  color: var(--text);
}

summary::-webkit-details-marker { display: none; }

.summary-left { display: flex; align-items: center; gap: 8px; }
.summary-right { display: flex; align-items: center; gap: 8px; }

.chev {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2);
  font-size: 11px;
  flex-shrink: 0;
  transition: transform .15s;
}

details[open] .chev { transform: rotate(180deg); }

/* ── Items ── */

.item {
  margin: 8px 12px;
  padding: 9px 11px;
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  background: var(--surf3);
}

.item-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }

.item-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  color: var(--muted); font-size: 12px;
}

.date-strong {
  font-weight: 600;
  color: var(--blue);
  font-family: ui-monospace, "SF Mono", monospace;
}

/* ── Badges ── */

.badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .03em;
}

.badge.high { background: var(--high-dim); color: var(--high); }
.badge.med  { background: var(--med-dim);  color: var(--med);  }
.badge.low  { background: var(--low-dim);  color: var(--low);  }

/* ── Peers ── */

.peers-wrap { margin-top: 4px; }
.peers-hint { font-size: 11px; color: var(--muted2); margin-bottom: 8px; }
.peers-list { display: flex; flex-wrap: wrap; gap: 6px; }

.peer-btn {
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s, color .12s, background .12s;
}

.peer-btn:hover  { border-color: var(--blue); color: var(--blue); }
.peer-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }

/* ── Comparison ── */

.compare-card { margin-top: 12px; }

.compare-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}

.compare-header h2 { margin: 0; }

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.cmp-item {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surf2);
  padding: 12px;
  position: relative;
}

.cmp-ticker  { font-size: 16px; font-weight: 700; }
.cmp-company { font-size: 11px; color: var(--muted); margin-top: 2px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cmp-score {
  font-size: 28px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.cmp-score.HIGH   { color: var(--high); }
.cmp-score.MEDIUM { color: var(--med); }
.cmp-score.LOW    { color: var(--low); }

.cmp-band    { font-size: 11px; font-weight: 700; margin-top: 1px; }
.cmp-signals { margin-top: 8px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.cmp-loading { color: var(--muted2); font-size: 12px; padding: 14px 0; }

.cmp-remove {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none;
  color: var(--muted2); cursor: pointer;
  font-size: 12px; padding: 0; line-height: 1;
}

.cmp-remove:hover { color: var(--high); }

/* ── Status / Toast ── */

.statusline {
  margin-top: 10px; padding: 6px 12px;
  border-radius: var(--radius2); font-size: 12px;
  border: 1px solid transparent;
}

.statusline.ok  { background: var(--low-dim);  color: var(--low);  border-color: rgba(63,185,80,.18); }
.statusline.err { background: var(--high-dim); color: var(--high); border-color: rgba(248,81,73,.18); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 7px 16px; border-radius: var(--radius2);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  z-index: 999; pointer-events: none;
  border: 1px solid transparent;
  font-family: inherit;
}

.toast.ok  { background: #1a2f1e; color: var(--low);  border-color: rgba(63,185,80,.2); }
.toast.err { background: #2f1a1a; color: var(--high); border-color: rgba(248,81,73,.2); }

/* ── Metrics section ── */

.metrics-wrap {
  display: flex; flex-direction: column; gap: 18px;
  margin: 6px 0;
}

.metrics-chart-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}

/* Price chart */
.metrics-chart-box { width: 100%; }
.price-chart { width: 100%; height: 70px; display: block; }
.price-chart-ends {
  display: flex; justify-content: space-between;
  margin-top: 3px;
}
.chart-end-label { font-size: 11px; color: var(--muted2); }

/* 52w range */
.week52-box { width: 100%; }
.week52-row { display: flex; align-items: center; gap: 8px; }
.week52-edge { font-size: 11px; color: var(--muted); white-space: nowrap; }
.week52-track {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--surf2); position: relative;
}
.week52-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); border: 2px solid var(--surf1);
}
.week52-pct { font-size: 11px; color: var(--muted2); margin-top: 4px; }

/* HV vs IV bars */
.hv-iv-box { width: 100%; margin-top: 14px; }
.hv-iv-bars { display: flex; flex-direction: column; gap: 6px; }
.hv-iv-row { display: flex; align-items: center; gap: 8px; }
.hv-iv-lbl { font-size: 11px; color: var(--muted); width: 36px; flex-shrink: 0; }
.hv-iv-track {
  flex: 1; height: 8px; border-radius: 4px;
  background: var(--surf2); overflow: hidden;
}
.hv-iv-fill {
  height: 100%; border-radius: 4px;
  width: 0%; transition: width .5s ease;
}
.hv-iv-fill.hv { background: var(--muted); }
.hv-iv-fill.iv { background: var(--blue); }
.hv-iv-num { font-size: 12px; font-weight: 600; color: var(--text); width: 42px; text-align: right; flex-shrink: 0; }
.hv-iv-signal {
  font-size: 12px; margin-top: 6px; font-weight: 500;
}
.hv-iv-signal.iv-rich   { color: #3fb950; }  /* IV > HV — good for sellers */
.hv-iv-signal.iv-thin   { color: #e3b341; }  /* IV < HV — caution for sellers */
.hv-iv-signal.fair      { color: var(--muted); }

/* Health grid */
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.health-item {
  background: var(--surf2); border-radius: var(--radius2);
  padding: 10px 12px;
}
.health-lbl { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.health-val { font-size: 14px; font-weight: 700; color: var(--text); }
.health-val.positive { color: #3fb950; }
.health-val.negative { color: #f85149; }
.health-val.warning  { color: #e3b341; }

/* Section collapse toggles (Options Signals, Company Fundamentals) */
.section-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 0;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.section-collapse-toggle:hover { color: var(--text); border-color: rgba(47,129,247,.4); }
.section-collapse-toggle > span:first-child {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.collapse-arrow { font-size: 10px; flex-shrink: 0; }
.collapse-body { padding-top: 10px; }

/* Dividends collapsible toggle */
.health-div-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.health-div-toggle:hover { color: var(--text); border-color: rgba(47,129,247,.4); }
.div-toggle-arrow { font-size: 10px; transition: transform .2s; }
.health-div-group { margin-top: 6px; }

/* Scan + scanner taglines */
.scan-tagline {
  margin: -4px 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.scanner-tagline {
  margin: -8px 0 12px;
  font-size: 12px;
  color: var(--muted2);
}

@media (max-width: 720px) {
  .health-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .health-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Options Signals panel ── */
.opt-signals-wrap {
  margin-top: 14px;
  margin-bottom: 6px;
}
.opt-signals-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.opt-signals-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted2);
}
.unusual-vol-badge {
  font-size: 11px;
  font-weight: 700;
  color: #e3b341;
  background: rgba(227,179,65,.12);
  border: 1px solid rgba(227,179,65,.3);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.opt-signals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.opt-signal-item {
  background: var(--surf3);
  border-radius: var(--radius2);
  padding: 9px 11px;
}
.opt-signal-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
  cursor: help;
}
.opt-signal-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", monospace;
}
.opt-signal-val.skew-pos { color: #f85149; }  /* puts > calls = bearish lean */
.opt-signal-val.skew-neg { color: #3fb950; }  /* calls > puts = bullish lean */

/* Term Structure */
.term-structure-box { }
.term-structure-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted2);
  margin-bottom: 8px;
}
.term-structure-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ts-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ts-bar-wrap {
  width: 100%;
  height: 48px;
  background: var(--surf3);
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.ts-bar {
  width: 100%;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  transition: height .3s ease;
  opacity: .75;
}
.ts-bar.ts-bar-active { opacity: 1; background: var(--blue); }
.ts-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", monospace;
}
.ts-lbl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 720px) {
  .opt-signals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Contact type custom dropdown ── */
.ctype-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 2px;
}
.ctype-trigger {
  width: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--surf3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  cursor: pointer; user-select: none;
  transition: border-color .15s;
}
.ctype-trigger:hover { border-color: rgba(47,129,247,.4); }
.ctype-dropdown.open .ctype-trigger {
  border-color: var(--blue);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.ctype-chevron {
  font-size: 12px; color: var(--muted);
  transition: transform .15s;
}
.ctype-dropdown.open .ctype-chevron { transform: rotate(180deg); }
.ctype-menu {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--surf3);
  border: 1px solid var(--blue);
  border-top: none;
  border-bottom-left-radius: var(--radius2);
  border-bottom-right-radius: var(--radius2);
  overflow: hidden;
}
.ctype-option {
  padding: 9px 12px;
  font-size: 14px; color: var(--muted);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.ctype-option:hover { background: rgba(47,129,247,.1); color: var(--text); }
.ctype-option.selected { color: var(--blue); font-weight: 600; }

/* ── Disclaimer / Footer ── */

.page-disclaimer {
  margin-top: 14px;
  border: 1px solid rgba(210,153,34,.18);
  background: rgba(210,153,34,.04);
  border-radius: var(--radius2);
  padding: 9px 12px;
  color: rgba(210,153,34,.75);
  font-size: 11px;
}

.footer {
  margin-top: 12px; text-align: center;
  color: var(--muted2); font-size: 11px;
}

.hidden { display: none !important; }

/* Inline line-icons (icons.js) — replace decorative emoji, inherit text color+size */
.tr-ico { display: inline-flex; align-items: center; justify-content: center; vertical-align: -0.14em; line-height: 0; }
.tr-ico svg { width: 1em; height: 1em; display: block; }

.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.quick-picks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qp-label { font-size: 11px; color: var(--muted2); margin-right: 2px; }
.qp-chip {
  font-size: 12px; font-weight: 600; font-family: ui-monospace, "SF Mono", monospace;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surf3);
  color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s;
}
.qp-chip:hover { border-color: var(--blue); color: var(--blue); }

/* ── Topbar right ── */

.topbar { justify-content: space-between; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-pricing-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  transition: color .15s, border-color .15s;
}
.topbar-pricing-link:hover { color: var(--text); border-color: var(--muted2); }

/* ── Auth bar (topbar) ── */

.auth-bar { display: flex; align-items: center; gap: 8px; }

.auth-bar .quota-pill {
  font-size: 12px; color: var(--muted2);
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 4px 10px;
  text-align: center;
  font-family: ui-monospace, "SF Mono", monospace;
  transition: color .3s, border-color .3s, background .3s;
}

.auth-bar .quota-pill.warn {
  color: var(--med);
  border-color: rgba(210,153,34,.5);
  background: rgba(210,153,34,.08);
}

.auth-bar .quota-pill.danger {
  color: var(--high);
  border-color: rgba(248,81,73,.5);
  background: rgba(248,81,73,.08);
  font-weight: 700;
  animation: pill-pulse 2s ease-in-out infinite;
}

@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}
.auth-bar .quota-pill.pro-pill {
  color: #f0b429;
  background: rgba(240,180,41,.12);
  border-color: rgba(240,180,41,.45);
  font-size: 13px; font-weight: 700;
  letter-spacing: .02em; padding: 2px 12px;
}

/* ── Modal overlay ── */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px;
  overflow-y: auto;            /* tall modals scroll within the overlay */
  -webkit-overflow-scrolling: touch;
}

.modal {
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%; max-width: 380px;
  position: relative;
  margin: auto;                /* centers when it fits; top stays reachable when taller */
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  z-index: 2;
  background: none; border: 1.5px solid rgba(47,129,247,.35);
  border-radius: 6px;
  color: var(--blue);
  font-size: 14px; font-weight: 700;
  cursor: pointer; line-height: 1; padding: 4px 8px;
  transition: background .15s, border-color .15s;
}
.modal-close:hover {
  background: rgba(47,129,247,.12);
  border-color: var(--blue);
}

/* ── Modal tabs ── */

.modal-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.modal-tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 8px 0; cursor: pointer; font-family: inherit;
  margin-bottom: -1px; transition: color .12s, border-color .12s;
}

.modal-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── Modal body ── */

.modal-body { display: flex; flex-direction: column; gap: 10px; }

.modal-body input {
  width: 100%; height: 38px;
  padding: 0 12px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf2);
  color: var(--text); font-size: 13px;
  outline: none; font-family: inherit;
}

.modal-body input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,129,247,.08); }

.modal-error {
  background: var(--high-dim); color: var(--high);
  border: 1px solid rgba(248,81,73,.2);
  border-radius: var(--radius2); padding: 7px 10px;
  font-size: 12px;
}

.modal-success {
  background: rgba(56,211,159,.1); color: #38d39f;
  border: 1px solid rgba(56,211,159,.25);
  border-radius: var(--radius2); padding: 7px 10px;
  font-size: 12px; line-height: 1.5;
}

.modal-note { font-size: 11px; color: var(--muted2); text-align: center; margin-top: 2px; }
/* Prominent reassurance line under the register CTA — counters "free trial = they'll charge me" anxiety. */
.reg-reassure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--green); margin-top: 10px; }
.reg-reassure .tr-ico { font-size: 14px; }

.modal-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted2); font-size: 11px;
}
.modal-divider::before, .modal-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Google button ── */

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 38px; border-radius: var(--radius2);
  border: 1px solid var(--border); background: var(--surf2);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none; font-family: inherit;
  transition: background .12s, border-color .12s;
}
.btn-google:hover { background: var(--surf3); border-color: var(--blue); }

/* ── Primary full-width button ── */

.btn-primary-full {
  width: 100%; height: 38px;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius2);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.btn-primary-full:hover { background: #388bfd; }
.btn-primary-full:disabled { opacity: .6; cursor: not-allowed; }

/* ── Upgrade modal ── */

.upgrade-header { text-align: center; margin-bottom: 14px; }
.upgrade-icon { font-size: 28px; margin-bottom: 6px; }
.upgrade-header h2 { margin: 0; font-size: 18px; }

/* ── Plan selector ── */

.plan-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.plan-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
  background: var(--surf2);
}

.plan-card:hover {
  border-color: var(--blue);
}

.plan-card-active {
  border-color: var(--blue) !important;
  background: rgba(88,166,255,.06);
}

.plan-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.plan-badge-best {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.plan-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", monospace;
  line-height: 1.1;
}

.plan-card-active .plan-price { color: var(--blue); }

.plan-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.plan-billing {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
}

.upgrade-features {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.upgrade-features li { font-size: 13px; color: var(--text); }
.upgrade-features li strong { color: var(--text); }
.uf-note { font-size: 11px; color: var(--muted); margin-left: 5px; }
.upgrade-free-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: -6px 0 14px;
  line-height: 1.5;
}

.refund-badge {
  text-align: center;
  font-size: 12px;
  color: var(--low);
  margin: 8px 0 4px;
  font-weight: 500;
}

.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  cursor: pointer;
}

.disclaimer-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--blue);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.disclaimer-check a {
  color: var(--blue);
  text-decoration: none;
}

.disclaimer-check a:hover { text-decoration: underline; }

/* ── Quota wall (shown when limit hit) ── */

.quota-wall {
  margin-top: 12px; padding: 16px;
  border: 1px solid rgba(210,153,34,.25);
  background: rgba(210,153,34,.05);
  border-radius: var(--radius);
  text-align: center;
}
.quota-wall-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.quota-wall-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.quota-wall-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── Alert indicator (inline in result-actions) ── */

.alert-count {
  color: var(--high);
  font-size: 10px; font-weight: 700;
  margin-left: 3px;
}

/* ── Alert threshold picker popover ── */

.alert-picker-popover {
  position: absolute;
  z-index: 600;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-width: 228px;
  max-width: calc(100vw - 16px);
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.ap-title {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.ap-custom-row { margin-bottom: 10px; }
.ap-custom-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surf1);
  color: var(--text);
  font-size: 13px;
}
.ap-custom-input:focus { border-color: var(--blue); outline: none; }
.ap-custom-input::placeholder { color: var(--muted); }
.ap-custom-input.ap-locked {
  opacity: .55;
  cursor: pointer;
  border-style: dashed;
}
.ap-custom-input.ap-locked::placeholder { color: var(--yellow, #f0b429); }
.ap-set-btn { width: 100%; font-size: 13px; padding: 8px 0; }
.ap-field { margin-bottom: 10px; }
.ap-label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ap-cur-hint { color: var(--muted2); font-weight: 400; margin-left: 4px; }
.ap-select {
  width: 100%; padding: 7px 9px; background: var(--surf1); border: 1px solid var(--border);
  border-radius: var(--radius2); color: var(--text); font-size: 13px; cursor: pointer;
}
.ap-select:focus { border-color: var(--blue); outline: none; }
.ap-dir-row { display: flex; gap: 6px; }
.ap-dir-btn {
  flex: 1; padding: 6px 0; background: var(--surf1); border: 1px solid var(--border);
  border-radius: var(--radius2); color: var(--muted); font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.ap-dir-btn:hover { border-color: var(--blue); color: var(--blue); }
.ap-dir-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); font-weight: 600; }

/* ── Profile dropdown ── */

.profile-btn { gap: 4px; }

.profile-dropdown {
  position: absolute;
  z-index: 500;
  width: 280px;
  max-width: calc(100vw - 16px);
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  overflow: hidden;
}

.dp-header {
  padding: 14px 16px 12px;
  background: var(--surf2);
  border-bottom: 1px solid var(--border);
}

.dp-name {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}

.dp-email { font-size: 11px; color: var(--muted2); margin-bottom: 10px; }

.dp-plan {
  font-size: 10px; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; letter-spacing: .06em; text-transform: uppercase;
}
.dp-plan.pro {
  background: rgba(240,180,41,.18);
  color: #f0b429;
  border: 1px solid rgba(240,180,41,.5);
  box-shadow: 0 0 8px rgba(240,180,41,.25);
}
.dp-plan.free { background: var(--low-dim); color: var(--low); }

.dp-quota-bar {
  height: 3px; background: var(--surf3); border-radius: 99px;
  overflow: hidden; margin-bottom: 4px;
}
.dp-quota-fill { height: 100%; background: var(--blue); border-radius: 99px; transition: width .3s; }
.dp-quota-label { font-size: 10px; color: var(--muted2); font-family: ui-monospace, "SF Mono", monospace; }

.dp-section {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border2);
}

.dp-section-title {
  font-size: 10px; font-weight: 600; color: var(--muted2);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px;
}

.dp-tickers { display: flex; flex-wrap: wrap; gap: 5px; }

.dp-ticker {
  padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color .12s, color .12s;
}
.dp-ticker:hover { border-color: var(--blue); color: var(--blue); }

.dp-ticker-plain { font-size: 12px; font-weight: 600; }

.dp-empty { font-size: 11px; color: var(--muted2); }

.dp-alert-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.dp-alert-thresh { font-size: 11px; color: var(--muted2); flex: 1; }
.dp-alert-remove {
  background: none; border: none; color: var(--muted2);
  cursor: pointer; font-size: 11px; padding: 0;
}
.dp-alert-remove:hover { color: var(--high); }

.dp-history { display: flex; flex-direction: column; gap: 3px; }

.dp-history-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 4px 6px; border-radius: var(--radius2);
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background .1s;
}
.dp-history-row:hover { background: var(--surf3); }

.dp-hist-score {
  font-size: 12px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", monospace;
  min-width: 28px;
}
.dp-hist-score.HIGH   { color: var(--high); }
.dp-hist-score.MEDIUM { color: var(--med);  }
.dp-hist-score.LOW    { color: var(--low);  }

.dp-hist-date { font-size: 10px; color: var(--muted2); margin-left: auto; font-family: ui-monospace, "SF Mono", monospace; }

.dp-footer {
  padding: 10px 16px;
  display: flex; gap: 8px; flex-wrap: wrap;
}

.dp-footer-btn { font-size: 11px; padding: 4px 10px; }
.dp-logout { margin-left: auto; }

/* ── Watchlist card ── */

.watchlist-card { }

.wl-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}

.wl-header h2 { margin: 0; }
.wl-actions { display: flex; gap: 6px; }

.wl-empty { color: var(--muted2); font-size: 12px; padding: 4px 0; }

.wl-list { display: flex; flex-wrap: wrap; gap: 6px; }

.wl-item {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surf2);
  overflow: hidden;
}

.wl-scan-btn {
  padding: 5px 12px; background: none; border: none;
  color: var(--text); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}

.wl-scan-btn:hover { background: var(--surf3); }

.wl-score {
  font-size: 11px; font-weight: 700;
  padding: 2px 6px;
  font-family: ui-monospace, "SF Mono", monospace;
}

.wl-score.HIGH   { color: var(--high); }
.wl-score.MEDIUM { color: var(--med); }
.wl-score.LOW    { color: var(--low); }

.wl-remove {
  padding: 5px 8px; background: none; border: none; border-left: 1px solid var(--border);
  color: var(--muted2); cursor: pointer; font-size: 12px; line-height: 1;
}

.wl-remove:hover { color: var(--high); }

/* ── Market scanner ── */

.scanner-card { }

.scanner-header { display: flex; flex-direction: column; gap: 10px; }
.scanner-header h2 { margin: 0; }

.scanner-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.scanner-cats { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }

.scanner-scan-btn {
  height: 34px; padding: 0 18px;
  font-size: 13px; flex-shrink: 0;
}

.scanner-expiry-select {
  height: 34px; padding: 0 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf2); color: var(--text);
  font-size: 13px; font-family: inherit;
  cursor: pointer; flex: 1 1 150px;
  min-width: 150px; max-width: 370px;
  color-scheme: dark; outline: none;
}

.scanner-cat-btn {
  padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color .12s, color .12s, background .12s;
}

.scanner-cat-btn:hover  { border-color: var(--blue); color: var(--blue); }
.scanner-cat-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }

/* S&P 500 mega-category — distinct gold accent */
.scanner-cat-sp500 { border-color: #c9a22a; color: #c9a22a; }
.scanner-cat-sp500:hover  { border-color: #e8bb30; color: #e8bb30; background: rgba(201,162,42,.08); }
.scanner-cat-sp500.active { border-color: #e8bb30; color: #e8bb30; background: rgba(201,162,42,.15); }

.scanner-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--blue);
  font-weight: 500; padding: 2px 0;
}

.scanner-spinner {
  width: 13px; height: 13px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(47,129,247,.25);
  border-top-color: var(--blue);
  animation: spin .65s linear infinite;
}

/* Scanner Pro sort bar */
.scanner-pro-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 6px;
  flex-wrap: wrap;
}
.scanner-pro-bar.hidden { display: none; }
.scanner-pro-bar-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.scanner-sort-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.sc-sort-btn {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.sc-sort-btn:hover  { border-color: var(--blue); color: var(--blue); }
.sc-sort-btn.active { border-color: var(--blue); background: var(--blue-dim); color: var(--blue); }

/* Tips on/off toggle */
.tip-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.tip-toggle input { display: none; }
.tip-toggle-track {
  width: 30px; height: 16px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.tip-toggle input:checked + .tip-toggle-track { background: var(--blue); }
.tip-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.tip-toggle input:checked + .tip-toggle-track .tip-toggle-thumb { left: 16px; }
.tip-toggle-label { font-size: 11px; color: var(--muted); font-weight: 600; }

/* Disable all tooltips when tips are off */
.tips-off [data-tip]::after,
.tips-off [data-tip]::before { display: none; }

.sc-na { color: var(--muted); }
.sc-val-high { color: var(--high); font-weight: 600; }
.sc-val-low  { color: var(--low);  font-weight: 600; }

/* IV Rank pills — neutral blue intensity (shared by home + scanner pages) */
.sc-iv-high { color: var(--iv-hi);  font-weight: 600; }
.sc-iv-med  { color: var(--iv-mid); font-weight: 600; }
.sc-iv-low  { color: var(--iv-lo);  font-weight: 600; }

/* ── Sort button tooltips ── */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #1a1f2e;
  color: #e6edf3;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  white-space: normal;
  width: 230px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 900;
}
[data-tip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 14px;
  border: 5px solid transparent;
  border-bottom-color: #1a1f2e;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 901;
}
[data-tip]:hover::after,
[data-tip]:hover::before { opacity: 1; }


/* Scanner custom ticker input */
.scanner-custom-row { margin-top: 10px; }
.scanner-custom-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surf1);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}
.scanner-custom-input:focus { border-color: var(--blue); outline: none; }
.scanner-custom-input::placeholder { color: var(--muted); }

/* Scanner table with blur overlay */
.scanner-table-wrap { margin-top: 12px; position: relative; }
.scanner-table-inner { overflow-x: auto; position: relative; }
/* Synced top horizontal scrollbar — mirrors the table's bottom scroll */
.scanner-scroll-top { overflow-x: auto; overflow-y: hidden; }
.scanner-scroll-top-inner { height: 1px; }

/* Dark-theme scrollbars for the scanner scroll containers (match site theme) */
.scanner-scroll-top,
.scanner-table-inner {
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: var(--surf3) var(--surf1);  /* thumb / track (Firefox) */
}
.scanner-scroll-top::-webkit-scrollbar,
.scanner-table-inner::-webkit-scrollbar {
  height: 10px;
}
.scanner-scroll-top::-webkit-scrollbar-track,
.scanner-table-inner::-webkit-scrollbar-track {
  background: var(--surf1);
  border-radius: 99px;
}
.scanner-scroll-top::-webkit-scrollbar-thumb,
.scanner-table-inner::-webkit-scrollbar-thumb {
  background: var(--surf3);
  border-radius: 99px;
  border: 2px solid var(--surf1);
}
.scanner-scroll-top::-webkit-scrollbar-thumb:hover,
.scanner-table-inner::-webkit-scrollbar-thumb:hover {
  background: var(--muted2);
}

.scanner-row-blurred td { filter: blur(4px); user-select: none; pointer-events: none; }

/* Selected / active scanner row (clicked to scan) */
.scanner-row-selected td { background: rgba(47,129,247,.10) !important; }
.scanner-row-selected td:first-child { border-left: 3px solid var(--blue); }
.scanner-table tr.scanner-row-selected:hover td { background: rgba(47,129,247,.16) !important; }

/* Locked Pro column headers — shown to free users as teasers */
.sc-th-locked {
  color: var(--muted2);
  font-size: 11px;
  letter-spacing: .03em;
  text-align: center;
}
.sc-th-locked::after { content: " 🔒"; font-size: 10px; }

/* Locked Pro data cells — blurred bar placeholders */
.sc-locked-cell { text-align: center; padding: 0 8px; }
.sc-locked-bar {
  display: inline-block;
  width: 68%;
  height: 10px;
  background: rgba(139,148,158,.13);
  border-radius: 4px;
  vertical-align: middle;
}

/* Teaser row — shown after 10th free result */
.sc-teaser-row td { padding: 0; border-bottom: none; }
.sc-teaser-inner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 16px;
  background: linear-gradient(90deg, rgba(47,129,247,.08) 0%, rgba(47,129,247,.04) 100%);
  border-top: 1px solid rgba(47,129,247,.2);
  border-bottom: 1px solid rgba(47,129,247,.2);
}
.sc-teaser-count {
  font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap;
}
.sc-teaser-sub {
  font-size: 11px; color: var(--muted); flex: 1; min-width: 180px;
}
.sc-teaser-btn {
  background: var(--blue); color: #fff;
  border: none; border-radius: 6px;
  padding: 5px 13px; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.sc-teaser-btn:hover { background: #388bfd; }

.scanner-upgrade-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px;
  margin-top: 8px;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.scanner-upgrade-overlay p {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--text);
}
.scanner-upgrade-overlay .sc-blur-note {
  font-size: 11px; color: var(--muted); margin-top: -4px;
}
.scanner-upgrade-overlay.hidden { display: none; }

.scanner-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}

.scanner-table th {
  padding: 7px 12px; text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--muted2); text-transform: uppercase; letter-spacing: .05em;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
  white-space: nowrap;
}

.scanner-table th:hover { color: var(--text); }
.scanner-table th.sort-active { color: var(--blue); }

.scanner-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}

.scanner-table tr:last-child td { border-bottom: none; }
.scanner-table tr:hover td { background: var(--surf3); cursor: pointer; }

.sc-ticker { font-weight: 700; font-size: 13px; }
.sc-company { color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sc-score {
  font-weight: 700; font-size: 14px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.sc-score.HIGH   { color: var(--high); }
.sc-score.MEDIUM { color: var(--med); }
.sc-score.LOW    { color: var(--low); }

/* ── Result actions ── */

.result-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ── IV / Expected Move ── */

.exp-move-row {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf2);
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; flex-wrap: wrap;
}

.exp-label { font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }
.exp-value { font-weight: 700; font-family: ui-monospace, "SF Mono", monospace; color: var(--blue); }
.exp-sub   { font-size: 11px; color: var(--muted); }

/* ── FDA legend dot ── */

.leg-dot.tl-fda { background: #ff7b72; }
.tl-event.tl-fda { background: #ff7b72; }

/* ── Mobile — tablet (≤ 720px) ── */

@media (max-width: 720px) {
  .wrap { margin: 12px auto 40px; }

  /* Topbar */
  .topbar { padding: 10px 0; }
  .brand-title { font-size: 14px; }

  /* Cards */
  .card { padding: 14px; max-width: 100%; }

  /* Hero */
  .hero h1 { font-size: 16px; }
  .hero-top { flex-wrap: wrap; gap: 10px; }
  .controls { grid-template-columns: 1fr; }

  /* Scan button full width on mobile */
  .hero-scan { width: 100%; justify-content: center; }

  /* Result top */
  .result-top  { flex-direction: column; gap: 12px; }
  .scorebox    { width: 100%; min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; }
  .scorelabel  { width: 100%; }
  .score-ring-wrap { margin: 4px auto 2px; }
  .sparkline-wrap { margin-top: 4px; }

  /* Result actions */
  .result-actions { gap: 4px; flex-wrap: wrap; }
  .result-actions .btn-ghost { font-size: 11px; padding: 4px 8px; }

  /* Fundamentals row */
  .fund-row  { flex-direction: column; }
  .fund-sep  { width: 100%; height: 1px; align-self: auto; }
  .fund-item { padding: 8px 12px; }

  /* Breakdown */
  .break-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 12px; }
  .pill.points { align-self: flex-end; }

  /* Timeline legend */
  .timeline-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }

  /* Signals accordion */
  .item { margin: 6px 8px; padding: 8px 10px; }
  .item-meta { gap: 6px; }

  /* Watchlist */
  .wl-list { gap: 5px; }
  .wl-scan-btn { font-size: 12px; padding: 6px 10px; }

  /* Market scanner */
  .scanner-header { gap: 8px; }
  .scanner-cats   { gap: 5px; }
  .scanner-cat-btn { padding: 4px 10px; font-size: 11px; }


  /* Comparison */
  .compare-grid { grid-template-columns: 1fr 1fr; }

  /* Peers */
  .peers-list { gap: 5px; }
  .peer-btn   { font-size: 11px; padding: 3px 10px; }

  /* Auth bar — shrink quota box and profile button on all phones */
  .auth-bar .quota-pill { font-size: 10px; padding: 2px 6px; }
  .auth-bar .quota-pill.pro-pill { font-size: 10px; padding: 2px 6px; letter-spacing: 0; }
  .profile-btn { font-size: 11px; padding: 3px 8px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Scanner pro sort bar — compact wrap on mobile */
  .scanner-pro-bar { flex-wrap: wrap; gap: 6px; }
  .scanner-sort-btns { display: flex; flex-wrap: wrap; gap: 4px; }
  .sc-sort-btn { font-size: 10px; padding: 2px 7px; }

  /* Sort button tooltips — suppress CSS pseudo-element on mobile, JS handles centering instead */
  .scanner-sort-btns [data-tip]::after,
  .scanner-sort-btns [data-tip]::before { display: none !important; }

  /* Timeline edge labels — already shown in date row above track */
  .tl-label-today, .tl-label-expiry { display: none; }
}

/* ── Mobile — small phones (≤ 420px) ── */

@media (max-width: 420px) {
  .wrap { width: 100%; margin: 8px auto 30px; }
  .card { padding: 12px; border-radius: 6px; }

  /* Topbar fits tight */
  .topbar { width: 92vw; }
  .auth-bar .quota-pill { font-size: 10px; padding: 2px 5px; }
  .auth-bar .quota-pill.pro-pill { font-size: 10px; padding: 2px 5px; }
  .profile-btn { font-size: 11px; padding: 3px 8px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Hero */
  .hero h1 { font-size: 15px; }
  .sub { font-size: 11px; }

  /* Score box stacks cleanly */
  .scorebox    { flex-direction: column; align-items: center; gap: 2px; }
  .sparkline-wrap { margin-left: 0; }

  /* Scanner category buttons wrap into 2 per row */
  .scanner-cats { display: grid; grid-template-columns: 1fr 1fr; }
  .scanner-cat-btn { text-align: center; border-radius: var(--radius2); }

  /* Scanner top — stack vertically so select doesn't overflow */
  .scanner-top { flex-direction: column; align-items: stretch; }
  .scanner-expiry-select { width: 100%; max-width: none; flex: none; }

  /* Comparison single column */
  .compare-grid { grid-template-columns: 1fr; }

  /* Result actions — 2 per row, equal height */
  .result-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .result-actions .btn-ghost { justify-content: center; }

  /* Rec bullets readable */
  .rec-bullets li { font-size: 12px; }

  /* Summary */
  .summary-text { font-size: 12px; }

  /* Hide pricing link — no room in topbar on tiny phones */
  .topbar-pricing-link { display: none; }
}

/* ── Mobile sort tip (JS-positioned, centered on screen) ── */
.wk-sel-wrap { display: inline-flex; align-items: center; gap: 6px; }
.wk-sel-wrap label { font-size: 12px; color: var(--muted2); white-space: nowrap; }
.wk-sel {
  padding: 6px 9px; background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius2); color: var(--text); font-size: 13px; cursor: pointer;
}
.wk-sel:focus { border-color: var(--blue); outline: none; }

#mobileSortTip {
  position: fixed;
  z-index: 950;
  background: #1a1f2e;
  color: #e6edf3;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 20px rgba(0,0,0,.55);
  text-align: center;
  pointer-events: none;
  display: none;
  max-width: 80vw;
}

/* ── Upgrade modal plan selector — scrollable on tiny phones ── */
@media (max-width: 480px) {
  .plan-selector {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    gap: 8px;
    /* prevent the grid from being too wide */
    grid-template-columns: unset;
  }
  .plan-card {
    min-width: 105px;
    flex-shrink: 0;
  }
}

/* ── Scanner expand row ── */

.scanner-expand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
}
.scanner-expand-row.hidden { display: none; }

.scanner-expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.scanner-expand-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Pagination */
.scanner-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 4px;
}
.scanner-pagination.hidden { display: none; }
.sc-page-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sc-page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.sc-page-btn:disabled { opacity: 0.35; cursor: default; }
.sc-page-info {
  font-size: 12px;
  color: var(--muted);
  min-width: 110px;
  text-align: center;
}

/* ── Edge Score Widget ── */
#edgeScoreWrap { margin-bottom: 12px; }
.edge-score-card {
  background: var(--surf2);
  border: 1px solid rgba(47,129,247,.25);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius2);
  padding: 14px 16px;
}
.edge-score-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}
.edge-score-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .02em;
}
.edge-score-sub {
  font-size: 11px;
  color: var(--muted);
}
.edge-score-list { display: flex; flex-direction: column; gap: 5px; }
.edge-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--surf2);
  cursor: pointer;
  transition: background .12s;
}
.edge-score-row:hover { background: rgba(47,129,247,.08); }
.edge-rank  { font-size: 11px; color: var(--muted); width: 20px; flex-shrink: 0; }
.edge-ticker { font-size: 13px; font-weight: 700; color: var(--text); width: 54px; flex-shrink: 0; }
.edge-meta  { font-size: 11px; color: var(--muted); flex: 1; }
.edge-meta strong { color: var(--text); }
.edge-val   { font-size: 13px; font-weight: 700; min-width: 80px; text-align: right; }
.edge-label { font-size: 10px; font-weight: 500; opacity: .8; }
.edge-great { color: #3fb950; }
.edge-ok    { color: #e3b341; }
.edge-weak  { color: var(--muted2); }
.edge-bad   { color: var(--high); }

.scanner-expand-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted2);
}
.scanner-expand-loading.hidden { display: none; }

/* Skeleton loading rows in scanner */
.sc-skeleton td {
  padding: 8px 10px;
}
.sc-skel-bar {
  height: 11px;
  border-radius: 4px;
  background: var(--surf3);
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer {
  0%,100% { opacity: .5; }
  50%      { opacity: 1;  }
}

/* ── Data freshness badge ── */

.data-freshness {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted2);
  margin-top: 4px;
}
.data-freshness::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--low);
  flex-shrink: 0;
}
.data-freshness.cached::before {
  background: var(--med);
}
.data-freshness.hidden { display: none; }

.freshness-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  margin-left: 8px;
  color: var(--muted);
  opacity: .85;
  transition: opacity .15s, border-color .15s, color .15s;
  line-height: 1;
  vertical-align: middle;
}
.freshness-refresh:hover { opacity: 1; border-color: var(--blue); color: var(--blue); }
.freshness-refresh.hidden { display: none; }

.refresh-label { display: inline-block; }
.refresh-spinner {
  display: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(47,129,247,.3);
  border-top-color: var(--blue);
  vertical-align: middle;
}
.freshness-refresh.spinning .refresh-label  { display: none; }
.freshness-refresh.spinning .refresh-spinner {
  display: inline-block;
  animation: spin .65s linear infinite;
}

/* ── Email capture strip ── */

.ec-strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 800;
  background: var(--surf2);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.4);
  animation: ec-slide-up .3s ease;
}
.ec-strip.hidden { display: none; }

@keyframes ec-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ec-strip-text {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 160px;
}

.ec-strip-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ec-strip-close {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s;
  flex-shrink: 0;
}
.ec-strip-close:hover { color: var(--text); }

/* Shared input + button */
.ec-input {
  padding: 7px 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--surf1);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  width: 200px;
  min-width: 140px;
  transition: border-color .15s;
}
.ec-input:focus { border-color: var(--blue); outline: none; }
.ec-input::placeholder { color: var(--muted); }

.ec-btn {
  padding: 7px 14px;
  border-radius: var(--radius2);
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  white-space: nowrap;
}
.ec-btn:hover { opacity: .85; }
.ec-btn:disabled { opacity: .5; cursor: default; }

.ec-msg {
  font-size: 12px;
  color: var(--low);
  margin-top: 4px;
  width: 100%;
}
.ec-msg.error { color: var(--high); }
.ec-msg.hidden { display: none; }

/* Upgrade modal secondary row */
.ec-modal-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border2);
}
.ec-modal-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}
.ec-modal-form {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.ec-modal-form .ec-input { width: 200px; }

@media (max-width: 480px) {
  .ec-strip { flex-direction: column; align-items: flex-start; }
  .ec-strip-form { width: 100%; }
  .ec-input { width: 100%; }
  .ec-strip-close { position: absolute; top: 10px; right: 12px; }
}


/* ── Admin Panel ─────────────────────────────────────────────────────────── */

.admin-topbar-btn {
  background: rgba(47,129,247,.15);
  color: var(--blue);
  border: 1px solid rgba(47,129,247,.3);
  border-radius: var(--radius2);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.admin-topbar-btn:hover { background: rgba(47,129,247,.28); }

.admin-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.admin-overlay.hidden { display: none; }

.admin-panel {
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 860px;
  min-height: 400px;
}

.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surf1);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}
.admin-panel-title { font-size: 16px; font-weight: 700; color: var(--text); }
.admin-panel-actions { display: flex; gap: 8px; align-items: center; }

.admin-refresh-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius2);
  padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.admin-refresh-btn:hover { color: var(--text); border-color: var(--muted); }

.admin-close-btn {
  background: transparent; border: none;
  color: var(--muted2); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.admin-close-btn:hover { color: var(--text); background: var(--surf2); }

.admin-content { padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.admin-loading  { color: var(--muted); text-align: center; padding: 40px; }

.adm-section {}
.adm-section-title {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.adm-reset-btn {
  margin-left: auto; font-size: 11px; font-weight: 600; text-transform: none;
  letter-spacing: 0; padding: 3px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surf3); color: var(--muted);
  transition: border-color .15s, color .15s;
}
.adm-reset-btn:hover { border-color: var(--high); color: var(--high); }
.adm-device-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.adm-device-row { display: flex; align-items: center; gap: 10px; }
.adm-device-label { font-size: 12px; color: var(--muted); width: 90px; flex-shrink: 0; }
.adm-device-bar-wrap { flex: 1; height: 8px; background: var(--surf3); border-radius: 4px; overflow: hidden; }
.adm-device-bar { height: 100%; border-radius: 4px; transition: width .4s; }
.adm-device-mob  { background: var(--blue); }
.adm-device-desk { background: var(--accent); }
.adm-device-pct { font-size: 12px; font-weight: 600; color: var(--text); width: 70px; text-align: right; flex-shrink: 0; }
.adm-device-n { font-size: 11px; font-weight: 400; color: var(--muted); }
.adm-sub-badge {
  font-size: 10px; font-weight: 500; letter-spacing: 0;
  text-transform: none; background: var(--surf2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 7px; color: var(--muted);
}

.adm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.adm-card {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 12px 14px;
}
.adm-val  { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.adm-lbl  { font-size: 11px; color: var(--muted); margin-top: 4px; }
.adm-sub  { font-size: 11px; color: var(--muted2); margin-top: 2px; }

/* Bar chart */
.adm-chart-label { font-size: 11px; color: var(--muted2); margin-bottom: 6px; }
.adm-bar-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 64px;
  position: relative;
}
.adm-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
}
.adm-bar {
  width: 100%; border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: opacity .15s;
}
.adm-bar-col:hover .adm-bar { opacity: .7; }

.adm-empty { font-size: 12px; color: var(--muted2); padding: 8px 0; }

/* Countries */
.adm-countries { display: flex; flex-direction: column; gap: 6px; }
.adm-country-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.adm-flag { font-size: 18px; line-height: 1; width: 24px; text-align: center; }
.adm-country-name { flex: 1; }
.adm-country-count { color: var(--muted); font-size: 12px; font-weight: 600; min-width: 30px; text-align: right; }

/* Referrer sources + pages */
.adm-src-list { display: flex; flex-direction: column; gap: 6px; }
.adm-src-row  { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.adm-src-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.adm-src-name { flex: 1; color: var(--text); }
.adm-src-count { color: var(--muted); font-size: 12px; font-weight: 600; min-width: 36px; text-align: right; }

/* Tickers */
.adm-ticker-list { display: flex; flex-direction: column; gap: 6px; }
.adm-ticker-row  {
  display: flex; align-items: center; gap: 10px;
  background: var(--surf2); border-radius: var(--radius2);
  padding: 6px 12px; font-size: 13px;
}
.adm-ticker-rank { color: var(--muted2); font-size: 11px; width: 16px; text-align: right; }
.adm-ticker-sym  { font-weight: 700; color: var(--blue); flex: 1; }
.adm-ticker-cnt  { color: var(--muted); font-size: 12px; }

/* Sign-ups */
.adm-signups    { display: flex; flex-direction: column; gap: 5px; }
.adm-signup-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.adm-signup-row:last-child { border-bottom: none; }
.adm-signup-email { flex: 1; color: var(--text); word-break: break-all; }
.adm-signup-date  { color: var(--muted2); font-size: 11px; white-space: nowrap; }
.adm-badge-pro  {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: rgba(56,211,159,.15);
  color: var(--accent); border: 1px solid rgba(56,211,159,.3);
  white-space: nowrap;
}
.adm-badge-free {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: var(--surf2);
  color: var(--muted2); border: 1px solid var(--border);
  white-space: nowrap;
}

/* Cache status grid */
.adm-cache-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.adm-cache-card {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.adm-cache-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}
.adm-cache-stat {
  font-size: 11px; color: var(--muted);
}
.adm-cache-stat strong { color: var(--text); }

/* Fresh bar */
.adm-fresh-row {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
.adm-fresh-label { font-size: 10px; color: var(--muted2); width: 64px; flex-shrink: 0; }
.adm-fresh-bar-wrap {
  flex: 1; height: 6px; background: var(--surf3);
  border-radius: 3px; overflow: hidden;
}
.adm-fresh-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.adm-fresh-pct { font-size: 10px; color: var(--muted); white-space: nowrap; }
.adm-fresh-pct span { color: var(--muted2); }

/* Fundamentals rows */
.adm-cache-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.adm-fc-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted);
}
.adm-fc-row strong { color: var(--text); font-weight: 600; }
.adm-fc-total {
  border-top: 1px solid var(--border); padding-top: 3px; margin-top: 1px;
  color: var(--text); font-weight: 600;
}
.adm-fc-total strong { color: var(--blue); }

/* ── Main navigation ─────────────────────────────────────────────────────────── */

.topnav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  overflow: hidden;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius2);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.nav-link:hover   { color: var(--text); background: var(--surf2); }
.nav-link.nav-current { color: var(--blue); background: var(--blue-dim); font-weight: 600; }

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.hamburger:hover span { background: var(--text); }

.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Floating nav button — fixed bottom-right, mobile only */
.fab-nav {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 18px;
  z-index: 250;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
}
.fab-nav:hover  { background: #4a91ff; transform: scale(1.07); }
.fab-nav:active { transform: scale(.95); }
@media (max-width: 860px) { .fab-nav { display: flex; } }

/* Mobile nav overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 300;
}
.mobile-nav-overlay.hidden { display: none; }

/* Mobile nav drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  max-width: 80vw;
  background: var(--surf1);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0,0,0,.4);
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-nav-drawer.hidden { display: none; }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.mobile-nav-close:hover { color: var(--text); background: var(--surf2); }

.mobile-nav-links {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius2);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .12s, background .12s;
}

.mobile-nav-link:hover    { color: var(--text); background: var(--surf2); }
.mobile-nav-link.nav-current { color: var(--blue); background: var(--blue-dim); font-weight: 600; }

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Hide topnav, show hamburger on narrower screens */
@media (max-width: 860px) {
  .topnav { display: none; }
  .hamburger { display: flex; }
}

/* ── Hero strip (anon visitors only) ──────────────────────────────────────── */

.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(47,129,247,.12) 0%, rgba(56,211,159,.07) 100%);
  border: 1px solid rgba(47,129,247,.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hero-strip.hidden { display: none; }

.hero-strip-text { flex: 1; min-width: 220px; }

.hero-strip-headline {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.hero-strip-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
/* Green "no credit card" pill on the hero — visible reassurance above the fold. */
.hero-nocard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--low-dim);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(63,185,80,.3);
}

.hero-strip-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hero-cta-btn {
  padding: 9px 20px;
  border-radius: var(--radius2);
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  white-space: nowrap;
}
.hero-cta-btn:hover { opacity: .85; }

.hero-cta-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.hero-cta-link:hover { color: var(--text); }

@media (max-width: 560px) {
  .hero-strip { padding: 16px; gap: 14px; }
  .hero-strip-headline { font-size: 17px; }
  .hero-strip-actions { width: 100%; }
  .hero-cta-btn { flex: 1; text-align: center; }
}

/* ── Market Pulse dashboard ───────────────────────────────────────────────── */

.market-pulse {
  margin-bottom: 24px;
}

.mp-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.mp-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.mp-sub {
  font-size: 12px;
  color: var(--muted2);
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .mp-grid { grid-template-columns: 1fr; }
}

.mp-card {
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border2);
}

.mp-card-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.mp-card-info {
  flex: 1;
  min-width: 0;
}

.mp-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-card-desc {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 1px;
}

.mp-card-link {
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .15s;
}
.mp-card-link:hover { opacity: .75; }

.mp-card-list {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Individual row */
.mp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border2);
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
}
.mp-row:last-child { border-bottom: none; }
.mp-row:hover { background: var(--surf2); }

.mp-ticker {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  width: 44px;
  flex-shrink: 0;
}

.mp-company {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Risk score badge */
.mp-score {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.mp-score.HIGH   { background: var(--high-dim);  color: var(--high); }
.mp-score.MEDIUM { background: var(--med-dim);   color: var(--med);  }
.mp-score.LOW    { background: var(--low-dim);   color: var(--low);  }
.mp-score.CLEAR  { background: var(--low-dim);   color: var(--low);  }

/* Edge score value */
.mp-edge {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
.mp-edge.edge-great { color: #3fb950; }
.mp-edge.edge-ok    { color: #e3b341; }
.mp-edge.edge-weak  { color: var(--muted2); }

/* Gainers value */
.mp-gain {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  flex-shrink: 0;
}

/* IV rank value */
.mp-iv {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
  color: var(--blue);
}

/* Earnings date */
.mp-date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

/* Loading / empty state */
.mp-loading {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}
.mp-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}

/* ═══════════════════════════════════════════════
   ACCOUNT PAGE
   ═══════════════════════════════════════════════ */

/* Page header */
.ac-page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.ac-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ac-page-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}
.ac-page-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Two-column grid */
.ac-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 760px) {
  .ac-grid { grid-template-columns: 1fr; }
}
.ac-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards */
.ac-card {
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.ac-card-full {
  margin-bottom: 20px;
}
.ac-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.ac-danger-card {
  border-color: rgba(224, 80, 80, 0.3);
}

/* Field rows */
.ac-field-row {
  margin-bottom: 14px;
}
.ac-field-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ac-field-row input[type="text"],
.ac-field-row input[type="email"],
.ac-field-row input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.ac-field-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.ac-field-static {
  font-size: 13px;
  color: var(--text);
  padding: 8px 0;
}
.ac-field-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ac-field-inline input {
  flex: 1;
}

/* Messages */
.ac-msg {
  font-size: 12px;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 4px;
}
.ac-msg-ok {
  color: var(--green);
  background: rgba(56, 211, 159, 0.1);
}
.ac-msg-err {
  color: var(--high);
  background: rgba(224, 80, 80, 0.1);
}

/* Buttons */
.ac-btn-primary {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
}
.ac-btn-primary:hover { opacity: .85; }
.ac-btn-sm {
  padding: 5px 12px;
  background: var(--surf3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.ac-btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.ac-btn-danger {
  padding: 8px 16px;
  background: transparent;
  color: var(--high);
  border: 1px solid var(--high);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ac-btn-danger:hover { background: rgba(224,80,80,.1); }

/* Plan card */
.ac-plan-row { margin-bottom: 12px; }
.ac-plan-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.ac-plan-pro { background: rgba(47,129,247,.2); color: var(--accent); }
.ac-plan-free { background: var(--surf2); color: var(--muted); }

.ac-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.ac-info-row:last-of-type { border-bottom: none; }
.ac-info-label { color: var(--muted); flex-shrink: 0; }

.ac-sub-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.ac-sub-active { background: rgba(56,211,159,.15); color: var(--green); }
.ac-sub-inactive { background: rgba(240,128,64,.15); color: #f08040; }

.ac-cancel-notice {
  font-size: 12px;
  color: #f08040;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(240,128,64,.1);
  border-radius: 4px;
}

/* Usage quota bar */
.ac-quota-bar-wrap {
  height: 6px;
  background: var(--surf3);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}
.ac-quota-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

/* Scan history table */
.ac-table-wrap {
  overflow-x: auto;
}
.ac-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ac-history-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ac-history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ac-history-table tr:last-child td { border-bottom: none; }
.ac-history-table tr:hover td { background: var(--surf2); }

/* Band chips */
.ac-band-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surf3);
  color: var(--muted);
}
.ac-band-chip.risk-low  { background: rgba(56,211,159,.15); color: #38d39f; }
.ac-band-chip.risk-med  { background: rgba(240,192,64,.15); color: #f0c040; }
.ac-band-chip.risk-high { background: rgba(240,128,64,.15); color: #f08040; }
.ac-band-chip.risk-crit { background: rgba(224,80,80,.15);  color: #e05050; }

/* Delete confirm area */
.ac-delete-confirm {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(224,80,80,.3);
}
.ac-delete-confirm p {
  font-size: 13px;
  margin: 0 0 10px;
  color: var(--text);
}
.ac-delete-confirm input {
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
}
.ac-delete-confirm input:focus {
  outline: none;
  border-color: var(--high);
}

/* Spinner wrap */
.ac-spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* nav auth user link */
.nav-auth-btn {
  padding: 5px 12px;
  background: var(--surf2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.nav-auth-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-auth-user { display: inline-flex; align-items: center; gap: 5px; }


/* ═══════════════════════════════════════════════
   CALENDAR PAGE
   ═══════════════════════════════════════════════ */

.sc-tab-btn {
  padding: 6px 16px;
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sc-tab-btn:hover  { border-color: var(--blue); color: var(--blue); }
.sc-tab-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); font-weight: 600; }

@media (max-width: 480px) {
  .sc-tab-btn { font-size: 11px; padding: 5px 10px; }
  .sc-tab-bar  { gap: 6px; }
}

.sc-tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cal-type-filter {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cal-type-btn {
  padding: 5px 14px;
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.cal-type-btn:hover  { border-color: var(--blue); color: var(--blue); }
.cal-type-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); font-weight: 600; }

.cal-table-wrap {
  overflow-x: auto;
}
.cal-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 13px;
}
.cal-table thead th {
  text-align: left;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--surf1);
  position: sticky;
  top: 0;
  z-index: 1;
}
.cal-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cal-row {
  cursor: pointer;
  transition: background .1s;
}
.cal-row:hover td { background: var(--surf2); }
.cal-row-today td { background: rgba(47,129,247,.05); }
.cal-row-today:hover td { background: rgba(47,129,247,.1); }

.cal-th-date    { width: 110px; white-space: nowrap; }
.cal-th-company { min-width: 160px; }

.cal-td-date { vertical-align: top; padding-top: 11px; width: 110px; }

.cal-date-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.cal-date-today    { color: var(--accent); }
.cal-date-tomorrow { color: #f0c040; }

.cal-ticker {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
}

.cal-company {
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-sector {
  color: var(--muted2);
  font-size: 11px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.cal-badge-earnings { background: rgba(47,129,247,.15); color: var(--accent); }
.cal-badge-exdiv    { background: rgba(56,211,159,.15); color: var(--green); }

.cal-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.cal-th-sortable:hover { color: var(--text); }
.cal-th-sorted { color: var(--blue) !important; }

/* Scanner page active sort column header */
.sc-th-feature { color: var(--blue) !important; }

.cal-beat {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.cal-beat-good { background: rgba(56,211,159,.15); color: var(--green); }
.cal-beat-ok   { background: rgba(240,192,64,.15);  color: #f0c040; }
.cal-beat-bad  { background: rgba(224,80,80,.15);   color: #e05050; }

.cal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ── Clinical trials calendar ── */
.ct-th-conditions  { min-width: 140px; }
.ct-th-completions { min-width: 160px; }
.ct-conditions     { color: var(--muted); font-size: 12px; max-width: 200px; }
.ct-completions    { white-space: nowrap; }

/* Phase pills */
.ct-phase { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; margin: 1px 2px 1px 0; white-space: nowrap; }
.ct-ph3   { background: rgba(47,129,247,.18);  color: var(--blue); }
.ct-ph4   { background: rgba(63,185,80,.15);   color: var(--low); }
.ct-ph2   { background: rgba(210,153,34,.15);  color: var(--med); }
.ct-ph1   { background: rgba(139,148,158,.12); color: var(--muted2); }

/* Completion date badges (linked) */
.ct-badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; text-decoration: none; margin: 2px 3px 2px 0; white-space: nowrap; transition: opacity .15s; }
.ct-badge:hover     { opacity: .75; text-decoration: none; }
.ct-badge-near      { background: rgba(248,81,73,.12);  color: var(--high); border: 1px solid rgba(248,81,73,.28); }
.ct-badge-mid       { background: rgba(210,153,34,.12); color: var(--med);  border: 1px solid rgba(210,153,34,.28); }
.ct-badge-far       { background: rgba(139,148,158,.10);color: var(--muted);border: 1px solid rgba(139,148,158,.22); }

/* ── Ticker result panel (shared: scanner, options, calendar) ── */
.trp-panel { border: 1px solid var(--border); border-radius: 10px; margin-top: 16px; overflow: hidden; animation: trp-in .18s ease; }
.trp-panel.trp-hidden { display: none; }
@keyframes trp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.trp-hdr { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surf2); border-bottom: 1px solid var(--border); gap: 12px; }
.trp-title { font-size: 15px; font-weight: 700; }
.trp-close { background: none; border: none; cursor: pointer; color: var(--muted2); font-size: 18px; padding: 0 4px; line-height: 1; }
.trp-close:hover { color: var(--text); }
/* Initial height only — JS in embed mode auto-grows the iframe to its content
   height (seamless, no inner scrollbar). See _trAutosize in script.js. */
.trp-iframe { width: 100%; height: 320px; border: none; display: block; background: var(--bg); }
.sc-row-selected { background: rgba(47,129,247,.1) !important; box-shadow: inset 3px 0 0 var(--blue); }



/* ═══════════════════════════════════════════════
   HEATMAP PAGE
   ═══════════════════════════════════════════════ */

/* Toolbar */
.hm-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Mode toggle pills */
.hm-mode-group {
  display: flex;
  gap: 6px;
}
.hm-mode-btn {
  padding: 6px 16px;
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.hm-mode-btn:hover  { border-color: var(--blue); color: var(--blue); }
.hm-mode-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); font-weight: 600; }

/* Expiry selector */
.hm-expiry-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}
.hm-expiry-wrap.hidden { display: none; }
.hm-expiry-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.hm-expiry-select {
  background: var(--surf2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius2);
  font-size: 13px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.hm-expiry-select:hover  { border-color: var(--blue); }
.hm-expiry-select:focus  { border-color: var(--blue); }

/* Legend */
.hm-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hm-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.hm-leg-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Map container */
.hm-map {
  position: relative;
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 420px;
  overflow: hidden;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border2);
}

/* Sector blocks */
.hm-sector {
  position: absolute;
  background: var(--surf1);
  border: 2px solid var(--bg);
  overflow: hidden;
  box-sizing: border-box;
}

/* Sector label */
.hm-sector-label {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20px;
  background: rgba(13,17,23,.65);
  font-size: 9px;
  font-weight: 700;
  color: rgba(230,237,243,.65);
  padding: 3px 5px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: .5px;
  z-index: 2;
  pointer-events: none;
}

/* Individual ticker tiles */
.hm-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: filter .12s, outline .12s;
  outline: 1px solid rgba(0,0,0,.18);
}
.hm-tile:hover {
  filter: brightness(1.25);
  outline: 2px solid rgba(255,255,255,.5);
  z-index: 10;
}
.hm-tile-ticker {
  font-weight: 700;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
  line-height: 1.1;
  pointer-events: none;
}
.hm-tile-score {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  line-height: 1;
  pointer-events: none;
}

/* Floating tooltip */
.hm-tooltip {
  position: fixed;
  background: var(--surf1);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 8px 12px;
  pointer-events: none;
  z-index: 999;
  min-width: 180px;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
.hm-tooltip.hidden { display: none; }
.hm-tip-ticker {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.hm-tip-company {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-tip-row {
  display: block;
  font-size: 12px;
  color: var(--muted2);
}
.hm-tip-row b { color: var(--text); }

/* Loading / empty states */
.hm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
}
.hm-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted2);
  font-size: 14px;
}
