/* 승인된 Figma 개선안: 결과를 먼저 보여 주고 근거와 견적은 열어서 읽는다. */
:root {
  --bg: #f4f5f2;
  --surface: #fff;
  --text: #141a22;
  --text-2: #4a525b;
  --text-3: #646b72;
  --line: #e3e5e1;
  --fill: #eceee9;
  --accent: #1d4e89;
  --accent-press: #163d6c;
  --accent-soft: #e3ebf5;
  --warn: #8a4f0b;
  --warn-soft: #f8eedd;
  --shadow: 0 2px 12px rgba(20, 26, 36, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Pretendard Variable", Pretendard, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { text-align: inherit; }
p, h1, h2, dl, dd { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.mobile-only { display: none; }
.container { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 10; padding: 12px 16px; border-radius: 12px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.hero { background: linear-gradient(90deg, #0b2242, #1d4e89); color: #fff; }
.hero-inner { display: flex; flex-direction: column; gap: 24px; padding-block: 24px 64px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { flex: none; color: #fff; font-size: 20px; line-height: 29px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand span { color: #8fb8f0; }
.demo-note { max-width: 340px; font-size: 12px; font-weight: 500; line-height: 17px; text-align: right; }
.hero-content { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; }
.hero-title { display: grid; gap: 8px; min-width: 0; }
.hero-title h1 { font-size: 30px; font-weight: 700; line-height: 44px; }
.hero-title p { font-size: 16px; font-weight: 500; line-height: 23px; }
.sample-picker { display: flex; flex: 0 0 430px; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .18); }
.chip { flex: 1; min-width: 0; min-height: 36px; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: #c9d6e8; font-size: 13px; font-weight: 600; line-height: 19px; letter-spacing: -.02em; white-space: nowrap; }
.chip[aria-pressed="true"] { background: #fff; color: #0e2a4f; }
.hero :focus-visible { outline-color: #fff; }

.page { position: relative; display: grid; gap: 20px; margin-top: -32px; padding-bottom: 40px; }
.card { min-width: 0; padding: 24px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.summary { display: grid; grid-template-columns: minmax(0, 1fr) 368px; grid-template-rows: min-content auto min-content; grid-template-areas: "title market" "note market" ". date"; column-gap: 32px; padding: 28px; }
.summary h2 { grid-area: title; align-self: start; margin-bottom: 8px; font-size: 30px; font-weight: 700; line-height: 44px; }
.summary-note { grid-area: note; align-self: start; font-size: 13px; line-height: 19px; color: var(--text-3); }
.market { grid-area: market; display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 105px; }
.market-delta { font-size: 44px; font-weight: 700; line-height: 64px; color: var(--accent); }
.market-copy { display: grid; gap: 2px; }
.market-label { font-size: 14px; font-weight: 600; line-height: 20px; }
.market-values { font-size: 12px; line-height: 17px; color: var(--text-3); }
.market-date { grid-area: date; font-size: 12px; line-height: 17px; color: var(--text-3); }
.market-unavailable { color: var(--text-3); font-size: 14px; line-height: 20px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 720fr) minmax(0, 460fr); align-items: start; gap: 20px; }
.findings-card { display: grid; gap: 16px; }
.findings-card h2 { font-size: 22px; font-weight: 700; line-height: 32px; }
.muted { color: var(--text-3); font-size: 13px; line-height: 19px; }
.findings { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.empty-state { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.empty-state strong { font-size: 15px; font-weight: 600; line-height: 22px; }
.empty-state p { color: var(--text-2); font-size: 13px; line-height: 19px; }
.action-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.action-row:hover { border-color: #c2cad4; }
.action-row:active { background: #f7f8f6; }
.row-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.row-copy strong { font-size: 15px; font-weight: 600; line-height: 22px; }
.row-detail { color: var(--text-2); font-size: 13px; font-weight: 400; line-height: 19px; }
.chevron, .item-status { flex: none; }
.example-note { color: var(--warn); font-size: 12px; font-weight: 500; line-height: 17px; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 14px 20px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 600; line-height: 23px; text-align: center; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-press); }
.secondary { border: 1px solid var(--line); background: var(--surface); }
.secondary:hover { background: var(--fill); }
.primary:disabled, .secondary:disabled { cursor: default; opacity: .5; }
.details-column { display: grid; gap: 16px; min-width: 0; }
.quote-card { display: grid; gap: 16px; }
.quote-forwarder { font-size: 15px; font-weight: 600; line-height: 22px; }
.quote-total { font-size: 30px; font-weight: 700; line-height: 44px; }
.page-footer { color: var(--text-3); font-size: 12px; line-height: 17px; }

.detail-dialog { width: min(680px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 64px); margin: auto; padding: 28px; border: 0; border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: auto; overscroll-behavior: contain; }
.detail-dialog[open] { display: grid; gap: 16px; }
.detail-dialog::backdrop { background: rgba(11, 34, 66, .48); }
body:has(.detail-dialog[open]) { overflow: hidden; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { flex: 1; min-width: 0; font-size: 24px; font-weight: 700; line-height: 35px; }
.close { display: grid; flex: 0 0 44px; place-items: center; min-height: 44px; margin-top: -5px; border: 0; border-radius: 12px; background: var(--fill); font-size: 28px; line-height: 1; }
.close:hover { background: var(--line); }
.prose { display: grid; gap: 16px; color: var(--text-2); font-size: 14px; line-height: 20px; }
.prose h3 { margin: 0; color: var(--text); font-size: 16px; line-height: 23px; }
.basis { display: grid; gap: 12px; }
.basis > div { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.basis dt { color: var(--text); font-size: 13px; font-weight: 600; line-height: 19px; }
.basis dd { color: var(--text-2); font-size: 14px; line-height: 20px; }
.detail-dialog > a { font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none; }
.detail-dialog > a:hover { text-decoration: underline; }
.quote-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-block: 4px; }
.quote-meta > div { display: grid; align-content: start; gap: 4px; }
.quote-meta dt { color: var(--text-3); font-size: 12px; line-height: 17px; }
.quote-meta dd { color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 19px; }
.items { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.row + .row { border-top: 1px solid var(--line); }
.kind { flex: 0 0 48px; border-radius: 8px; background: var(--fill); color: var(--text-2); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; letter-spacing: -.02em; }
.row-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; line-height: 20px; }
.row-sub { color: var(--text-3); font-size: 12px; line-height: 17px; }
.amt { display: flex; flex: none; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; line-height: 20px; }
.amt input { width: 112px; min-height: 36px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; background: var(--fill); font-size: 14px; line-height: 20px; text-align: right; }
.amt input:focus { border-color: var(--accent); background: var(--surface); }
.row.zero .amt input { border-color: var(--warn); }
.quote-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 8px; }
.quote-bottom span { color: var(--text-3); font-size: 13px; line-height: 19px; }
.quote-bottom strong { font-size: 15px; line-height: 22px; }
textarea { width: 100%; min-height: 300px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 15px; line-height: 22px; resize: vertical; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dialog-actions > button { flex: 1; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; line-height: 19px; }
.status { min-height: 17px; color: var(--text-3); font-size: 12px; line-height: 17px; }
.programs { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.programs li { display: grid; gap: 6px; }
.programs h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 22px; }
.programs span { color: var(--text-3); font-size: 12px; line-height: 17px; }
.programs p { color: var(--text-2); font-size: 14px; line-height: 20px; }
noscript { display: block; margin: 24px; color: var(--warn); }

@media (max-width: 900px) {
  .desktop-only { display: none; }
  .mobile-only { display: revert; }
  .container { width: calc(100% - 32px); }
  .hero-inner { width: calc(100% - 40px); gap: 12px; padding-block: 24px 52px; }
  .demo-note { flex: 1; max-width: 224px; }
  .hero-content { display: block; }
  .hero-title { gap: 12px; }
  .hero-title h1 { font-size: 24px; line-height: 35px; }
  .hero-title p { font-size: 13px; line-height: 19px; }
  .summary { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
  .summary h2 { margin-bottom: 0; font-size: 26px; line-height: 38px; }
  .market { flex-direction: row; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 12px; border-radius: 14px; background: var(--accent-soft); }
  .market-delta { flex: 0 0 76px; font-size: 28px; line-height: 41px; }
  .market-copy { flex: 1; min-width: 0; gap: 0; }
  .market-label, .market-values { color: var(--text); font-size: 13px; font-weight: 500; line-height: 19px; }
  .market-date { font-size: 11px; line-height: 16px; }
  .summary-note { align-self: stretch; margin-top: 0; font-size: 12px; line-height: 17px; }
  .result-layout { grid-template-columns: minmax(0, 1fr); }
  .findings-card { gap: 10px; padding: 16px; }
  .findings-card h2 { font-size: 19px; line-height: 28px; }
  .findings { gap: 10px; }
  .finding-row { padding-block: 14px; }
  .finding-row .row-detail { display: none; }
  .quote-card { display: block; padding: 0; border-radius: 14px; box-shadow: none; background: transparent; }
  .details-column > .desktop-only { display: none; }
  .quote-card > .desktop-only { display: none; }
  .mobile-sample-picker { display: grid; gap: 8px; margin-top: 24px; }
  .mobile-sample-picker label { color: var(--text-2); font-size: 13px; line-height: 19px; }
  .mobile-sample-picker select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 14px; }
  .detail-dialog { width: calc(100% - 32px); max-height: calc(100dvh - 32px); padding: 20px; }
  .dialog-heading h2 { font-size: 22px; line-height: 32px; }
  .quote-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { gap: 8px; }
  .kind { flex-basis: 36px; }
  .amt input { width: 88px; padding-inline: 6px; font-size: 16px; }
  .dialog-actions { flex-direction: column; }
}

@media (max-width: 360px) {
  .brand-row { gap: 12px; }
  .demo-note { font-size: 11px; line-height: 16px; }
  .market { gap: 8px; }
  .market-delta { flex-basis: 64px; }
  .market-label, .market-values { font-size: 12px; line-height: 18px; }
  .row-copy strong { font-size: 14px; }
  .kind { flex-basis: 30px; font-size: 10px; }
  .amt input { width: 78px; }
}
.ai-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff7e6; color: #5c3b00; font-size: 14px; line-height: 1.5; }
.ai-note ul { margin: 6px 0 0; padding-left: 18px; }
.ai-note p { margin: 4px 0 0; }
.tariff-list { padding-left: 18px; font-size: 14px; line-height: 1.5; }
.tariff-list li { margin-bottom: 8px; }
#extract-dialog textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; }
#extract-dialog input[type="file"] { display: block; margin: 4px 0 12px; max-width: 100%; }
.mobile-sample-picker .secondary { margin-bottom: 12px; width: 100%; }
#extract-dialog .consent { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; font-size: 14px; line-height: 1.5; }
#extract-dialog .consent input { margin-top: 3px; flex: none; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-icon { width: 28px; height: 28px; border-radius: 7px; }

.video-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 18, 36, .72); }
.video-modal[hidden] { display: none; }
.video-dialog { width: min(960px, 100%); background: #0b1626; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; }
.video-actions button { font: inherit; font-size: 15px; font-weight: 600; border-radius: 10px; padding: 9px 16px; cursor: pointer; }
.video-hide { background: transparent; color: #b8c4d6; border: 1px solid rgba(255, 255, 255, .2); }
.video-close { background: #fff; color: #0b1626; border: 0; }
