:root {
  --canvas: #f5f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #0d1726;
  --text: #253142;
  --muted: #6b7787;
  --line: #dbe7f3;
  --accent: #0b84d8;
  --accent-soft: #e8f5ff;
  --grid-line: rgba(11, 132, 216, 0.08);
  --blue-bg: #e8f5ff;
  --blue-fg: #075f9d;
  --green-bg: #e9f8f0;
  --green-fg: #14703f;
  --yellow-bg: #fff7dc;
  --yellow-fg: #8a6100;
  --red-bg: #fff0f1;
  --red-fg: #a3303a;
  --font-ui: "SF Pro Display", "Geist Sans", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-serif: "Newsreader", "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "Geist Mono", "SF Mono", "JetBrains Mono", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--canvas);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.58;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 251, 0.92);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.hero-actions,
.toolbar,
.segmented {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: inset 0 0 0 1px var(--line);
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.brand-mark::before {
  top: 7px;
  bottom: 7px;
}

.brand-mark::after {
  top: 5px;
  bottom: 5px;
  left: 11px;
  right: 11px;
  border-top: 0;
  border-bottom: 0;
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.nav {
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 470px);
  gap: 24px;
  align-items: center;
  min-height: auto;
  padding: 28px 0 52px;
}

.hero > *,
.detail-layout > *,
.ranking-grid > *,
.review-grid > *,
.group-grid > *,
.update-grid > * {
  min-width: 0;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(24px, 2.9vw, 36px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.14;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
}

.lede {
  max-width: 720px;
  color: #536173;
  font-size: 16px;
}

.hero-actions {
  gap: 12px;
  margin-top: 24px;
}

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

.cockpit-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.cockpit-card > span,
.cockpit-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cockpit-card > strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.cockpit-card-wide,
.cockpit-card-list {
  grid-column: span 2;
}

.cockpit-card-chart {
  min-height: 182px;
}

.cockpit-stock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(11, 132, 216, 0.18);
  border-radius: 7px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.cockpit-stock:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.cockpit-stock:active {
  transform: scale(0.99);
}

.cockpit-stock strong {
  color: var(--ink);
}

.cockpit-stock b {
  align-self: center;
  grid-row: span 2;
}

.cockpit-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.market-flow-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  align-items: end;
  gap: 6px;
  min-height: 130px;
  margin-top: 12px;
  padding: 10px 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  overflow-x: auto;
}

.market-flow-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 6px;
  min-width: 18px;
  height: 110px;
}

.market-flow-bar i {
  width: 100%;
  min-height: 8px;
  height: var(--bar-height);
  border-radius: 5px 5px 2px 2px;
  background: var(--red-fg);
}

.market-flow-bar.neg-bar i {
  background: var(--green-fg);
}

.market-flow-bar b {
  writing-mode: vertical-rl;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.cockpit-stock.compact {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 0;
}

.cockpit-stock.compact i {
  color: var(--muted);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
}

.marketlens-lite {
  padding-top: 64px;
}

.model3-lab {
  padding-top: 48px;
}

.marketlens-shell {
  display: grid;
  gap: 14px;
}

.model3-shell {
  display: grid;
  gap: 14px;
}

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

.marketlens-stat,
.marketlens-main,
.marketlens-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.marketlens-stat {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
}

.marketlens-stat span,
.marketlens-card small {
  color: var(--muted);
  font-size: 12px;
}

.marketlens-stat strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.marketlens-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.62fr);
  gap: 14px;
  align-items: start;
}

.marketlens-main,
.marketlens-card {
  padding: 14px;
}

.marketlens-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.marketlens-table {
  min-width: 860px;
}

.model3-table {
  min-width: 1040px;
}

.marketlens-table th,
.marketlens-table td {
  padding: 12px 10px;
}

.marketlens-row {
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.marketlens-row:hover,
.marketlens-row:focus-visible {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
  outline: none;
}

.marketlens-side {
  display: grid;
  gap: 14px;
}

.marketlens-buckets,
.marketlens-risk-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.marketlens-bucket {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.marketlens-bucket div,
.marketlens-risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.marketlens-bucket span,
.marketlens-risk-item small {
  color: var(--muted);
}

.marketlens-bucket b {
  color: var(--ink);
  font-family: var(--font-mono);
}

.marketlens-bucket i {
  display: block;
  width: var(--bucket-width);
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.marketlens-bucket.hot i,
.marketlens-bucket.warm i,
.marketlens-bucket.soft-red i {
  background: var(--red-fg);
}

.marketlens-bucket.soft-green i,
.marketlens-bucket.cold i {
  background: var(--green-fg);
}

.marketlens-bucket.hot i {
  opacity: 0.95;
}

.marketlens-bucket.warm i,
.marketlens-bucket.cold i {
  opacity: 0.75;
}

.marketlens-bucket.soft-red i,
.marketlens-bucket.soft-green i {
  opacity: 0.45;
}

.marketlens-risk-item {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(11, 132, 216, 0.14);
  border-radius: 7px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.marketlens-risk-item:hover,
.marketlens-risk-item:focus-visible {
  border-color: #aad5ef;
  background: var(--accent-soft);
  outline: none;
}

.marketlens-risk-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.marketlens-risk-item b {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.model3-row.is-external {
  cursor: default;
  opacity: 0.92;
}

.model3-reason {
  display: -webkit-box;
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.model3-empty {
  display: grid;
  gap: 6px;
  min-height: 116px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.model3-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.model3-empty span {
  color: var(--muted);
  font-size: 13px;
}

.marketlens-risk-item:disabled {
  cursor: default;
  opacity: 0.72;
}

.review-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.review-flow span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
}

.review-flow b {
  color: var(--accent);
  font-family: var(--font-mono);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.secondary {
  background: var(--surface);
  color: var(--accent);
}

.quick-jump {
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 40;
  display: grid;
  gap: 8px;
}

.quick-jump-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(15, 38, 64, 0.08);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.quick-jump-button:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.quick-jump-button:active {
  transform: scale(0.96);
}

.summary-panel,
.table-frame,
.ranking-panel,
.detail-card,
.score-detail-card,
.score-card,
.group-card,
.update-grid article,
.schema-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 38, 64, 0.04);
}

.summary-panel {
  overflow: hidden;
}

.panel-chrome {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.panel-chrome span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7cce0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 22px;
}

.metric {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: inset 0 2px 0 var(--accent-soft);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
}

.risk-note {
  margin: 0 22px 22px;
  padding: 14px;
  border: 1px solid #ead7d9;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red-fg);
  font-size: 13px;
}

.section {
  padding: 92px 0;
}

.section-title {
  position: relative;
  max-width: 860px;
  margin-bottom: 28px;
}

.section-title.with-tools {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-title.compact {
  margin-bottom: 24px;
}

.section-title:not(.with-tools) {
  padding-right: 96px;
}

.section-title:not(.with-tools) .section-collapse-toggle {
  position: absolute;
  top: 0;
  right: 0;
}

.section-title.with-tools .section-collapse-toggle {
  margin-left: auto;
}

.section-collapse-toggle {
  min-width: 72px;
}

.section-collapse-summary {
  display: none;
  margin: -10px 0 28px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.section.is-section-collapsed > :not(.section-title):not(.section-collapse-summary) {
  display: none !important;
}

.section.is-section-collapsed .section-collapse-summary {
  display: block;
}

.toolbar {
  gap: 12px;
}

.group-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.watchlist-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}

input,
select {
  min-height: 42px;
  min-width: 210px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(11, 132, 216, 0.16);
  border-color: #9fd1f1;
}

textarea {
  width: 100%;
  min-height: 172px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  resize: vertical;
}

.table-frame {
  --sticky-code-width: 88px;
  --sticky-name-width: 210px;
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.table-mobile-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.watchlist-table-frame th:nth-child(1),
.watchlist-table-frame td:nth-child(1),
.moneyflow-table-frame th:nth-child(1),
.moneyflow-table-frame td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: var(--sticky-code-width);
  background: var(--surface);
}

.watchlist-table-frame th:nth-child(2),
.watchlist-table-frame td:nth-child(2),
.moneyflow-table-frame th:nth-child(2),
.moneyflow-table-frame td:nth-child(2) {
  position: sticky;
  left: var(--sticky-code-width);
  z-index: 3;
  min-width: var(--sticky-name-width);
  background: var(--surface);
}

.watchlist-table-frame thead th:nth-child(1),
.watchlist-table-frame thead th:nth-child(2),
.moneyflow-table-frame thead th:nth-child(1),
.moneyflow-table-frame thead th:nth-child(2) {
  z-index: 6;
}

.watchlist-table-frame .watchlist-filter-row th:nth-child(1),
.watchlist-table-frame .watchlist-filter-row th:nth-child(2),
.moneyflow-table-frame .moneyflow-filter-row th:nth-child(1),
.moneyflow-table-frame .moneyflow-filter-row th:nth-child(2) {
  background: var(--surface-soft);
  z-index: 7;
}

.watchlist-table-frame tbody tr:hover td:nth-child(1),
.watchlist-table-frame tbody tr:hover td:nth-child(2),
.watchlist-table-frame tbody tr.active td:nth-child(1),
.watchlist-table-frame tbody tr.active td:nth-child(2),
.moneyflow-table-frame tbody tr:hover td:nth-child(1),
.moneyflow-table-frame tbody tr:hover td:nth-child(2),
.moneyflow-table-frame tbody tr.active td:nth-child(1),
.moneyflow-table-frame tbody tr.active td:nth-child(2) {
  background: var(--accent-soft);
}

.watchlist-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.watchlist-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.watchlist-summary > div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
}

.watchlist-summary span,
.watchlist-summary small {
  color: var(--muted);
  font-size: 12px;
}

.watchlist-summary strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
}

.health-momentum-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
}

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

.data-health-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

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

.data-health-metric strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.health-failure summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.health-failure-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.health-failure-list small {
  color: var(--muted);
  font-size: 12px;
}

.momentum-grid {
  display: grid;
  gap: 10px;
}

.momentum-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.momentum-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.momentum-list {
  display: grid;
  gap: 6px;
}

.momentum-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.momentum-item:hover {
  border-color: #cde2f4;
  background: var(--surface-soft);
}

.momentum-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.momentum-main strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-main small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-empty {
  margin: 0;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-section-summary {
  margin-bottom: 14px;
}

.watchlist-panel.is-collapsed {
  display: none;
}

.moneyflow-panel.is-collapsed {
  display: none;
}

.review-panel-shell.is-collapsed {
  display: none;
}

.group-panel-shell.is-collapsed {
  display: none;
}

.watchlist-panel,
.moneyflow-panel,
.review-panel-shell,
.group-panel-shell {
  min-width: 0;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.watchlist-table-frame table {
  min-width: 1380px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.watchlist-filter-row th {
  padding: 8px 10px 12px;
  background: var(--surface-soft);
  cursor: default;
}

.table-filter {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}

.table-filter-static {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.score-factor-table {
  min-width: 0;
  margin-top: 14px;
  table-layout: fixed;
}

.score-factor-table th,
.score-factor-table td {
  padding: 10px 12px;
  font-size: 12px;
}

.score-factor-table th:nth-child(2),
.score-factor-table td:nth-child(2) {
  width: 72px;
  text-align: right;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover,
tbody tr.active {
  background: var(--accent-soft);
}

.stock-cell {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-weight: 800;
}

.code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.tag.blue {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.tag.green {
  background: var(--green-bg);
  color: var(--green-fg);
}

.tag.yellow {
  background: var(--yellow-bg);
  color: var(--yellow-fg);
}

.tag.red {
  background: var(--red-bg);
  color: var(--red-fg);
}

.tag.neutral {
  background: #eef3f8;
  color: #526071;
}

.discipline-pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  max-width: 100%;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.discipline-pill.blue {
  background: var(--blue-bg);
  color: var(--blue-fg);
}

.discipline-pill.green {
  background: var(--green-bg);
  color: var(--green-fg);
}

.discipline-pill.yellow {
  background: var(--yellow-bg);
  color: var(--yellow-fg);
}

.discipline-pill.red {
  background: var(--red-bg);
  color: var(--red-fg);
}

.discipline-pill.neutral {
  background: #eef3f8;
  color: #526071;
}

.discipline-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.flow-stack {
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.flow-stack strong {
  display: block;
  font-family: var(--font-mono);
  line-height: 1.15;
}

.flow-stack small {
  color: var(--muted);
  font-size: 11px;
}

.pos {
  color: var(--red-fg);
}

.neg {
  color: var(--green-fg);
}

.score-inline {
  display: grid;
  gap: 7px;
  min-width: 110px;
}

.score-track {
  height: 6px;
  overflow: hidden;
  border-radius: 9999px;
  background: #e5eef7;
}

.score-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.segmented {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: var(--accent);
  color: white;
}

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

.group-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.group-insight strong {
  color: var(--ink);
  font-family: var(--font-mono);
}

.group-card {
  padding: 16px;
}

.group-card,
.ranking-panel,
.detail-card,
.score-detail-card,
.score-card,
.update-grid article,
.schema-card {
  position: relative;
}

.group-card::before,
.ranking-panel::before,
.detail-card::before,
.score-detail-card::before,
.score-card::before,
.update-grid article::before,
.schema-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  width: 42px;
  height: 2px;
  background: var(--accent);
  border-radius: 9999px;
}

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

.group-card-head h3 {
  margin: 8px 0 0;
}

.group-strip {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 130px;
  color: var(--muted);
  font-size: 12px;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.group-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.group-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.group-leader {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.group-toggle {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.group-toggle:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.group-detail {
  display: none;
  margin-top: 12px;
}

.group-card.is-expanded .group-detail {
  display: grid;
  gap: 12px;
}

.group-members {
  display: grid;
  gap: 8px;
}

.group-member {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.group-member:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.group-member span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.group-member strong {
  color: var(--ink);
}

.group-leader.empty {
  cursor: default;
  background: var(--surface-soft);
}

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

.group-leader strong {
  color: var(--ink);
  font-size: 18px;
}

.leader-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.leader-metrics b {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(11, 132, 216, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  overflow-wrap: anywhere;
}

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

#money .ranking-grid {
  display: none;
}

.selected-money-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.selected-money-title {
  align-items: flex-start;
}

.selected-money-title small {
  text-align: right;
}

.selected-money-window-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.selected-money-window-card,
.selected-score-part,
.selected-score-total {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.selected-money-window-card {
  display: grid;
  gap: 8px;
}

.selected-money-window-card span,
.selected-score-total span,
.selected-score-part span {
  color: var(--muted);
  font-size: 13px;
}

.selected-money-window-card strong,
.selected-score-total strong {
  font-size: clamp(18px, 2vw, 26px);
}

.selected-money-window-card small,
.selected-score-part small {
  color: var(--muted);
}

.selected-money-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.selected-money-context span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.selected-money-score {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.selected-score-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.selected-score-parts {
  display: grid;
  gap: 8px;
}

.selected-score-part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selected-money-detail {
  margin-top: 14px;
  justify-self: stretch;
}

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

.research-workbench-panel {
  grid-column: 1 / -1;
}

.research-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 14px;
  min-width: 0;
}

.research-summary-card,
.research-context-card,
.research-peer-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.research-head {
  display: grid;
  gap: 6px;
}

.research-head .tag {
  justify-self: start;
}

.research-head strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.2;
}

.research-head small,
.research-card-title small,
.research-copy-status {
  color: var(--muted);
  font-size: 12px;
}

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

.research-kpi-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.research-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
}

.research-kpi-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
}

.research-summary-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.research-copy-status {
  min-height: 18px;
}

.research-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.research-card-title span {
  color: var(--ink);
  font-weight: 900;
}

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

.research-line-list p {
  margin: 0;
  padding: 10px 11px;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.research-context-preview {
  max-height: 220px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1b2a;
  color: #d8e8f7;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

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

.research-peer-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.research-peer-item:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.research-peer-item span:nth-child(2) {
  min-width: 0;
}

.research-peer-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-summary {
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 16px;
}

.ranking-panel {
  padding: 22px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title span {
  color: var(--ink);
  font-weight: 900;
}

.panel-title small {
  color: var(--muted);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.rank-item:hover,
.review-row:hover,
.note-item:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
}

.rank-index {
  color: var(--muted);
  font-family: var(--font-mono);
}

.review-list {
  display: grid;
  gap: 10px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-row,
.note-item {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.review-row {
  grid-template-columns: 30px 1fr auto;
  align-items: center;
}

.review-row strong,
.note-item strong {
  display: block;
  color: var(--ink);
}

.review-row small,
.note-item small {
  display: block;
}

.review-values {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.note-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.note-status {
  min-height: 20px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

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

.note-item {
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  font-size: 13px;
}

.detail-layout {
  display: block;
}

.detail-section-title {
  align-items: flex-start;
  position: relative;
  z-index: 8;
}

.detail-stock-picker {
  position: relative;
  width: min(360px, 100%);
  flex: 0 0 min(360px, 100%);
}

.detail-nav {
  position: relative;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-nav-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.detail-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail-nav-text {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}

.detail-stock-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 9px 12px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 30px rgba(15, 38, 64, 0.04);
  cursor: pointer;
}

.detail-stock-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-stock-toggle small,
.detail-stock-search span,
.detail-stock-item small {
  color: var(--muted);
  font-size: 12px;
}

.detail-stock-toggle strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-stock-toggle b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  line-height: 1;
}

.detail-stock-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(460px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 38, 64, 0.14);
}

.detail-stock-panel.is-collapsed {
  display: none;
}

.detail-stock-search {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-stock-search input {
  width: 100%;
  min-width: 0;
}

.detail-stock-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

.detail-stock-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.detail-stock-item:hover,
.detail-stock-item.active {
  border-color: #cde2f4;
  background: var(--accent-soft);
}

.detail-stock-item > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-stock-item strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-stock-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.detail-card,
.score-detail-card,
.score-card {
  padding: 24px;
}

.detail-card {
  overflow: hidden;
}

.score-detail-card {
  margin-top: 16px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.score-detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.flow-detail-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.score-radar-card,
.score-detail-list-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 38, 64, 0.04);
}

.score-radar-card {
  display: grid;
  gap: 14px;
}

.score-radar-head {
  display: grid;
  gap: 7px;
}

.score-radar-head .tag {
  justify-self: start;
}

.score-radar-head strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.score-radar-head small,
.score-radar-card p {
  color: var(--muted);
}

.score-radar-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.flow-signal-card .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.score-radar {
  width: 100%;
  max-width: 280px;
  height: auto;
  justify-self: center;
}

.score-radar-grid {
  fill: none;
  stroke: #dce8f2;
  stroke-width: 1;
}

.score-radar-axis {
  stroke: #e7eff7;
  stroke-width: 1;
}

.score-radar-area {
  fill: rgba(11, 132, 216, 0.16);
  stroke: var(--accent);
  stroke-width: 2;
}

.score-radar-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.score-radar-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.score-radar-label {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  dominant-baseline: middle;
}

.score-radar-legend {
  display: grid;
  gap: 8px;
}

.score-radar-legend div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #edf3f9;
}

.score-radar-legend div:last-child {
  border-bottom: 0;
}

.score-radar-legend span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.score-radar-legend small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.score-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.score-detail-title {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.score-detail-card p {
  margin: 0;
  color: #536173;
  line-height: 1.7;
}

.score-details-panel {
  margin-top: 16px;
}

.score-details-panel.is-collapsed {
  display: none;
}

.score-details-table-frame {
  --sticky-code-width: 72px;
  --sticky-name-width: 190px;
}

.score-details-table {
  min-width: 1120px;
}

.score-details-table th,
.score-details-table td {
  white-space: nowrap;
}

.score-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.score-sort-button span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.score-sort-button small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.score-sort-button b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
}

.score-sort-button:hover b,
.score-sort-button.active b {
  border-color: #aad5ef;
  background: var(--accent-soft);
  color: var(--accent);
}

.score-details-table .stock-cell {
  min-width: 168px;
}

.score-mini {
  display: grid;
  gap: 6px;
  min-width: 74px;
}

.score-mini .score-track {
  width: 74px;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 260px;
}

.detail-title {
  display: grid;
  gap: 4px;
}

.detail-title strong {
  color: var(--ink);
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.detail-metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.sparkline-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.sparkline-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sparkline-panel h3 {
  margin-bottom: 14px;
}

.sparkline {
  width: 100%;
  height: 140px;
}

.sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.sparkline circle {
  fill: var(--accent);
}

.money-flow-detail {
  margin-top: 22px;
}

.flow-panel-title {
  align-items: center;
}

.flow-date-control {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
}

.flow-date-control select,
.detail-flow-date-select {
  width: 100%;
  min-width: 0;
}

.flow-window-control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.detail-flow-window {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.detail-flow-window.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.flow-trend-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.flow-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.flow-trend-head span,
.flow-trend-head strong {
  display: block;
}

.flow-trend-head span {
  color: var(--ink);
  font-weight: 900;
}

.flow-trend-head small {
  color: var(--muted);
}

.flow-trend-head strong {
  font-size: 18px;
}

.flow-trend-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 12px 0 14px;
}

.flow-bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10px, 1fr);
  align-items: end;
  min-height: 118px;
  gap: 4px;
  padding: 12px 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  overflow-x: auto;
}

.flow-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 5px;
  min-width: 10px;
  height: 98px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.flow-bar i {
  width: 100%;
  min-height: 6px;
  height: var(--bar-height);
  border-radius: 9999px 9999px 2px 2px;
  background: var(--red-fg);
}

.flow-bar.neg-bar i {
  background: var(--green-fg);
}

.flow-bar span {
  writing-mode: vertical-rl;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}

.detail-flow-row {
  cursor: pointer;
}

.selected-flow-title {
  margin-top: 16px;
}

.flow-detail-grid {
  margin-top: 0;
}

.compact-frame {
  margin-top: 12px;
}

.compact-table {
  min-width: 720px;
}

.compact-table th,
.compact-table td {
  padding: 12px 10px;
}

.score-card {
  position: sticky;
  top: 96px;
}

.score-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.score-row {
  display: grid;
  grid-template-columns: 102px 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

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

.update-grid article,
.schema-card {
  padding: 22px;
}

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

.update-grid p,
.schema-card p,
.score-detail-card p,
.detail-card p {
  color: #536173;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.error-box {
  padding: 22px;
  border: 1px solid #f0cbd0;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red-fg);
}

.workbench-toolbar {
  justify-content: flex-end;
}

.workbench-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.workbench-cockpit {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.42fr) minmax(300px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.workbench-left-rail,
.workbench-action-rail {
  display: grid;
  gap: 14px;
}

.workbench-action-rail {
  position: sticky;
  top: 86px;
}

.workbench-status-card,
.workbench-signal-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 248, 0.78)),
    var(--surface);
  box-shadow: 0 18px 44px rgba(15, 38, 64, 0.07);
}

.workbench-bridge-summary {
  display: grid;
  gap: 10px;
  color: var(--text);
}

.workbench-bridge-summary p {
  margin: 0;
}

.workbench-bridge-summary code {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--blue-fg);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.workbench-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.workbench-mini-card {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(15, 38, 64, 0.06);
}

.workbench-mini-card span,
.workbench-mini-card small {
  display: block;
  color: var(--muted);
}

.workbench-mini-card strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.workbench-timeline {
  display: grid;
  gap: 12px;
}

.workbench-timeline div {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.workbench-timeline div::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--blue-fg);
}

.workbench-timeline span {
  color: var(--blue-fg);
  font-family: var(--font-mono);
  font-size: 12px;
}

.workbench-timeline b {
  color: var(--ink);
}

.workbench-timeline small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

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

.workbench-task-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #bfd4dd;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.workbench-task-button:hover {
  border-color: #aad5ef;
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.workbench-task-button.is-running {
  border-left-color: #a26a16;
  background: #fff8e8;
}

.workbench-task-button.is-sensitive {
  border-left-color: var(--red-fg);
}

.workbench-task-button:active {
  transform: scale(0.99);
}

.workbench-task-button span {
  color: var(--ink);
  font-weight: 800;
}

.workbench-task-button small {
  color: var(--muted);
}

.workbench-task-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.workbench-signal-list {
  display: grid;
  gap: 12px;
}

.workbench-signal-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-fg);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 250, 248, 0.76)),
    var(--surface-soft);
}

.workbench-signal-head {
  display: grid;
  gap: 4px;
}

.workbench-signal-head strong {
  color: var(--ink);
}

.workbench-signal-head small {
  color: var(--muted);
}

.workbench-signal-card p {
  margin: 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(234, 244, 249, 0.76);
  color: var(--text);
  font-size: 14px;
}

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

.workbench-signal-field {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
}

.workbench-signal-field.wide {
  padding: 0;
  border: 0;
  background: transparent;
}

.workbench-signal-field b {
  color: var(--muted);
  font-size: 12px;
}

.workbench-signal-field span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.workbench-signal-field.confirm {
  border-color: rgba(47, 126, 89, 0.25);
  background: rgba(234, 247, 238, 0.75);
}

.workbench-signal-field.invalidate {
  border-color: rgba(181, 65, 82, 0.22);
  background: rgba(255, 241, 243, 0.75);
}

@media (max-width: 1080px) {
  .hero,
  .detail-layout,
  .ranking-grid,
  .selected-money-profile,
  .review-grid,
  .flow-summary,
  .group-grid,
  .health-momentum-grid,
  .update-grid,
  .workbench-cockpit,
  .workbench-kpi-strip,
  .workbench-signal-list,
  .workbench-signal-columns,
  .research-workbench,
  .sparkline-wrap,
  .marketlens-layout,
  .score-detail-layout {
    grid-template-columns: 1fr;
  }

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

  .workbench-action-rail {
    position: static;
  }

  .score-card {
    position: static;
  }

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

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

  .section-title.with-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .section-title:not(.with-tools) {
    display: grid;
    gap: 12px;
    padding-right: 0;
  }

  .section-title:not(.with-tools) .section-collapse-toggle {
    position: static;
    width: fit-content;
  }

  .section-title.with-tools .section-collapse-toggle {
    margin-left: 0;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select {
    width: 100%;
  }

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

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

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

@media (max-width: 720px) {
  .shell {
    padding: 0 14px 72px;
  }

  .section {
    padding: 58px 0;
  }

  .section-title.with-tools {
    gap: 14px;
  }

  .detail-nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .detail-nav-btn {
    flex: 1 1 auto;
  }

  .detail-nav-text {
    width: 100%;
    justify-content: center;
    min-width: auto;
    margin: 4px 0;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .toolbar label,
  .toolbar .button {
    flex: 0 0 min(72vw, 280px);
    scroll-snap-align: start;
  }

  .marketlens-lite .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .marketlens-lite .toolbar .button {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
  }

  .detail-stock-picker {
    width: 100%;
    flex: 1 1 auto;
  }

  .detail-stock-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 12px 30px rgba(15, 38, 64, 0.08);
  }

  .toolbar label span {
    white-space: nowrap;
  }

  input,
  select {
    width: 100%;
    min-width: 0;
  }

  .table-mobile-hint {
    display: block;
  }

  table {
    min-width: 920px;
  }

.watchlist-table-frame table {
    min-width: 1380px;
  }

  .moneyflow-table-frame table {
    min-width: 980px;
  }

  .watchlist-table-frame,
  .moneyflow-table-frame {
    --sticky-code-width: 78px;
    --sticky-name-width: 176px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .metric-grid,
  .flow-summary,
  .watchlist-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .review-row {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .review-values {
    grid-column: 2;
    grid-template-columns: repeat(3, max-content);
    justify-items: start;
    gap: 8px;
  }
}

@media (max-width: 680px) {
  .shell {
    padding-inline: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .nav {
    width: 100%;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    white-space: nowrap;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  .hero-copy,
  h1,
  .lede {
    width: min(100%, 320px);
  }

  h1 {
    font-size: 34px;
    letter-spacing: 0;
    line-height: 1.12;
    word-break: break-all;
  }

  .selected-money-window-grid {
    grid-template-columns: 1fr;
  }

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

  .marketlens-stat strong {
    font-size: 16px;
  }

  .selected-score-part,
  .selected-score-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .lede {
    max-width: 100%;
    font-size: 16px;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .metric-grid,
  .flow-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-board,
  .group-member {
    grid-template-columns: 1fr;
  }

  .data-health-grid,
  .health-momentum-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-card-wide,
  .cockpit-card-list {
    grid-column: span 1;
  }

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

  .score-detail-head {
    flex-direction: column;
  }

  .score-detail-head .button {
    width: 100%;
  }

  .detail-tags {
    justify-content: flex-start;
    max-width: 100%;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .note-actions,
  .note-item {
    grid-template-columns: 1fr;
  }

  .note-actions {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .group-insight {
    align-items: flex-start;
    flex-direction: column;
  }

  .leader-metrics {
    grid-template-columns: 1fr;
  }

  .quick-jump {
    right: 12px;
    bottom: 18px;
  }

  .quick-jump-button {
    width: 38px;
    height: 38px;
  }
}
