/* Luma Quant — polish.css (loaded last). One consistent layer over the dark theme: shared tokens for
   spacing / radius / type, the grouped navigation, the Overview page, and small fixes that apply to every
   workspace. Layout rules of the individual workspaces stay in their own files. */
:root {
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --ink-2: #b6bfd0;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --ring: 0 0 0 3px rgba(77, 141, 255, 0.35);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.26);
}

/* ---- base ---- */
html { scroll-behavior: smooth; }
body { font-size: var(--fs-md); line-height: 1.45; text-rendering: optimizeLegibility; }
::selection { background: rgba(77, 141, 255, 0.35); }
* { scrollbar-width: thin; scrollbar-color: #2a3346 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #2a3346; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #3a465e; background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: none; box-shadow: var(--ring); }
table { font-variant-numeric: tabular-nums; }
h2 { letter-spacing: -0.01em; }
aside, section, .industry-card, .analytics-card { border-radius: var(--r-md); }
aside > label { font-size: var(--fs-sm); font-weight: 600; margin: 12px 0 5px; }
.hint { font-size: var(--fs-sm); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- header and grouped navigation ---- */
header { gap: var(--s-4); padding: 10px 20px; backdrop-filter: saturate(140%) blur(10px); background: linear-gradient(180deg, rgba(20, 28, 46, 0.94) 0%, rgba(15, 21, 36, 0.94) 100%); }
header h1 { font-size: 20px; line-height: 1.1; }
.brand-lockup { flex: 0 0 auto; }
.top-nav { align-items: center; gap: 2px; padding: 4px; border-radius: var(--r-md); min-width: 0; }
.nav-group { display: flex; align-items: center; gap: 2px; padding-left: 10px; margin-left: 6px; border-left: 1px solid var(--line); }
.nav-group-label { display: none; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5f6a82; margin-right: 4px; white-space: nowrap; user-select: none; }
button.nav-tab { min-height: 32px; padding: 4px 12px; border-radius: 7px; font-weight: 600; box-shadow: none; }
button.nav-tab:active { transform: none; }
.header-right { flex: 0 1 auto; gap: 10px; min-width: 0; }
.lang-switch { flex-shrink: 0; }
@media (min-width: 1001px) { .top-nav { flex: 0 0 auto; } }
.status { flex: 0 1 auto; min-width: 0; max-width: 230px; font-size: var(--fs-sm); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.02); }
@media (min-width: 1720px) { .nav-group-label { display: inline; } }
@media (max-width: 1500px) { .brand-subtitle { display: none; } }
@media (max-width: 1320px) and (min-width: 1001px) {
  header { padding: 8px 14px; gap: 10px; }
  button.nav-tab { padding: 4px 9px; font-size: 12.5px; }
  .nav-group { padding-left: 6px; margin-left: 4px; }
  .status { max-width: 150px; }
}
@media (max-width: 1130px) and (min-width: 1001px) { .status { display: none; } }
@media (max-width: 1000px) {
  header { padding: 10px 12px; gap: 10px; }
  .top-nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .top-nav::-webkit-scrollbar { display: none; }
  .nav-group { flex: 0 0 auto; }
  button.nav-tab { flex: 0 0 auto; scroll-snap-align: center; min-height: 36px; }
  .status { max-width: 46vw; }
}

/* ---- settings sidebars ---- */
.aside-section { margin: 18px -16px 2px; padding: 9px 16px 0; border-top: 1px solid var(--line); font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #6f7b95; }
aside > .aside-section:first-child { margin-top: -4px; padding-top: 0; border-top: 0; }
aside > .aside-section + label { margin-top: 8px; }
@media (max-width: 1000px) { #tradingView > aside > .aside-section { grid-column: 1 / -1; } }
input, select, textarea { border-radius: var(--r-sm); font-size: var(--fs-md); }
input[type="number"], input[type="date"] { font-variant-numeric: tabular-nums; }
aside > button, #runFitButton, #runPortfolioButton { height: 40px; border-radius: 8px; letter-spacing: 0.01em; }
.source-card { border-radius: var(--r-sm); font-size: var(--fs-sm); }

/* ---- cards, stats and tables ---- */
.strategy-stat, .paper-stat { border-radius: 8px; }
.strategy-stat span, .paper-stat span, .metric span { font-size: var(--fs-xs); letter-spacing: 0.02em; color: var(--muted); }
.strategy-header h2, .portfolio-panel > h2 { font-size: var(--fs-xl); margin-bottom: 2px; }
.strategy-header p, .portfolio-panel > p { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.strategy-table th, .paper-table th, .portfolio-table th, .stock-table th, .factor-table th {
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.strategy-table td, .paper-table td, .portfolio-table td { font-size: var(--fs-sm); }
.paper-table tbody tr:hover, .portfolio-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.paper-log-wrap, .portfolio-table-wrap, .strategy-table-scroll { border-radius: 8px; }
.mini-btn { border-radius: 7px; }
.pulse-toolbar h2 { font-size: var(--fs-xl); }
main.pulse-view { padding: 20px; }

/* loading placeholders: a calm shimmer instead of bare text */
.pulse-loading { border: 1px dashed var(--line); border-radius: var(--r-md); background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.035) 50%, rgba(255,255,255,0) 70%) 0 0 / 200% 100%, rgba(255,255,255,0.012); animation: lq-shimmer 1.6s linear infinite; }
@keyframes lq-shimmer { from { background-position: 200% 0, 0 0; } to { background-position: -200% 0, 0 0; } }

/* ---- Overview ---- */
main.overview-view { max-width: 1320px; padding: 26px 20px 40px; }
.ov-hero { background: radial-gradient(900px 260px at 12% 0%, rgba(77, 141, 255, 0.16), rgba(77, 141, 255, 0) 70%), linear-gradient(180deg, #131a2a 0%, #111726 100%); padding: 26px 28px; border-radius: var(--r-lg); }
.ov-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.ov-hero h2 { margin: 8px 0 8px; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; }
.ov-hero p { margin: 0; max-width: 760px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.ov-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 28px 2px 12px; }
.ov-section-head h3, .ov-panel-head h3 { margin: 0; font-size: var(--fs-lg); }
.ov-section-head span { color: var(--muted); font-size: var(--fs-sm); }
.ov-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ov-tile { min-width: 0; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, #131a2a 0%, #111726 100%); box-shadow: var(--shadow-1); }
.ov-tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ov-tile-head strong { font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-tile-head span { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-tile-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.ov-tile-main b { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.ov-tile-main span { font-size: var(--fs-sm); font-weight: 650; }
.ov-spark { display: block; width: 100%; height: 38px; }
.ov-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ov-spark polygon { stroke: none; opacity: 0.12; }
.ov-spark.up polyline { stroke: var(--green); } .ov-spark.up polygon { fill: var(--green); }
.ov-spark.down polyline { stroke: var(--red); } .ov-spark.down polygon { fill: var(--red); }
.ov-tile dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.ov-tile dt { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.ov-tile dd { margin: 1px 0 0; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-tile-skel { height: 158px; animation: lq-shimmer 1.6s linear infinite; background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 70%) 0 0 / 200% 100%, #121826; }
.overview-view .up { color: var(--green); } .overview-view .down { color: var(--red); } .ov-flat { color: var(--muted); }

.ov-flow { display: grid; grid-template-columns: 1fr 2fr 2fr 1fr; gap: 12px; align-items: stretch; }
.ov-flow-group { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: 10px 12px; min-width: 0; }
.ov-flow-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); }
.ov-flow-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; letter-spacing: 0; }
.ov-flow-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
button.ov-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; height: auto; min-height: 132px; margin: 0; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, #151d2f 0%, #111726 100%); box-shadow: var(--shadow-1); color: var(--ink); font-weight: 400; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
button.ov-card:hover { filter: none; border-color: rgba(77, 141, 255, 0.6); background: linear-gradient(180deg, #18223a 0%, #121a2c 100%); transform: translateY(-1px); }
.ov-card-title { font-size: 16px; font-weight: 700; }
.ov-card-desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; flex: 1; }
.ov-card-go { color: var(--accent); font-size: var(--fs-sm); font-weight: 650; }

.ov-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; margin-top: 28px; }
.ov-panel { padding: 18px; min-width: 0; }
.ov-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ov-panel-head .mini-btn { margin: 0; width: auto; }
.ov-hot { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ov-hot li { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(60px, 1fr) 56px 76px; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.ov-hot li:first-child { border-top: 0; }
.ov-hot-name strong { display: block; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-hot-name span, .ov-hot-num span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.ov-hot-bar, .ov-meter { height: 6px; border-radius: 999px; background: #1c2333; overflow: hidden; }
.ov-hot-bar i, .ov-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b73e0, #7fb0ff); }
.ov-hot-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.ov-hot-num span { font-weight: 400; }
.ov-data { margin: 0; display: grid; gap: 0; }
.ov-data > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.ov-data > div:first-child { border-top: 0; }
.ov-data dt { color: var(--muted); }
.ov-data dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ov-meter { display: inline-block; width: 90px; vertical-align: middle; margin-left: 8px; }
.ov-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #f5b942; }
.ov-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(38, 194, 129, 0.16); }
.ov-empty { margin: 0; padding: 22px 4px; color: var(--muted); font-size: var(--fs-sm); }
.ov-empty .mini-btn { width: auto; margin: 0 0 0 8px; }
.ov-disclaimer { margin: 26px 2px 0; color: #5f6a82; font-size: var(--fs-xs); text-align: center; }
.ov-skeleton { display: grid; gap: 14px; padding: 8px 2px; }
.ov-skel-line { height: 22px; border-radius: 6px; background: #151c2c; } .ov-skel-line.w40 { width: 40%; } .ov-skel-line.w70 { width: 70%; height: 14px; }
.ov-skel-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ov-skel-grid span { height: 150px; border-radius: var(--r-md); background: #121826; border: 1px solid var(--line); }
@media (max-width: 1180px) {
  .ov-tiles, .ov-skel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-flow-group { grid-template-columns: 1fr; grid-template-rows: none; }
  .ov-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main.overview-view { padding: 14px 12px 28px; }
  .ov-hero { padding: 20px 18px; }
  .ov-tiles, .ov-skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-flow { grid-template-columns: minmax(0, 1fr); }
  button.ov-card { min-height: 0; }
  .ov-hot li { grid-template-columns: minmax(0, 1fr) 50px 70px; }
  .ov-hot-bar { display: none; }
  .ov-tile { padding: 12px 11px 10px; }
  .ov-tile dd { font-size: 11px; }
  .ov-tile-main b { font-size: 19px; }
  .ov-data > div { grid-template-columns: 110px minmax(0, 1fr); }
}
@media print { header .top-nav, header .header-right { display: none; } }

/* Portfolio tools and tooltip stay inside the fullscreen top layer. */
#portfolioChart { touch-action: none; cursor: grab; }
#portfolioChart:active { cursor: grabbing; }
.portfolio-chart-controls { position:absolute; left:60px; top:30px; display:flex; gap:4px; z-index:16; }
.portfolio-chart-controls button { padding:3px 9px; width:auto; background:#142035; color:#e6e9f0; border:1px solid #384357; border-radius:5px; }
#portfolioTooltip { max-width:min(340px, 80vw); max-height:60%; overflow:auto; pointer-events:auto; z-index:20; }

.chart-expand-host.chart-expanded { position:fixed; inset:0; z-index:9999; padding:22px; box-sizing:border-box; background:#0b1020; display:flex; flex-direction:column; }
.chart-expand-host.chart-expanded > canvas { flex:1 1 auto; width:100% !important; height:100% !important; min-height:0; }

/* Keep the return line clear; trades live on a separate event rail. */
#portfolioChart, #portfolioWeightChart { height:420px; }
.portfolio-chart-controls { left:14px; top:10px; right:54px; gap:5px; flex-wrap:wrap; }
.portfolio-chart-controls button, .portfolio-chart-controls select { font-size:11px; line-height:20px; padding:3px 8px; min-height:29px; margin:0; width:auto; }
.portfolio-chart-controls select { background:#142035; color:#e6e9f0; border:1px solid #384357; border-radius:5px; }
.portfolio-chart-controls button[aria-pressed="true"] { background:#254779; border-color:#60a5fa; }
.portfolio-weight-list { position:absolute; top:70px; bottom:18px; left:20px; right:20px; overflow-y:auto; padding-right:8px; scrollbar-width:thin; }
.weight-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; padding:8px 0; font-size:13px; font-variant-numeric:tabular-nums; }
.weight-name { display:flex; align-items:center; gap:8px; overflow-wrap:anywhere; min-width:0; color:#cbd5e1; }
.weight-name i { width:9px; height:9px; border-radius:3px; flex-shrink:0; }
.weight-row b { color:#f1f5f9; font-weight:600; }
.weight-track { grid-column:1/-1; height:4px; background:#1c2638; border-radius:3px; overflow:hidden; }
.weight-track > span { display:block; height:100%; border-radius:3px; }
.weights-wide .portfolio-weight-list { left:55%; right:7%; top:18%; bottom:12%; }
.weights-wide .weight-row { padding:11px 0; font-size:16px; }
.weights-wide .weight-track { height:5px; }
@media (max-width:600px) { .portfolio-chart-controls { gap:3px; } .portfolio-chart-controls button, .portfolio-chart-controls select { padding:2px 5px; font-size:10px; } }

.weight-row { line-height:1.25; padding:5px 0; gap:4px 12px; }
.weights-wide .weight-row { line-height:1.25; padding:7px 0; gap:5px 12px; font-size:15px; }

/* Portfolio summary: balanced rows, secondary notes stay secondary. */
.portfolio-panel { container-type:inline-size; }
.portfolio-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; align-items:stretch; }
.portfolio-metrics .strategy-stat { min-width:0; padding:11px 13px; }
.portfolio-metrics .strategy-stat > span { font-size:12px; line-height:1.3; letter-spacing:0; }
.portfolio-metrics .strategy-stat strong { font-size:25px; line-height:1.2; margin-top:7px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.portfolio-metrics .strategy-stat small { display:block; margin-top:5px; font-size:11px; line-height:1.25; color:#8995ab; }
.portfolio-metrics .strategy-stat small:empty { display:none; }
@container (min-width:900px) {
  .portfolio-metrics { grid-template-columns:repeat(20,minmax(0,1fr)); }
  .portfolio-metrics .strategy-stat { grid-column:span 4; }
  .portfolio-metrics .strategy-stat:nth-child(n+6) { grid-column:span 5; }
}
@container (max-width:460px) {
  .portfolio-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .portfolio-metrics .strategy-stat:last-child { grid-column:1/-1; }
  .portfolio-metrics .strategy-stat strong { font-size:22px; }
}
.portfolio-weight-detail { display:none; }
.weights-wide .portfolio-weight-detail { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 16px; position:absolute; left:55%; right:7%; top:86px; padding:8px 0 8px 14px; border-left:3px solid; color:#e2e8f0; }
.portfolio-weight-detail > span { font-size:17px; font-weight:600; align-self:center; overflow-wrap:anywhere; }
.portfolio-weight-detail > strong { font-size:27px; font-variant-numeric:tabular-nums; }
.portfolio-weight-detail > small { grid-column:1/-1; font-size:12px; color:#94a3b8; }
.weights-wide .portfolio-weight-list { top:186px; bottom:6%; }
.portfolio-weight-list .weight-row { width:100%; margin:0; padding:5px 6px; background:transparent; border:1px solid transparent; border-radius:6px; box-shadow:none; text-align:left; font-weight:400; cursor:pointer; }
.portfolio-weight-list .weight-row.is-active { border-color:#50617a; background:#1c293d; }
.portfolio-weight-list .weight-row:focus-visible { outline:2px solid #60a5fa; outline-offset:-2px; }
.weights-wide .portfolio-weight-list .weight-row { padding:6px 8px; }

/* Fill the risk card even when the adjacent correlation matrix is taller. */
.risk-contribution-card { display:flex; flex-direction:column; }
.risk-contribution-plot { position:relative; flex:1 0 190px; min-height:190px; }
.risk-contribution-plot > canvas { position:absolute; inset:0; width:100%; height:100%; }

/* ---- Industry Pulse v2 (2026-11-16): full ranking table, score components, tagged headlines ---- */
.pulse-body { display: grid; gap: 16px; }
.pulse-ranking { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px 6px; }
.pulse-ranking h3 { margin: 0 0 8px; font-size: var(--fs-md); }
.pulse-rank-table td, .pulse-rank-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pulse-rank-table td:nth-child(2) { white-space: normal; }
.pulse-rank-table tbody tr:last-child td { border-bottom: 0; }
.pulse-heat { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 120px; }
.pulse-heat b { width: 26px; text-align: right; }
.pulse-heat-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.pulse-heat-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b73e0, #7fb0ff); }
.pulse-flat { color: var(--muted); }
.industry-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pulse-why { margin: 0 0 12px; }
.pulse-why h4, .pulse-sub { margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pulse-why p { margin: 0 0 8px; font-size: var(--fs-sm); color: var(--ink); line-height: 1.45; }
.pulse-comp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pulse-comp-row span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.pulse-comp-track { position: relative; height: 5px; border-radius: 999px; background: var(--line-soft); }
.pulse-comp-track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); opacity: .5; }
.pulse-comp-track i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.pulse-comp-track i.pos { background: #4d8dff; }
.pulse-comp-track i.neg { background: #d9774f; }
.pulse-news { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.pulse-news li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: start; font-size: var(--fs-sm); line-height: 1.4; }
.pulse-news a { color: var(--ink); text-decoration: none; }
.pulse-news a:hover { color: var(--accent); text-decoration: underline; }
.pulse-news small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.pulse-tag { display: inline-block; padding: 2px 0; text-align: center; border-radius: 4px; font-size: 11px; font-weight: 650; color: #b9c6e4; background: #1c2740; border: 1px solid #2a3a5e; }
.pulse-tag-news { color: var(--muted); background: transparent; border-color: var(--line); }
.pulse-news-empty { margin: 0 0 14px; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 760px) {
  .industry-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse-comp { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pulse-news li { grid-template-columns: 1fr; gap: 3px; }
  .pulse-tag { justify-self: start; padding: 2px 8px; }
}

/* ---- UI clean-up 2026-11-16 ---- */
/* Portfolio Lab: before the first run show only the title and the status line, not nine empty tiles and blank charts */
.portfolio-panel.is-empty > :not(h2):not(.portfolio-status):not(p:first-of-type) { display: none !important; }
.portfolio-panel.is-empty .portfolio-status { margin-top: 14px; padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }
/* Factor Library: title and description on their own row, filters below (the description was squeezed into a narrow column) */
#libraryToolbar { flex-direction: column; align-items: stretch; gap: 14px; }
#libraryToolbar > div:first-child p { max-width: 860px; }
#libraryToolbar .lib-toolbar-controls { flex-wrap: wrap; }
#libraryToolbar .lib-control.lib-search { flex: 1 1 260px; width: auto; }
#libraryToolbar .lib-upload-control { margin-left: auto; }
/* Industry Pulse toolbar: one remaining control, keep it compact */
#pulseView .pulse-control { width: 200px; }
