/* 아스콘.com 데이터 앱 — 디자인 시스템 v2 (2026-09-02)
   원칙: 숫자마다 기준일·표본·창을 붙인다. 등급 A(정본)/B(참고)를 색이 아니라 라벨로 구분한다.
   팔레트는 아스콘.com 본사이트(크림 바탕·짙은 청록 잉크·번트 오렌지)와 같은 계열. */

:root {
  color-scheme: light;
  --bg: #f4eee3;
  --bg-2: #ede5d5;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --ink: #163438;
  --ink-2: #3f5250;
  --muted: #7a8884;
  --line: #e3d9c3;
  --line-2: #d2c6ab;
  --accent: #b5530a;
  --accent-ink: #8f3f05;
  --accent-soft: #fbe9db;
  --ok: #2f7d4e;
  --ok-soft: #e4f2e8;
  --warn: #9a6b12;
  --warn-soft: #f8ecc9;
  --bad: #a83d2b;
  --bad-soft: #f7e0da;
  --info: #2c5d8f;
  --info-soft: #e1ebf6;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(22, 52, 56, 0.06), 0 8px 24px -16px rgba(22, 52, 56, 0.25);
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --dock-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111a1b;
    --bg-2: #0d1415;
    --surface: #1a2527;
    --surface-2: #202d2f;
    --ink: #eee8da;
    --ink-2: #c9c2b2;
    --muted: #8e9b97;
    --line: #2d3b3d;
    --line-2: #3a4b4d;
    --accent: #e08a52;
    --accent-ink: #f2b088;
    --accent-soft: #3a2619;
    --ok: #6fc28c;
    --ok-soft: #1b3325;
    --warn: #e2b656;
    --warn-soft: #3a3016;
    --bad: #ee8b78;
    --bad-soft: #3d1f1a;
    --info: #86b4e6;
    --info-soft: #1c2c3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; color: var(--ink-2); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 상단 바 ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: #f6c46a; font-size: 15px; font-weight: 900;
}
.brand__sub { font-size: 12px; font-weight: 600; color: var(--muted); display: block; line-height: 1.1; }
.nav { display: none; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 12px; border-radius: 999px; font-weight: 650; color: var(--ink-2);
}
.nav a:hover { background: var(--bg-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.topbar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── 하단 독 (모바일) ───────────────────────────────── */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--dock-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.dock a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 650; color: var(--muted);
}
.dock a:hover { text-decoration: none; }
.dock a[aria-current="page"] { color: var(--accent-ink); }
.dock svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ── 레이아웃 ───────────────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
.page__head { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; margin-bottom: 16px; }
.page__head .lede { color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row--between { justify-content: space-between; }
.section { margin-top: 26px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section__head a { font-size: 13px; font-weight: 650; }

/* ── 카드 ───────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); min-width: 0;
}
.card--flat { box-shadow: none; background: var(--surface-2); }
.card--accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card__foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.kpi { display: grid; gap: 2px; }
.kpi__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi__value { font-size: 34px; font-weight: 850; letter-spacing: -0.02em; line-height: 1.1; }
.kpi__value small { font-size: 15px; font-weight: 650; color: var(--ink-2); margin-left: 3px; }
.kpi__value--md { font-size: 24px; }
.kpi__sub { font-size: 13px; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpis .kpi { padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.supply-summary { display: grid; gap: 18px; padding-top: 4px; }
.supply-summary__change { color: var(--ink-2); font-size: 18px; line-height: 1.45; }
.supply-summary__change strong { color: var(--ink); font-size: 24px; font-weight: 850; }
.supply-summary__periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.supply-summary__periods > div { padding-top: 12px; border-top: 1px solid var(--line); }
.supply-summary__periods dt { color: var(--muted); font-size: 13px; font-weight: 650; }
.supply-summary__periods dd { margin: 2px 0 0; color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1.3; }

/* ── 상태 칩·배지 ───────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--fresh { color: var(--ok); background: var(--ok-soft); }
.chip--stale { color: var(--warn); background: var(--warn-soft); }
.chip--blocked { color: var(--bad); background: var(--bad-soft); }
.chip--empty { color: var(--muted); background: var(--bg-2); }
.chip--error { color: var(--bad); background: var(--bad-soft); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.02em; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface-2);
}
.badge--a { color: #fff; background: var(--ink); border-color: var(--ink); }
.badge--b { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--bad { background: var(--bad-soft); color: var(--bad); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--muted { background: var(--bg-2); color: var(--muted); }

/* ── 상태 패널 ──────────────────────────────────────── */
.state { padding: 18px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--ink-2); display: grid; gap: 6px; }
.state--blocked { border-color: color-mix(in srgb, var(--bad) 50%, var(--line-2)); }
.state__title { font-weight: 750; }
.note { font-size: 13px; color: var(--ink-2); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; }
.note--info { background: var(--info-soft); }
.notes { display: grid; gap: 6px; margin-top: 10px; }
.defn { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.defn b { color: var(--ink-2); font-weight: 650; }

/* ── 컨트롤 ─────────────────────────────────────────── */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.select, .input {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 9px 12px; min-height: 40px;
}
.input { width: 100%; }
.input:focus, .select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 11px;
  padding: 9px 14px; font-weight: 700; cursor: pointer; min-height: 40px;
}
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: var(--ink-2); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn--sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 9px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button { flex: 0 0 auto; }

/* ── 리스트·표 ──────────────────────────────────────── */
.list { display: grid; gap: 10px; }
.item {
  display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius-s);
  background: var(--surface); border: 1px solid var(--line); color: inherit;
}
.item:hover { text-decoration: none; border-color: var(--line-2); background: var(--surface-2); }
.item__title { font-weight: 750; font-size: 15px; }
.item__meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.item__nums { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.item__nums b { font-weight: 750; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; }
.table tr.is-me td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
.bar { position: relative; height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar__range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 35%, var(--bg-2)); }
.bar__mark { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; background: var(--ink); }
.bar__mark--me { background: var(--accent); }
.scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.price-chart { margin: 10px 0 0; }
.price-chart__plot { position: relative; height: clamp(190px, 24vw, 260px); }
.price-chart__plot .spark { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.price-chart__value {
  position: absolute; left: 6px; z-index: 1; padding: 1px 5px; border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: 11.5px;
}
.price-chart__value--high { top: 2px; }
.price-chart__value--low { bottom: 18px; }
.price-chart__dates { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; }
.spark .band { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.spark .axis { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.price-table-card .table th, .price-table-card .table td { padding: 13px 10px; line-height: 1.45; }
.dist { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; align-items: end; height: 70px; }
.dist div { background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; }
.dist div.is-peak { background: var(--accent); }
.dist span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.count { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.count b { display: block; font-size: 22px; font-weight: 850; }
.count span { font-size: 12px; color: var(--muted); }
.skeleton { display: grid; gap: 10px; }
.skeleton i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
.skeleton i.big { height: 34px; width: 60%; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.footer { max-width: 1120px; margin: 24px auto 0; padding: 0 16px; font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,0.35); display: none; align-items: end; }
.sheet[open] { display: flex; }
.sheet__panel { width: 100%; background: var(--surface); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.sheet__panel a { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; color: var(--ink); }
@media (min-width: 640px) { .sheet { align-items: center; justify-content: center; } .sheet__panel { max-width: 420px; border-radius: 20px; } }

/* 데스크톱: 상단 내비만, 하단 독 숨김 (독 규칙보다 뒤에 두어 우선) */
@media (min-width: 900px) { .nav { display: flex; } body { padding-bottom: 32px; } .dock { display: none; } }

/* ── 공고 「지금 바뀐 것」 판 ─────────────────────────── */
#signals .kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
#advisory .item__title, #policy .item__title { font-size: 14px; }
#notice-insights .card__title { align-items: flex-start; flex-direction: column; }
#notice-insights .card__title h3 { flex: 1; font-size: 14.5px; }
#notice-insights .badge { white-space: normal; }

/* Factory contract observations keep conditions adjacent to every price. */
.price-tabs { flex-wrap: wrap; max-width: 100%; }
.factory-section { min-width: 0; }
.factory-intro { display:flex; justify-content:space-between; gap:20px; align-items:center; margin:20px 0 10px; }
.factory-intro h2 { margin:0 0 6px; font-size:22px; }
.factory-intro p { margin:0; color:var(--ink-2); }
.factory-total { display:grid; gap:4px; flex-shrink:0; max-width:55%; text-align:right; }
.factory-total strong { font-size:20px; }
.factory-total span { font-size:12px; color:var(--ink-2); }
.factory-basis { color:var(--ink-2); font-size:13px; line-height:1.65; margin:10px 0; }
.factory-basis summary { cursor:pointer; color:var(--accent-ink); font-weight:600; }
.factory-basis p { margin:8px 0; max-width:85ch; }
.factory-filters { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,.8fr); gap:12px; margin:20px 0 12px; }
.factory-filters label { display:grid; gap:6px; font-size:13px; font-weight:600; min-width:0; }
.factory-filters select,.factory-filters input,.company-history-choice select { min-width:0; width:100%; padding:10px; min-height:44px; border:1px solid var(--line-2); border-radius:8px; color:var(--ink); background:var(--surface); font:inherit; text-overflow:ellipsis; }
.factory-filters select,.company-history-choice select { overflow:hidden; white-space:nowrap; }
.factory-filters :focus-visible,.factory-details summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.factory-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin:14px 0; font-size:13px; color:var(--ink-2); }
.factory-table-wrap { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--surface); }
.factory-table { border-collapse:collapse; width:100%; table-layout:fixed; font-size:13px; }
.factory-table th { text-align:left; padding:14px; background:var(--surface-2); color:var(--ink-2); }
.factory-table td { vertical-align:top; padding:16px 14px; border-top:1px solid var(--line); overflow-wrap:anywhere; line-height:1.6; }
.factory-table th:nth-child(1) { width:24%; }.factory-table th:nth-child(2) { width:24%; }.factory-table th:nth-child(3) { width:28%; }.factory-table th:nth-child(4) { width:24%; }
.factory-table .small { margin-top:5px; color:var(--ink-2); }
.factory-price { display:block; font-size:22px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.factory-price small { margin-left:4px; font-size:12px; font-weight:500; }
.factory-term { display:inline-block; padding:3px 7px; margin-top:8px; background:var(--accent-soft); color:var(--accent-ink); border-radius:4px; font-weight:700; }
.factory-match { display:inline-block; color:var(--ok); margin-top:8px; font-size:12px; font-weight:600; }
.factory-details { margin-top:12px; }.factory-details summary { cursor:pointer; color:var(--accent-ink); font-weight:600; }
.factory-details dl { margin:10px 0; }.factory-details dt { font-size:11px; color:var(--ink-2); margin-top:8px; }.factory-details dd { margin:0; }
.factory-section > .small { margin-top:18px; line-height:1.7; }
@media(max-width:700px) {
  .price-tabs { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .price-tabs a { padding:10px 6px; text-align:center; }
  .factory-intro { flex-direction:column; align-items:flex-start; gap:12px; }.factory-intro h2 { font-size:20px; }
  .factory-total { max-width:100%; text-align:left; }
  .factory-intro p { font-size:13px; line-height:1.6; }.factory-total strong { font-size:16px; }
  .factory-filters { grid-template-columns:1fr 1fr; margin-top:12px; gap:8px; }.factory-filters label:first-child { grid-column:1 / -1; }
  .factory-table-wrap { border:0; background:transparent; overflow:visible; }
  .factory-table,.factory-table tbody,.factory-table tr,.factory-table td { display:block; width:100%; }
  .factory-table thead { display:none; }
  .factory-table tr { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; background:var(--surface); margin-bottom:14px; padding:4px 14px; }
  .factory-table td { border:0; padding:10px 0; }
  .factory-table td:nth-child(2) { order:-1; }
  .factory-table td:not(:nth-child(2)) { border-top:1px solid var(--line); }
  .factory-table td::before { content:attr(data-label); display:block; font-size:11px; color:var(--ink-2); margin-bottom:5px; }
}

.company-locations {margin:16px 0; padding:12px 0; border-block:1px solid var(--line); overflow-wrap:anywhere;}
.company-locations h3 {margin:0 0 6px;}
.company-locations p,.company-locations li {font-size:13px; line-height:1.65;}
.company-locations ul {padding-left:20px;}
.company-locations .factory-match {margin-left:8px;}
.company-history {margin:28px 0 20px;padding-top:20px;border-top:1px solid var(--line);}
.company-history h3 {margin:0 0 10px;}
.company-history-actions {display:flex;flex-wrap:wrap;gap:8px;margin:14px 0;}
.company-history-choice {display:block;font-size:13px;line-height:1.6;}
.company-history-choice select {display:block;width:100%;max-width:100%;min-width:0;margin:8px 0 16px;}
.company-history-chart {margin:16px 0;overflow-wrap:anywhere;}
.company-history-chart figcaption {font-size:13px;line-height:1.6;}
.company-history-chart svg {display:block;width:100%;height:auto;min-height:150px;}
.company-history-chart circle {fill:var(--accent);stroke:var(--surface);stroke-width:1;}
.company-history-chart circle:focus {outline:none;stroke:var(--ink);stroke-width:3;}
.company-history-axis {fill:none;stroke:var(--line);stroke-width:1;}
#company-paging {display:flex; flex-wrap:wrap; gap:10px; margin-top:14px;}
