:root {
  --ink: #111513;
  --muted: #5b6460;
  --line: #dbe2dd;
  --panel: #ffffff;
  --soft: #f4f7f5;
  --green: #1f7a52;
  --mint: #dff4e8;
  --blue: #2457c5;
  --blue-soft: #e6edff;
  --amber: #b36b00;
  --amber-soft: #fff1cc;
  --red: #c73535;
  --red-soft: #ffe1df;
  --violet: #5c4bb5;
  --shadow: 0 18px 50px rgba(19, 34, 28, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 44px;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  width: 86px;
  height: 44px;
  object-fit: contain;
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-size: 16px;
}

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

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #eef3f0;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.topnav a {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
}

.topnav a:hover {
  color: var(--ink);
  background: #fff;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.dashboard-band {
  padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 44px) 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
}

.headline-panel,
.status-board,
.detail-panel,
.signal-panel,
.method-section,
.sources-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.headline-panel {
  padding: clamp(26px, 5vw, 54px);
  min-height: 330px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 740px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
}

.lede {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: start;
  margin-top: 26px;
  padding: 16px;
  background: #eef8f2;
  border: 1px solid #cbe9d7;
  border-radius: 8px;
}

.notice strong {
  color: var(--green);
}

.notice span {
  color: #33423a;
  line-height: 1.55;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.status-board article {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  padding: 22px;
  background: #fff;
}

.status-board span,
.status-board small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-board strong {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

#kpiUpdated {
  font-size: clamp(24px, 3vw, 38px);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto;
  align-items: end;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 44px);
}

.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-box input {
  height: 44px;
  width: 100%;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 82, 0.14);
}

.segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e7eeea;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment-button {
  min-width: 64px;
  height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.segment-button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(17, 21, 19, 0.08);
}

.monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) 32px;
  align-items: start;
}

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

.product-card {
  display: grid;
  gap: 14px;
  min-height: 214px;
  padding: 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(19, 34, 28, 0.06);
  cursor: pointer;
}

.product-card:hover,
.product-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 16px 40px rgba(31, 122, 82, 0.15);
}

.card-topline,
.card-footer,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-topline strong {
  font-size: 20px;
}

.product-unit,
.card-footer {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card-metric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.card-metric span {
  font-size: 32px;
  font-weight: 900;
}

.card-metric small {
  color: var(--muted);
  font-weight: 800;
}

.price-stack {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-stack span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.price-stack em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.price-stack strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.price-cham strong {
  color: var(--ink);
}

.price-online strong {
  color: var(--blue);
}

.price-online-missing {
  color: var(--muted);
  font-style: italic;
}

.gap-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.gap-pill.gap-up {
  color: var(--amber);
  background: var(--amber-soft);
}

.gap-pill.gap-down {
  color: var(--blue);
  background: var(--blue-soft);
}

.gap-pill.gap-flat {
  color: var(--green);
  background: var(--mint);
}

.gap-gap-up { color: var(--amber); }
.gap-gap-down { color: var(--blue); }
.gap-gap-flat { color: var(--green); }

#kpiGap.gap-gap-up { color: var(--amber); }
#kpiGap.gap-gap-down { color: var(--blue); }
#kpiGap.gap-gap-flat { color: var(--green); }

.muted {
  color: var(--muted) !important;
}

.card-footer span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-chart {
  display: block;
  height: 54px;
  color: var(--green);
}

.mini-chart svg {
  width: 100%;
  height: 54px;
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.risk-stable {
  color: var(--green);
  background: var(--mint);
}

.risk-watch {
  color: var(--amber);
  background: var(--amber-soft);
}

.risk-alert {
  color: var(--red);
  background: var(--red-soft);
}

.risk-severe {
  color: #fff;
  background: var(--red);
}

.detail-panel {
  position: sticky;
  top: 88px;
  padding: 22px;
}

.detail-head {
  align-items: center;
}

.chart {
  margin-top: 20px;
  padding: 10px;
  color: var(--green);
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart svg {
  width: 100%;
  display: block;
}

.chart-grid line {
  stroke: #dce5df;
  stroke-width: 1;
}

.chart circle {
  fill: currentColor;
}

.chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  background: #eef3f0;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chart-toggle-btn {
  padding: 6px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chart-toggle-btn.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 10px rgba(17, 21, 19, 0.08);
}

.chart-toggle-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 10px;
}

.detail-metrics.secondary {
  margin-top: 0;
}

.detail-metrics div {
  padding: 14px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-metrics dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-metrics dd {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.detail-copy {
  margin: 0;
  color: #36423d;
  line-height: 1.7;
}

.online-samples {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.online-samples .sample-head {
  margin: 0 0 4px;
  color: var(--blue);
}

.sample-chip {
  display: grid;
  grid-template-columns: 80px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.sample-chip:hover {
  border-color: var(--blue);
}

.sample-mall {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.sample-price {
  font-size: 13px;
  font-weight: 800;
}

.sample-title {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sample-error {
  color: var(--red);
}

.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.source-chip-row span {
  padding: 7px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.split-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) 32px;
}

.signal-panel {
  padding: 24px;
}

.signal-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.signal-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--violet);
  border-radius: 8px;
  font-weight: 900;
}

.signal-item strong {
  display: block;
  margin-bottom: 4px;
}

.signal-item small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.signal-item strong em {
  margin-left: 6px;
  font-size: 11px;
  vertical-align: middle;
}

.fine-print code {
  padding: 1px 5px;
  background: #eef3f0;
  border-radius: 4px;
  font-size: 12px;
}

.risk-scale {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.risk-scale div {
  display: grid;
  grid-template-columns: 16px 72px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.risk-scale div:last-child {
  border-bottom: 0;
}

.risk-scale small {
  color: var(--muted);
  line-height: 1.45;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.stable { background: var(--green); }
.dot.watch { background: var(--amber); }
.dot.alert { background: #ff6f61; }
.dot.severe { background: var(--red); }

.method-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: clamp(22px, 4vw, 34px);
}

.method-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.method-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.method-list li {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.method-list span {
  color: var(--muted);
  line-height: 1.55;
}

.flow-figure {
  display: grid;
  align-content: center;
  gap: 12px;
  margin: 0;
}

.flow-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow-figure figcaption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sources-section {
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: clamp(22px, 4vw, 34px);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.source-grid a,
.source-grid span {
  min-height: 82px;
  padding: 16px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  text-decoration: none;
}

.source-grid a:hover {
  border-color: var(--green);
}

.fine-print {
  max-width: 980px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px clamp(18px, 4vw, 44px) 42px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.footer img {
  width: 90px;
  height: 45px;
  object-fit: contain;
}

.footer a {
  color: var(--green);
  text-decoration: none;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .monitor-layout,
  .split-section,
  .method-section {
    grid-template-columns: 1fr;
  }

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

  .detail-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr 44px;
  }

  .topnav {
    display: none;
  }

  .brand-logo {
    width: 72px;
  }

  .brand-text span {
    display: none;
  }

  .control-strip {
    grid-template-columns: 1fr;
  }

  .segment {
    overflow-x: auto;
  }

  .product-grid,
  .status-board,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .headline-panel {
    min-height: 0;
  }

  h1 {
    font-size: 42px;
  }

  .notice,
  .method-list li,
  .risk-scale div {
    grid-template-columns: 1fr;
  }

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

  .signal-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .signal-item .risk-pill {
    grid-column: 2;
    justify-self: start;
  }
}
