:root {
  color-scheme: light;
  font-family: "Segoe UI", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --ink: #18211d;
  --muted: #65716b;
  --line: #dce3df;
  --line-strong: #c9d3ce;
  --green: #08785a;
  --green-dark: #075d47;
  --green-soft: #e4f4ee;
  --blue: #2868b2;
  --blue-soft: #eaf2fb;
  --amber: #9a6200;
  --amber-soft: #fff3d9;
  --red: #b43a45;
  --red-soft: #fcebed;
  --charcoal: #26312c;
  --shadow: 0 1px 2px rgba(25, 45, 35, 0.04), 0 8px 24px rgba(25, 45, 35, 0.04);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 30; }
.brand { min-height: 42px; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--green); font-size: 18px; font-weight: 800; }
.brand > span:last-child { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.primary-nav { margin-top: 34px; display: grid; gap: 4px; }
.nav-item { height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 11px; border-radius: 6px; color: #58645e; text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-item:hover { color: var(--ink); background: var(--surface-subtle); }
.nav-item.active { color: var(--green-dark); background: var(--green-soft); }
.sidebar-foot { margin-top: auto; padding: 14px 7px 2px; border-top: 1px solid var(--line); }
.research-only { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.research-only svg { margin-top: 1px; color: var(--green); }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 66px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 0; font-size: 16px; line-height: 1.2; }
.header-status { margin-top: 4px; display: flex; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.separator { margin: 0 5px; }
.status-dot { width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #9ba59f; }
.status-dot.positive { background: #14a378; box-shadow: 0 0 0 3px #e1f5ee; }
.status-dot.attention { background: #d08a10; box-shadow: 0 0 0 3px #fff1d2; }
.status-dot.danger { background: #d04b57; box-shadow: 0 0 0 3px #fbe5e8; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; color: #56625c; background: transparent; border: 1px solid transparent; border-radius: 6px; text-decoration: none; }
.icon-button:hover { color: var(--ink); background: var(--surface-subtle); border-color: var(--line); }
.mobile-menu { display: none; }
.user-block { margin-left: 3px; padding-left: 11px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.avatar-fallback { display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font-weight: 700; }
.user-copy { min-width: 82px; display: flex; flex-direction: column; line-height: 1.2; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 28px 30px 48px; }
.page-heading { min-height: 70px; margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-heading h2, .stock-title-line h2 { margin: 3px 0 4px; font-size: 24px; line-height: 1.28; }
.page-heading p, .section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--green-dark); font-size: 10px; font-weight: 800; letter-spacing: 0; }
.heading-actions, .stock-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.button { min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 700; }
.button.primary { color: #fff; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--charcoal); background: var(--surface); border-color: var(--line-strong); }
.button.secondary:hover { border-color: #9eaca5; background: var(--surface-subtle); }
.button.full { width: 100%; min-height: 42px; }
.text-link, .quiet-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-link svg, .quiet-link svg { width: 14px; height: 14px; }

.select-control, .search-control { min-height: 36px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; color: #58645e; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
.select-control:focus-within, .search-control:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.select-control select, .search-control input { min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; }
.select-control select { padding-right: 4px; }
.select-control.small { min-width: 150px; }
.search-control { width: min(260px, 100%); }
.search-control input { width: 100%; }

.metric-band { margin-bottom: 22px; display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.metric-item { min-width: 0; min-height: 96px; padding: 17px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.metric-item:last-child { border-right: 0; }
.metric-item > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-item strong { margin-top: 3px; font-size: 24px; line-height: 1.15; }
.metric-item small { margin-top: auto; padding-top: 8px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.alert { min-height: 48px; margin: 0 0 22px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.alert > div { display: flex; flex-direction: column; }
.alert > div span { margin-top: 2px; }
.alert.attention { color: #674500; background: var(--amber-soft); border-color: #eed79d; }
.alert.danger { color: #7c2630; background: var(--red-soft); border-color: #f0c7cc; }
.alert.positive { color: var(--green-dark); background: var(--green-soft); border-color: #bde3d5; }

.section-block { min-width: 0; margin-top: 28px; }
.section-heading { min-height: 40px; margin-bottom: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.section-heading h3 { margin: 0 0 3px; font-size: 16px; }
.panel, .chart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.list-panel, .news-list, .audit-panel { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }

.table-wrap { width: 100%; contain: layout paint inline-size; overflow-x: auto; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 40px; padding: 0 12px; color: var(--muted); background: var(--surface-subtle); border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 700; white-space: nowrap; }
.data-table td { height: 51px; padding: 8px 12px; border-bottom: 1px solid #e8ece9; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr[data-href]:hover, .data-table tbody tr[data-href]:focus { background: #f7faf8; outline: 0; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.rank-cell { width: 54px; text-align: center !important; }
.rank-number { display: inline-grid; min-width: 23px; height: 23px; place-items: center; color: #59645f; background: #edf1ef; border-radius: 4px; font-weight: 800; }
.action-cell { width: 42px; padding-left: 4px !important; padding-right: 8px !important; text-align: right; }
.row-link { width: 30px; height: 30px; display: inline-grid; place-items: center; color: var(--muted); border-radius: 5px; }
.row-link:hover { color: var(--green); background: var(--green-soft); }
.stock-name { min-width: 110px; display: flex; flex-direction: column; line-height: 1.25; }
.stock-name strong { overflow-wrap: anywhere; font-size: 12px; }
.stock-name small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.strategy, .badge { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.strategy.momentum { color: #1f5d9c; background: var(--blue-soft); }
.strategy.reversal { color: #8a5610; background: #fff0df; }
.badge { color: #48534e; background: #edf1ef; border: 1px solid #e0e5e2; }
.badge.positive { color: var(--green-dark); background: var(--green-soft); border-color: #c8e7db; }
.badge.attention { color: #775000; background: var(--amber-soft); border-color: #efddaf; }
.badge.danger { color: #8d2c36; background: var(--red-soft); border-color: #f0cbd0; }
.badge.muted { color: #6f7974; background: #f2f4f3; border-color: #e2e7e4; }
.badge.neutral { color: #405e78; background: #edf4fa; border-color: #d6e5f2; }
.positive { color: var(--green-dark); }
.attention { color: var(--amber); }
.up { color: #c03b48; }
.down { color: #2667ac; }
.neutral { color: var(--ink); }
.mini-progress { width: 46px; height: 3px; margin: 4px 0 0 auto; display: block; appearance: none; border: 0; border-radius: 2px; overflow: hidden; }
.mini-progress::-webkit-progress-bar { background: #e6ebe8; }
.mini-progress::-webkit-progress-value { background: var(--green); }
.mini-progress::-moz-progress-bar { background: var(--green); }
.empty-cell, .empty-inline { padding: 26px !important; color: var(--muted); text-align: center !important; }

.insight-row { min-height: 66px; padding: 10px 6px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #e6ebe8; text-decoration: none; }
.insight-row:last-child { border-bottom: 0; }
.insight-row:hover { background: #f7faf8; }
.insight-marker { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 6px; }
.insight-marker.positive { color: var(--green-dark); background: var(--green-soft); }
.insight-marker.danger { color: var(--red); background: var(--red-soft); }
.insight-marker svg { width: 16px; height: 16px; }
.insight-copy { min-width: 0; display: flex; flex-direction: column; }
.insight-copy strong { font-size: 12px; }
.insight-copy strong small { color: var(--muted); font-weight: 500; }
.insight-copy > span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.insight-meta { color: var(--muted); font-size: 10px; }

.performance-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.performance-strip > div { min-height: 84px; padding: 14px 16px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.performance-strip > div:last-child { border-right: 0; }
.performance-strip span { color: var(--muted); font-size: 10px; }
.performance-strip strong { margin-top: 2px; font-size: 20px; }
.performance-strip small { margin-top: auto; color: var(--muted); font-size: 10px; }

.filter-toolbar { margin: 0 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.segmented-control { min-height: 36px; padding: 3px; display: inline-flex; background: #e8edea; border-radius: 6px; }
.segmented-control a { min-width: 78px; padding: 6px 10px; border-radius: 4px; color: var(--muted); text-align: center; text-decoration: none; font-size: 11px; font-weight: 700; }
.segmented-control a.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(25, 45, 35, 0.12); }
.stage-switch { width: fit-content; margin: -8px 0 20px; }
.stage-control { width: auto; }
.filter-form { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.legend-bar { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 10px; }
.legend-bar span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ba59f; }
.legend-dot.focus { background: var(--blue); }
.legend-dot.filter { background: var(--amber); }
.legend-dot.evaluated { background: var(--green); }

.stock-header { margin-bottom: 18px; }
.stock-identity { min-width: 0; }
.back-link { margin-bottom: 14px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
.back-link:hover { color: var(--green-dark); }
.back-link svg { width: 15px; height: 15px; }
.stock-title-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.stock-title-line h2 small { color: var(--muted); font-size: 14px; font-weight: 500; }
.stock-metrics { margin-top: 18px; }
.strategy-notice { min-height: 40px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; color: #2e5c82; background: var(--blue-soft); border: 1px solid #cfe1f0; border-radius: 6px; font-size: 11px; }
.detail-grid { margin-top: 4px; }
.fact-list { min-height: 124px; padding: 10px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact-list > div { min-height: 34px; padding: 7px 10px; display: flex; align-items: flex-start; gap: 9px; font-size: 12px; }
.fact-list svg { width: 15px; height: 15px; margin-top: 1px; color: var(--green); }
.danger-list svg { color: var(--red); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-grid > div { min-height: 94px; padding: 15px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-grid > div:nth-child(3n) { border-right: 0; }
.feature-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
.feature-grid span { color: var(--muted); font-size: 10px; }
.feature-grid strong { margin-top: 4px; display: block; font-size: 16px; }
.feature-progress { width: 100%; height: 5px; margin-top: 12px; display: block; appearance: none; border: 0; border-radius: 3px; overflow: hidden; }
.feature-progress::-webkit-progress-bar { background: #e6ebe8; }
.feature-progress::-webkit-progress-value { background: var(--blue); }
.feature-progress::-moz-progress-bar { background: var(--blue); }
.feature-progress.inverse::-webkit-progress-value { background: var(--red); }
.feature-progress.inverse::-moz-progress-bar { background: var(--red); }
.feature-progress.evidence::-webkit-progress-value { background: var(--green); }
.feature-progress.evidence::-moz-progress-bar { background: var(--green); }
.subtle-count { color: var(--muted); font-size: 11px; }

.news-row { min-height: 54px; padding: 9px 12px; display: grid; grid-template-columns: 100px minmax(0, 1fr) 120px 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e7ebe9; text-decoration: none; }
.news-row:last-child { border-bottom: 0; }
.news-row:hover { background: #f7faf8; }
.news-source { overflow: hidden; color: var(--green-dark); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.news-title { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.news-time { color: var(--muted); font-size: 10px; text-align: right; white-space: nowrap; }
.news-row > svg { width: 14px; height: 14px; color: var(--muted); }
.news-stock { min-width: 88px; display: flex; flex-direction: column; font-size: 11px; font-weight: 700; }
.news-stock small { color: var(--muted); font-size: 9px; font-weight: 500; }
.news-stock + .news-source { width: 90px; }
.news-row:has(.news-stock) { grid-template-columns: 100px 90px minmax(0, 1fr) 120px 18px; }

.chart-panel { padding: 14px 16px 10px; }
.chart-legend { min-height: 30px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-key { width: 14px; height: 3px; border-radius: 2px; background: #999; }
.chart-key.target { background: var(--red); }
.chart-key.near { background: var(--amber); }
.chart-key.high10 { background: var(--green); }
.chart-key.close { background: var(--blue); }
.performance-chart { width: 100%; height: 280px; display: block; }
.data-note { min-height: 64px; margin-top: 24px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: #315a78; background: var(--blue-soft); border: 1px solid #cfe0ef; border-radius: 6px; }
.data-note > div { display: flex; flex-direction: column; }
.data-note strong { font-size: 12px; }
.data-note span { margin-top: 3px; color: #5d7485; font-size: 10px; }

.evidence-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); }
.evidence-candidates { max-height: 480px; overflow-y: auto; }
.evidence-row { min-height: 59px; padding: 9px 10px; display: grid; grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.8fr) 55px; align-items: center; gap: 12px; border-bottom: 1px solid #e7ebe9; text-decoration: none; }
.evidence-row:last-child { border-bottom: 0; }
.evidence-row:hover { background: #f7faf8; }
.evidence-bars progress, .source-progress { width: 100%; height: 5px; display: block; appearance: none; border: 0; border-radius: 3px; overflow: hidden; }
.evidence-bars progress::-webkit-progress-bar, .source-progress::-webkit-progress-bar { background: #e4eae6; }
.evidence-bars progress::-webkit-progress-value { background: var(--green); }
.evidence-bars progress::-moz-progress-bar { background: var(--green); }
.evidence-bars small { margin-top: 5px; display: block; color: var(--muted); font-size: 9px; }
.source-breakdown { padding: 8px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-breakdown > div { min-height: 47px; padding: 8px 12px; display: grid; grid-template-columns: minmax(90px, 1fr) auto; align-items: center; gap: 8px; }
.source-breakdown span { font-size: 11px; }
.source-breakdown strong { font-size: 11px; }
.source-progress { grid-column: 1 / -1; height: 4px; }
.source-progress::-webkit-progress-value { background: var(--blue); }
.source-progress::-moz-progress-bar { background: var(--blue); }

.change-band { margin: 0 0 24px; padding: 17px 18px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.change-band-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.change-band-heading h3 { margin: 2px 0 0; font-size: 15px; }
.change-metrics { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.change-metrics > div { min-height: 62px; padding: 10px 12px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.change-metrics > div:last-child { border-right: 0; }
.change-metrics span { color: var(--muted); font-size: 10px; }
.change-metrics strong { margin-top: 2px; font-size: 20px; }
.change-lists { padding-top: 11px; display: grid; gap: 7px; }
.change-lists > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; font-size: 11px; }
.change-lists strong { color: var(--muted); }
.change-lists span { overflow-wrap: anywhere; }

.ops-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.ops-summary > div { min-height: 78px; padding: 14px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-right: 1px solid var(--line); }
.ops-summary > div:last-child { border-right: 0; }
.status-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: #edf1ef; }
.status-icon.positive { color: var(--green-dark); background: var(--green-soft); }
.status-icon.attention { color: var(--amber); background: var(--amber-soft); }
.status-icon.danger { color: var(--red); background: var(--red-soft); }
.ops-summary > div > div { display: flex; min-width: 0; flex-direction: column; }
.ops-summary strong { font-size: 12px; }
.ops-summary small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-line { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-step { min-height: 104px; padding: 14px 16px; position: relative; border-right: 1px solid var(--line); }
.schedule-step:last-child { border-right: 0; }
.schedule-time { color: var(--green-dark); font-size: 10px; font-weight: 800; }
.schedule-step > i { width: 8px; height: 8px; margin: 9px 0; display: block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.schedule-step > div { display: flex; flex-direction: column; }
.schedule-step strong { font-size: 11px; }
.schedule-step small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
code { padding: 2px 4px; color: #47534d; background: #edf1ef; border-radius: 3px; font-family: Consolas, monospace; font-size: 10px; }
.run-row { min-height: 58px; padding: 8px 10px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid #e7ebe9; }
.run-row:last-child { border-bottom: 0; }
.run-row > div { min-width: 0; display: flex; flex-direction: column; }
.run-row strong { font-size: 11px; }
.run-row small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.run-row > span:last-child { color: var(--muted); font-size: 10px; }
.audit-panel { padding: 8px 0; }
.audit-row { min-height: 40px; padding: 8px 10px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 11px; }
.audit-row svg { width: 16px; height: 16px; margin-top: 1px; }
.audit-row.positive { color: var(--green-dark); }
.audit-row.danger { color: var(--red); }

.empty-state { min-height: 55vh; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.empty-state > svg { width: 44px; height: 44px; color: #87928c; }
.empty-state h2 { margin: 16px 0 5px; font-size: 20px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }

.login-body { min-height: 100vh; background: #eef3f0; }
.login-shell { min-height: 100vh; padding: 30px 18px; display: grid; place-items: center; }
.login-panel { width: min(430px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(32, 54, 43, 0.1); }
.login-brand { margin-bottom: 38px; }
.login-copy h1 { margin: 5px 0 9px; font-size: 24px; }
.login-copy p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-panel .alert { margin-bottom: 14px; }
.login-meta { margin-top: 20px; padding: 14px 0; display: grid; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.login-meta span { display: flex; align-items: center; gap: 7px; }
.login-meta svg { width: 14px; height: 14px; color: var(--green); }
.login-panel .quiet-link { margin-top: 15px; }
.sidebar-scrim { display: none; }

@media (max-width: 1120px) {
  .metric-band { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .metric-item:nth-child(3) { border-right: 0; }
  .metric-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .metric-item:nth-child(4) { border-right: 1px solid var(--line); }
  .performance-strip { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .performance-strip > div:nth-child(3) { border-right: 0; }
  .performance-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .ops-summary { grid-template-columns: 1fr; }
  .ops-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ops-summary > div:last-child { border-bottom: 0; }
  .filter-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-form { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .schedule-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .schedule-step:nth-child(3n) { border-right: 0; }
  .schedule-step:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 232px; transition: transform 160ms ease; box-shadow: 14px 0 36px rgba(25, 45, 35, 0.16); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 232px; z-index: 25; width: auto; height: 100%; background: rgba(20, 30, 25, 0.34); border: 0; }
  body.sidebar-open .sidebar-scrim { display: block; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 24px 18px 42px; }
  .two-column { grid-template-columns: 1fr; gap: 0; }
  .evidence-grid { grid-template-columns: 1fr; }
  .schedule-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-step:nth-child(3n) { border-right: 1px solid var(--line); }
  .schedule-step:nth-child(2n) { border-right: 0; }
  .schedule-step:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .feature-grid > div:nth-child(2n) { border-right: 0; }
  .feature-grid > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .feature-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 700px) {
  .user-copy { display: none; }
  .user-block { min-width: 0; padding-left: 8px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions > .icon-button:first-child { display: none; }
  .page-heading, .stock-title-line { min-height: 0; align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-heading h2, .stock-title-line h2 { font-size: 21px; }
  .heading-actions, .stock-actions { width: 100%; }
  .metric-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-item { min-height: 88px; padding: 14px; border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .metric-item:nth-child(2n) { border-right: 0 !important; }
  .metric-item:last-child { border-bottom: 0; }
  .metric-item strong { font-size: 21px; }
  .performance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-strip > div { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .performance-strip > div:nth-child(2n) { border-right: 0 !important; }
  .performance-strip > div:last-child { border-bottom: 0; }
  .secondary-column { display: none; }
  .candidate-table { min-width: 590px; }
  .filter-form { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-form .search-control { width: 100%; grid-column: 1 / -1; }
  .filter-form .select-control { min-width: 0; width: 100%; }
  .segmented-control { width: 100%; }
  .segmented-control a { flex: 1; min-width: 0; }
  .stage-control { width: 100%; }
  .change-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .change-metrics > div:nth-child(2) { border-right: 0; }
  .change-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .news-row, .news-row:has(.news-stock) { min-height: 72px; grid-template-columns: minmax(0, 1fr) 18px; gap: 4px 8px; }
  .news-source, .news-stock { grid-column: 1; grid-row: 1; }
  .news-title { grid-column: 1; grid-row: 2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .news-time { grid-column: 1; grid-row: 3; text-align: left; }
  .news-row > svg { grid-column: 2; grid-row: 1 / span 3; }
  .news-stock + .news-source { display: none; }
  .performance-chart { height: 240px; }
}

@media (max-width: 480px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 10px; }
  .header-status .separator, .header-status .separator + span { display: none; }
  .metric-band { grid-template-columns: 1fr 1fr; }
  .metric-item small { white-space: normal; }
  .section-heading { align-items: flex-start; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid > div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .feature-grid > div:last-child { border-bottom: 0 !important; }
  .schedule-line { grid-template-columns: 1fr; }
  .schedule-step { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .schedule-step:last-child { border-bottom: 0 !important; }
  .ops-summary > div { grid-template-columns: 36px minmax(0, 1fr); }
  .ops-summary .badge { grid-column: 2; justify-self: start; }
  .evidence-row { grid-template-columns: minmax(120px, 1fr) 55px; }
  .evidence-bars { grid-column: 1 / -1; grid-row: 2; }
  .change-band { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .change-lists > div { grid-template-columns: 1fr; gap: 2px; }
  .login-panel { padding: 22px; }
}
