/* ═══════════════════════════════════════════════════════════════════
   FinSight — Detail Page Pro Redesign
   Value-Investor-Focused • Koyfin × Stockanalysis × Simply Wall St × SeekingAlpha
═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   1. Design Tokens — moved to tokens.css (single source of truth).
   This file now only owns body.pro component rules. The few
   detail-page-only tokens (table row tints) stay here.
─────────────────────────────────────────────────────────── */
body.pro {
  /* Detail-only table-row tints (not used by other pages) */
  --bg-table-head:  #11162200;
  --bg-table-row:   #0E121C;
  --bg-table-row-2: #11162200;
}
body.pro.light {
  --bg-table-row:   #FFFFFF;
  --bg-table-row-2: #F9FAFB;
}

/* ───────────────────────────────────────────────────────────
   2. Page chrome — collapse old container, kill old card frame
─────────────────────────────────────────────────────────── */
body.pro {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter','Helvetica Neue',Arial,system-ui,sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01","cv01","cv11","tnum";
}

body.pro .main-content {
  background: var(--bg-base);
}
body.pro .container {
  max-width: none;
  padding: 0 24px 80px;
}

body.pro .titlebar {
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
body.pro.light .titlebar {
  background: rgba(255,255,255,0.92);
}

body.pro .sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--line);
}

/* Legacy DOM-hide rules removed: #detail-skeleton, #company-header,
   .page-tabs, .reports-section-header are no longer present in detail.html
   (the mirror stubs at the top of <body class="pro"> sit inside an inline
   style="display:none" wrapper, so no double-protection needed). */

/* Mobile bottom nav — keep but restyle */
body.pro .mobile-bottom-nav {
  background: rgba(7,9,15,0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

/* ───────────────────────────────────────────────────────────
   3. Hero Header — Bloomberg ticker + identity
─────────────────────────────────────────────────────────── */
.pro-hero {
  position: relative;
  padding: 24px 0 0;
  margin-bottom: 20px;
}
/* PDF §6 改进 1: Hero halo orb 给主体一个微弱的纵深背景，
   让 Serif 公司名"浮"在屏幕上而不是贴在 surface 上。 */
.pro-hero::before {
  content: "";
  position: absolute;
  inset: -20px -40px auto -40px;
  height: 220px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 50% 80% at 22% 50%,
    rgba(var(--accent-rgb), 0.08) 0%,
    transparent 65%
  );
  filter: blur(20px);
}

.pro-hero-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.pro-logo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pro-logo:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.pro-logo img,
.pro-logo canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.pro-identity { min-width: 0; }
/* PDF §6 改进 1: 主体层 — 公司名用 Serif 显示，让"我在看谁"成最强信号 */
.pro-name {
  font-family: 'Instrument Serif', 'Iowan Old Style', 'Songti SC', 'STSong', Georgia, serif;
  font-size: clamp(38px, 4vw + 16px, 64px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.pro-ticker {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(77,211,229,0.20);
}

.pro-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.pro-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.pro-meta-item strong { color: var(--text-secondary); font-weight: 600; }
.pro-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-faint);
}

/* Quick action cluster (right side of hero) */
.pro-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pro-icon-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.pro-icon-btn:hover {
  background: var(--bg-overlay);
  border-color: var(--line-strong);
  color: var(--text-primary);
}
.pro-icon-btn svg { width: 14px; height: 14px; }
.pro-icon-btn.danger:hover {
  border-color: var(--loss);
  color: var(--loss);
}

/* ───────────────────────────────────────────────────────────
   4. Key Metrics Strip — terminal ticker
─────────────────────────────────────────────────────────── */
.pro-kpi-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.pro-kpi {
  background: var(--bg-surface);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: background .15s;
  animation: pro-kpi-in 0.5s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: calc(var(--kpi-i, 0) * 60ms);
}
.pro-kpi:hover { background: var(--bg-elevated); }

@keyframes pro-kpi-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pro-kpi { animation: none; }
}

.pro-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pro-kpi-value {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-feature-settings: "tnum","zero";
}
.pro-kpi-value.neg { color: var(--loss); }
.pro-kpi-meta {
  font-size: 11px;
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.pro-kpi-delta-up   { color: var(--gain); }
.pro-kpi-delta-dn   { color: var(--loss); }
.pro-kpi-delta-flat { color: var(--text-muted); }

/* ── Hero KPI hierarchy (PDF §6 改进 2: 1 个主角 + 4 个辅证)
   First card spans 2 columns, gets the Serif treatment so the
   primary number reads first. The rest stay mono/26px. */
.pro-kpi-strip > .pro-kpi:first-child {
  grid-column: span 2;
  padding: 18px 24px;
  gap: 6px;
}
.pro-kpi-strip > .pro-kpi:first-child .pro-kpi-value {
  font-family: 'Instrument Serif', 'Iowan Old Style', 'Songti SC', Georgia, serif;
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.pro-kpi-strip > .pro-kpi:first-child .pro-kpi-label {
  font-size: 11px;
}

/* ───────────────────────────────────────────────────────────
   5. Scorecard + Radar Grid (Investor Snapshot)
─────────────────────────────────────────────────────────── */
.pro-snapshot {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .pro-snapshot { grid-template-columns: 1fr; }
}

.pro-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
}
.pro-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}
.pro-card-title h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}
.pro-card-title .pro-card-aside {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quant Scorecard rows */
.pro-scorecard { display: grid; gap: 8px; }
.pro-score-row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line-faint);
  position: relative;
  overflow: hidden;
  transition: border-color .15s, background .15s, transform .15s var(--ease-out, ease);
}
/* Left-edge cyan trace on hover (mirrors stmt-table row hover) */
.pro-score-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0;
  transition: opacity var(--dur-fast, 150ms) var(--ease-out, ease);
  pointer-events: none;
}
.pro-score-row:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--bg-overlay);
  transform: translateY(-1px);
}
.pro-score-row:hover::before { opacity: 1; }
.pro-score-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.pro-score-name small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  color: var(--text-faint);
  margin-top: 3px;
}
.pro-score-bar {
  height: 7px;
  background: transparent;
  border-radius: 4px;
  position: relative;
  overflow: visible;  /* let the threshold marker bleed slightly */
}
.pro-score-bar-track {
  position: absolute;
  inset: 0;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}
/* Threshold tick at 60 (B / C boundary) — subtle vertical line */
.pro-score-bar-track::after {
  content: "";
  position: absolute;
  left: 60%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(var(--accent-rgb), 0.25);
  pointer-events: none;
}
.pro-score-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--grade-d), var(--grade-c), var(--grade-a), var(--grade-aplus));
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.18);
}
/* Sweep highlight on the fill — pulses once on row mount */
.pro-score-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%);
  border-radius: 4px;
  animation: pro-score-sweep 1.4s 0.2s var(--ease-out, ease) 1 both;
  pointer-events: none;
}
@keyframes pro-score-sweep {
  from { transform: translateX(-100%); opacity: 0.9; }
  to   { transform: translateX(100%);  opacity: 0;   }
}
@media (prefers-reduced-motion: reduce) {
  .pro-score-bar-fill { transition: none; }
  .pro-score-bar-fill::after { animation: none; }
  .pro-score-row:hover { transform: none; }
}
.pro-score-num {
  font-family: 'JetBrains Mono',monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pro-grade-badge {
  width: 38px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono',monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #07090F;
  flex-shrink: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset,
    0 2px 6px rgba(0, 0, 0, 0.25);
}
.pro-grade-aplus { background: var(--grade-aplus); }
.pro-grade-a     { background: var(--grade-a); }
.pro-grade-b     { background: var(--grade-b);  color: #fff; }
.pro-grade-c     { background: var(--grade-c); }
.pro-grade-d     { background: var(--grade-d);  color: #fff; }
.pro-grade-na    {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--text-muted);
}

/* Composite header — serif letter + score + tier label */
.pro-composite {
  margin-top: 16px;
  padding: 14px 16px;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  border-radius: 0 0 var(--radius-md, 14px) var(--radius-md, 14px);
}
.pro-composite-letter {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-base);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.pro-composite-letter-orb {
  position: absolute;
  inset: -24px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.pro-composite-letter-text {
  position: relative;
  z-index: 1;
  font-family: 'Instrument Serif','Iowan Old Style','Songti SC',Georgia,serif;
  font-style: italic;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
/* Color the letter by grade — mirror the badge palette */
.pro-composite-letter.pro-grade-aplus .pro-composite-letter-text { color: var(--grade-aplus); }
.pro-composite-letter.pro-grade-a     .pro-composite-letter-text { color: var(--grade-a); }
.pro-composite-letter.pro-grade-b     .pro-composite-letter-text { color: var(--grade-b); }
.pro-composite-letter.pro-grade-c     .pro-composite-letter-text { color: var(--grade-c); }
.pro-composite-letter.pro-grade-d     .pro-composite-letter-text { color: var(--grade-d); }
.pro-composite-letter.pro-grade-aplus .pro-composite-letter-orb,
.pro-composite-letter.pro-grade-a     .pro-composite-letter-orb {
  background: radial-gradient(circle, rgba(52, 209, 124, 0.28), transparent 60%);
}
.pro-composite-letter.pro-grade-d     .pro-composite-letter-orb {
  background: radial-gradient(circle, rgba(242, 92, 92, 0.22), transparent 60%);
}
.pro-composite-letter.pro-grade-na    .pro-composite-letter-text { color: var(--text-faint); }
.pro-composite-letter.pro-grade-na    .pro-composite-letter-orb  { background: none; }

.pro-composite-body { flex: 1; min-width: 0; }
.pro-composite-tag {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pro-composite-num {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.pro-composite-num .pro-composite-denom {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}
.pro-composite-tier {
  font-family: 'Instrument Serif','Iowan Old Style','Songti SC',Georgia,serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.01em;
}
@media (max-width: 640px) {
  .pro-composite {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
  }
  .pro-composite-letter { width: 60px; height: 60px; }
  .pro-composite-letter-text { font-size: 36px; }
  .pro-composite-num { font-size: 20px; }
}

/* Radar / Snowflake card */
.pro-radar-wrap {
  height: 280px;
  position: relative;
}
.pro-radar-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.pro-radar-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.pro-radar-legend i {
  width: 8px; height: 8px; border-radius: 2px;
  display: inline-block; margin-right: 6px;
  vertical-align: middle;
}

/* ───────────────────────────────────────────────────────────
   6. Insight callouts (3 colored chips)
─────────────────────────────────────────────────────────── */
.pro-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.pro-insight {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pro-insight-pos { border-left-color: var(--gain); }
.pro-insight-neg { border-left-color: var(--loss); }
.pro-insight-warn{ border-left-color: var(--neutral); }
.pro-insight-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pro-insight-msg {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}
.pro-insight-num {
  font-family: 'JetBrains Mono',monospace;
  font-weight: 700;
}

/* ───────────────────────────────────────────────────────────
   7. Sticky Tab Bar
─────────────────────────────────────────────────────────── */
.pro-tabs-wrap {
  margin-top: 28px;
  position: sticky;
  top: 48px;  /* below titlebar */
  z-index: 30;
  background: var(--bg-base);
  border-bottom: 1px solid var(--line);
  margin-left: -24px;
  margin-right: -24px;
  padding: 0 24px;
}
.pro-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pro-tabs::-webkit-scrollbar { display: none; }

.pro-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
  transition: color .15s;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: -0.01em;
}
.pro-tab:hover { color: var(--text-secondary); }
.pro-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.pro-tab .pro-tab-count {
  margin-left: 6px;
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}

/* ── "更多" dropdown — folds 3 lower-frequency tabs ─────────── */
.pro-tab-more {
  position: relative;
  display: inline-flex;
}
.pro-tab-more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pro-tab-more-caret {
  transition: transform var(--dur-fast) var(--ease-out);
  opacity: 0.7;
}
.pro-tab-more.open .pro-tab-more-caret { transform: rotate(180deg); }
/* When the active tab lives inside the dropdown, the trigger itself
   wears the accent so the user can see "I'm in 更多 → 市场对比". */
.pro-tab-more.has-active .pro-tab-more-trigger {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.pro-tab-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.pro-tab-more.open .pro-tab-more-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.pro-tab-more-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.pro-tab-more-item:hover {
  background: var(--accent-whisper);
  color: var(--text-primary);
}
.pro-tab-more-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* TOC "更多" sub-label — separates high-freq from folded tabs */
.pro-toc .pro-toc-sublabel {
  list-style: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 0 4px;
  margin: 0;
}

/* ───────────────────────────────────────────────────────────
   8. Toolbar (period / view / range)
─────────────────────────────────────────────────────────── */
.pro-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line-faint);
}

.pro-seg {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.pro-seg button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: all .15s;
}
.pro-seg button:hover { color: var(--text-secondary); }
.pro-seg button.active {
  background: var(--accent);
  color: #07090F;
}

.pro-toolbar-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 4px;
}

.pro-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  margin-left: auto;
  width: 220px;
  max-width: 100%;
}
.pro-search input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  flex: 1;
  min-width: 0;
}
.pro-search input::placeholder { color: var(--text-faint); }
.pro-search svg { color: var(--text-muted); flex-shrink: 0; }
.pro-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ───────────────────────────────────────────────────────────
   9. Statement Tables — Roic.ai-style heatmap
─────────────────────────────────────────────────────────── */
body.pro .stmt-tabs {
  display: none; /* old sub-tabs now part of pro-tabs */
}

body.pro .stmt-scroll-outer {
  position: relative;
  margin-top: 4px;
}
body.pro .stmt-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
body.pro .stmt-wrap::-webkit-scrollbar { height: 8px; }
body.pro .stmt-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

body.pro .stmt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  background: var(--bg-surface);
  font-variant-numeric: tabular-nums;
}
body.pro .stmt-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
body.pro .stmt-table thead th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg-elevated);
  border-right: 1px solid var(--line);
  min-width: 230px;
}
body.pro .stmt-table tbody td {
  padding: 8px 10px;
  text-align: right;
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  color: var(--text-primary);
  border-bottom: 1px solid var(--line-faint);
  white-space: nowrap;
}
body.pro .stmt-table tbody td:first-child {
  text-align: left;
  font-family: 'Inter','Helvetica Neue',Arial,system-ui,sans-serif;
  color: var(--text-primary);
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--line);
  z-index: 2;
}
/* PDF §9 微交互 02: hover row 渗色 — radial gradient follows the cursor.
   --mx / --my are written by JS on mousemove (see detail-pro.js). */
body.pro .stmt-table tbody tr {
  --mx: 50%;
  --my: 50%;
}
body.pro .stmt-table tbody tr:hover td {
  background:
    radial-gradient(180px circle at var(--mx) var(--my),
      var(--accent-whisper),
      transparent 65%),
    var(--bg-elevated) !important;
  transition: background var(--dur-fast) var(--ease-out);
}
body.pro .stmt-table tbody tr.section-hdr td {
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  font-family: 'Inter',sans-serif !important;
}
body.pro .stmt-table tbody tr.divider td {
  height: 4px;
  padding: 0;
  background: var(--bg-base);
  border: 0;
}
body.pro .stmt-table .sub-label {
  color: var(--text-muted) !important;
  font-size: 11.5px !important;
  padding-left: 18px !important;
  font-weight: 400 !important;
}
body.pro .stmt-table tbody td.editable-cell {
  cursor: cell;
  position: relative;
}
body.pro .stmt-table tbody td.editable-cell:hover {
  background: var(--accent-soft) !important;
  box-shadow: inset 0 0 0 1px var(--accent);
}
body.pro .stmt-table .edit-pencil {
  display: none;
}

/* YoY heatmap — applied by detail-pro.js based on growth magnitude */
body.pro .stmt-table tbody td.heat-up-1 { background: var(--heat-soft-up)   !important; }
body.pro .stmt-table tbody td.heat-up-2 { background: var(--heat-mid-up)    !important; }
body.pro .stmt-table tbody td.heat-up-3 { background: var(--heat-strong-up) !important; }
body.pro .stmt-table tbody td.heat-dn-1 { background: var(--heat-soft-dn)   !important; }
body.pro .stmt-table tbody td.heat-dn-2 { background: var(--heat-mid-dn)    !important; }
body.pro .stmt-table tbody td.heat-dn-3 { background: var(--heat-strong-dn) !important; }

/* Hover keeps heat tint visible (slightly lifted) */
body.pro .stmt-table tbody tr:hover td.heat-up-1 { background: var(--heat-mid-up)    !important; }
body.pro .stmt-table tbody tr:hover td.heat-up-2 { background: var(--heat-strong-up) !important; }
body.pro .stmt-table tbody tr:hover td.heat-up-3 { background: var(--heat-strong-up) !important; filter: brightness(1.15); }
body.pro .stmt-table tbody tr:hover td.heat-dn-1 { background: var(--heat-mid-dn)    !important; }
body.pro .stmt-table tbody tr:hover td.heat-dn-2 { background: var(--heat-strong-dn) !important; }
body.pro .stmt-table tbody tr:hover td.heat-dn-3 { background: var(--heat-strong-dn) !important; filter: brightness(1.15); }

/* QoQ delta badge inside cell */
body.pro .stmt-table .cell-delta {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
}
body.pro .stmt-table .cell-delta.trend-up   { background: var(--gain-dim); color: var(--gain); }
body.pro .stmt-table .cell-delta.trend-down { background: var(--loss-dim); color: var(--loss); }
body.pro .stmt-table .trend-up    { color: var(--gain); }
body.pro .stmt-table .trend-down  { color: var(--loss); }
body.pro .stmt-table .val-na      { color: var(--text-faint); }
body.pro .stmt-table .val-neg     { color: var(--loss); }

/* Scroll arrows (kept from old, restyled) */
body.pro .stmt-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  z-index: 4;
  font-size: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
body.pro .stmt-arrow-l { left: 8px; }
body.pro .stmt-arrow-r { right: 8px; }
body.pro .stmt-arrow.arrow-hidden { display: none; }
body.pro .stmt-arrow:hover {
  background: var(--accent);
  color: #07090F;
  border-color: var(--accent);
}

/* ───────────────────────────────────────────────────────────
   9.b · Signal-mode upgrades (v3 design)
   - Latest-column accent (cyan underline + soft bg)
   - Row hover-trace bar on first cell
   - Inline 5-period sparkline column
─────────────────────────────────────────────────────────── */
body.pro .stmt-table thead th.latest {
  color: var(--accent);
  position: relative;
}
body.pro .stmt-table thead th.latest::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  pointer-events: none;
}
body.pro .stmt-table thead th.latest .latest-tag {
  display: block;
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 1px;
  opacity: 0.85;
}
body.pro .stmt-table tbody td.latest {
  color: var(--text-primary);
  font-weight: 600;
  background: rgba(var(--accent-rgb), 0.045);
}
/* Heat tint still wins over the latest tint */
body.pro .stmt-table tbody td.latest.heat-up-1,
body.pro .stmt-table tbody td.latest.heat-up-2,
body.pro .stmt-table tbody td.latest.heat-up-3,
body.pro .stmt-table tbody td.latest.heat-dn-1,
body.pro .stmt-table tbody td.latest.heat-dn-2,
body.pro .stmt-table tbody td.latest.heat-dn-3 {
  background: inherit;
}

/* Hover-trace: thin cyan bar on the first (label) cell when the row is hovered */
body.pro .stmt-table tbody tr td:first-child { position: relative; }
body.pro .stmt-table tbody tr:hover td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  pointer-events: none;
}

/* Section-header trace is suppressed (no first-child td structure) */
body.pro .stmt-table tbody tr.section-hdr:hover td:first-child::before,
body.pro .stmt-table tbody tr.divider:hover td:first-child::before {
  display: none;
}

/* Sparkline column (rightmost) */
body.pro .stmt-table thead th.spark-h {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-align: right;
  padding-right: 14px;
}
body.pro .stmt-table tbody td.spark-cell {
  padding: 4px 12px 4px 8px;
  background: transparent;
  white-space: nowrap;
  text-align: right;
}
body.pro .stmt-table tbody td.spark-cell .ft-spark-col {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
body.pro .stmt-table tbody td.spark-cell .ft-spark {
  width: 48px;
  height: 14px;
  flex-shrink: 0;
  overflow: visible;
}
body.pro .stmt-table tbody td.spark-cell .ft-spark polyline {
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.pro .stmt-table tbody td.spark-cell .ft-spark-d {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 10px;
  min-width: 42px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
body.pro .stmt-table tbody td.spark-cell .ft-spark-d.up   { color: var(--gain); }
body.pro .stmt-table tbody td.spark-cell .ft-spark-d.dn   { color: var(--loss); }
body.pro .stmt-table tbody td.spark-cell .ft-spark-d.flat { color: var(--text-muted); }

/* ───────────────────────────────────────────────────────────
   9.c · Auto one-line "take" above the KPI strip (v3 narrative)
   Mirrors the compare narrative card — one accent orb, one chip
   tag, one serif sentence with key numbers in mono.
─────────────────────────────────────────────────────────── */
body.pro .pro-take {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.05), rgba(var(--accent-rgb), 0.01));
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 10px;
  overflow: hidden;
  animation: pro-take-in 0.5s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both;
}
@keyframes pro-take-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.pro .pro-take .pro-take-orb {
  position: absolute;
  top: -60px;
  left: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16), transparent 60%);
  filter: blur(36px);
  pointer-events: none;
}
body.pro .pro-take .pro-take-tag {
  position: relative;
  z-index: 1;
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 9.5px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 4px;
  background: var(--accent-soft);
  flex-shrink: 0;
}
body.pro .pro-take .pro-take-text {
  position: relative;
  z-index: 1;
  font-family: 'Instrument Serif','Iowan Old Style','Songti SC',Georgia,serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-primary);
}
body.pro .pro-take .pro-take-text b {
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.pro .pro-take .pro-take-text .pro-take-gain { color: var(--gain); }
body.pro .pro-take .pro-take-text .pro-take-loss { color: var(--loss); }
body.pro .pro-take .pro-take-text .pro-take-num  { color: var(--accent); }
@media (max-width: 640px) {
  body.pro .pro-take {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
  }
  body.pro .pro-take .pro-take-text { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body.pro .pro-take { animation: none; }
}

/* ───────────────────────────────────────────────────────────
   10. Derived Metrics (re-skin existing)
─────────────────────────────────────────────────────────── */
body.pro .derived-section {
  margin-top: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px;
}
body.pro .derived-section h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
body.pro .derived-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
body.pro .derived-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: right;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
body.pro .derived-table thead th:first-child {
  text-align: left;
}
body.pro .derived-table tbody td {
  padding: 7px 10px;
  text-align: right;
  font-family: 'JetBrains Mono',monospace;
  color: var(--text-primary);
  border-bottom: 1px solid var(--line-faint);
}
body.pro .derived-table tbody td:first-child {
  text-align: left;
  font-family: 'Inter',sans-serif;
  color: var(--text-secondary);
}
body.pro .derived-table tbody tr:hover td {
  background: var(--bg-elevated);
}

body.pro .val-inputs-bar {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
body.pro .val-input-group {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}
body.pro .val-input-group label {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
body.pro .val-input-group input {
  width: 140px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono',monospace;
  font-size: 12px;
  outline: none;
}
body.pro .val-input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.pro .val-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ───────────────────────────────────────────────────────────
   11. Reports section (bottom)
─────────────────────────────────────────────────────────── */
body.pro .pro-reports {
  margin-top: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
body.pro .pro-reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
body.pro .pro-reports-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

body.pro .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
body.pro .data-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
body.pro .data-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--text-primary);
}
body.pro .data-table tbody tr:hover td {
  background: var(--bg-elevated);
}

/* ───────────────────────────────────────────────────────────
   12. Notes inline
─────────────────────────────────────────────────────────── */
.pro-notes {
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--neutral);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.pro-notes-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pro-notes textarea {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  padding: 0;
}
.pro-notes textarea::placeholder { color: var(--text-faint); }
.pro-notes-status { font-size: 10.5px; color: var(--gain); margin-top: 4px; min-height: 14px; }

/* ───────────────────────────────────────────────────────────
   13. Tab content visibility
─────────────────────────────────────────────────────────── */
body.pro .page-tab-content { display: none; }
body.pro .page-tab-content.active { display: block; padding-top: 8px; }

/* Industry template selector — keep visible inside notes/settings dropdown */
body.pro #tmpl-wrap { margin-top: 8px; }
body.pro .template-selector { display: inline-flex; gap: 4px; }
body.pro .template-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
body.pro .template-btn:hover { color: var(--text-secondary); }
body.pro .template-btn.active {
  background: var(--accent);
  color: #07090F;
  border-color: var(--accent);
}

/* ───────────────────────────────────────────────────────────
   14. Skeleton (new pro version)
─────────────────────────────────────────────────────────── */
.pro-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
}
.pro-skeleton-block {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: pro-shimmer 1.4s ease-in-out infinite;
}
.pro-sk-hero { height: 72px; }
.pro-sk-strip { height: 78px; }
.pro-sk-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}
.pro-sk-card { height: 280px; }
@keyframes pro-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ───────────────────────────────────────────────────────────
   15. Mini sparkline (used in KPI strip)
─────────────────────────────────────────────────────────── */
.pro-spark {
  margin-top: 4px;
  height: 22px;
  width: 100%;
}

/* ───────────────────────────────────────────────────────────
   16. Tooltips (period quick nav etc)
─────────────────────────────────────────────────────────── */
body.pro .period-quick-nav .period-quick-btn {
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 5px 11px;
  font-weight: 600;
}
body.pro .period-quick-btn.active {
  background: var(--accent);
  color: #07090F;
  border-color: var(--accent);
}

/* Tame the old liquid-glass card hover effects on detail page */
body.pro [data-glass]:hover { transform: none !important; }
body.pro .ripple { display: none !important; }

/* Kill noisy old animations that distract from data — pro design is calm.
   .page-tab-content removed from this list: motion.css now drives a
   240ms fade-up wipe via fs-tab-content-in (PDF §7.B), and this !important
   rule was suppressing that. */
body.pro .yoy-extreme       { animation: none !important; }
body.pro .sk-hd,
body.pro .sk-sub,
body.pro .sk-tabs,
body.pro .sk-row,
body.pro .skeleton-block    { animation: none !important; }

/* Ensure ECharts DOM doesn't leak grey borders */
body.pro #fin-chart-income,
body.pro #fin-chart-cashflow,
body.pro .fin-chart,
body.pro .cf-chart { background: transparent !important; }

/* ───────────────────────────────────────────────────────────
   17. 10-Year Highlights (annual)
─────────────────────────────────────────────────────────── */
.pro-annual-highlights .pro-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}
.pro-mini-tile {
  background: var(--bg-elevated);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pro-mini-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pro-mini-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.pro-mini-sub {
  font-size: 10.5px;
  color: var(--text-faint);
}

/* ───────────────────────────────────────────────────────────
   18. Valuation Tab
─────────────────────────────────────────────────────────── */
.pro-val-inputs {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px 12px;
  margin-top: 12px;
}
.pro-val-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.pro-val-input-grid .val-input-group { gap: 4px; }
.pro-val-input-grid .val-input-group label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
}
.pro-val-input-grid .val-input-group input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
}
.pro-val-input-grid .val-input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pro-val-input-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.pro-val-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.pro-val-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-faint);
  font-size: 12.5px;
}
.pro-val-row:last-child { border-bottom: 0; }
.pro-val-name { color: var(--text-secondary); }
.pro-val-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 80px;
}
.pro-val-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: right;
  min-width: 80px;
}

.pro-val-bigvalue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin: 4px 0 16px;
  font-variant-numeric: tabular-nums;
}
.pro-val-bigvalue small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0;
}

.pro-val-mos {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pro-val-mos-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pro-val-formula {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.pro-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ───────────────────────────────────────────────────────────
   18.5 DCF sensitivity matrix
─────────────────────────────────────────────────────────── */
.pro-sens-card { margin-top: 14px; }
.pro-sens-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.pro-sens-table th,
.pro-sens-table td {
  padding: 7px 10px;
  text-align: right;
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  white-space: nowrap;
}
.pro-sens-table thead th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pro-sens-table tbody th {
  text-align: left;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
}
.pro-sens-corner { background: transparent !important; border: 0 !important; }
.pro-sens-current-col,
.pro-sens-current-row { color: var(--accent) !important; }
/* Heat scale: relative to center cell (the user's chosen scenario). */
.pro-sens-cold { background: rgba(239,68,68,0.12); color: var(--loss); }
.pro-sens-cool { background: rgba(239,68,68,0.05); color: var(--text-secondary); }
.pro-sens-mid  { color: var(--text-primary); }
.pro-sens-warm { background: rgba(34,197,94,0.06); color: var(--text-primary); }
.pro-sens-hot  { background: rgba(34,197,94,0.14); color: var(--gain); }
.pro-sens-na   { color: var(--text-muted); font-style: italic; }
.pro-sens-center {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  font-weight: 700;
}

/* ───────────────────────────────────────────────────────────
   19. Mobile tweaks
─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  body.pro .container { padding: 0 14px 100px; }
  .pro-name { font-size: 22px; gap: 10px; }
  .pro-logo { width: 56px; height: 56px; }
  .pro-hero-grid { grid-template-columns: auto 1fr; }
  .pro-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .pro-kpi-strip { grid-template-columns: 1fr 1fr; }
  .pro-snapshot { grid-template-columns: 1fr; }
  .pro-tabs-wrap { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
}

@media (max-width: 640px) {
  /* Hero: full vertical stack so the 90 px logo + name + meta + actions
     don't fight a single 320 px column. */
  .pro-hero-grid { grid-template-columns: 1fr; gap: 12px; }
  .pro-logo { width: 48px; height: 48px; }
  .pro-name { font-size: 18px; flex-wrap: wrap; }
  .pro-meta { font-size: 11.5px; gap: 6px; flex-wrap: wrap; }
  .pro-actions { gap: 6px; }
  .pro-icon-btn { padding: 4px 8px; font-size: 11px; }
  .pro-icon-btn span { display: none; }   /* icon-only on tiny screens */
  .pro-spark { width: 100%; }              /* sparkline fills row */

  /* KPI strip: horizontal scroll carousel keeps numbers readable.
     !important needed because luxe-pro.css's `body.luxe .pro-kpi-strip
     { overflow: hidden }` is unscoped to viewport and is loaded later. */
  body.pro .pro-kpi-strip {
    grid-template-columns: none !important;
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .pro-kpi-strip::-webkit-scrollbar { display: none; }
  .pro-kpi {
    flex: 0 0 70%; min-width: 200px;
    scroll-snap-align: start;
    border-right: 1px solid var(--line);
  }
  .pro-kpi-value { font-size: 18px; }
  .pro-kpi-label { font-size: 9.5px; }
  /* Hero hierarchy resets to flat on narrow screens — there's no width
     budget for a 1.4× hero card in a horizontal scroller. */
  .pro-kpi-strip > .pro-kpi:first-child { grid-column: auto; padding: 12px 16px; }
  .pro-kpi-strip > .pro-kpi:first-child .pro-kpi-value {
    font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
    font-size: 18px;
  }

  /* Radar: shrink so it fits in the viewport without huge whitespace. */
  .pro-radar-wrap { height: 240px; }
  .pro-card { padding: 14px 16px; }
  .pro-card-title h3 { font-size: 13px; }

  /* Diff modal becomes full-width so users can see all four columns. */
  .diff-modal { max-height: 92vh; }
  .diff-modal-head { gap: 8px; padding: 10px 12px; flex-direction: column; align-items: stretch; }
  .diff-modal-controls { margin-left: 0; }
  .diff-table th, .diff-table td { padding: 6px 6px; font-size: 11.5px; }

  /* Notes popover: clamp to viewport edges. */
  .note-popover { width: calc(100vw - 24px); max-width: 360px; }
}
