:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f1f4f7;
  --surface-strong: #151922;
  --ink: #14171f;
  --muted: #626b79;
  --muted-2: #8a94a3;
  --line: #d8dee7;
  --line-strong: #b9c2cf;
  --green: #067647;
  --green-bg: #e7f6ee;
  --blue: #175cd3;
  --blue-bg: #e9f1ff;
  --amber: #b54708;
  --amber-bg: #fff3df;
  --red: #b42318;
  --red-bg: #fde8e5;
  --violet: #6941c6;
  --violet-bg: #f0eaff;
  --shadow: 0 10px 28px rgba(20, 23, 31, 0.07);
  --shadow-hover: 0 18px 42px rgba(20, 23, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 222, 231, 0.92);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.34;
  letter-spacing: 0;
}

h3 {
  letter-spacing: 0;
}

main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 40px) 34px;
}

.top-actions,
.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button,
.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button {
  padding: 8px 13px;
  border: 1px solid transparent;
}

.button::after,
.card-action::after {
  content: ">";
  color: currentColor;
  opacity: 0.58;
}

.button.primary {
  background: var(--surface-strong);
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 23, 31, 0.14);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button.ghost {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.button.inverse {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.button:hover,
.card-action:hover,
.detail-nav a:hover,
.source-list a:hover,
.tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button:focus-visible,
.card-action:focus-visible,
.tab:focus-visible,
.detail-nav a:focus-visible,
.source-list a:focus-visible {
  outline: 3px solid rgba(23, 92, 211, 0.22);
  outline-offset: 2px;
}

.card-action {
  min-height: 34px;
  margin-top: auto;
  padding: 7px 0;
  color: var(--blue);
}

.trust-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trust-ribbon article {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--surface);
}

.trust-ribbon p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trust-ribbon strong {
  grid-column: 2;
  font-size: 15px;
  line-height: 1.35;
}

.signal-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.signal-dot.confirmed {
  background: var(--green);
}

.signal-dot.progress {
  background: var(--blue);
}

.signal-dot.inferred {
  background: var(--amber);
}

.signal-dot.unknown {
  background: var(--red);
}

.snapshot {
  display: grid;
  grid-template-columns: minmax(310px, 1.7fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.approval-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.6fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.approval-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.latest-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.approval-item {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.approval-item.hot {
  border-color: rgba(23, 92, 211, 0.28);
  background: var(--blue-bg);
}

.approval-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.approval-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-item strong {
  font-size: 18px;
}

.approval-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.metric-panel,
.work-panel,
.product-card,
.research-card,
.network-card,
.risk-card,
.ladder-item,
.detail-hero,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-panel,
.product-card,
.research-card,
.network-card,
.risk-card,
.ladder-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.metric-panel {
  min-height: 158px;
  padding: 18px;
}

.metric-panel.thesis {
  position: relative;
  overflow: hidden;
  background: var(--surface-strong);
  color: #f8fafc;
}

.metric-panel.thesis::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #66e0c2, #8bb8ff, #f7b955);
}

.metric-panel.thesis > * {
  position: relative;
  z-index: 1;
}

.metric-panel.thesis .panel-label,
.metric-panel.thesis p {
  color: #cbd5e1;
}

.metric-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1;
}

.metric-panel span,
.metric-panel p {
  color: var(--muted);
  line-height: 1.56;
}

.metric-panel .button,
.metric-panel .card-action {
  margin-top: auto;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tab {
  min-width: max-content;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  background: var(--surface-strong);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.work-panel {
  padding: 20px;
}

.panel-heading,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.status-pill,
.chip,
.grade,
.source-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

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

.inferred,
.medium {
  background: var(--amber-bg);
  color: var(--amber);
}

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

.timeline {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.timeline-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.timeline-row:first-child {
  border-top: 0;
}

.timeline-row > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 4px var(--surface-soft);
}

.timeline-row.done > span {
  background: var(--green);
}

.timeline-row.active > span {
  background: var(--blue);
}

.timeline-row strong,
.scenario strong,
.plain-list strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-row p,
.risk-card p,
.ladder-item p,
.product-card p,
.research-card p,
.network-card p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.56;
}

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

.scenario {
  display: grid;
  grid-template-columns: 82px 1fr 112px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.scenario:last-child {
  border-bottom: 0;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--violet));
}

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

.evidence-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 170px minmax(220px, 2fr);
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border-top: 1px solid var(--line);
}

.evidence-row.head {
  border-top: 0;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-grid,
.research-grid,
.network-grid,
.risk-grid,
.ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-card,
.research-card,
.network-card,
.risk-card,
.ladder-item {
  min-height: 224px;
  padding: 16px;
}

.product-card:hover,
.research-card:hover,
.network-card:hover,
.risk-card:hover,
.ladder-item:hover,
.metric-panel:hover,
.work-panel:hover {
  box-shadow: var(--shadow-hover);
}

.product-card h3,
.research-card h3,
.network-card h3,
.risk-card h3,
.ladder-item h3 {
  margin: 10px 0;
  font-size: 17px;
  line-height: 1.34;
}

.product-meta {
  display: grid;
  width: 100%;
  gap: 6px;
  margin: auto 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.quarter-chart {
  display: grid;
  gap: 10px;
}

.quarter {
  display: grid;
  grid-template-columns: 78px 1fr 66px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.quarter:last-child {
  border-bottom: 0;
}

.quarter .bar i {
  background: var(--blue);
}

.plain-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.plain-list li:last-child {
  border-bottom: 0;
}

.plain-list span {
  color: var(--muted);
  text-align: right;
}

.ladder-item {
  border-left: 5px solid var(--line);
}

.ladder-item.grade-a {
  border-left-color: var(--red);
}

.ladder-item.grade-b {
  border-left-color: var(--blue);
}

.ladder-item.grade-c {
  border-left-color: var(--violet);
}

.ladder-item.grade-d {
  border-left-color: var(--amber);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 4vw, 48px) 26px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

footer a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.detail-main {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.detail-nav {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-nav a {
  display: block;
  min-height: 40px;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.detail-nav a.active {
  background: var(--surface-strong);
  color: #fff;
}

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

.detail-hero,
.detail-section {
  padding: 20px;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.source-count {
  background: var(--surface-soft);
  color: var(--muted);
}

.detail-hero p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.detail-section h2 {
  margin-bottom: 12px;
}

.detail-section ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

  .trust-ribbon,
  .approval-list,
  .product-grid,
  .research-grid,
  .network-grid,
  .risk-grid,
  .ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .board-grid,
  .approval-panel,
  .detail-main {
    grid-template-columns: 1fr;
  }

  .evidence-row {
    grid-template-columns: 1fr;
  }

  .detail-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 27px;
  }

  h2 {
    font-size: 19px;
  }

  .snapshot,
  .trust-ribbon,
  .approval-list,
  .product-grid,
  .research-grid,
  .network-grid,
  .risk-grid,
  .ladder {
    grid-template-columns: 1fr;
  }

  .metric-panel {
    min-height: auto;
  }

  .scenario,
  .quarter {
    grid-template-columns: 1fr;
  }

  .plain-list li,
  .panel-heading,
  .section-head {
    display: block;
  }

  .plain-list span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .panel-actions {
    justify-items: start;
    margin-top: 12px;
  }

  .detail-nav {
    grid-template-columns: 1fr 1fr;
  }

  footer {
    flex-direction: column;
  }
}
