:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --ink: #111827;
  --ink-muted: #6B7280;
  --ink-faint: #9CA3AF;
  --emerald: #0F766E;
  --emerald-soft: rgba(15, 118, 110, 0.08);
  --ochre: #B45309;
  --ochre-soft: rgba(180, 83, 9, 0.09);
  --crimson: #B91C1C;
  --crimson-soft: rgba(185, 28, 28, 0.08);
  --indigo: #3730A3;
  --indigo-soft: rgba(55, 48, 163, 0.08);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.wrap {
  max-width: 1152px;
  margin: 0 auto;
  padding: 28px 32px 64px 32px;
  min-height: 760px;
}
@media (max-width: 640px) {
  .wrap { padding: 16px 18px 48px 18px; }
}
html.is-embedded .wrap {
  padding-top: 14px;
}
.hidden { display: none !important; }

/* Masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 8px;
}
.masthead h1 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 8px 0;
  color: var(--ink);
  font-weight: 700;
}
.subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.regime-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.score-ring {
  min-width: 72px;
  text-align: center;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.score-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.score-lbl {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.status-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.mini-db-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.mini-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--ink-muted);
}
.mini-pill.ok {
  border-color: rgba(15, 118, 110, 0.25);
  background: var(--emerald-soft);
  color: var(--emerald);
}
.mini-pill.bad {
  border-color: rgba(185, 28, 28, 0.25);
  background: var(--crimson-soft);
  color: var(--crimson);
}

/* Buttons & Segmented Controls */
.btn {
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: #9CA3AF;
  background: #F9FAFB;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: #111827;
  border-color: #111827;
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) {
  background: #1F2937;
  border-color: #1F2937;
}
.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.seg button.active {
  background: #111827;
  color: #FFFFFF;
}
.seg button:hover:not(.active) {
  color: var(--ink);
  background: rgba(20, 25, 31, 0.05);
}

/* Primary Navigation Tabs */
.primary-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.primary-tabs {
  display: inline-flex;
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.primary-tabs button {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.primary-tabs button.active {
  background: #111827;
  color: #FFFFFF;
}
.primary-tabs button:hover:not(.active) {
  color: var(--ink);
  background: rgba(17, 24, 39, 0.05);
}
.tab-subinfo {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Alert Banner */
.alert-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: var(--crimson-soft);
  color: var(--crimson);
  font-size: 12.5px;
}
.alert-banner.warn {
  border-color: rgba(180, 83, 9, 0.28);
  background: var(--ochre-soft);
  color: var(--ochre);
}
.alert-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.alert-desc {
  color: var(--ink);
  opacity: 0.85;
  font-size: 12px;
}

/* Pills */
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.pill-pass { background: var(--emerald-soft); color: var(--emerald); }
.pill-mid { background: var(--ochre-soft); color: var(--ochre); }
.pill-fail { background: rgba(91, 100, 112, 0.11); color: var(--ink-muted); }
.pill-hot { background: var(--crimson-soft); color: var(--crimson); }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-grid.kpi-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1280px) {
  .kpi-grid.kpi-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease;
}
.kpi-card:hover { border-color: var(--border-strong); }
.kpi-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 6px;
  margin-bottom: 6px;
}
.kpi-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-muted);
}
.kpi-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
}
.kpi-bar-track {
  position: relative;
  height: 5px;
  background: #F3F4F6;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.kpi-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Module Cards & Layouts */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
}
.two-col .module-card { margin-bottom: 0; }
.mod-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.cmp-scatter-head {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px 16px;
}
.cmp-scatter-head > div:first-child {
  flex: 1 1 0;
  min-width: 0;
}
.cmp-scatter-head #seg-cmp-scatter {
  flex: 0 0 auto;
}
.mod-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.mod-desc {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Readiness Strip */
.readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 820px) {
  .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ready-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ready-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.ready-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* Tables */
.table-wrap {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
}
.table-wrap.tall {
  max-height: 580px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: #111827;
  border-bottom: 1.5px solid #D1D5DB;
  font-weight: 600;
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  z-index: 2;
}
thead th.left { text-align: left; }
thead th.center { text-align: center; }
thead th.sortable {
  cursor: pointer;
  user-select: none;
}
thead th.sortable:hover {
  background: #EFF4F9;
}
thead th.sort-active {
  color: var(--indigo);
}
tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody td.left {
  text-align: left;
  font-family: var(--font-sans);
}
tbody td.center { text-align: center; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:hover { background: var(--emerald-soft); }
tbody tr.clickable { cursor: pointer; }
.up { color: var(--crimson); font-weight: 600; }
.down { color: var(--emerald); font-weight: 600; }
.flat { color: var(--ink-muted); }
.val-guide-bar {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.55;
}
.val-guide-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.val-guide-row + .val-guide-row {
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.val-guide-bar strong { color: var(--ink); font-weight: 700; white-space: nowrap; }
.val-guide-bar b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.val-guide-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.val-guide-summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--ink);
  user-select: none;
}
.val-guide-summary::-webkit-details-marker { display: none; }
.val-guide-summary-left {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.val-guide-caret {
  display: inline-block;
  font-size: 11px;
  color: var(--ink-muted);
  transition: transform 0.16s ease;
}
.val-guide-details[open] .val-guide-caret {
  transform: rotate(90deg);
}
.val-guide-tagline {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 400;
}
.val-guide-toggle-hint {
  font-size: 11px;
  color: var(--ink-faint);
}
.val-guide-body {
  padding: 2px 13px 13px 13px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.6;
}
.val-guide-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 6px 0;
}
.val-guide-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.val-guide-steps ul {
  margin: 4px 0 2px 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.val-guide-steps b, .val-guide-rules b {
  color: var(--ink);
  font-weight: 600;
}
.val-guide-steps code {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 10.8px;
  color: var(--ink);
}
.val-guide-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #FFFFFF;
}
.val-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.48;
  table-layout: fixed;
}
.val-guide-table th,
.val-guide-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.val-guide-table th:nth-child(1) { width: 12%; }
.val-guide-table th:nth-child(2) { width: 22%; }
.val-guide-table th:nth-child(3) { width: 16%; }
.val-guide-table th:nth-child(4) { width: 17%; }
.val-guide-table th:nth-child(5) { width: 20%; }
.val-guide-table th:nth-child(6) { width: 13%; }
.val-guide-table th {
  background: #F9FAFB;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.val-guide-table tbody tr:last-child td {
  border-bottom: none;
}
.val-guide-table td b {
  color: var(--ink);
}
.val-guide-rules {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 11px;
}
.stmt-main {
  display: block;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.stmt-card {
  padding: 0;
}
.stmt-details {
  width: 100%;
}
.stmt-summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  user-select: none;
}
.stmt-summary::-webkit-details-marker { display: none; }
.stmt-summary-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.stmt-caret {
  display: inline-block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-muted);
  transition: transform 0.16s ease;
}
.stmt-details[open] .stmt-caret {
  transform: rotate(90deg);
}
.stmt-toggle-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.stmt-body {
  padding: 0 20px 18px 20px;
  border-top: 1px dashed var(--border);
}
.stmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0;
}
.stmt-chg {
  display: block;
  font-size: 10.5px;
  line-height: 1.25;
  margin-top: 2px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.stmt-chg .up, .stmt-chg .down { font-weight: 500; }
.stmt-chg .sep { margin: 0 4px; color: var(--border-strong); }
#stmt-tbody.hide-deltas .stmt-chg { display: none; }
#stmt-tbody.hide-deltas .stmt-main { font-weight: 400; }

/* Watermark grid */
.wm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.wm-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.wm-key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  word-break: break-all;
}
.wm-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  word-break: break-word;
  line-height: 1.45;
}
.wm-group {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.wm-age {
  margin-top: 5px;
}

/* Data Inspect Enhancement */
.audit-summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.snap-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.snap-stat {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  min-width: 0;
}
.snap-stat-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.snap-stat-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.cov-track {
  display: inline-block;
  width: 110px;
  height: 6px;
  background: #F3F4F6;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
  overflow: hidden;
}
.cov-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.sample-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--ink);
  border-radius: 6px;
  padding: 2px 6px;
  margin: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sample-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
}
.probe-group-row td {
  background: #F8FAFC;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.snap-industry-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

/* Forms & Filter Grid */
.presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.ctrl-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}
.preset-btn {
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: #374151;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-btn:hover {
  border-color: #9CA3AF;
  color: #111827;
  background: #F9FAFB;
}
.preset-btn.active {
  background: #111827;
  border-color: #111827;
  color: #FFFFFF;
}
.preset-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-alt);
  color: var(--ink-faint);
  border-color: var(--border);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}
@media (max-width: 1024px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .filter-grid { grid-template-columns: 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.input, .select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 9px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink);
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s ease;
}
.input.mono, .select.mono {
  font-family: var(--font-mono);
}
.input:focus, .select:focus {
  border-color: #6B7280;
}
.range-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 5px;
}
.range-sep {
  font-size: 11px;
  color: var(--ink-faint);
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inline-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Summary Bar & Pagination */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink-muted);
}
.summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.summary-metrics strong {
  color: var(--ink);
  font-family: var(--font-mono);
}
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Stock Search Bar & Dropdown */
.stock-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 440px;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 10px 25px -8px rgba(17, 24, 39, 0.16);
}
.search-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #F3F4F6;
  font-size: 12.5px;
}
.search-opt:last-child { border-bottom: none; }
.search-opt:hover { background: var(--surface-alt); }

/* Charts (uPlot) */
.chart-box,
.chart-box-tall,
.chart-box-vol {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.chart-box { height: 300px; }
.chart-box-tall { height: 360px; }
.chart-box-vol { height: 155px; margin-top: 8px; }
.chart-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.chart-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 9px;
  border-radius: 2px;
}
.legend-line {
  display: inline-block;
  width: 15px;
  height: 2px;
  border-radius: 1px;
}
.chart-hint {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.chart-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.uplot { font-family: var(--font-sans) !important; }
.chart-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  display: none;
  min-width: 170px;
  max-width: 260px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
}
.tt-date {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--ink);
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0;
}
.tt-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-muted);
}
.tt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tt-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}

/* Audit & Raw JSON */
details.raw-box {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  padding: 8px 12px;
}
details.raw-box summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
pre.json-pre {
  margin: 10px 0 0 0;
  padding: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  max-height: 300px;
  overflow: auto;
  color: var(--ink);
}
.notes-card {
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-left: 3px solid #D1D5DB;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.notes-card h3 {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--ink);
  margin: 0 0 6px 0;
}
.notes-card ul { margin: 0; padding-left: 18px; }
.notes-card li { margin: 3px 0; }
.notes-card code {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #111827;
}

/* ==================== Valuation Observatory ==================== */
.val-cap-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink-muted);
}
.val-cap-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.val-cap-items strong {
  color: var(--ink);
  font-family: var(--font-mono);
}
.val-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 1080px) {
  .val-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .val-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.val-subcard {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.val-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.val-subtitle {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.val-cycle-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.val-cycle-ctrls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.val-cycle-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: help;
}
.val-cycle-summary strong {
  color: var(--ink);
  font-weight: 700;
}
.val-cycle-sep {
  color: var(--ink-faint);
}
.val-cycle-pos {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(75, 85, 99, 0.10);
  color: #4B5563;
}
.val-cycle-pos.tone-emerald {
  background: rgba(15, 118, 110, 0.10);
  color: var(--emerald);
}
.val-cycle-pos.tone-crimson {
  background: rgba(185, 28, 28, 0.10);
  color: var(--crimson);
}
.val-cycle-pos.tone-ochre {
  background: rgba(180, 83, 9, 0.11);
  color: var(--ochre);
}
.val-cycle-pos.tone-neutral {
  background: rgba(75, 85, 99, 0.10);
  color: #4B5563;
}
.val-jump-link {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.06);
  color: var(--emerald);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.45;
  white-space: nowrap;
}
.val-jump-link:hover {
  background: rgba(15, 118, 110, 0.14);
}
.val-warn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.val-warn-row > div {
  flex: 1 1 420px;
}
.val-jump-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(180, 83, 9, 0.42);
  background: #FFFFFF;
  color: #B45309;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.val-jump-btn:hover {
  background: #FFFBEB;
  border-color: #B45309;
}
.val-sliders-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 1024px) {
  .val-sliders-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .val-sliders-grid { grid-template-columns: 1fr; }
}
.slider-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.slider-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}
.slider-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}
.slider-box input[type="range"] {
  width: 100%;
  accent-color: var(--emerald);
  cursor: pointer;
  margin: 2px 0;
}
.slider-hint {
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.35;
}

/* Football Field */
.football-wrap {
  position: relative;
  padding: 18px 8px 6px 8px;
}
.fb-row {
  display: grid;
  grid-template-columns: 118px 1fr 118px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12px;
}
@media (max-width: 640px) {
  .fb-row { grid-template-columns: 96px 1fr 94px; gap: 6px; font-size: 11px; }
}
.fb-name {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.fb-name small {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--ink-faint);
}
.fb-track {
  position: relative;
  height: 22px;
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.fb-band {
  position: absolute;
  top: 4px;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.25);
  border: 1px solid rgba(15, 118, 110, 0.55);
}
.fb-band.indigo {
  background: rgba(55, 48, 163, 0.20);
  border-color: rgba(55, 48, 163, 0.55);
}
.fb-band.ochre {
  background: rgba(180, 83, 9, 0.20);
  border-color: rgba(180, 83, 9, 0.55);
}
.fb-mid-dot {
  position: absolute;
  top: 5px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #111827;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.25);
}
.fb-mos-tick {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: var(--emerald);
}
.fb-cur-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 0;
  border-left: 1.5px dashed #B91C1C;
  z-index: 3;
  pointer-events: none;
}
.fb-cur-label {
  position: absolute;
  top: -17px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--crimson);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 4px;
  white-space: nowrap;
}
.fb-vals {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink);
}
.fb-vals small {
  display: block;
  font-size: 10.5px;
}

/* Sensitivity Heatmap */
.sens-table th,
.sens-table td {
  text-align: center;
  padding: 7px 6px;
  font-size: 11.5px;
  line-height: 1.3;
}
.sens-table td.hm-cheap {
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
  font-weight: 600;
}
.sens-table td.hm-fair {
  background: #F8FAFC;
  color: #111827;
}
.sens-table td.hm-rich {
  background: rgba(185, 28, 28, 0.10);
  color: #B91C1C;
}
.sens-table td.hm-center {
  outline: 2px solid #111827;
  outline-offset: -2px;
  font-weight: 700;
}
.sens-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}

/* DuPont Strip */
.dupont-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 960px) {
  .dupont-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dp-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.dp-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 3px;
}
.dp-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.dp-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ==================== Watchlist & Tab 4 Compare ==================== */
.watch-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.watch-pill:hover { border-color: #9CA3AF; background: #F9FAFB; }
.watch-pill.active { background: #111827; border-color: #111827; color: #FFFFFF; }
.watch-pill .x-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  opacity: 0.65;
  cursor: pointer;
}
.watch-pill .x-del:hover { opacity: 1; background: rgba(185, 28, 28, 0.15); color: var(--crimson); }
.watch-pill.active .x-del:hover { background: rgba(255, 255, 255, 0.22); color: #FFFFFF; }

.cmp-basket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.cmp-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cmp-tag:hover { border-color: #9CA3AF; }
.cmp-tag.is-anchor {
  border-color: rgba(15, 118, 110, 0.55);
  background: var(--emerald-soft);
  color: #0F766E;
}
.cmp-tag .x-del {
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-faint);
  padding: 0 2px;
}
.cmp-tag .x-del:hover { color: var(--crimson); }

.cmp-peers-panel {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cmp-peers-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.cmp-peers-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cmp-peers-meta {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.cmp-peers-meta strong {
  color: var(--ink);
}
.cmp-peers-fallback-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ochre);
  background: var(--ochre-soft);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
}
.cmp-peers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}
.peer-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  transition: border-color 0.15s ease;
}
.peer-card:hover {
  border-color: var(--border-strong);
}
.peer-card.in-basket {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.03);
}
.peer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.peer-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.peer-card-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.peer-card-sub {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.peer-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}
.peer-card-metrics strong {
  color: var(--ink);
  font-weight: 600;
}

.scatter-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.scatter-wrap {
  position: relative;
  width: 100%;
  min-height: 420px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.scatter-svg {
  width: 100%;
  height: 420px;
  display: block;
  user-select: none;
}
.scatter-dot {
  cursor: pointer;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.scatter-dot:hover,
.scatter-dot.is-active {
  stroke: #111827 !important;
  stroke-width: 2.5 !important;
  fill-opacity: 0.96 !important;
}
.scatter-tooltip {
  max-width: 290px;
  z-index: 20;
}
.legend-ring-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: transparent;
}
.legend-ring-swatch.low-vol {
  border: 2px solid #0F766E;
}
.legend-ring-swatch.high-risk {
  border: 2px dashed #DC2626;
}
.cmp-table th {
  white-space: nowrap;
}
.cmp-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cmp-mode-brief {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.cmp-glossary-bar {
  margin: -4px 0 12px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--emerald);
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.5;
}
.cmp-glossary-bar.hidden {
  display: none !important;
}
.cmp-glossary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 14px;
}
.cmp-glossary-row + .cmp-glossary-row {
  padding-top: 5px;
  border-top: 1px dashed var(--border);
}
.cmp-glossary-bar strong {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.cmp-glossary-bar b {
  color: var(--ink);
  font-weight: 600;
  margin-right: 4px;
}
.cmp-research-seg button {
  font-weight: 700;
}
.cmp-sub-seg-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cmp-sub-seg-wrap.hidden {
  display: none !important;
}
.cmp-table tbody tr.is-hover {
  background: rgba(15, 118, 110, 0.07) !important;
}
.btn-mini {
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: #374151;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-mini:hover { border-color: #111827; color: #111827; }
.btn-mini.added { border-color: rgba(15, 118, 110, 0.45); color: var(--emerald); background: var(--emerald-soft); }

/* ==================== P3-1: Earnings Audit & Anomaly Self-Check ==================== */
.ea-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.ea-summary-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ea-verdict {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-left: 4px;
}
.ea-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 1080px) {
  .ea-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ea-kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  min-width: 0;
}
.ea-kpi-lbl {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ea-kpi-val {
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.ea-kpi-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 3px;
  line-height: 1.35;
  word-break: break-word;
}
.ea-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
}
.ea-svg {
  display: block;
  width: 100%;
  height: 250px;
}
.ea-bar, .ea-hover-col {
  cursor: pointer;
}
.ea-bar:hover {
  opacity: 0.92;
}
.ea-detail-cell {
  white-space: normal !important;
  min-width: 240px;
  max-width: 520px;
  line-height: 1.48;
  color: var(--ink-muted);
}
.pill-clue {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(67, 56, 202, 0.10);
  color: #4338ca;
  border: 1px solid rgba(67, 56, 202, 0.25);
  white-space: nowrap;
}
.pill-clue-muted {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(67, 56, 202, 0.05);
  color: #4f46e5;
  white-space: nowrap;
}
tbody tr.ea-row-fail {
  background: rgba(185, 28, 28, 0.04) !important;
}
tbody tr.ea-row-warn {
  background: rgba(217, 119, 6, 0.04) !important;
}
tbody tr.ea-row-clue {
  background: rgba(67, 56, 202, 0.035) !important;
}
.ea-wl-panel {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.ea-wl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ea-trend-head {
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
}
.ea-trend-head .val-subtitle {
  white-space: nowrap;
  flex-shrink: 0;
}
.ea-trend-ctrls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.ea-trend-ctrls .seg {
  flex-wrap: nowrap;
}
.ea-trend-ctrls .seg button {
  padding: 4px 6.5px;
  font-size: 11px;
}
.ea-chart-card {
  margin-bottom: 0;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
}
.ea-chart-card .ea-chart-wrap {
  margin-top: auto;
}
.ea-wf-head {
  min-height: 30px;
  margin-bottom: 8px;
}
.ea-trend-legend {
  min-height: 36px;
  align-content: flex-start;
  gap: 4px 10px;
  font-size: 11px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.stk-fin-two-col > .module-card {
  display: flex;
  flex-direction: column;
}
.stk-fin-two-col > .module-card > .chart-box {
  margin-top: auto;
}
@media (max-width: 1180px) {
  .ea-trend-head {
    flex-wrap: wrap;
  }
  .ea-trend-ctrls {
    flex-wrap: wrap;
  }
}

/* ==================== P2-2: Responsive & Mobile (<= 768px / 375px) ==================== */
html, body {
  overflow-x: clip;
}
.module-card,
.kpi-card,
.val-subcard,
.slider-box,
.dp-card,
.ready-card,
.wm-card {
  min-width: 0;
}
.mobile-scroll-hint {
  display: none;
  font-size: 11px;
  color: var(--ink-faint);
  margin: 0 0 6px 2px;
}

@media (max-width: 768px) {
  .wrap {
    padding: 14px 12px 44px 12px;
  }
  .masthead {
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .masthead h1 {
    font-size: 20px;
    line-height: 1.3;
  }
  .subtitle {
    font-size: 12.5px;
  }
  .primary-tabs-bar {
    gap: 8px;
  }
  .primary-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
  }
  .primary-tabs button {
    text-align: center;
    padding: 8px 6px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .module-card {
    padding: 14px 12px;
  }
  .val-subcard {
    padding: 12px 10px;
  }
  .mod-header {
    gap: 8px;
  }
  .seg {
    max-width: 100%;
  }
  .seg button {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .stock-search-wrap {
    min-width: 0;
    width: 100%;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .kpi-grid.kpi-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ea-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ea-detail-cell {
    min-width: 200px;
  }
  .snap-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .kpi-card {
    padding: 10px 11px;
  }
  .kpi-num {
    font-size: 17px;
  }
  .val-cap-bar {
    padding: 8px 10px;
    gap: 8px;
    font-size: 11.5px;
  }
  .val-cap-items {
    gap: 8px 12px;
  }
  .slider-box {
    padding: 8px 10px;
  }
  .slider-box input[type="range"] {
    min-height: 24px;
  }
  .fb-row {
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    margin-bottom: 16px;
  }
  .fb-track {
    grid-column: 1 / -1;
    margin-top: 14px;
  }
  .sens-table th,
  .sens-table td {
    padding: 5px 4px;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .sens-sub {
    font-size: 9.5px;
  }
  .scatter-wrap {
    min-height: 340px;
  }
  .scatter-svg {
    height: 340px;
  }
  .chart-box {
    height: 240px;
  }
  .chart-box-tall {
    height: 290px;
  }
  .chart-box-vol {
    height: 135px;
  }
  .mobile-scroll-hint {
    display: block;
  }
  .stmt-meta-col {
    display: none;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 7px 8px;
    font-size: 11.5px;
  }
  .chart-tooltip {
    max-width: min(260px, calc(100vw - 24px));
  }
  .cmp-peers-panel {
    padding: 10px;
  }
  .cmp-peers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }
  .cmp-mode-bar {
    padding: 8px 10px;
    gap: 6px 10px;
  }
  .cmp-glossary-bar {
    padding: 8px 10px;
    font-size: 11px;
  }
  .cmp-scatter-head {
    flex-wrap: wrap;
  }
  .cmp-scatter-head > div:first-child {
    flex: 1 1 100%;
  }
  .cmp-scatter-head #seg-cmp-scatter {
    flex: 0 1 auto;
    max-width: 100%;
  }
  .cmp-sub-seg-wrap {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 12px 10px 40px 10px;
  }
  .val-kpi-grid {
    gap: 8px;
  }
  .dupont-grid {
    gap: 8px;
  }
  .cmp-basket {
    gap: 5px;
  }
  .cmp-tag {
    font-size: 11px;
    padding: 3px 8px;
  }
  .cmp-peers-grid {
    grid-template-columns: 1fr;
    max-height: 250px;
  }
}


/* ==================== TAB 5: 行业与组合（申万一级相关性分析） ==================== */
.ind-ctrl-card {
  padding: 14px 16px;
}
.ind-ctrl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.ind-ctrl-row-2 {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  justify-content: space-between;
}
.ind-ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ind-ctrl-card .seg button {
  padding: 5px 9px;
  font-size: 11.5px;
}
.ind-ctrl-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}
.ind-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ind-custom-picker {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ind-pick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ind-pick-summary {
  font-size: 12px;
  color: var(--ink-muted);
}
.ind-pick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ind-pick-groups {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ind-pick-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ind-pick-glabel {
  flex: 0 0 82px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  padding-top: 4px;
}
.ind-pick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ind-pick-pill {
  padding: 3px 9px;
  font-size: 11.5px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.14s ease;
}
.ind-pick-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.ind-pick-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 600;
}

.ind-kpi-grid {
  margin-bottom: 14px;
}
.ind-kpi-pair {
  font-size: 15.5px !important;
  line-height: 1.35;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ind-kpi-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ind-kpi-clickable:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.ind-matrix-head {
  align-items: flex-end;
  gap: 12px;
}
.ind-legend-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
}
.ind-leg-cap {
  font-size: 10.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.ind-leg-grad {
  display: inline-block;
  width: 54px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, #0f766e 0%, #99f6e4 55%, #f8fafc 100%);
}
.ind-leg-grad-pos {
  display: inline-block;
  width: 68px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, #fcfbf8 0%, #feebc3 42%, #e66a45 75%, #b92424 100%);
}

.ind-matrix-wrap {
  position: relative;
  margin-top: 8px;
}
.ind-matrix-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.ind-loading-box {
  padding: 38px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.ind-corr-table {
  border-collapse: separate;
  border-spacing: 1px;
  margin: 0 auto;
  background: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ind-corr-table th,
.ind-corr-table td {
  padding: 0;
  border: none;
  font-variant-numeric: tabular-nums;
}
.ind-corner-cell {
  background: var(--surface-alt);
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: center;
  vertical-align: middle;
  min-width: 76px;
}
.ind-corner-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
}
.ind-col-th {
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 4px !important;
  text-align: center;
  vertical-align: bottom;
  min-width: 50px;
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}
.ind-corr-table.is-compact .ind-col-th {
  min-width: 29px;
  width: 29px;
  height: 72px;
  padding: 5px 0 6px 0 !important;
}
.ind-corr-table.is-compact .ind-col-lbl {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0 auto;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.ind-row-th {
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
  padding: 0 8px !important;
  position: sticky;
  left: 0;
  z-index: 2;
  white-space: nowrap;
  min-width: 76px;
  transition: background 0.1s ease, color 0.1s ease;
}
.ind-corr-table.is-compact .ind-row-th {
  font-size: 11px;
  padding: 0 5px !important;
  min-width: 62px;
}
.ind-corr-table.is-compact .ind-corner-cell {
  min-width: 62px;
}
.ind-col-th.is-hover,
.ind-row-th.is-hover {
  background: #1e293b !important;
  color: #ffffff !important;
}
.ind-col-th.is-selected,
.ind-row-th.is-selected {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
}

.ind-cell {
  text-align: center;
  vertical-align: middle;
  height: 30px;
  min-width: 50px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease;
}
.ind-corr-table.is-compact .ind-cell {
  width: 29px;
  min-width: 29px;
  height: 23px;
  font-size: 9.8px;
  letter-spacing: -0.02em;
}
.ind-cell.is-diag {
  cursor: default;
  font-weight: 600;
}
.ind-cell:not(.is-diag):hover {
  outline: 2px solid #0f172a;
  outline-offset: -2px;
  position: relative;
  z-index: 2;
}
.ind-cell.is-active-pair {
  outline: 2px solid #0f172a;
  outline-offset: -2px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.ind-matrix-tooltip {
  min-width: 224px;
  pointer-events: none;
  z-index: 20;
}
.ind-tt-hint {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 10.5px;
  color: #cbd5e1;
}

/* Pair Deep-Dive Section */
.ind-pair-head {
  align-items: center;
  gap: 10px 14px;
}
.ind-pair-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.ind-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ind-pair-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
}
.ind-pair-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ind-pair-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
}
.ind-pair-chip strong {
  color: var(--ink);
}
.ind-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ind-chart-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px 14px 10px 14px;
  display: flex;
  flex-direction: column;
}
.ind-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.ind-chart-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.ind-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-muted);
}
.ind-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ind-leg-item i {
  display: inline-block;
  width: 11px;
  height: 2.5px;
  border-radius: 2px;
}
.ind-leg-item i.is-dash {
  height: 0;
  border-top: 2px dashed;
  background: transparent !important;
}
.ind-svg-wrap {
  position: relative;
  width: 100%;
}
.ind-svg {
  display: block;
  width: 100%;
  height: 264px;
}
.ind-svg-tip {
  pointer-events: none;
  z-index: 15;
}

/* Summary Table & Methodology */
.ind-summary-table th,
.ind-summary-table td {
  padding: 7px 6px !important;
  font-size: 11.8px;
}
.ind-summary-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.ind-summary-table th.sorted {
  color: var(--ink);
  background: #eef2f6;
}
.ind-sum-row {
  cursor: pointer;
}
.ind-sum-row:hover td {
  background: #f8fafc;
}
.ind-sum-row.is-selected td {
  background: rgba(15, 118, 110, 0.06);
}
.ind-group-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  white-space: nowrap;
}
.ind-top-stocks {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ind-method-details {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}
.ind-method-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ind-method-details summary::-webkit-details-marker {
  display: none;
}
.ind-method-sum-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.ind-method-sum-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.ind-method-details[open] .ind-method-sum-hint::before {
  content: "收起 · ";
}
.ind-method-body {
  padding: 0 16px 12px 16px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.ind-method-body ul {
  margin: 10px 0 0 18px;
  padding: 0;
}
.ind-method-body li {
  margin-bottom: 5px;
}

@media (max-width: 960px) {
  .ind-pair-grid {
    grid-template-columns: 1fr;
  }
  .ind-ctrl-actions {
    margin-left: 0;
  }
}


/* ==================== TAB 5 Section 3: PCA & Low-Vol Hedge Screener ==================== */
.ind-pca-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.ind-pca-subtag {
  font-size: 11px;
  color: var(--ink-faint);
}
.ind-svg-scree {
  height: 228px;
}
.ind-svg-biplot {
  height: 312px;
}
.ind-pca-factors {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ind-pca-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.ind-pca-meta-bar strong {
  color: var(--ink);
}
.ind-pca-factor-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.2px;
  line-height: 1.45;
}
.ind-pca-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
}
.ind-pca-badge.pc-1 { background: #334155; }
.ind-pca-badge.pc-2 { background: #0f766e; }
.ind-pca-badge.pc-3 { background: #b91c1c; }
.ind-pca-poles {
  color: var(--ink-muted);
  min-width: 0;
}
.ind-pca-poles .pole-pos { color: #0f4c45; }
.ind-pca-poles .pole-neg { color: #7f1d1d; }
.ind-pca-poles .pole-sep {
  margin: 0 4px;
  color: var(--ink-faint);
  font-weight: 600;
}

.ind-hedge-divider {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  margin-bottom: 14px;
}
.ind-hedge-ctrl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.ind-hedge-ctrl-row-2 {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  justify-content: space-between;
}
.ind-hedge-divider .seg button {
  padding: 5px 9px;
  font-size: 11.5px;
}
.ind-anchor-hint {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.ind-hedge-kpis {
  margin-bottom: 14px;
}
.ind-hedge-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
}
.ind-hedge-table-wrap {
  max-height: 298px;
  border: none;
  border-radius: 0;
}
.ind-hedge-table th,
.ind-hedge-table td {
  padding: 7px 6px !important;
  font-size: 11.6px;
}
.ind-hedge-row {
  cursor: pointer;
}
.ind-hedge-row:hover td {
  background: #f8fafc;
}
.ind-anchor-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  background: #0f766e;
  color: #ffffff;
  vertical-align: middle;
}
.ind-w-bar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.ind-w-bar {
  display: inline-block;
  width: 46px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.ind-w-bar i {
  display: block;
  height: 100%;
  background: #0f766e;
  border-radius: 999px;
}
.ind-pc-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

@media (max-width: 1024px) {
  .ind-pca-grid,
  .ind-hedge-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== TAB 5 Sub-View Bar & Watchlist Portfolio Lab ==================== */
.tab5-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tab5-subseg button {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.tab5-subhint {
  font-size: 11.8px;
  color: var(--ink-muted);
}

.pf-wl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.pf-wl-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex: 1 1 560px;
  min-width: 0;
}
.pf-wl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pf-wl-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.14s ease;
}
.pf-wl-chip.active {
  border-color: rgba(15, 118, 110, 0.55);
  background: rgba(15, 118, 110, 0.06);
}
.pf-wl-toggle {
  border: none;
  background: transparent;
  padding: 3px 6px 3px 9px;
  font-size: 11.8px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}
.pf-wl-chip.active .pf-wl-toggle {
  color: #0f4c45;
}
.pf-wl-del {
  border: none;
  background: transparent;
  padding: 3px 8px 3px 3px;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
}
.pf-wl-del:hover {
  color: var(--crimson);
}
.pf-add-box {
  position: relative;
  flex: 0 0 215px;
}
.pf-add-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 12px;
  background: #ffffff;
  color: var(--ink);
}
.pf-add-box .search-dropdown {
  top: 34px;
  right: 0;
  left: auto;
  min-width: 260px;
}
.pf-status-banner {
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--ink-muted);
}

.pf-weights-grid {
  display: grid;
  grid-template-columns: 1.38fr 0.62fr;
  gap: 14px;
}
.pf-bottom-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 14px;
}
.pf-table-wrap {
  max-height: 340px;
  border: none;
  border-radius: 0;
}
.pf-stock-link {
  color: var(--ink);
  text-decoration: none;
}
.pf-stock-link:hover {
  color: #0f766e;
  text-decoration: underline;
}
.pf-w-input {
  width: 58px;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink);
  background: #ffffff;
}
.pf-w-input:focus {
  outline: none;
  border-color: #0f766e;
}

.pf-exp-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pf-exp-ok,
.pf-exp-warn {
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1.5;
}
.pf-exp-ok {
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: #0f4c45;
}
.pf-exp-warn {
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: #7f1d1d;
}
.pf-exp-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pf-exp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.6px;
  margin-bottom: 4px;
}
.pf-exp-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: #eef2f6;
}
.pf-exp-fill {
  height: 100%;
  border-radius: 999px;
  background: #0f766e;
}
.pf-exp-fill.is-warn {
  background: #dc2626;
}
.pf-exp-eq-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #1e293b;
  border-radius: 1px;
}

.pf-corr-table {
  margin: 0 auto;
}
.pf-pk-row {
  cursor: pointer;
}
.pf-pk-row:hover td {
  background: #f8fafc;
}
.pf-pk-row.is-active td {
  background: rgba(15, 118, 110, 0.07);
}
.pf-pk-bench td {
  background: var(--surface-alt);
  border-top: 1.5px solid var(--border-strong) !important;
}

@media (max-width: 1024px) {
  .pf-weights-grid,
  .pf-bottom-grid {
    grid-template-columns: 1fr;
  }
}
