/* BURI 사업 시뮬레이션 — 흰 바탕 · 청록(핵심) · 갈색(브랜드·회수 전) · 주황(확인 필요) · 적색(손실·부족) */
:root {
  --bg: #ffffff;
  --subtle: #f7f7f5;
  --subtle-2: #f1f0ed;
  --line: #e6e4e0;
  --line-2: #d4d1cb;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #625c56;           /* 설명 글씨: 흐리지 않게 */
  --teal: #0d5c63;
  --teal-2: #0f7179;
  --teal-50: #eef6f6;
  --teal-100: #d3e8e7;
  --brown: #5a3825;
  --brown-2: #8a6248;
  --brown-50: #f7f1ec;
  --orange: #a65300;
  --orange-50: #fff5e8;
  --orange-line: #f2c58a;
  --danger: #b42318;
  --danger-50: #fef1ef;
  --danger-line: #f4c2bc;
  --ok: #17663f;
  --radius: 14px;
  --font: 'Freesentation', 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.015em; }
p { margin: 0; }
small { font-size: 0.86em; }
button { font: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 6px 10px; z-index: 80; border: 2px solid var(--teal); }
:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; border-radius: 6px; }

/* ---------- 상단 ---------- */
.top { border-bottom: 1px solid var(--line); }
.top__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 18px; padding-bottom: 16px; }
.top__plan { font-size: 13px; color: var(--brown-2); font-weight: 600; margin-bottom: 2px; }
.top h1 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; color: var(--ink); }
.top__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.save-state { font-size: 13px; color: var(--muted); }

/* ---------- 버튼·링크 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--teal); background: var(--teal); color: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--teal-2); }
.btn--line { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.btn--line:hover { background: var(--subtle); color: var(--ink); }
.btn--small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; font-size: 13.5px; }
.link:hover { color: var(--teal-2); }
.icon-btn { width: 36px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; flex: none; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-50); }

/* ---------- 레이아웃 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "quick results" "details results"; column-gap: 24px; row-gap: 20px; align-items: start; padding: 24px 0 8px; }
.quick { grid-area: quick; min-width: 0; padding: 20px; }
.details { grid-area: details; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.results { grid-area: results; min-width: 0; position: sticky; top: 16px; align-self: start; }
.results__inner { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: 0 1px 2px rgba(28,25,23,.04), 0 8px 24px rgba(28,25,23,.05); max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.block-title { font-size: 17px; margin: 4px 0 2px; }
.block-title small { display: block; font-size: 13.5px; font-weight: 400; color: var(--ink-2); margin-top: 2px; letter-spacing: 0; }
.analysis { display: flex; flex-direction: column; gap: 10px; padding: 20px 0 8px; border-top: 1px solid var(--line); margin-top: 12px; }

/* 빠른 계산 */
.step { padding: 14px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; padding-top: 0; }
.step__label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.num-badge { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.manual { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--subtle); }
.applied { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.applied__vals { font-size: 17px; font-weight: 700; }
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.sentence__slot { display: inline-flex; align-items: center; gap: 8px; }
.sentence__fixed { font-weight: 700; }
.control.control--inline { display: inline-flex; width: 150px; }
.control.control--sm { width: 110px; }
.control.control--w { max-width: 340px; }
.link--sm { font-size: 12.5px; }
.alert__acts { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* 결과 범위·주요 상태 */
.scope { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--orange-line); background: var(--orange-50); font-size: 13.5px; color: var(--ink-2); }
.scope strong { color: var(--orange); display: block; font-size: 14px; }
.scope .btn { margin-top: 8px; }
.scope.is-ok { border-color: var(--teal-100); background: var(--teal-50); }
.scope.is-ok strong { color: var(--teal); }
.alerts { display: grid; gap: 6px; margin-top: 4px; }
.alerts:empty { display: none; }
.alerts .note { margin-top: 0; padding: 8px 10px; font-size: 13px; }
.note .link { font-size: inherit; }
.note--cash { background: var(--brown-50); border-color: #e5d5c8; color: var(--brown); }

/* 분석 */
.group__q { font-weight: 700; font-size: 15.5px; flex: 1 0 auto; }
.group > summary { flex-wrap: wrap; row-gap: 4px; }
.ana > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ana > summary::-webkit-details-marker { display: none; }
.ana > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.ana[open] > summary::before { transform: rotate(45deg); }
.ana > summary .group__sum { margin-left: auto; }
.ana__body { padding: 16px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; min-width: 0; }
.insight { font-size: 15px; line-height: 1.65; color: var(--ink); padding: 12px 14px; border-left: 3px solid var(--teal); background: var(--teal-50); border-radius: 0 10px 10px 0; }
.insight strong { color: var(--teal); }
.insight .loss, .insight .loss strong { color: var(--danger); }
.insight .cashneg, .insight .cashneg strong { color: var(--brown); }
.sub-title { font-size: 15px; margin-top: 6px; }
.detail--plain { margin-top: 0; border-top: 0; padding-top: 0; }
.detail--plain > summary { font-size: 13.5px; }
.detail--plain p { margin-top: 6px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.card__head h2 { font-size: 18px; }

/* ---------- 결과 패널 ---------- */
.cond__line { font-size: 15px; font-weight: 700; color: var(--ink); }
.cond__basis { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.core { margin-top: 10px; display: flex; flex-direction: column; }
.core__item { padding: 9px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.core__item > * { grid-column: 1 / -1; }
.core__item:first-child { border-top: 0; padding-top: 4px; }
.core__label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.core__value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; color: var(--teal); margin-top: 2px; }
.core__exact { font-size: 13px; color: var(--muted); }
.core__desc { font-size: 13px; color: var(--muted); }
.core__item.is-loss .core__value { color: var(--danger); }
.core__item.is-unrecovered .core__value { color: var(--brown); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; vertical-align: 4px; margin-left: 6px; letter-spacing: 0; }
.tag--loss { background: var(--danger-50); color: var(--danger); border: 1px solid var(--danger-line); }
.tag--cash { background: var(--brown-50); color: var(--brown); border: 1px solid #e5d5c8; }


.delta { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--subtle); font-size: 13.5px; }
.delta__head { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.delta ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.delta li { display: flex; justify-content: space-between; gap: 8px; }
.delta .up { color: var(--teal); font-weight: 700; }
.delta .down { color: var(--danger); font-weight: 700; }
.delta.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--teal-100); } to { background: var(--subtle); } }

.secondary { margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.secondary > div { background: #fff; padding: 9px 12px; }
.secondary dt { font-size: 12.5px; color: var(--muted); }
.secondary dd { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); }

.detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.detail > summary, .group > summary, .section--fold > summary { cursor: pointer; list-style: none; }
.detail > summary::-webkit-details-marker, .group > summary::-webkit-details-marker, .section--fold > summary::-webkit-details-marker { display: none; }
.detail > summary { font-weight: 700; font-size: 14px; color: var(--teal); display: flex; align-items: center; gap: 6px; }
.detail > summary::before, .group > summary::before, .section--fold > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.detail[open] > summary::before, .group[open] > summary::before, .section--fold[open] > summary::before { transform: rotate(45deg); }
.detail__body h3 { font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.detail__body h3 small { font-weight: 400; color: var(--muted); }

.rows { margin: 0; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 13.5px; border-bottom: 1px solid var(--subtle-2); }
.rows dt { color: var(--ink-2); min-width: 0; }
.rows dt small { color: var(--muted); }
.rows dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.rows .tot { border-bottom: 0; border-top: 1px solid var(--ink-2); }
.rows .tot dt, .rows .tot dd { font-weight: 800; color: var(--ink); }

/* 금액 색: 손실(적색) / 회수 전 현금(갈색) */
.loss { color: var(--danger); }
.cashneg { color: var(--brown); }
.okc { color: var(--ok); }

/* ---------- 입력 ---------- */
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.preset { text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; color: var(--ink); }
.preset:hover { border-color: var(--teal); }
.preset[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal); }
.preset strong { font-size: 15px; }
.preset span { font-size: 12.5px; color: var(--ink-2); }
@keyframes flash2 { from { background: var(--teal-100); } to { background: transparent; } }

.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.group__body .field + .field, .group__body .field + .calc-line, .group__body .calc-line + .field, .group__body fieldset + div, .group__body #costItemized { margin-top: 14px; }
.field > label, .field__label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); padding: 0; }
.field > label small, .field__label small { font-weight: 400; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.field__msg { margin-top: 4px; font-size: 13px; color: var(--danger); }
.field__msg:empty { display: none; }

.control { display: flex; align-items: stretch; max-width: 100%; }
.in { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-width: 0; width: 100%; transition: border-color .12s, box-shadow .12s; }
.in:hover { border-color: #b9b4ac; }
.in:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 92, 99, .16); }
.in[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-50); }
.in.num { text-align: right; font-weight: 700; }
.in::placeholder { color: #8f8881; font-weight: 500; }
.control .in { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.unit { display: flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--ink-2); background: var(--subtle); border: 1px solid var(--line-2); border-left: 0; border-radius: 0 10px 10px 0; white-space: nowrap; }
.unit--plain { background: none; border: 0; padding: 0 0 0 6px; }
.control--mini { margin: 6px auto 0; justify-content: center; max-width: 110px; }
.control--mini .in { padding: 4px 8px; font-size: 14px; }
.control--mini .unit { padding: 0 8px; }

.alert { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.alert--check { background: var(--orange-50); color: var(--orange); border: 1px solid var(--orange-line); }
.alert--check strong { margin-right: 4px; }

.group > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--ink); }
.group > summary::before { color: var(--muted); }
.group__title { font-weight: 700; font-size: 15.5px; }
.group__sum { margin-left: auto; font-size: 13px; color: var(--ink-2); text-align: right; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.group__body { padding: 4px 18px 18px; border-top: 1px solid var(--line); padding-top: 14px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--subtle); border-radius: 12px; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg label:has(input:checked) { background: #fff; color: var(--teal); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--teal-2); }
.seg input { accent-color: var(--teal); margin: 0; }

.items { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.items__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.items__total { font-size: 14px; }
.items__total strong { font-size: 16px; }
.calc-line { font-size: 14px; }

.opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge--missing { background: var(--orange-50); color: var(--orange); border: 1px dashed var(--orange); }
.badge--missing::before { content: '!'; font-weight: 800; }
.badge--example { background: var(--orange-50); color: var(--orange); border: 1px solid var(--orange-line); }
.badge--ok { background: var(--teal-50); color: var(--teal); border: 1px solid var(--teal-100); }
.badge--ok::before { content: '✓'; }
.badge--info { background: var(--subtle); color: var(--ink-2); border: 1px solid var(--line-2); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.month { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }
.month .in { font-size: 15px; padding: 7px 10px; }

.term { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--subtle-2); color: var(--ink-2); font-size: 11px; font-weight: 800; cursor: help; position: relative; vertical-align: 1px; }
.term:hover::after, .term:focus::after { content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 6px); z-index: 30; width: min(260px, 70vw); background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.5; padding: 8px 10px; border-radius: 8px; text-align: left; }

/* ---------- 하단 섹션 ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { background: var(--subtle); color: var(--ink-2); font-weight: 700; font-size: 13px; vertical-align: bottom; }
.tbl thead th small, .tbl td small, .tbl th small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.tbl tbody th { font-weight: 600; }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot th, .tbl tfoot td { background: var(--subtle); font-weight: 800; border-top: 1px solid var(--line-2); border-bottom: 0; }
.tbl tfoot tr + tr th, .tbl tfoot tr + tr td { border-top: 1px solid var(--line); }
.tbl .sub th, .tbl .sub td { font-weight: 500; color: var(--ink-2); background: #fff; }
.tbl .start th, .tbl .start td { background: var(--brown-50); }
.tbl .start .note-cell { text-align: left; white-space: normal; color: var(--ink-2); }
.tbl--month th:first-child, .tbl--month td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.tbl--month thead th:first-child, .tbl--month tfoot th:first-child { background: var(--subtle); }
.tbl--month .start th:first-child { background: var(--brown-50); }

.tbl--scen th:not(:first-child) { text-align: center; }
.tbl--scen .is-base { background: var(--teal-50); }
.tbl--scen thead .is-base { background: var(--teal-100); color: var(--teal); }
.tbl--scen tbody th { font-weight: 600; }
.tbl--scen tr.is-key th, .tbl--scen tr.is-key td { font-weight: 800; font-size: 15px; }
.tbl--scen tr.is-sep th, .tbl--scen tr.is-sep td { border-top: 2px solid var(--line-2); }
.tbl--scen .diff { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.limit { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--danger); background: var(--danger-50); border: 1px solid var(--danger-line); padding: 0 6px; border-radius: 999px; }

.note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; border: 1px solid var(--line); background: var(--subtle); color: var(--ink-2); }
.note strong { margin-right: 4px; }
.note--danger { background: var(--danger-50); border-color: var(--danger-line); color: var(--danger); }
.note--check { background: var(--orange-50); border-color: var(--orange-line); color: var(--orange); }

/* 그래프 */
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--subtle-2); stroke-width: 1; }
.chart .zero { stroke: var(--ink); stroke-width: 1.5; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .zl { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 12.5px; font-weight: 700; font-family: var(--font); }
.chart .ann { font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart .ann--ok { fill: var(--teal); }
.chart .ann--no { fill: var(--brown); }
.chart .ann-line { stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .bar-pos { fill: var(--teal); }
.chart .bar-neg { fill: var(--brown-2); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit.on { fill: rgba(13, 92, 99, .06); }
.chart__legend { margin-top: 6px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.sw:first-child { margin-left: 0; }
.sw--pos { background: var(--teal); }
.sw--neg { background: var(--brown-2); }
.reconcile .note { margin-top: 12px; }
.tip { position: absolute; z-index: 60; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; max-width: 260px; }
.tip .loss, .tip .cashneg { color: #ffc2b8; }

/* 원가 구성 막대 */
.costbar { margin-bottom: 14px; }
.costbar__track { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--subtle-2); gap: 2px; }
.costbar__track span { height: 100%; min-width: 2px; }
.costbar__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.seg-c0 { background: #5a3825; } .seg-c1 { background: #7d5640; } .seg-c2 { background: #a2795e; }
.seg-c3 { background: #c4a38c; } .seg-c4 { background: #6e4a35; } .seg-c5 { background: #937058; }
.seg-sell { background: #c78a2c; }
.seg-margin { background: var(--teal); }

/* 목표 역산 */
.target__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tk { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.tk--main { background: var(--teal-50); border-color: var(--teal-100); }
.tk p:first-child { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tk strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tk--main strong { color: var(--teal); }
.tk small { font-size: 12.5px; color: var(--muted); }

.assume { margin: 0; padding: 0 0 0 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.assume strong { color: var(--ink); margin-right: 4px; }

.foot { padding: 8px 0 40px; font-size: 13px; color: var(--muted); }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px; display: flex; align-items: center; gap: 10px; z-index: 70; box-shadow: 0 8px 28px rgba(0,0,0,.2); max-width: calc(100vw - 32px); font-size: 14px; }
.toast .btn { background: #fff; color: var(--teal); border-color: #fff; }
.toast__close { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }

/* 모바일 하단 요약 */
.mbar { display: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 1040px) {
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr) 360px; column-gap: 18px; }
  .core__value { font-size: 28px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "quick" "results" "details"; padding-top: 16px; }
  .results { position: static; }
  .results__inner { max-height: none; overflow: visible; box-shadow: none; }
  .core { flex-direction: row; flex-wrap: wrap; gap: 0; }
  .core__item { flex: 1 1 33%; border-top: 0; border-left: 1px solid var(--line); padding: 4px 12px; }
  .core__item:first-child { border-left: 0; padding-left: 0; }
  .mbar:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .mbar__vals { flex: 1; display: flex; gap: 12px; min-width: 0; }
  .mbar__vals span { display: flex; flex-direction: column; min-width: 0; }
  .mbar__vals small { font-size: 11.5px; color: var(--muted); }
  .mbar__vals strong { font-size: 14.5px; font-weight: 800; white-space: nowrap; }
  body.has-mbar { padding-bottom: 72px; }
  body.has-mbar .toast { bottom: 84px; }
}
@media (max-width: 560px) {
  .top__inner { padding-top: 14px; padding-bottom: 12px; }
  .save-state { display: none; }
  .core { flex-direction: column; }
  .core__item { border-left: 0; border-top: 1px solid var(--line); padding: 10px 0; }
  .core__item:first-child { border-top: 0; padding-top: 2px; }
  .core__value { font-size: 28px; }
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .item { grid-template-columns: minmax(0, 1fr) auto; }
  .item .control { grid-column: 1 / 2; }
  .item .icon-btn { grid-row: 1 / 3; grid-column: 2; height: auto; align-self: stretch; }
  .group > summary, .ana > summary { flex-wrap: wrap; }
  .group__sum, .ana > summary .group__sum { margin-left: 20px; width: 100%; justify-content: flex-start; text-align: left; }
  .target__kpis { grid-template-columns: minmax(0, 1fr); }
  .mbar__vals { gap: 10px; }
  .sentence { gap: 6px; font-size: 15px; }
  .control.control--inline { width: 118px; }
  .control.control--sm { width: 84px; }
  .control--inline .unit { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
