:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfe;
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --border: #d7dee9;
  --border-soft: #e7ebf2;
  --blue: #0b63d8;
  --blue-soft: #eaf2ff;
  --green: #139a43;
  --green-soft: #eaf8ef;
  --red: #e2333d;
  --red-soft: #fff0f1;
  --teal: #1aa6a4;
  --shadow: 0 18px 50px rgba(35, 55, 88, 0.08);
  --radius: 8px;
  font-family:
    Inter, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 18px 10px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #bdd6ff;
  border-radius: 8px;
  color: var(--blue);
  background: #f4f8ff;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #344054;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.nav-item b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-muted {
  color: var(--faint);
}

.index-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.index-panel p,
.score-note,
.data-note,
.chart-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.index-panel p {
  display: flex;
  justify-content: space-between;
}

.index-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}

.index-row strong {
  font-size: 12px;
}

.index-row em {
  font-style: normal;
}

.data-note {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 68px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.control-group {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}

.control-group > span {
  font-weight: 700;
}

.segmented,
.mini-segmented {
  display: inline-grid;
  grid-auto-flow: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.segmented button,
.mini-segmented button {
  min-width: 72px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--border-soft);
  background: transparent;
  color: #344054;
  font-weight: 700;
  cursor: pointer;
}

.segmented button:last-child,
.mini-segmented button:last-child {
  border-right: 0;
}

.segmented button:hover,
.mini-segmented button:hover {
  background: var(--blue-soft);
}

.segmented .is-selected,
.mini-segmented .is-selected {
  color: #fff;
  background: var(--blue);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.update-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.update-chip strong {
  color: #344054;
}

.update-chip .icon {
  width: 18px;
  height: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  min-height: 630px;
}

.overview-shell {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.workbench-header {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.workbench-header h1 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.workbench-header p {
  max-width: 900px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.data-trust-bar {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-trust-status {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7fbff;
}

.data-trust-status strong {
  font-size: 17px;
}

.data-trust-status p,
.data-trust-caution,
.data-trust-method p,
.data-rail p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-trust-method {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.data-trust-method article,
.methodology-list article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.data-trust-method span,
.methodology-list b {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.data-trust-method strong,
.methodology-list strong {
  font-size: 13px;
}

.data-trust-caution {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid #f1d6a8;
  border-radius: 8px;
  color: #8a5a12;
  background: #fff8e8;
}

.screener-workbench {
  display: grid;
  grid-template-columns: 220px minmax(520px, 1fr) 330px;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.workbench-filter-rail,
.candidate-screener,
.candidate-detail-rail {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.workbench-filter-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.rail-section,
.filter-checklist,
.mini-theme-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.rail-section strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.rail-section small,
.rail-label {
  color: var(--muted);
  font-size: 12px;
}

.rail-label {
  font-weight: 800;
  text-transform: uppercase;
}

.data-rail strong {
  color: #075635;
}

.filter-checklist p {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.4;
}

.filter-checklist b {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--green);
}

.mini-theme-list button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mini-theme-list button:first-of-type {
  border-top: 0;
}

.mini-theme-list button:hover,
.mini-theme-list button.is-active {
  color: var(--blue);
}

.mini-theme-list span,
.mini-theme-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.mini-theme-list strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-screener {
  overflow: hidden;
}

.screener-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.screener-titlebar h2 {
  font-size: 18px;
}

.screener-titlebar p,
.screener-titlebar span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.candidate-table {
  min-width: 780px;
  overflow-x: auto;
}

.candidate-table-head,
.candidate-table-row {
  display: grid;
  grid-template-columns: 56px minmax(130px, 1.1fr) 94px 76px 104px minmax(128px, 1fr) 64px minmax(150px, 1.2fr);
  gap: 10px;
  align-items: center;
}

.candidate-table-head {
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 800;
}

.candidate-table-row {
  width: 100%;
  min-height: 58px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.candidate-table-row:hover,
.candidate-table-row.is-active {
  background: #f4f8ff;
}

.candidate-table-row.is-active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.table-score {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 30px;
  border-radius: 6px;
  color: #075635;
  background: #e6f7ec;
  font-weight: 800;
}

.table-symbol,
.table-note,
.candidate-table-row > span {
  min-width: 0;
}

.table-symbol strong,
.table-symbol em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-symbol strong {
  font-size: 13px;
}

.table-symbol em,
.candidate-table-row > span,
.table-note {
  color: #344054;
  font-size: 12px;
}

.table-symbol em,
.table-note {
  color: var(--muted);
}

.table-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-detail-rail {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.detail-rail-title h2 {
  margin-top: 5px;
  font-size: 24px;
}

.detail-rail-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-rail-score {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cde7d6;
  border-radius: 8px;
  background: #f1fbf4;
}

.detail-rail-score strong {
  grid-row: span 2;
  font-size: 34px;
  line-height: 1;
  color: #075635;
}

.detail-rail-score span,
.detail-rail-score em {
  display: block;
  font-style: normal;
}

.detail-rail-score span {
  font-weight: 800;
}

.detail-rail-score em {
  color: var(--muted);
  font-size: 12px;
}

.rail-metric-list {
  display: grid;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.rail-metric-list p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin: 0;
  padding: 9px 10px;
  border-top: 1px solid var(--border-soft);
}

.rail-metric-list p:first-child {
  border-top: 0;
}

.rail-metric-list span {
  color: var(--muted);
  font-size: 12px;
}

.rail-metric-list strong {
  font-size: 12px;
}

.detail-rail-chart {
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.detail-rail-chart .line-chart {
  margin: 0;
}

.detail-rail-chart small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.rail-review {
  display: grid;
  gap: 8px;
}

.rail-review p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.rail-review b,
.rail-review span {
  display: block;
}

.rail-review b {
  font-size: 12px;
}

.rail-review span {
  color: #344054;
  font-size: 12px;
  line-height: 1.4;
}

.market-context-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(560px, 1.28fr);
  gap: 12px;
  align-items: start;
}

.market-context-grid .theme-panel,
.market-context-grid .theme-stocks-panel,
.market-context-grid .rotation-card,
.market-context-grid .alerts-card {
  min-width: 0;
  overflow: hidden;
}

.market-context-grid .theme-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

.market-context-grid .theme-stocks-panel {
  grid-column: auto;
}

.market-context-grid .theme-head,
.market-context-grid .theme-row {
  grid-template-columns: 42px minmax(128px, 1fr) 132px;
}

.market-context-grid .theme-head span:last-child,
.market-context-grid .theme-row .change-cell {
  display: none;
}

.view-grid {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.view-grid.two-column {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
}

.candidate-panel,
.theme-panel,
.detail-panel {
  min-width: 0;
  background: var(--surface);
}

.candidate-panel,
.theme-panel {
  padding: 18px 14px 16px;
  border-right: 1px solid var(--border);
}

.candidate-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.candidate-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 126px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
  cursor: pointer;
}

.candidate-item:hover {
  border-color: #b9d5ff;
  background: #f5f9ff;
}

.candidate-item.is-active {
  border-color: #8bbcff;
  background: #f0f7ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.candidate-score {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #075635;
  background: #dff8e8;
  font-weight: 800;
}

.candidate-copy {
  min-width: 0;
}

.candidate-copy strong,
.candidate-copy em,
.candidate-copy small,
.candidate-copy i,
.candidate-copy u,
.candidate-copy b {
  display: block;
}

.candidate-copy strong {
  color: #102a43;
  font-size: 15px;
  line-height: 1.25;
}

.candidate-copy em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.candidate-copy small,
.candidate-copy i,
.candidate-copy u,
.candidate-copy b {
  margin-top: 7px;
  color: #344054;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.candidate-copy i {
  color: var(--blue);
}

.candidate-diagnostics {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.candidate-diagnostics span,
.candidate-copy u {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.candidate-diagnostics span {
  padding: 6px 8px;
  border-radius: 7px;
  background: #edf7f6;
  color: #0b625f;
}

.candidate-diagnostics .candidate-diagnostics-label {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.candidate-copy u {
  color: var(--muted);
  text-decoration: none;
}

.candidate-copy b {
  color: #bd1f2b;
  font-weight: 700;
}

.live-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid #cde7d6;
  border-radius: 999px;
  color: #0f6b3a;
  background: #effaf2;
  font-size: 11px;
  font-weight: 800;
}

.panel-heading,
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-heading {
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.35;
}

.theme-table,
.theme-row {
  overflow: hidden;
}

.theme-table {
  display: grid;
  border-top: 1px solid var(--border-soft);
}

.theme-head,
.theme-row {
  display: grid;
  grid-template-columns: 42px minmax(96px, 1fr) 150px 80px;
  align-items: center;
  gap: 10px;
}

.theme-head {
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
}

.theme-row {
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.theme-row:hover,
.theme-row.is-active {
  background: #f8fbff;
}

.rank b,
.rank small,
.theme-name strong,
.theme-name small {
  display: block;
}

.rank {
  display: grid;
  justify-items: center;
}

.rank b {
  font-size: 17px;
}

.rank small,
.theme-name small {
  color: var(--muted);
  font-size: 11px;
}

.theme-name {
  min-width: 0;
}

.theme-name strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strength-cell {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 8px;
  align-items: center;
}

.strength-cell i {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3ed;
}

.strength-cell i::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--score) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, #108640, #17a756);
  content: "";
}

.change-cell {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 2px;
  align-items: center;
  justify-items: end;
}

.sparkline {
  width: 44px;
  height: 24px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--muted);
}

.wide-button {
  width: 100%;
  min-height: 34px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.wide-button:hover {
  border-color: #b9c9df;
  background: #f8fbff;
}

.score-note {
  margin-top: 12px;
  text-align: center;
}

.empty-state {
  display: grid;
  gap: 4px;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.detail-panel {
  padding: 18px 22px 20px;
}

.detail-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 16px;
  border-left: 3px solid var(--green);
}

.detail-title > div {
  padding-left: 14px;
}

.selected-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: #344054;
  font-weight: 700;
  cursor: pointer;
}

.favorite-button.is-on {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c9dcff;
}

.favorite-button .icon {
  width: 18px;
  height: 18px;
}

.tabs {
  display: flex;
  gap: 26px;
  min-height: 48px;
  margin-top: 2px;
  border-bottom: 1px solid var(--border);
}

.tabs button {
  position: relative;
  border: 0;
  background: transparent;
  color: #475467;
  font-weight: 700;
  cursor: pointer;
}

.tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.tabs .is-active {
  color: var(--blue);
}

.tabs .is-active::after {
  background: var(--blue);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 18px 0;
}

.candidate-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric-card,
.table-card,
.chart-card,
.review-card,
.rotation-card,
.chair-card,
.alerts-card,
.settings-card,
.plain-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  align-content: center;
  min-height: 130px;
  padding: 16px;
  box-shadow: none;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  margin-top: 14px;
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  margin-left: 4px;
  color: #344054;
  font-size: 16px;
  font-weight: 500;
}

.metric-card em {
  margin-top: 8px;
  color: #344054;
  font-size: 12px;
  font-style: normal;
}

.text-positive {
  color: var(--green);
}

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

.candidate-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.table-card,
.chart-card,
.review-card,
.plain-panel {
  min-width: 0;
  padding: 14px;
}

.card-heading {
  margin-bottom: 12px;
}

.card-heading button {
  border: 0;
  background: transparent;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.leader-table,
.theme-stock-table {
  display: grid;
  border-top: 1px solid var(--border-soft);
}

.leader-head,
.leader-row,
.theme-stock-head,
.theme-stock-row {
  display: grid;
  grid-template-columns: 36px minmax(92px, 1.35fr) 45px minmax(62px, 0.8fr) minmax(68px, 0.75fr) minmax(64px, 0.7fr);
  gap: 8px;
  align-items: center;
}

.leader-head,
.theme-stock-head {
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
}

.leader-row,
.theme-stock-row {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: transparent;
  text-align: left;
}

.leader-row:hover,
.theme-stock-row:hover {
  background: #f8fbff;
}

.leader-row b,
.theme-stock-row b {
  font-size: 18px;
  text-align: center;
}

.leader-row span,
.theme-stock-row span {
  min-width: 0;
}

.leader-row strong,
.leader-row small,
.theme-stock-row strong,
.theme-stock-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row strong,
.theme-stock-row strong {
  font-size: 13px;
}

.leader-row small,
.leader-row i,
.theme-stock-row small,
.theme-stock-row i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.leader-row em,
.theme-stock-row em {
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.theme-stocks-panel {
  align-self: stretch;
  grid-column: span 2;
}

.theme-stocks-panel .card-heading > div {
  min-width: 0;
}

.card-caption {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chart-card {
  min-height: 330px;
}

.review-card {
  min-height: 330px;
}

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

.review-list p {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 58px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.review-list b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
}

.review-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-heading {
  align-items: start;
}

.mini-segmented button {
  min-width: 48px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 10px 0 2px;
  color: #344054;
  font-size: 12px;
}

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

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
}

.grid-line {
  stroke: #d9dee8;
  stroke-dasharray: 4 5;
}

.axis-text {
  fill: #667085;
  font-size: 12px;
}

.axis-label {
  text-anchor: middle;
}

.chart-footnote {
  padding-left: 4px;
}

.candidate-line-chart {
  margin-top: 10px;
}

.view-panel {
  min-width: 0;
  padding: 18px;
}

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

.watch-list.compact {
  margin-top: 14px;
}

.watch-list button {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
  cursor: pointer;
}

.watch-list button:hover {
  border-color: #b9d5ff;
  background: #f5f9ff;
}

.watch-list strong,
.watch-list span {
  display: block;
}

.watch-list span {
  color: var(--muted);
  font-size: 12px;
}

.alert-list.expanded {
  gap: 12px;
}

.alert-list.expanded .alert-item {
  min-height: 72px;
}

.settings-summary {
  display: grid;
  gap: 12px;
}

.settings-summary p {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.settings-summary strong {
  color: var(--text);
}

.settings-summary span {
  color: var(--muted);
  line-height: 1.45;
}

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

.methodology-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.2fr) minmax(260px, 0.9fr) minmax(280px, 1fr) minmax(250px, 0.9fr);
  gap: 10px;
  padding: 16px 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.lower-grid .theme-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: none;
}

.lower-grid .theme-head,
.lower-grid .theme-row {
  grid-template-columns: 38px minmax(90px, 1fr) 80px;
}

.lower-grid .theme-head span:last-child,
.lower-grid .theme-row .change-cell {
  display: none;
}

.rotation-card,
.chair-card,
.alerts-card,
.settings-card {
  min-width: 0;
  padding: 14px;
  box-shadow: none;
}

.rotation-body {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  gap: 12px;
  align-items: center;
}

.rotation-box {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.rotation-box.positive {
  color: #0f7d39;
  background: var(--green-soft);
  border-color: #bee8cc;
}

.rotation-box.danger {
  color: #bd1f2b;
  background: var(--red-soft);
  border-color: #ffd0d4;
}

.rotation-box span,
.rotation-box em {
  font-size: 12px;
  font-style: normal;
}

.rotation-box strong {
  font-size: 20px;
}

.swap-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.rotation-card p {
  margin: 12px 2px 0;
  color: #344054;
  font-size: 12px;
}

.chair-list {
  display: grid;
  gap: 8px;
}

.chair-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
  cursor: pointer;
}

.chair-item:hover {
  border-color: #b9d5ff;
  background: #f5f9ff;
}

.pattern-score {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #075635;
  background: #dff8e8;
  font-weight: 800;
}

.chair-item strong,
.chair-item em,
.chair-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chair-item strong {
  color: #102a43;
  font-size: 13px;
}

.chair-item em,
.chair-item small,
.pattern-note {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pattern-note {
  margin: 10px 2px 0;
}

.alert-list,
.setting-list,
.news-list {
  display: grid;
  gap: 8px;
}

.alert-item,
.setting-row,
.news-list button,
.member-grid button {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.alert-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  text-align: left;
}

.alert-item.success .icon {
  color: var(--green);
}

.alert-item.danger {
  border-color: #ffd0d4;
  background: #fff8f8;
}

.alert-item.danger .icon {
  color: var(--red);
}

.alert-item strong,
.alert-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-item strong {
  color: var(--green);
}

.alert-item.danger strong {
  color: var(--red);
}

.alert-item em,
.alert-item time {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  text-align: left;
}

.setting-row strong,
.setting-row em {
  display: block;
}

.setting-row strong {
  font-size: 13px;
}

.setting-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.setting-row i {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #a9b5c6;
}

.setting-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 160ms ease;
}

.setting-row i.is-on {
  background: var(--blue);
}

.setting-row i.is-on::after {
  transform: translateX(18px);
}

.tab-space {
  padding-top: 18px;
}

.table-card.is-expanded {
  max-width: 900px;
}

.plain-panel {
  min-height: 400px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.member-grid button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  text-align: left;
}

.member-grid b {
  color: var(--blue);
}

.member-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.news-list button {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 12px;
  text-align: left;
}

.news-list span {
  color: var(--muted);
  font-size: 12px;
}

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

  .search-box,
  .update-chip {
    grid-column: span 1;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .detail-grid,
  .lower-grid,
  .market-context-grid,
  .data-trust-bar,
  .candidate-detail-grid,
  .view-grid.two-column {
    grid-template-columns: 1fr;
  }

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

  .screener-workbench {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .candidate-detail-rail {
    grid-column: 1 / -1;
  }

  .theme-stocks-panel {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding: 0;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-item {
    position: relative;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    min-height: 52px;
    padding: 7px 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .nav-item b {
    position: absolute;
    top: 4px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .index-panel,
  .data-note {
    display: none;
  }

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

  .candidate-panel,
  .theme-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .overview-shell,
  .view-grid {
    padding: 12px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .sidebar {
    gap: 8px;
    padding: 10px 12px 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    display: none;
  }

  .nav-list {
    gap: 4px;
  }

  .nav-item {
    min-height: 46px;
    border-radius: 7px;
    font-size: 11px;
  }

  .toolbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .control-group {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .control-group > span {
    font-size: 12px;
  }

  .segmented {
    grid-auto-flow: column;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }

  .segmented button {
    min-width: 0;
    min-height: 32px;
    border-right: 1px solid var(--border-soft);
    border-bottom: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .segmented button:last-child {
    border-right: 0;
  }

  .search-box {
    min-height: 34px;
  }

  .update-chip {
    justify-content: space-between;
  }

  .theme-head,
  .theme-row {
    grid-template-columns: 38px minmax(84px, 1fr) minmax(94px, 0.9fr);
  }

  .theme-head span:last-child,
  .change-cell {
    display: none;
  }

  .detail-panel {
    padding: 14px 12px;
  }

  .detail-title {
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .tabs {
    gap: 14px;
    overflow-x: auto;
  }

  .tabs button {
    min-width: max-content;
  }

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

  .dashboard-grid .candidate-detail-panel {
    order: 1;
  }

  .dashboard-grid .candidate-panel {
    order: 2;
  }

  .overview-shell,
  .view-grid {
    gap: 8px;
    padding: 8px;
  }

  .screener-workbench {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .candidate-screener {
    order: 1;
    overflow: hidden;
  }

  .candidate-detail-rail {
    order: 2;
    gap: 10px;
    padding: 12px;
  }

  .workbench-filter-rail {
    order: 3;
    gap: 8px;
    padding: 8px;
  }

  .rail-section,
  .filter-checklist,
  .mini-theme-list {
    padding: 8px;
  }

  .workbench-header {
    padding: 10px 12px;
  }

  .workbench-header h1 {
    font-size: 21px;
  }

  .workbench-header p {
    display: none;
  }

  .data-trust-bar {
    gap: 8px;
    padding: 8px;
  }

  .data-trust-method,
  .methodology-list {
    grid-template-columns: 1fr;
  }

  .data-trust-method article:nth-child(n+3) {
    display: none;
  }

  .screener-titlebar {
    align-items: center;
    padding: 10px 12px;
  }

  .screener-titlebar h2 {
    font-size: 16px;
  }

  .screener-titlebar p {
    display: none;
  }

  .screener-titlebar span {
    margin: 0;
  }

  .candidate-table {
    min-width: 0;
    overflow: visible;
  }

  .candidate-table-head,
  .candidate-table-row {
    grid-template-columns: 44px minmax(104px, 1fr) 64px 58px;
    gap: 6px;
  }

  .candidate-table-head span:nth-child(n+5),
  .candidate-table-row > span:nth-child(n+5) {
    display: none;
  }

  .candidate-table-head {
    min-height: 32px;
    padding: 0 8px;
  }

  .candidate-table-row {
    min-height: 50px;
    padding: 0 8px;
  }

  .table-score {
    width: 34px;
    height: 28px;
    font-size: 12px;
  }

  .table-symbol strong {
    font-size: 12px;
  }

  .table-symbol em,
  .candidate-table-row > span,
  .table-note {
    font-size: 11px;
  }

  .settings-summary p {
    grid-template-columns: 1fr;
  }

  .leader-head,
  .leader-row,
  .theme-stock-head,
  .theme-stock-row {
    grid-template-columns: 30px 1fr 44px 58px;
  }

  .leader-head span:nth-child(3),
  .leader-row i,
  .leader-head span:nth-child(4),
  .leader-row em:nth-of-type(1),
  .theme-stock-head span:nth-child(3),
  .theme-stock-row i,
  .theme-stock-head span:nth-child(4),
  .theme-stock-row em:nth-of-type(1) {
    display: none;
  }

  .rotation-body {
    grid-template-columns: 1fr;
  }

  .swap-icon {
    min-height: 32px;
  }
}

@media (max-width: 380px) {
  .nav-item {
    min-height: 44px;
    font-size: 10px;
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
  }

  .toolbar {
    padding: 10px;
  }

  .control-group {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .segmented button {
    padding: 0 4px;
    font-size: 11px;
  }

  .candidate-table-head,
  .candidate-table-row {
    grid-template-columns: 40px minmax(96px, 1fr) 56px 54px;
  }
}
