:root {
  --canvas: #081420;
  --surface-soft: #0d1f30;
  --surface-card: #11283d;
  --surface-elevated: #173654;
  --ink: #ffffff;
  --body: #b6c8dc;
  --body-strong: #ebf3fb;
  --muted: #7d98b3;
  --hairline: #274663;
  --hairline-strong: #173654;
  --m-blue-light: #0066b1;
  --m-blue-dark: #1c69d4;
  --m-red: #e22718;
  --warning: #f4b400;
  --success: #0fa336;
  --font-display: "Pretendard", "Segoe UI", sans-serif;
  --font-body: "Pretendard", "Segoe UI", sans-serif;
  --section-gap: 28px;
  --hero-display-size: clamp(34px, 5vw, 56px);
  --radius-none: 0px;
  --shadow-none: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
}

button,
input {
  font: inherit;
}

a {
  color: var(--ink);
}

.app-shell {
  width: min(1460px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.hero-band,
.surface-panel,
.section-tabs,
.metric-row {
  border: 1px solid var(--hairline);
  background: var(--canvas);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  align-items: stretch;
  overflow: hidden;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(6, 24, 39, 0.96), rgba(10, 33, 52, 0.88)),
    var(--canvas);
}

.hero-band__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 28px 30px;
}

.hero-band__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-left: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(8, 20, 32, 0.42);
}

.hero-band__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.hero-band h1,
.stack-card__header h2,
.detail-head h2,
.surface-panel h2,
.detail-block h3,
.evidence-grid h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-band h1 {
  font-size: var(--hero-display-size);
  line-height: 1;
  margin: 0;
}

.hero-band__lede {
  max-width: 680px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.hero-band__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.overline {
  margin: 0;
  color: var(--body);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.meta-chip,
.switch-pill,
.action-button,
.section-tab,
.metric-card,
.result-card,
.detail-metric,
.source-link {
  border-radius: var(--radius-none);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  color: var(--body);
  background: rgba(255, 255, 255, 0.02);
}

.locale-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-visual {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--hairline);
  border: 1px solid var(--hairline);
  background:
    radial-gradient(circle at 22% 28%, rgba(28, 105, 212, 0.18), transparent 20%),
    radial-gradient(circle at 78% 38%, rgba(141, 211, 255, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 100%),
    var(--surface-soft);
  overflow: hidden;
}

.hero-visual__glow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.3));
}

.hero-visual__ring {
  position: absolute;
  border: 1px solid rgba(132, 197, 255, 0.22);
  border-radius: 999px;
}

.hero-visual__ring--outer {
  inset: 26px 54px 34px;
}

.hero-visual__ring--inner {
  inset: 56px 104px 64px;
  border-color: rgba(28, 105, 212, 0.3);
}

.hero-visual__deal-card {
  position: absolute;
  z-index: 1;
  min-width: 118px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  background: rgba(9, 25, 39, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hero-visual__deal-card span {
  display: block;
  color: var(--body);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hero-visual__deal-card strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}

.hero-visual__deal-card--left {
  left: 22px;
  top: 30px;
}

.hero-visual__deal-card--right {
  right: 22px;
  top: 56px;
}

.hero-visual__connector {
  position: absolute;
  z-index: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(28, 105, 212, 0), rgba(132, 197, 255, 0.9), rgba(28, 105, 212, 0));
}

.hero-visual__connector--one {
  left: 96px;
  top: 88px;
  width: 176px;
  transform: rotate(12deg);
}

.hero-visual__connector--two {
  left: 132px;
  top: 126px;
  width: 162px;
  transform: rotate(-18deg);
}

.hero-visual__node {
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #dff0ff;
  box-shadow: 0 0 0 6px rgba(28, 105, 212, 0.16);
}

.hero-visual__node--a {
  left: 42%;
  top: 28%;
}

.hero-visual__node--b {
  left: 58%;
  top: 44%;
}

.hero-visual__node--c {
  left: 36%;
  top: 60%;
}

.hero-visual__node--d {
  left: 68%;
  top: 70%;
}

.hero-visual__ticker {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-visual__ticker span {
  padding: 6px 10px;
  border: 1px solid rgba(132, 197, 255, 0.24);
  background: rgba(8, 20, 32, 0.78);
  color: var(--body);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.switch-pill,
.action-button,
.section-tab {
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.switch-pill,
.action-button {
  min-height: 44px;
  padding: 0 18px;
}

.switch-pill.is-active,
.section-tab.is-active {
  border-color: var(--m-blue-dark);
  background: rgba(28, 105, 212, 0.18);
  color: var(--body-strong);
}

.action-button:hover,
.switch-pill:hover,
.section-tab:hover {
  border-color: var(--m-blue-light);
  background: rgba(0, 102, 177, 0.12);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
}

.metric-card {
  padding: 16px 18px;
  border-right: 1px solid var(--hairline);
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  display: block;
  color: var(--body);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}

.section-tabs {
  display: inline-flex;
  gap: 0;
  margin-top: 14px;
}

.section-tab {
  min-height: 50px;
  padding: 0 22px;
  border-right: 0;
}

.section-tab:last-child {
  border-right: 1px solid var(--hairline);
}

.workspace {
  margin-top: 16px;
}

.tab-panel {
  display: none;
}

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

.control-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.search-control {
  display: grid;
  gap: 8px;
  flex: 1;
}

.search-control span {
  color: var(--body);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.search-control input {
  min-height: 52px;
  padding: 12px 16px;
  background: rgba(10, 28, 45, 0.92);
  color: var(--ink);
  border: 1px solid var(--hairline);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.search-control input:focus {
  border-color: var(--m-blue-dark);
  box-shadow: inset 0 0 0 1px rgba(28, 105, 212, 0.4);
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr));
  min-width: 480px;
  gap: 0;
  border: 1px solid var(--hairline);
}

.compact-stats--small {
  min-width: 240px;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.compact-stat {
  padding: 12px 14px;
  border-right: 1px solid var(--hairline);
}

.compact-stat:last-child {
  border-right: 0;
}

.compact-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.compact-stat span {
  color: var(--body);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 16px;
  min-height: 0;
}

.split-layout--graph {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.surface-panel {
  padding: 16px;
  min-height: 0;
  height: min(68vh, 760px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%),
    var(--canvas);
}

.surface-panel--stack,
.surface-panel--detail {
  display: grid;
  align-content: start;
  overflow: auto;
}

.stack-card {
  border: 1px solid var(--hairline);
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 100%), var(--surface-card);
}

.stack-card:last-child {
  margin-bottom: 0;
}

.stack-card__header {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.stack-card__header p,
.detail-path,
.result-card small,
.empty-box,
.markdown,
.trend-band,
.source-link span {
  color: var(--body);
}

.card-stack {
  display: grid;
  gap: 10px;
}

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

.result-card {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
  color: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.result-card:hover,
.result-card.is-active {
  border-color: var(--m-blue-dark);
  background: rgba(16, 49, 77, 0.96);
}

.result-card:active {
  transform: translateY(1px);
}

.result-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.result-card p {
  margin: 10px 0 0;
  color: var(--body);
  line-height: 1.55;
}

.empty-box {
  border: 1px solid var(--hairline);
  padding: 16px;
  background: var(--surface-soft);
  line-height: 1.55;
}

.graph-empty {
  min-height: 180px;
}

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

.detail-head h2 {
  font-size: 32px;
  line-height: 1.15;
  margin: 6px 0;
}

.detail-metrics {
  display: grid;
  gap: 10px;
  min-width: 240px;
}

.detail-metric {
  padding: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
}

.detail-metric strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.detail-block {
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
  margin-top: 14px;
}

.detail-block:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 14px;
}

.detail-block h3,
.evidence-grid h3 {
  font-size: 20px;
  margin: 0 0 12px;
}

.markdown {
  line-height: 1.62;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  margin: 18px 0 10px;
}

.markdown p,
.markdown li {
  line-height: 1.6;
}

.markdown ul {
  padding-left: 18px;
}

.markdown a {
  text-decoration: none;
  border-bottom: 1px solid var(--m-blue-dark);
}

.source-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
  text-decoration: none;
}

.source-link strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.graph-frame {
  position: relative;
  height: min(62vh, 640px);
  min-height: 460px;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(28, 105, 212, 0.24), transparent 24%),
    var(--surface-soft);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

#graphCanvas {
  width: 100%;
  height: 100%;
}

.graph-link {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-linecap: square;
}

.graph-link.is-active {
  stroke: var(--m-blue-dark);
}

.graph-node {
  cursor: pointer;
}

.graph-node circle {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.5;
}

.graph-node.is-active circle {
  stroke: var(--m-blue-light);
  stroke-width: 2.2;
}

.graph-node text {
  fill: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-anchor: middle;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.surface-panel--wide {
  grid-column: 1 / -1;
}

.tab-panel[data-panel="operations"] .surface-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: min(34vh, 340px);
  overflow: hidden;
}

.tab-panel[data-panel="operations"] .surface-panel--wide {
  height: min(40vh, 420px);
}

.tab-panel[data-panel="operations"] .stack-card__header {
  margin-bottom: 12px;
}

.tab-panel[data-panel="operations"] .card-stack,
.tab-panel[data-panel="operations"] .trend-band {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.trend-band {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 180px;
  padding-bottom: 24px;
}

.trend-bar {
  position: relative;
  flex: 1;
  min-width: 30px;
  background: linear-gradient(180deg, var(--m-blue-light), var(--m-blue-dark));
}

.trend-bar--accent {
  background: linear-gradient(180deg, var(--m-blue-dark), var(--m-red));
}

.trend-bar span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .hero-band,
  .split-layout,
  .split-layout--graph,
  .ops-grid,
  .evidence-grid,
  .control-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-band__content {
    padding-bottom: 18px;
  }

  .hero-band__side {
    border-left: 0;
    border-top: 1px solid var(--hairline);
    padding-top: 14px;
  }

  .hero-band__actions {
    justify-content: flex-start;
  }

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

  .compact-stats,
  .compact-stats--small {
    min-width: 0;
  }

  .surface-panel,
  .split-layout,
  .surface-panel--wide {
    min-height: auto;
    height: auto;
  }

  .tab-panel[data-panel="operations"] .surface-panel,
  .tab-panel[data-panel="operations"] .surface-panel--wide {
    height: auto;
  }

  .graph-frame {
    height: 560px;
  }
}

@media (max-width: 760px) {
  .hero-visual {
    min-height: 250px;
  }

  .hero-visual__deal-card--left {
    left: 16px;
    top: 18px;
  }

  .hero-visual__deal-card--right {
    right: 16px;
    top: 34px;
  }

  .hero-visual__connector--one,
  .hero-visual__connector--two {
    width: 124px;
  }
}
