:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-strong: #edf3f4;
  --ink: #172126;
  --muted: #647277;
  --line: #dce4e6;
  --blue: #1769aa;
  --teal: #13806d;
  --green: #0f8a4b;
  --red: #c43d36;
  --amber: #a76514;
  --shadow: 0 18px 45px rgba(23, 33, 38, 0.08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 228px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  font-size: 19px;
  font-weight: 760;
}

.mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav a.is-active {
  background: var(--surface-strong);
  color: var(--ink);
}

.main {
  padding: 22px 26px 30px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar > * {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.subtle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  min-width: 0;
}

.ticker {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

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

.ticker em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.ticker i {
  font-style: normal;
}

.breadth-card {
  min-width: 150px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.theme-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.theme-card {
  display: grid;
  gap: 7px;
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.theme-card.is-active {
  border-color: var(--blue);
  background: #f4f9fd;
}

.theme-card strong {
  font-size: 14px;
}

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

.theme-card b {
  color: var(--blue);
  font-size: 12px;
}

.research-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 18px;
  align-items: start;
}

.graph-panel {
  grid-column: auto;
  display: flex;
  flex-direction: column;
  height: 920px;
  min-width: 0;
  overflow: hidden;
}

.insight-rail {
  grid-column: auto;
  display: grid;
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 14px;
  height: 920px;
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 1100px) {
  .research-split {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .graph-panel {
    grid-column: 1 / span 2;
  }

  .insight-rail {
    grid-column: 3;
  }
}

.memo-panel,
.candidate-dock .candidate-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
}

.candidate-dock {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.candidate-dock .candidate-panel {
  height: 100%;
}

.candidate-dock .table-wrap,
.research-memo {
  min-height: 0;
  overflow: auto;
}

.candidate-dock .candidate-panel .table-wrap,
.memo-panel .research-memo {
  flex: 1;
}

.knowledge-graph {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #07090d;
}

.galaxy-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 52% 48%, rgba(28, 102, 112, 0.26), transparent 34%),
    radial-gradient(circle at 28% 70%, rgba(39, 124, 96, 0.12), transparent 25%),
    #071014;
}

.galaxy-shell.is-dragging {
  cursor: grabbing;
}

.galaxy-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.galaxy-hit-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.galaxy-hit-layer button {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.001);
  cursor: pointer;
  touch-action: none;
  pointer-events: auto;
}

.galaxy-hit-layer button:focus-visible {
  outline: 2px solid rgba(144, 239, 231, 0.9);
  outline-offset: 3px;
}

.galaxy-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.galaxy-topbar button,
.galaxy-bottlenecks button,
.galaxy-modebar button {
  pointer-events: auto;
}

.galaxy-modebar {
  position: absolute;
  top: 58px;
  left: 14px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: min(520px, calc(100% - 28px));
  padding: 6px;
  border: 1px solid rgba(105, 184, 196, 0.18);
  border-radius: 8px;
  background: rgba(5, 12, 18, 0.62);
  backdrop-filter: blur(8px);
}

.galaxy-modebar button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(119, 190, 202, 0.22);
  border-radius: 7px;
  background: rgba(6, 18, 24, 0.72);
  color: #b4cdd4;
  cursor: pointer;
  font-size: 12px;
}

.galaxy-modebar button:hover,
.galaxy-modebar button:focus-visible {
  border-color: rgba(84, 205, 195, 0.48);
  color: #e0faf6;
}

.galaxy-modebar button.is-active {
  border-color: rgba(84, 205, 195, 0.58);
  background: rgba(13, 57, 63, 0.82);
  color: #d6f7f2;
}

.galaxy-breadcrumb {
  max-width: min(760px, 78%);
}

.galaxy-breadcrumb button,
.galaxy-reset {
  min-height: 32px;
  border-color: rgba(119, 190, 202, 0.24);
  background: rgba(6, 18, 24, 0.78);
  color: #9ebdc6;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.galaxy-breadcrumb strong {
  color: #d8f4f8;
}

.galaxy-breadcrumb button.is-active {
  border-color: rgba(84, 205, 195, 0.58);
  background: rgba(13, 57, 63, 0.82);
  color: #d6f7f2;
}

.galaxy-reset {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(147, 221, 232, 0.26);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}

.galaxy-focus {
  position: absolute;
  right: 16px;
  top: 66px;
  z-index: 3;
  display: grid;
  gap: 7px;
  width: min(330px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid rgba(105, 184, 196, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(9, 26, 34, 0.9), rgba(5, 14, 20, 0.86));
  color: #d9f4f7;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.galaxy-focus.graph-card-product,
.galaxy-focus.graph-card-component {
  border-color: rgba(91, 184, 224, 0.38);
  background: linear-gradient(180deg, rgba(8, 28, 46, 0.94), rgba(5, 15, 25, 0.88));
}

.galaxy-focus.graph-card-material {
  border-color: rgba(217, 146, 45, 0.5);
  background: linear-gradient(180deg, rgba(42, 28, 10, 0.95), rgba(16, 13, 8, 0.9));
}

.galaxy-focus.graph-card-company {
  border-color: rgba(70, 198, 140, 0.38);
  background: linear-gradient(180deg, rgba(7, 33, 26, 0.94), rgba(5, 17, 15, 0.88));
}

.galaxy-focus span,
.galaxy-focus em {
  color: #a9c4ca;
  font-size: 12px;
  font-style: normal;
}

.galaxy-focus strong {
  color: #eefcff;
  font-size: 18px;
}

.galaxy-focus p {
  margin: 0;
  color: #bdd3d8;
  font-size: 12px;
  line-height: 1.55;
}

.galaxy-focus b {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(68, 205, 196, 0.13);
  color: #8ee6dc;
  font-size: 11px;
}

.galaxy-focus.graph-card-material b {
  background: rgba(217, 146, 45, 0.18);
  color: #ffd88f;
}

.galaxy-focus-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.galaxy-focus-metrics span {
  padding: 3px 7px;
  border: 1px solid rgba(144, 207, 216, 0.18);
  border-radius: 999px;
  background: rgba(144, 207, 216, 0.08);
  color: #c5dde2;
}

.galaxy-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  max-width: min(620px, calc(100% - 32px));
  padding: 8px 10px;
  border: 1px solid rgba(105, 184, 196, 0.18);
  border-radius: 8px;
  background: rgba(5, 12, 18, 0.68);
  color: #a9c3ca;
  backdrop-filter: blur(8px);
  font-size: 12px;
}

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

.galaxy-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-product {
  background: #44cdc4;
}

.legend-material {
  background: #d9922d;
}

.legend-company {
  background: #37c586;
}

.legend-active {
  background: #f7fbff;
  box-shadow: 0 0 12px rgba(111, 232, 216, 0.9);
}

.galaxy-tooltip {
  position: absolute;
  z-index: 4;
  display: none;
  max-width: 230px;
  padding: 9px 10px;
  border: 1px solid rgba(105, 184, 196, 0.34);
  border-radius: 7px;
  background: rgba(8, 22, 29, 0.96);
  color: #e2f7fa;
  pointer-events: none;
}

.galaxy-tooltip.is-visible {
  display: grid;
  gap: 4px;
}

.galaxy-tooltip strong {
  font-size: 13px;
}

.galaxy-tooltip span,
.galaxy-tooltip em {
  color: #9fb9c1;
  font-size: 11px;
  font-style: normal;
}

.galaxy-bottlenecks {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(620px, calc(100% - 32px));
  padding: 8px;
  border: 1px solid rgba(217, 146, 45, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(32, 21, 8, 0.82), rgba(14, 11, 7, 0.82));
  color: #f2cf91;
  backdrop-filter: blur(8px);
  font-size: 12px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.galaxy-bottlenecks strong {
  flex: 0 0 auto;
}

.galaxy-bottlenecks > span {
  color: #bba172;
}

.galaxy-bottlenecks button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(217, 146, 45, 0.36);
  border-radius: 7px;
  background: rgba(217, 146, 45, 0.12);
  color: #ffe0a6;
  cursor: pointer;
  text-align: left;
}

.galaxy-bottlenecks button em {
  max-width: 108px;
  overflow: hidden;
  color: #cdb98f;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.galaxy-shell.is-dragging .galaxy-focus,
.galaxy-shell.is-dragging .galaxy-bottlenecks,
.galaxy-shell.is-dragging .galaxy-modebar {
  opacity: 0.18;
  transform: translateY(4px);
}

.drill-shell {
  display: grid;
  gap: 14px;
  width: 100%;
  min-height: 100%;
  padding: 16px;
}

.graph-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-breadcrumb button,
.focus-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.graph-breadcrumb button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.graph-breadcrumb button::after {
  content: ">";
  color: #9aa8ad;
}

.graph-breadcrumb button:last-child::after {
  content: "";
}

.graph-breadcrumb button.is-active {
  border-color: rgba(23, 105, 170, 0.45);
  background: #eef6fb;
  color: var(--blue);
}

.graph-breadcrumb strong {
  color: var(--ink);
  font-size: 12px;
}

.drill-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: stretch;
}

.focus-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #c9dde7;
  border-radius: 8px;
  background: var(--surface);
}

.focus-card span,
.focus-card em,
.drill-card span,
.drill-card em,
.shared-card span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.focus-card strong {
  font-size: 22px;
}

.focus-card p {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.focus-card b,
.drill-card b,
.shared-card b {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--teal);
  font-size: 11px;
}

.focus-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.focus-actions button:hover,
.graph-breadcrumb button:hover,
.drill-card:hover,
.shared-card button:hover {
  border-color: var(--blue);
}

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

.drill-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.drill-column header,
.shared-upstream > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drill-column header strong,
.shared-upstream > header strong {
  font-size: 14px;
}

.drill-column header span,
.shared-upstream > header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.drill-list,
.shared-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.drill-card {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.drill-card strong {
  font-size: 14px;
}

.graph-card-product,
.graph-card-component {
  border-color: rgba(23, 105, 170, 0.34);
}

.graph-card-material {
  border-color: rgba(167, 101, 20, 0.36);
  background: #fffaf2;
}

.graph-card-company {
  border-color: rgba(19, 128, 109, 0.28);
}

.shared-upstream {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfcda7;
  border-radius: 8px;
  background: #fffaf2;
}

.shared-upstream > header b {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 12px;
}

.shared-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.shared-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e8d8b8;
  border-radius: 7px;
  background: var(--surface);
}

.shared-card button {
  display: grid;
  gap: 5px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.shared-card strong {
  font-size: 15px;
}

.shared-card p {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-note {
  color: var(--muted);
  font-size: 12px;
}

.evidence-status-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.evidence-status-head {
  align-items: flex-start;
}

.evidence-status-head p {
  margin: 5px 0 0;
}

.evidence-status-head > strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 12px;
}

.evidence-status-body {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.evidence-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.evidence-metrics div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: baseline;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.evidence-metrics span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.evidence-metrics strong {
  color: var(--ink);
  font-size: 22px;
}

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

.evidence-lanes {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.05fr 0.9fr;
  gap: 12px;
  align-items: start;
}

.evidence-lanes article {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.evidence-lanes h3 {
  margin: 0;
  font-size: 14px;
}

.evidence-list,
.batch-list {
  display: grid;
  gap: 8px;
}

.evidence-item {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.evidence-item.is-confirmed {
  border-color: #c7ded8;
  background: #f3faf8;
}

.evidence-item.is-pending {
  border-color: #e4d3b2;
  background: #fffaf2;
}

.evidence-item.is-imported {
  border-color: #cfe1ea;
  background: #f7fbfd;
}

.evidence-item strong,
.batch-row strong {
  font-size: 13px;
}

.evidence-item p,
.batch-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.evidence-item span,
.batch-row span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.evidence-item a {
  justify-self: start;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.evidence-item a:hover,
.evidence-item a:focus-visible {
  text-decoration: underline;
}

.batch-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.batch-row b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 11px;
}

.batch-row b.is-review {
  background: #eef7f5;
  color: var(--teal);
}

.batch-row b.is-muted {
  background: #f0f3f4;
  color: var(--muted);
}

.batch-row span {
  grid-column: 2;
  color: var(--muted);
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-tools strong {
  color: var(--blue);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.actions button.is-active {
  border-color: var(--blue);
  color: var(--blue);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
}

.pager button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.research-memo {
  display: grid;
  gap: 13px;
  padding: 15px 16px 17px;
}

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

.node-brief {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #cfe1ea;
  border-radius: 7px;
  background: #f4f9fd;
}

.node-brief header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

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

.node-brief strong {
  color: var(--blue);
  font-size: 18px;
}

.node-brief p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.node-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.node-path span {
  padding: 4px 7px;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}

.memo-verdict div {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid #cfe1ea;
  border-radius: 7px;
  background: #f4f9fd;
}

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

.memo-verdict strong {
  color: var(--blue);
  font-size: 18px;
}

.memo-section {
  display: grid;
  gap: 6px;
}

.memo-section h3 {
  margin: 0;
  font-size: 13px;
}

.memo-section p,
.memo-section li,
.memo-action {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-wrap: pretty;
}

.memo-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.memo-facts div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.memo-facts span,
.memo-facts em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.memo-facts strong {
  color: var(--ink);
  font-size: 15px;
}

.evidence-chain {
  display: grid;
  gap: 8px;
}

.evidence-chain div {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.evidence-chain header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.evidence-chain strong {
  font-size: 13px;
}

.evidence-chain header span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--teal);
  font-size: 11px;
  font-weight: 760;
}

.evidence-chain p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.evidence-chain em {
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
}

.company-evidence {
  padding: 10px;
  border: 1px solid #cfe1ea;
  border-radius: 7px;
  background: #f7fbfd;
}

.company-evidence-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.company-evidence-head strong {
  font-size: 15px;
}

.company-evidence-head span {
  color: var(--muted);
  font-size: 12px;
}

.company-evidence-head b {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--blue);
  font-size: 13px;
}

.linked-companies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
}

.linked-companies button {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.linked-companies button:hover {
  border-color: var(--blue);
}

.linked-companies strong {
  font-size: 13px;
}

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

.memo-section ol,
.memo-section ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.memo-action {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 650;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.candidate-dock th,
.candidate-dock td {
  padding: 9px;
  font-size: 12px;
}

.compact-cell {
  display: grid;
  gap: 3px;
}

.compact-cell strong {
  font-size: 12px;
}

.compact-cell span {
  font-size: 12px;
}

.candidate-dock .panel-header {
  align-items: flex-start;
}

.candidate-dock .panel-tools {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

tr.is-active {
  background: #eef7f5;
}

.stock-button {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

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

.level {
  color: var(--blue);
  font-weight: 760;
}

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

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

.side-stack,
.lower-grid {
  display: grid;
  gap: 18px;
}

.side-stack {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.factor-panel {
  padding: 16px;
}

.factor-panel header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
}

.factor-panel header strong {
  color: var(--blue);
  font-size: 24px;
}

.thesis-block {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.thesis-block b {
  color: var(--ink);
  font-size: 14px;
}

.thesis-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.thesis-block span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.factor-row {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  gap: 10px;
  align-items: center;
  min-height: 33px;
  color: var(--muted);
  font-size: 13px;
}

.industry-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.exposure-panel {
  overflow: hidden;
}

.industry-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 90px 46px;
  gap: 10px;
  align-items: center;
}

.industry-row div:first-child {
  display: grid;
  gap: 3px;
}

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

.industry-row span,
.industry-row b {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.metric-grid div {
  display: grid;
  gap: 6px;
  min-height: 64px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

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

.metric-grid strong {
  font-size: 15px;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: #e8eef0;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.risk-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 10px 18px 18px 34px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 650;
}

.risk-subsection {
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.subsection-header {
  padding: 14px 18px 0;
}

.subsection-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

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

.summary div {
  display: grid;
  gap: 8px;
  padding: 17px;
  background: var(--surface);
}

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

.summary strong {
  font-size: 20px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.strategy-card {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.strategy-card h3 {
  margin: 0 0 9px;
  font-size: 15px;
}

.strategy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .app,
  .grid,
  .research-split,
  .drill-focus,
  .drill-grid,
  .side-stack,
  .summary,
  .evidence-metrics,
  .evidence-lanes,
  .theme-panel,
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .actions {
    flex-wrap: wrap;
  }

  .main {
    padding: 18px 14px;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .candidate-dock table {
    table-layout: fixed;
    width: 100%;
  }

  .candidate-dock th,
  .candidate-dock td {
    white-space: normal;
  }

  .candidate-dock th:nth-child(2),
  .candidate-dock td:nth-child(2),
  .candidate-dock th:nth-child(4),
  .candidate-dock td:nth-child(4),
  .candidate-dock th:nth-child(5),
  .candidate-dock td:nth-child(5) {
    display: none;
  }

  .graph-panel,
  .insight-rail {
    height: auto;
  }

  .graph-panel {
    height: 680px;
  }

  .knowledge-graph,
  .research-memo {
    max-height: none;
  }

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

  .galaxy-breadcrumb {
    max-width: 100%;
  }

  .galaxy-reset {
    justify-self: start;
  }

  .galaxy-focus {
    right: 12px;
    left: 12px;
    top: 106px;
    bottom: auto;
    width: auto;
  }

  .galaxy-bottlenecks {
    right: 12px;
    left: 12px;
    bottom: 46px;
    max-width: none;
    overflow: hidden;
  }

  .galaxy-legend {
    right: 12px;
    left: 12px;
    bottom: 10px;
    max-width: none;
  }

  .drill-shell,
  .drill-column,
  .drill-list,
  .drill-card,
  .shared-upstream,
  .shared-card {
    width: 100%;
    min-width: 0;
  }

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