:root {
  --bg: #f4efe6;
  --bg-alt: #efe6d6;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf1;
  --line: rgba(60, 50, 36, 0.12);
  --text: #1f1a14;
  --muted: #65594b;
  --deep-green: #17352d;
  --deep-green-soft: #24493e;
  --bronze: #8f633b;
  --shadow: 0 18px 40px rgba(73, 54, 28, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(143, 99, 59, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(23, 53, 45, 0.15), transparent 26%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 46%, #ece3d2 100%);
}

.page-shell {
  padding: 14px 16px 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(60, 50, 36, 0.12);
}

.eyebrow {
  margin: 0;
  color: var(--deep-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: uppercase;
}

.hero-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.panel,
.detail-empty {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(60, 50, 36, 0.08);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.56);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stat-chip strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.86fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.brief-panel {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 20px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 251, 244, 0.96), rgba(247, 240, 228, 0.96)),
    rgba(255, 252, 246, 0.88);
}

.brief-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.brief-copy {
  display: grid;
  gap: 8px;
  max-width: 780px;
}

.brief-kicker {
  margin: 0;
  color: var(--bronze);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brief-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.28;
}

.brief-closing {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.brief-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brief-context,
.brief-themes {
  display: grid;
  gap: 12px;
}

.brief-context {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.brief-context-card,
.brief-theme-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(34, 28, 20, 0.08);
  background: rgba(255, 251, 246, 0.9);
}

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

.brief-themes {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.brief-theme-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.brief-theme-confidence {
  margin: 0;
  color: var(--deep-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-theme-meta {
  color: var(--bronze);
  font-size: 12px;
  font-weight: 600;
}

.map-panel,
.summary-panel {
  min-height: 0;
}

.detail-empty,
.detail-view {
  border-radius: 24px;
}

.map-panel {
  padding: 0;
}

.summary-panel {
  display: flex;
  align-items: stretch;
  padding: 18px;
  border-radius: 24px;
  max-height: min(62vh, 760px);
}

.map-frame {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.map-control-button {
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(34, 28, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(73, 54, 28, 0.08);
}

.map-control-button--reset {
  min-width: 60px;
  font-size: 12px;
}

#world-map {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 940 / 477;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#world-map.is-dragging {
  cursor: grabbing;
}

.map-ocean {
  fill: #f5efe5;
}

.map-base {
  opacity: 0.7;
}

.marker {
  cursor: pointer;
  outline: none;
}

.marker:focus-visible .marker-dot {
  stroke: #c55f32;
  stroke-width: 3;
}

.marker-glow {
  fill: rgba(143, 99, 59, 0.15);
}

.marker-dot {
  fill: var(--deep-green);
  stroke: rgba(255, 250, 241, 0.95);
  stroke-width: 2;
}

.marker.active .marker-dot {
  fill: #c55f32;
}

.marker.active .marker-glow {
  fill: rgba(197, 95, 50, 0.18);
}

.marker.muted {
  opacity: 0.58;
}

.marker.muted .marker-glow {
  fill: rgba(101, 89, 75, 0.08);
}

.marker.muted .marker-dot {
  fill: rgba(101, 89, 75, 0.45);
}

.marker.muted .marker-label {
  fill: rgba(31, 26, 20, 0.72);
}

.marker-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.detail-stock,
.panel h3 {
  margin: 0;
}

.card-thesis,
.detail-summary,
.panel p,
dd,
.topic-subsection p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.detail-view {
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 2px 10px 2px 2px;
  max-height: min(62vh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.detail-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(62vh, 760px);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.detail-header {
  display: grid;
  gap: 8px;
}

.detail-stock {
  color: var(--bronze);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-updated-at {
  color: var(--muted);
  font-size: 12px;
}

.detail-header h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.02rem, 1.25vw, 1.22rem);
  line-height: 1.38;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.summary-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.9);
}

.panel {
  padding: 18px;
  border-radius: 22px;
}

.panel h3 {
  font-size: 15px;
  font-weight: 700;
}

.specialist-grid,
.topic-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-sections {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.specialist-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.9);
  border: 1px solid rgba(34, 28, 20, 0.08);
}

.specialist-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.45;
}

.specialist-meta {
  margin-bottom: 8px;
  color: var(--bronze);
  font-size: 12px;
  font-weight: 600;
}

.topic-subsection {
  margin-top: 12px;
}

.topic-subsection strong {
  display: block;
  margin-bottom: 4px;
  color: var(--deep-green-soft);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

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

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

  .summary-panel,
  .detail-view,
  .detail-empty {
    max-height: none;
  }

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

@media (max-width: 720px) {
  .page-shell {
    padding: 10px 12px 16px;
  }

  .brief-panel,
  .summary-panel,
  .map-panel,
  .panel {
    border-radius: 20px;
  }

  .brief-context,
  .brief-themes,
  .hero-meta,
  .specialist-grid,
  .topic-stack {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
