:root {
  --positive: #10b981;
  --negative: #ef4444;
  --cn-up: #ef4444;
  --cn-down: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --neutral: #94a3b8;
  --accent: #22d3ee;
  --regime-hot: linear-gradient(135deg, #ef4444, #b91c1c);
  --regime-warm: linear-gradient(135deg, #f59e0b, #b45309);
  --regime-mixed: linear-gradient(135deg, #64748b, #334155);
  --regime-cold: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --regime-weak: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --regime-base: #64748b;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] {
  --bg-canvas: #0b1020;
  --bg-surface: #121a2e;
  --bg-surface-2: #1a2440;
  --border-subtle: #1f2a44;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
  --bg-canvas: #f6f7fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f3f9;
  --border-subtle: #e5e7eb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

button,
select {
  font: inherit;
}

button {
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -24px 40px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-canvas) 88%, transparent);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
}

.brand-meta,
.subline {
  color: var(--text-secondary);
  font-size: 12px;
}

.subline {
  max-width: 480px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  max-width: 480px;
}

.status-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.date-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.theme-toggle,
.tab-button,
.select-date {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-radius: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.select-date {
  min-width: 156px;
  height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

.theme-toggle {
  height: 38px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pill-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.pill strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.data-health-badge {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  display: inline-block;
  background: var(--neutral);
}

.data-health-badge.green .health-dot { background: var(--positive); }
.data-health-badge.yellow .health-dot { background: var(--warning); }
.data-health-badge.red .health-dot {
  background: var(--negative);
  animation: healthPulse 1.2s infinite;
}

@keyframes healthPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--negative) 45%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--negative) 0%, transparent); }
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--neutral);
  display: inline-block;
}

.dot.positive { background: var(--positive); }
.dot.warning { background: var(--warning); }
.dot.negative { background: var(--negative); }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 36px;
  margin-bottom: 48px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--regime-base) 10%, transparent), transparent 48%),
    var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.hero-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.regime-badge {
  min-height: 220px;
  border-radius: 16px;
  background: var(--regime-gradient, var(--regime-mixed));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.08), 0 18px 40px rgba(0, 0, 0, 0.25);
}

.regime-icon {
  font-size: 40px;
}

.regime-label {
  font-size: 46px;
  line-height: 1.15;
  font-weight: 900;
}

.regime-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 2px;
}

.regime-score {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-top: 6px;
}

.regime-score-max {
  font-size: 14px;
  opacity: 0.65;
  margin-left: 4px;
  font-weight: 500;
}

.hero-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 850;
}

.hero-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-surface-2) 80%, var(--bg-canvas));
  border: 1px solid var(--border-subtle);
  min-width: 96px;
}

.hero-stat-label {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-stat-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.hero-cta {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface-2));
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.hero-cta:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-surface-2));
  text-decoration: none;
}

.hero-finding {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface-2));
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
}

.hero-side {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section {
  margin-bottom: 56px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 800;
}

.section-note {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 24px;
}

.card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
}

.bar-row {
  margin-bottom: 16px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
}

.bar-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--regime-gradient, var(--regime-mixed));
  transition: width 0.4s ease;
}

.bar-fill.is-empty {
  background: repeating-linear-gradient(45deg, var(--bg-surface-2), var(--bg-surface-2) 4px, var(--border-subtle) 4px, var(--border-subtle) 8px);
  width: 100% !important;
  opacity: 0.4;
}

.bar-max {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 2px;
}

.breadth .bar-fill {
  background: linear-gradient(135deg, var(--positive), var(--accent));
}

.trade-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

.trade-chip-negative { background: color-mix(in srgb, var(--danger) 14%, var(--bg-surface-2)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border-subtle)); }
.trade-chip-warning  { background: color-mix(in srgb, var(--warning) 14%, var(--bg-surface-2)); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, var(--border-subtle)); }
.trade-chip-positive { background: color-mix(in srgb, var(--positive) 14%, var(--bg-surface-2)); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 40%, var(--border-subtle)); }

.limit-grid,
.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.limit-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.index-list {
  margin-top: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.index-list-head {
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
}

.index-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.index-row:last-child {
  border-bottom: 0;
}

.index-name { color: var(--text-primary); font-weight: 600; }
.index-value { color: var(--text-secondary); text-align: left; font-size: 13px; }
.index-pct { text-align: right; font-weight: 700; }

.limit-box,
.price-cell,
.kpi-card {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface-2);
}

.limit-label,
.price-label,
.kpi-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 4px;
}

.limit-number,
.price-number,
.kpi-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
}

.kpi-value {
  font-size: 30px;
}

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

.kpi-empty .kpi-value {
  opacity: 0.45;
}

.review-card {
  margin-top: 16px;
}

.key-finding-box {
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface-2));
  margin-bottom: 14px;
}

.key-finding-box strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-weight: 700;
}

.notice {
  margin: 8px 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-surface-2));
  color: var(--text-primary);
  font-size: 13px;
}

.notice-info {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface-2));
}

.tab-count-strict {
  margin-left: 4px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
}

.mono {
  font-family: var(--font-mono);
}

.positive-text { color: var(--positive); }
.negative-text { color: var(--negative); }
.cn-up-text { color: var(--cn-up); }
.cn-down-text { color: var(--cn-down); }
.warning-text { color: var(--warning); }
.muted-text { color: var(--text-muted); }

.index-table,
.entry-table,
.fallback-table {
  width: 100%;
  border-collapse: collapse;
}

.index-table th,
.index-table td,
.entry-table th,
.entry-table td,
.fallback-table th,
.fallback-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.index-table th,
.entry-table th,
.fallback-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.theme-tier {
  margin-bottom: 18px;
}

.theme-panel-note {
  margin: 4px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.theme-tier-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-chip {
  position: relative;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 13px;
}

.theme-chip.empty {
  color: var(--text-muted);
  border-style: dashed;
  background: transparent;
}

.theme-chip em {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 11px;
}

.theme-chip strong {
  color: var(--accent);
  margin-left: 4px;
  font-family: var(--font-mono);
}

.theme-chip-with-detail {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 10px;
  gap: 2px;
}

.theme-chip-main {
  font-weight: 650;
}

.theme-chip-sub {
  font-size: 11px;
  line-height: 1.3;
}

.theme-empty {
  font-size: 12px;
}

.theme-tier-note {
  margin: -2px 0 8px;
  font-size: 12px;
  line-height: 1.5;
}

.theme-tier-fading {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border-left: 3px solid var(--warning);
}

.theme-tier-fading > summary {
  cursor: pointer;
  list-style: none;
}

.theme-tier-fading > summary::-webkit-details-marker {
  display: none;
}

.theme-tier-fading > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-muted);
}

.theme-tier-fading[open] > summary::after {
  content: "▴";
}

.theme-tier-fading .theme-tier-title {
  margin-bottom: 0;
}

.theme-tier-fading .theme-tier-chips {
  margin-top: 10px;
}

.theme-tier-fading .theme-tier-title em {
  margin-left: 2px;
  font-style: normal;
  font-size: 11px;
}

.theme-tier-extra {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.theme-tier-extra summary {
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}

.badge-small {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-surface));
  color: var(--accent);
  font-size: 11px;
  font-family: var(--font-mono);
}

.review-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.review-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.review-item strong {
  color: var(--text-primary);
}

.details-toggle {
  margin-top: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.details-toggle summary {
  padding: 12px 14px;
  cursor: pointer;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: 700;
}

.details-body {
  overflow-x: auto;
  padding: 8px 14px 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-button {
  position: relative;
  min-height: 40px;
  padding: 8px 14px;
  cursor: pointer;
}

.tab-button.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  color: var(--accent);
}

.tab-button.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.plan-list {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.plan-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1199px) {
  .plan-list.two-col {
    grid-template-columns: 1fr;
  }
}

.conditional-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1199px) {
  .conditional-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.conditional-card {
  padding: 14px 14px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conditional-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.conditional-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.conditional-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg-surface-2);
  padding: 10px 12px;
  border-radius: 8px;
}

.conditional-prices > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conditional-prices .mono {
  font-size: 15px;
  font-weight: 700;
}

.conditional-rule {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.conditional-card .disclaimer-inline {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 11px;
}

.plan-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.plan-card.compact {
  box-shadow: none;
}

.plan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--regime-base) 8%, var(--bg-surface-2));
}

.plan-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.plan-symbol {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.plan-theme {
  align-self: flex-start;
}

.plan-card-body {
  padding: 20px;
}

.template-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-surface-2);
}

.template-title {
  margin: 0 0 6px;
  font-weight: 800;
}

.condition-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.condition-box {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.condition-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.condition-box ul,
.plain-list {
  margin: 0;
  padding-left: 18px;
}

.condition-box li,
.plain-list li {
  margin: 5px 0;
}

.disclaimer-inline {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.empty-state {
  padding: 34px 24px;
  border: 1px solid color-mix(in srgb, var(--regime-base) 25%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--regime-base) 8%, var(--bg-surface));
  text-align: center;
}

.empty-state.subtle {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.empty-state-icon {
  font-size: 34px;
  display: block;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-secondary);
}

.observe-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.observe-main {
  display: flex;
  flex-direction: column;
}

.observe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.conditional-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.observe-side {
  display: grid;
  gap: 12px;
}

.observe-side .card-pad {
  padding: 16px 18px;
}

@media (max-width: 1023px) {
  .observe-grid {
    grid-template-columns: 1fr;
  }
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 12px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.timeline-wrap {
  min-height: 360px;
}

.timeline-wrap .chart-box canvas {
  max-height: 320px;
}

.count-big {
  font-size: 42px;
  font-family: var(--font-mono);
  font-weight: 900;
}

.timeline-wrap {
  min-height: 320px;
}

.chart-box {
  position: relative;
  min-height: 260px;
}

.chart-box canvas {
  width: 100%;
  max-height: 280px;
}

.fallback-chart {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.risk-list {
  display: grid;
  gap: 10px;
}

.risk-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
}

.risk-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  margin-top: 6px;
  background: var(--warning);
}

.risk-dot.danger {
  background: var(--danger);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer {
  margin-top: 64px;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.footer strong {
  color: var(--text-primary);
}

.error-box {
  margin: 48px auto;
  max-width: 860px;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-surface));
}

.section-tight {
  margin-bottom: 40px;
}

.main-force-hint {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-surface-2));
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.emotion-stepper {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--regime-base) 8%, var(--bg-surface-2));
}

.emotion-stepper-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.emotion-stepper-head strong {
  color: var(--text-primary);
}

.emotion-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  position: relative;
}

.emotion-step {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.emotion-step.done {
  color: var(--text-secondary);
  background: var(--bg-surface-2);
}

.emotion-step.active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--regime-base) 60%, var(--border-subtle));
  background: color-mix(in srgb, var(--regime-base) 18%, var(--bg-surface));
  font-weight: 800;
}

.emotion-warning-overlay {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border-subtle));
  color: var(--text-primary);
  font-weight: 800;
  font-size: 13px;
}

.emotion-dot {
  font-family: var(--font-mono);
  color: inherit;
}

.emotion-advice {
  margin-top: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--regime-base);
  color: var(--text-primary);
  font-size: 13px;
}

.emotion-advice span {
  color: var(--text-secondary);
  margin-right: 8px;
}

.resonance-panel {
  display: grid;
  gap: 16px;
}

.resonance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.resonance-card {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface-2);
}

.resonance-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 10px;
  font-family: var(--font-mono);
}

.resonance-score strong {
  font-size: 30px;
  line-height: 1;
  color: var(--text-primary);
}

.resonance-score span {
  color: var(--text-secondary);
}

.resonance-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-surface);
  overflow: hidden;
}

.resonance-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--regime-gradient);
}

.resonance-theme .resonance-bar span {
  background: var(--accent);
}

.resonance-stock .resonance-bar span {
  background: var(--positive);
}

.resonance-total {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.resonance-total strong {
  color: var(--text-primary);
  font-size: 30px;
  line-height: 1;
}

.resonance-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}

.resonance-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 8%, var(--bg-surface-2));
  color: var(--text-secondary);
  font-size: 12px;
}

.resonance-result p {
  margin: 0;
  color: var(--text-secondary);
}

.template-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.template-stats-card {
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
}

.template-stats-card.template-stats-pending {
  background: color-mix(in srgb, var(--neutral) 6%, var(--bg-surface));
}

.tsc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 10px;
}

.tsc-icon { font-size: 18px; }

.tsc-title {
  font-weight: 700;
  font-size: 14px;
}

.tsc-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.tsc-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: baseline;
  font-size: 13px;
  gap: 12px;
}

.tsc-row > span {
  color: var(--text-secondary);
}

.tsc-row > strong {
  text-align: right;
  font-weight: 700;
}

.tsc-row em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}

.tsc-section-label {
  padding-top: 8px;
  margin: 10px 0 4px;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tsc-bucket-mini {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.tsc-row-headline {
  font-weight: 800;
}

.tsc-row-empty {
  display: block;
  padding: 4px 0;
  font-size: 12px;
}

.tsc-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.resonance-verdict {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  color: white;
  font-weight: 800;
}

.verdict-attack { background: var(--positive); }
.verdict-partial { background: var(--warning); }
.verdict-defense { background: var(--neutral); color: #111827; }

.strategy-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.strategy-badge-row.compact {
  margin-top: 2px;
  gap: 4px;
}

.strategy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-badge-row.compact .strategy-badge {
  font-size: 11px;
  min-height: 24px;
  padding: 3px 6px;
}

.badge-wave {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface-2));
}

.badge-style {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 9%, var(--bg-surface-2));
}

.badge-discipline {
  border-color: color-mix(in srgb, var(--positive) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 8%, var(--bg-surface-2));
}

.badge-countdown {
  border-color: color-mix(in srgb, var(--regime-base) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--regime-base) 10%, var(--bg-surface-2));
}

.position-block {
  margin-top: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.position-block summary {
  cursor: pointer;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: 800;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.position-grid h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.position-list,
.exit-list {
  margin: 0;
  padding-left: 18px;
}

.position-step,
.exit-rule {
  margin: 5px 0;
  color: var(--text-secondary);
}

.discipline-card {
  padding: 20px 22px;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--regime-base);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.discipline-card .section-head {
  margin-bottom: 10px;
}

.discipline-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.discipline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.discipline-item span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--regime-base) 18%, var(--bg-surface));
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 800;
}

.strategy-cheatsheet {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.strategy-cheatsheet summary {
  cursor: pointer;
  padding: 14px 18px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-weight: 800;
}

.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.cheatsheet-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.cheatsheet-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.cheatsheet-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.timeline-stage-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.timeline-stage-dot {
  min-width: 0;
  min-height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}

.timeline-stage-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--neutral);
  margin-bottom: 2px;
}

.timeline-stage-dot span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.stage-potential::before,
.stage-freeze::before { background: #3b82f6; }
.stage-ignition::before { background: #64748b; }
.stage-accelerate::before { background: #f59e0b; }
.stage-climax::before { background: #ef4444; }
.stage-diverge::before { background: #8b5cf6; }
.stage-fakeout_up::before { background: var(--warning); }

.regime-heatmap {
  display: grid;
  grid-template-columns: 72px repeat(var(--heatmap-cols), minmax(28px, 1fr));
  gap: 4px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}

.heatmap-corner,
.heatmap-row-label,
.heatmap-date,
.heatmap-count {
  min-width: 0;
  font-size: 11px;
}

.heatmap-row-label {
  color: var(--text-secondary);
  font-weight: 800;
}

.heatmap-date {
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
}

.heatmap-cell {
  min-height: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface-2);
}

.heatmap-cell.active {
  background: color-mix(in srgb, var(--cell-color) 78%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--cell-color) 55%, var(--border-subtle));
}

.heatmap-count {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.sticky-strategy-bar {
  position: sticky;
  top: 84px;
  z-index: 18;
  margin: 0 -24px 24px;
  padding: 8px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  background: color-mix(in srgb, var(--regime-base) 12%, var(--bg-surface));
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(6px);
  font-size: 13px;
}

.bar-stage {
  font-weight: 800;
  color: var(--text-primary);
}

.bar-resonance {
  color: var(--text-secondary);
}

.bar-advice {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-jump {
  white-space: nowrap;
}

.decision-overview {
  display: grid;
  grid-template-columns: auto minmax(260px, 0.85fr) minmax(0, 1.7fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.decision-regime {
  display: grid;
  place-items: center;
  width: 74px;
  min-height: 82px;
  border: 1px solid color-mix(in srgb, var(--regime-base) 42%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--regime-base) 10%, var(--bg-surface-2));
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.decision-regime-icon {
  font-size: 30px;
  line-height: 1;
}

.decision-regime span:not(.decision-regime-icon) {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
}

.decision-regime em {
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
}

.decision-primary {
  min-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--regime-base) 35%, var(--border-subtle));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--regime-base) 14%, var(--bg-surface-2)), var(--bg-surface-2));
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.decision-eyebrow {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.decision-primary h2 {
  margin: 4px 0 4px;
  font-size: 17px;
  line-height: 1.3;
}

.decision-primary p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.decision-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.decision-primary-actions a {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.decision-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.decision-card {
  min-height: 100px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.decision-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.decision-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.45;
}

.decision-card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.decision-footnote {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.decision-footnote span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}

.decision-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 280px;
  padding: 6px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface-2);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.decision-regime:hover,
.decision-primary:hover,
.decision-chip:hover,
.decision-regime:focus-visible,
.decision-primary:focus-visible,
.decision-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface-2));
  transform: translateY(-1px);
  outline: none;
}

.decision-chip b {
  font-size: 14px;
  line-height: 1;
}

.decision-chip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-chip em {
  color: var(--text-tertiary);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.stage-warning {
  margin: 12px 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-surface));
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 700;
}

.glossary-trigger {
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 60%, transparent);
  cursor: help;
}

.glossary-trigger:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 2px;
  border-radius: 3px;
}

.glossary-popover {
  position: absolute;
  width: 280px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  font-size: 13px;
  line-height: 1.6;
}

.glossary-title {
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.glossary-body {
  margin: 0;
  color: var(--text-secondary);
}

.glossary-popover.hidden {
  display: none;
}

.data-health-panel.hidden {
  display: none;
}

.data-health-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start end;
  padding: 84px 24px 24px;
  background: rgba(0, 0, 0, 0.22);
}

.data-health-card {
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--neutral);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  position: relative;
}

.data-health-card.health-green { border-left-color: var(--positive); }
.data-health-card.health-yellow { border-left-color: var(--warning); }
.data-health-card.health-red { border-left-color: var(--negative); }

.health-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  cursor: pointer;
}

.health-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 32px;
}

.health-title-row h3 {
  margin: 0;
}

.health-status-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--bg-canvas);
  background: var(--neutral);
}

.health-status-pill.green { background: var(--positive); }
.health-status-pill.yellow { background: var(--warning); }
.health-status-pill.red { background: var(--negative); }

.health-row-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.health-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.health-row span {
  color: var(--text-secondary);
}

.health-row strong {
  color: var(--text-primary);
}

.health-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.fulfillment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fulfillment-buckets {
  display: grid;
  gap: 16px;
}

.fulfillment-bucket {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface-2);
}

.fulfillment-bucket[open] .fulfillment-bucket-head {
  border-bottom: 1px solid var(--border-subtle);
}

.fulfillment-bucket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.fulfillment-bucket-head::-webkit-details-marker {
  display: none;
}

.fulfillment-bucket-head::after {
  content: "▾";
  margin-left: 8px;
  color: var(--text-muted);
}

.fulfillment-bucket[open] .fulfillment-bucket-head::after {
  content: "▴";
}

.fulfillment-bucket-active .fulfillment-bucket-head {
  color: var(--positive);
}

.fulfillment-bucket-conditional .fulfillment-bucket-head {
  color: var(--warning);
}

.fulfillment-bucket-observe .fulfillment-bucket-head {
  color: var(--text-secondary);
}

.fulfillment-bucket .fulfillment-grid {
  margin-top: 0;
  padding: 12px;
}

.fulfillment-card {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--bg-surface);
}

.fulfillment-positive { border-left-color: var(--positive); }
.fulfillment-negative { border-left-color: var(--negative); }
.fulfillment-warning { border-left-color: var(--warning); }
.fulfillment-neutral { border-left-color: var(--neutral); }

.fulfillment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.fulfillment-head h4 {
  margin: 0;
  font-size: 15px;
}

.fulfillment-meta {
  margin-top: 4px;
  font-size: 12px;
}

.fulfillment-bucket-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.bucket-active {
  color: var(--positive);
  background: color-mix(in srgb, var(--positive) 16%, var(--bg-surface));
}

.bucket-conditional {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 16%, var(--bg-surface));
}

.bucket-observe {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-muted) 16%, var(--bg-surface));
}

.fulfillment-verdict {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.fulfillment-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
  font-size: 12px;
}

.fulfillment-body span {
  color: var(--text-secondary);
}

.fulfillment-body strong {
  display: block;
  color: var(--text-primary);
}

.fulfillment-foot {
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.fulfillment-quality {
  padding: 6px 0 10px;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
}

.premarket-card {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface));
}

.premarket-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.premarket-task {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.premarket-task:last-child {
  border-bottom: 0;
}

.premarket-time {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 800;
}

.premarket-task.priority-high .premarket-time {
  color: var(--negative);
}

/* V10 competitive dashboard sections */
.hero-tone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.tone-positive {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 10%, var(--bg-surface));
}

.tone-neutral {
  color: var(--text-secondary);
}

.tone-warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-surface));
}

.tone-danger {
  color: var(--negative);
  border-color: color-mix(in srgb, var(--negative) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--negative) 9%, var(--bg-surface));
}

.hero-tone-line {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-master-plan {
  margin-top: 14px;
  max-width: 860px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--bg-surface-2));
}

.master-plan-positive {
  border-left-color: var(--positive);
}

.master-plan-neutral {
  border-left-color: var(--accent);
}

.master-plan-danger {
  border-left-color: var(--negative);
}

.master-plan-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 800;
}

.master-plan-icon {
  font-size: 18px;
  line-height: 1.4;
}

.master-plan-constraints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.master-plan-chip {
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
}

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

.market-overview-panel {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--regime-base) 9%, transparent), transparent 64%),
    var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.market-overview-visual {
  min-height: 178px;
  border-radius: 12px;
  background: var(--regime-gradient, var(--regime-mixed));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 32px rgba(255, 255, 255, 0.08);
}

.market-overview-icon {
  font-size: 34px;
  line-height: 1;
}

.market-overview-visual strong {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.1;
}

.market-overview-visual em {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  opacity: 0.74;
}

.market-overview-score {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 900;
}

.market-overview-score small {
  margin-left: 3px;
  font-size: 12px;
  opacity: 0.68;
}

.market-overview-main {
  min-width: 0;
}

.market-overview-title {
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.35;
}

.market-overview-copy {
  margin: 0 0 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.market-overview-stats .snapshot-card {
  min-height: 92px;
  background: color-mix(in srgb, var(--bg-surface-2) 72%, var(--bg-surface));
}

.snapshot-card {
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.snapshot-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.snapshot-value {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 900;
}

.snapshot-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.watch-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.watch-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.watch-table th,
.watch-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.watch-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  background: var(--bg-surface-2);
}

.watch-table tbody tr:last-child td {
  border-bottom: 0;
}

.watch-row-active {
  background: color-mix(in srgb, var(--positive) 5%, var(--bg-surface));
}

.priority-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 900;
  border: 1px solid var(--border-subtle);
}

.priority-active {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 12%, var(--bg-surface));
}

.priority-cond {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-surface));
}

.stock-name,
.theme-name,
.template-name {
  font-weight: 800;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.theme-icon {
  margin-right: 6px;
}

.mini-line {
  margin-top: 3px;
  font-size: 11px;
}

.watch-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 4px 4px 0;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  white-space: nowrap;
}

.tag-whitelist {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 45%, var(--border-subtle));
}

.tag-huddle,
.tag-limithead {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border-subtle));
}

.tag-cond {
  color: var(--text-secondary);
}

.tag-risk {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border-subtle));
}

.buy-strategies-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.buy-group {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-top-width: 4px;
  border-radius: 8px;
  background: var(--bg-surface);
}

.buy-group-primary {
  border-top-color: var(--positive);
}

.buy-group-secondary {
  border-top-color: var(--warning);
}

.buy-group-tertiary {
  border-top-color: var(--accent);
}

.buy-group-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.buy-group-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 800;
}

.buy-group-theme {
  font-weight: 900;
}

.buy-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.buy-group-stock {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-surface-2);
  font-size: 12px;
}

.buy-group-constraints {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
}

.buy-group-constraints li + li {
  margin-top: 5px;
}

.buy-group-recommend {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.forbidden-banner,
.final-exec-banner,
.position-risk-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}

.forbidden-banner {
  border-color: color-mix(in srgb, var(--negative) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--negative) 5%, var(--bg-surface));
}

.forbidden-head,
.final-exec-head,
.prc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.forbidden-title,
.final-exec-title,
.prc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.forbidden-body {
  padding: 14px 16px;
}

.forbidden-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.forbidden-chip {
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 12%, var(--bg-surface));
  font-weight: 800;
  font-size: 12px;
}

.forbidden-note {
  margin: 10px 0 0;
  color: var(--text-secondary);
}

.final-exec-banner {
  margin-bottom: 12px;
}

.final-exec-stage {
  margin-left: auto;
  font-size: 12px;
}

.final-exec-list {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
  display: grid;
  gap: 10px;
}

.final-exec-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.exec-rank {
  line-height: 1.5;
}

.exec-name {
  font-weight: 900;
}

.position-risk-card {
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface));
}

.prc-list {
  margin: 0;
  padding: 12px 18px 16px 32px;
  color: var(--text-secondary);
}

.prc-list li + li {
  margin-top: 6px;
}

@media (max-width: 1023px) {
  .market-snapshot-grid,
  .buy-strategies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-overview-panel {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .market-overview-visual {
    min-height: 150px;
  }

  .decision-overview {
    grid-template-columns: auto minmax(220px, 1fr);
  }

  .decision-chip-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .market-snapshot-grid,
  .buy-strategies-grid {
    grid-template-columns: 1fr;
  }

  .market-overview-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .market-overview-visual {
    min-height: 116px;
  }

  .market-overview-visual strong {
    font-size: 26px;
  }

  .market-overview-title {
    font-size: 19px;
  }

  .decision-overview,
  .decision-primary {
    padding: 10px;
  }

  .decision-overview {
    grid-template-columns: 1fr;
  }

  .decision-regime {
    width: 100%;
    min-height: 56px;
    grid-template-columns: auto auto auto;
    justify-content: center;
    gap: 8px;
  }

  .decision-regime-icon {
    font-size: 22px;
  }

  .decision-primary {
    min-height: auto;
  }

  .decision-primary h2 {
    font-size: 17px;
  }

  .decision-chip {
    max-width: 100%;
  }

  .hero-master-plan {
    padding: 12px;
  }

  .master-plan-constraints {
    flex-direction: column;
  }

  .snapshot-value {
    font-size: 22px;
  }
}

@media (max-width: 1023px) {
  .topbar-inner,
  .hero-grid,
  .grid-2,
  .grid-3,
  .resonance-grid,
  .position-grid,
  .cheatsheet-grid,
  .review-line,
  .observe-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    align-items: stretch;
  }

  .pill-row {
    justify-content: flex-start;
  }

  .hero-side {
    position: static;
    margin-bottom: 18px;
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .app-shell {
    padding: 0 14px 40px;
  }

  .topbar {
    margin: 0 -14px 32px;
    padding: 12px 14px;
  }

  .hero {
    padding: 22px;
  }

  .regime-badge {
    min-height: 180px;
  }

  .regime-label {
    font-size: 38px;
  }

  .hero-title {
    font-size: 24px;
  }

  .emotion-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .regime-heatmap {
    grid-template-columns: 58px repeat(var(--heatmap-cols), minmax(24px, 1fr));
    gap: 3px;
    overflow-x: auto;
  }

  .sticky-strategy-bar {
    grid-template-columns: auto 1fr;
    margin: 0 -14px 16px;
    padding: 6px 14px;
    top: 76px;
  }

  .bar-advice,
  .bar-jump {
    display: none;
  }

  .data-health-panel {
    place-items: end center;
    padding: 16px;
  }

  .premarket-task {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .limit-grid,
  .price-grid,
  .conditional-grid,
  .condition-columns {
    grid-template-columns: 1fr;
  }

  .tabs {
    position: sticky;
    top: 96px;
    z-index: 10;
    padding: 8px 0;
    background: var(--bg-canvas);
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab-button {
    white-space: nowrap;
  }
}

@media print {
  :root {
    --bg-canvas: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-2: #f3f4f6;
    --border-subtle: #d1d5db;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --shadow-card: none;
  }

  body {
    background: #ffffff;
    color: #111827;
  }

  .app-shell {
    max-width: none;
    padding: 0;
  }

  .topbar {
    position: static;
    margin: 0 0 20px;
    padding: 0 0 12px;
    background: #ffffff;
    backdrop-filter: none;
  }

  .date-switcher,
  .theme-toggle,
  .tabs,
  .icon-button,
  .select-date,
  .sticky-strategy-bar,
  .data-health-badge,
  .data-health-panel,
  .glossary-popover {
    display: none !important;
  }

  .tab-panel {
    display: block !important;
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .card,
  .plan-card,
  .fulfillment-card,
  .premarket-card,
  .template-stats-card,
  .regime-heatmap,
  .hero,
  .discipline-card,
  .strategy-cheatsheet {
    box-shadow: none;
    break-inside: avoid;
  }

  details.strategy-cheatsheet:not([open]) > .cheatsheet-grid {
    display: grid !important;
  }

  .strategy-cheatsheet summary {
    border-bottom: 1px solid var(--border-subtle);
  }

a {
    color: #111827;
    text-decoration: underline;
  }
}

.trading-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.paper-session-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.paper-session-pill {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
}

.paper-session-pill strong,
.paper-session-pill em {
  font-family: var(--font-mono);
  font-style: normal;
}

.paper-refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  padding: 6px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.paper-refresh-status em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 11px;
}

.paper-refresh-ok .pulse-dot {
  background: var(--positive);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--positive) 14%, transparent);
}

.paper-refresh-error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border-subtle));
  color: var(--danger);
}

.paper-refresh-error .pulse-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.today-entry-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border-subtle));
  font-family: var(--font-sans);
  font-size: 11px;
}

.paper-session-pill.active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface));
  color: var(--text-primary);
}

.paper-discipline-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-surface));
}

.paper-discipline-notice.shadow {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
}

.paper-discipline-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 14px;
}

.paper-discipline-notice p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.paper-discipline-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.paper-discipline-stats span {
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.paper-sizing-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.paper-sizing-note span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.paper-sizing-note .dynamic-cap-pill {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface-2));
}

.paper-position-report {
  margin: 12px 0 14px;
}

.paper-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.paper-report-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.paper-report-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.paper-report-metrics,
.paper-risk-radar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.paper-report-metrics span {
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
}

.paper-report-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.paper-report-block {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.paper-report-block > strong {
  font-size: 12px;
  color: var(--text-primary);
}

.paper-report-block span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  min-width: 0;
}

.paper-report-block em {
  color: var(--text-primary);
  font-style: normal;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.paper-report-note {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.paper-add-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  font-size: 12px;
}

.paper-add-candidates strong,
.paper-add-candidates span {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--bg-surface-2);
}

.paper-add-candidates strong {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--positive) 12%, var(--bg-surface-2));
  border-color: color-mix(in srgb, var(--positive) 35%, var(--border-subtle));
}

.paper-add-candidates span {
  color: var(--text-secondary);
}

.paper-report-positions {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.paper-report-position-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 0.8fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.paper-report-position-row span:first-child {
  display: grid;
  gap: 2px;
}

.paper-report-position-row em {
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--font-mono);
}

.trading-metric {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.trading-metric span {
  color: var(--text-secondary);
  font-size: 12px;
}

.trading-metric strong {
  font-family: var(--font-mono);
  font-size: 18px;
}

.trading-panels {
  align-items: start;
}

.compact-table-wrap {
  overflow-x: auto;
}

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

.compact-table th,
.compact-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  white-space: nowrap;
}

.trading-flow {
  display: grid;
  gap: 8px;
}

.flow-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.flow-side {
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: color-mix(in srgb, var(--text-muted) 16%, var(--bg-surface));
  color: var(--text-secondary);
}

.flow-side.buy {
  background: color-mix(in srgb, var(--positive) 16%, var(--bg-surface));
  color: var(--positive);
}

.flow-side.filled,
.flow-side.partial_filled,
.flow-side.actionable {
  background: color-mix(in srgb, var(--positive) 16%, var(--bg-surface));
  color: var(--positive);
}

.flow-side.unfilled,
.flow-side.rejected,
.flow-side.cancelled {
  background: color-mix(in srgb, var(--negative) 16%, var(--bg-surface));
  color: var(--negative);
}

.flow-side.watch_only,
.flow-side.observe,
.flow-side.near_trigger,
.flow-side.touched {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  color: var(--text-secondary);
}

.flow-side.sell,
.flow-side.block,
.flow-side.pending_sell,
.flow-side.blocked_t1 {
  background: color-mix(in srgb, var(--negative) 16%, var(--bg-surface));
  color: var(--negative);
}

.trading-risk-card {
  margin-top: 16px;
}

.inline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.2;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.tag-muted {
  color: var(--text-muted);
}

.tag-good {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 36%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 10%, var(--bg-surface-2));
}

.tag-warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface-2));
}

.tag-danger {
  color: var(--negative);
  border-color: color-mix(in srgb, var(--negative) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--negative) 10%, var(--bg-surface-2));
}

@media (max-width: 760px) {
  .paper-report-head,
  .paper-report-position-row {
    grid-template-columns: 1fr;
  }

  .paper-report-head {
    display: grid;
  }

  .paper-report-subgrid {
    grid-template-columns: 1fr;
  }
}

.lesson-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.lesson-line {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.lesson-line strong {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .lesson-line {
    grid-template-columns: 1fr;
  }
}

.v8-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  color: var(--text-secondary);
  font-size: 11px;
  cursor: help;
}

.v8-badge strong {
  color: var(--accent);
}

.v8-badge-icon {
  font-size: 14px;
}

.report-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  line-height: 1.2;
  cursor: help;
}

.source-badge-hermes {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--positive) 12%, var(--bg-surface));
}

.source-badge-fallback {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
}

.source-badge-neutral {
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.suggest-highlight {
  color: var(--text-primary);
  font-weight: 700;
}

.suggest-normal {
  color: var(--text-secondary);
}

.iteration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.iteration-card {
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
}

.iteration-good {
  border-left: 4px solid var(--positive);
}

.iteration-bad {
  border-left: 4px solid var(--danger);
}

.iter-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.iter-title {
  margin: 0;
  font-size: 14px;
}

.only-action-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.only-action-main,
.only-action-aside {
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
}

.only-action-main {
  border-left: 4px solid var(--accent);
}

.only-action-aside {
  border-left: 4px solid var(--danger);
}

.oa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.oa-title {
  margin: 0;
  font-size: 15px;
}

.oa-body {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
}

.oa-confirm strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.oa-confirm ul,
.oa-no-trade {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.oa-head-danger .oa-title {
  color: var(--danger);
}

.signal-reference-details {
  padding: 14px 16px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}

.signal-reference-details > summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 700;
}

.signal-reference-note {
  margin-top: 10px;
  color: var(--text-secondary);
}

.paper-signal-bridge {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
}

.bridge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.paper-real-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--positive) 16%, var(--bg-surface));
  color: var(--positive);
  font-size: 12px;
  font-weight: 700;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bridge-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.bridge-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.bridge-grid strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-list.compact {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.code-iteration-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.code-iteration-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.code-iteration-head strong {
  color: var(--text-primary);
}

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

.mira-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
}

.mira-state {
  border-left: 4px solid var(--accent);
}

.mira-kicker {
  margin-bottom: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.mira-readiness {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
}

.mira-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.mira-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

@media (max-width: 1024px) {
  .only-action-grid {
    grid-template-columns: 1fr;
  }

  .mira-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-discipline-notice {
    grid-template-columns: 1fr;
  }

  .paper-discipline-stats {
    justify-content: flex-start;
  }

  .bridge-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .iteration-grid {
    grid-template-columns: 1fr;
  }

  .mira-grid {
    grid-template-columns: 1fr;
  }
}
