:root {
  --ink: #10201b;
  --muted: #68756f;
  --paper: #f4f6f1;
  --surface: #ffffff;
  --line: #dde3dc;
  --dark: #0c1714;
  --green: #19a963;
  --green-bright: #9df7c5;
  --green-soft: #e4f8ec;
  --amber: #db7a27;
  --red: #d04a4a;
  --blue: #3d68d8;
  --shadow: 0 18px 48px rgba(18, 43, 32, 0.08);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--paper); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(25, 169, 99, 0.22); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 30; top: 0; height: 74px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(221, 227, 220, 0.78); background: rgba(244, 246, 241, 0.88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--green-bright); background: var(--dark); font-weight: 900; letter-spacing: -1px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.scenario-select-wrap { height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.65); }
.scenario-select-wrap span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.scenario-select-wrap select { max-width: 150px; border: 0; color: var(--ink); background: transparent; font-size: 13px; font-weight: 700; }
.button { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 750; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--ink); box-shadow: 0 8px 22px rgba(16,32,27,.16); }
.button.primary:hover { background: #17362b; }
.button.ghost { border-color: var(--line); background: rgba(255,255,255,.75); color: var(--ink); }
.button.danger { border-color: #f1c6c6; color: var(--red); background: #fff4f4; }
.button:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }

main { width: min(1440px, 100%); margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 72px; }
.hero { min-height: 340px; padding: 46px 0 38px; display: flex; align-items: center; justify-content: center; }
.eyebrow, .section-kicker { color: #4c6259; font-size: 10px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 24px; height: 2px; background: var(--green); }
.hero h1 { margin: 19px 0 20px; max-width: 760px; font-size: clamp(42px, 5.2vw, 76px); line-height: 1.04; letter-spacing: -.055em; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-copy > p { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.7; }
.hero-meta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 12px; }
.status-dot { display: flex; align-items: center; gap: 7px; color: #2f5b47; font-weight: 750; }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(25,169,99,.12); }
.margin-stage { width: min(620px, 100%); display: grid; grid-template-columns: 240px minmax(180px,1fr); gap: 42px; align-items: center; }
.margin-ring { --margin-angle: 0deg; width: 240px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--margin-angle), #dfe5de 0); box-shadow: inset 0 0 0 1px rgba(0,0,0,.03), var(--shadow); transition: background .35s ease; }
.margin-ring::before { content: ""; position: absolute; width: 210px; aspect-ratio: 1; border-radius: 50%; background: var(--paper); }
.margin-ring-inner { position: relative; z-index: 1; text-align: center; }
.margin-ring-inner span, .margin-ring-inner small { display: block; }
.margin-ring-inner span { color: var(--muted); font-size: 12px; }
.margin-ring-inner strong { display: block; margin: 4px 0 2px; font-size: 48px; letter-spacing: -.05em; }
.margin-ring-inner small { color: var(--green); font-size: 11px; font-weight: 800; }
.margin-formula { display: grid; grid-template-columns: 1fr; gap: 5px; }
.margin-formula span { margin-top: 8px; color: var(--muted); font-size: 11px; }
.margin-formula b { font-size: 17px; }
.margin-formula i { margin: 2px 0 -3px; color: #aeb8b2; font-size: 15px; font-style: normal; }

.kpi-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 12px; }
.kpi-card { min-height: 150px; padding: 23px 24px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); box-shadow: 0 10px 30px rgba(17,40,30,.035); }
.kpi-card.dark { color: white; border-color: var(--dark); background: var(--dark); }
.kpi-card.accent { border-color: #bdebd0; background: var(--green-soft); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.dark .kpi-label { color: #acc2b8; }
.kpi-label small { margin-left: 4px; font-size: 9px; font-weight: 500; }
.kpi-card strong { margin: auto 0 9px; font-size: clamp(22px, 2.2vw, 31px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.kpi-foot { color: var(--muted); font-size: 10px; }
.dark .kpi-foot { color: #94aa9f; }

.workspace-grid { margin-top: 32px; display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 14px; }
.panel { min-height: 310px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 14px 38px rgba(14,45,31,.045); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.panel h2, .section-heading h2, .modal h2 { margin: 6px 0 0; font-size: 23px; letter-spacing: -.035em; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 800; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: white; }
.settings-button { height: 34px; padding: 0 9px 0 12px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #cae3d4; border-radius: 9px; color: #17653f; background: var(--green-soft); font-size: 10px; font-weight: 850; }
.settings-button b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: white; background: var(--green); font-size: 10px; }
.discount-controls { margin-top: 26px; display: grid; gap: 18px; }
.range-control { display: grid; grid-template-columns: 1fr 72px; gap: 9px 13px; align-items: center; }
.range-control > span { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.range-control b { color: var(--ink); }
.range-control output { color: var(--green); font-weight: 800; }
.range-control input[type="range"] { width: 100%; height: 4px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--green) var(--range-fill, 0%), #e2e7e1 var(--range-fill, 0%)); }
.range-control input[type="range"]::-webkit-slider-thumb { width: 17px; height: 17px; appearance: none; border: 4px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 1px 7px rgba(12,23,20,.3); }
.number-suffix { width: 72px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; text-align: right; font-size: 12px; }
.range-control.subdued output { color: var(--blue); }
.impact-strip { margin-top: 23px; padding-top: 17px; display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--line); }
.impact-strip span { color: var(--muted); font-size: 11px; }
.impact-strip strong { color: var(--red); font-size: 15px; }
.impact-strip small { grid-column: 1 / -1; margin-top: 3px; color: #9ba59f; font-size: 9px; }
.mix-bars { margin-top: 30px; display: grid; gap: 17px; }
.mix-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; font-size: 11px; }
.mix-row > span { font-weight: 700; }
.mix-row > div { height: 7px; overflow: hidden; border-radius: 99px; background: #edf0ec; }
.mix-row i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.mix-row:nth-child(2) i { background: #274d40; }
.mix-row:nth-child(3) i { background: #9ab8aa; }
.mix-row b { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.mini-stats { margin-top: 29px; padding-top: 18px; display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; border-top: 1px solid var(--line); }
.mini-stats span, .mini-stats b { display: block; text-align: center; }
.mini-stats span { color: var(--muted); font-size: 9px; }
.mini-stats b { margin-top: 5px; font-size: 15px; }
.reference-panel { display: flex; flex-direction: column; color: white; border-color: #1c3029; background: #14251f; }
.reference-panel .section-kicker { color: #7fa091; }
.reference-top { margin-top: 34px; display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.reference-top span { color: #a8bbb2; font-size: 10px; }
.reference-top strong { display: block; margin-top: 8px; font-size: 25px; letter-spacing: -.04em; }
.reference-margin { margin-top: 22px; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(157,247,197,.13); border-radius: 11px; background: rgba(157,247,197,.055); }
.reference-margin span b, .reference-margin span small { display: block; }
.reference-margin span b { color: #d9e9e1; font-size: 10px; }
.reference-margin span small { margin-top: 3px; color: #829c90; font-size: 8px; }
.reference-margin > strong { color: var(--green-bright); font-size: 20px; letter-spacing: -.035em; }
.reference-scale { margin-top: auto; }
.reference-scale div { height: 6px; overflow: hidden; border-radius: 10px; background: #2b3d36; }
.reference-scale i { display: block; height: 100%; background: var(--green-bright); }
.reference-scale small { display: block; margin-top: 12px; color: #8ea49a; font-size: 9px; line-height: 1.5; }

.people-section { min-width: 0; max-width: 100%; margin-top: 76px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading h2 { font-size: 32px; }
.section-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.section-actions { display: flex; gap: 9px; }
.search-box { min-width: 220px; height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.search-box span { color: #9aa59f; }
.search-box input { width: 100%; border: 0; outline: 0; font-size: 12px; }
.section-actions > select { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 12px; font-weight: 700; }
.source-alert { margin-top: 26px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid #e5dcc8; border-radius: 12px; color: #6c5b35; background: #fbf7ec; }
.source-alert > span { width: 23px; height: 23px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #8b6d2d; background: #f2e5bf; font-size: 11px; font-weight: 900; }
.source-alert p { margin: 0; flex: 1; font-size: 10px; line-height: 1.5; }
.source-alert button { border: 0; color: #9b8d6d; background: transparent; font-size: 18px; }
.source-alert.dismissed { display: none; }
.table-shell { width: 100%; max-width: 100%; margin-top: 14px; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 12px 36px rgba(14,45,31,.04); }
table { width: 100%; min-width: 1305px; border-collapse: collapse; table-layout: fixed; }
th { height: 48px; padding: 0 11px; color: #7b8781; background: #f8faf7; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; font-weight: 850; letter-spacing: .03em; }
th:nth-child(1) { width: 55px; text-align: center; }
th:nth-child(2) { width: 180px; }
th:nth-child(3) { width: 72px; }
th:nth-child(4) { width: 150px; }
th:nth-child(5), th:nth-child(8) { width: 80px; }
th:nth-child(6), th:nth-child(9), th:nth-child(10) { width: 120px; }
th:nth-child(7) { width: 140px; }
th:nth-child(11) { width: 70px; text-align: center; }
th:nth-child(12) { width: 65px; text-align: center; }
th:nth-child(13) { width: 45px; }
td { height: 68px; padding: 9px 11px; border-bottom: 1px solid #edf0ec; font-size: 11px; vertical-align: middle; }
tbody tr { transition: background .15s ease, opacity .15s ease; }
tbody tr:hover { background: #fbfdfb; }
tbody tr.excluded { opacity: .42; background: #f6f7f5; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.person-cell strong, .person-cell small { display: block; }
.person-cell strong { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.person-name-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replacement-badge { min-height: 18px; padding: 3px 6px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; border: 1px solid #e8c96d; border-radius: 20px; color: #765500; background: #fff1ae; font-size: 7px; font-weight: 900; line-height: 1; white-space: nowrap; }
.replacement-badge i { font-size: 9px; font-style: normal; }
.person-cell small { margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.group-chip { display: inline-flex; padding: 5px 7px; border-radius: 7px; color: #23734a; background: var(--green-soft); font-size: 9px; font-weight: 850; }
.group-chip.erp { color: #375d9d; background: #eaf0fb; }
.table-select, .mm-input { height: 33px; border: 1px solid #e0e5df; border-radius: 8px; background: #fff; font-size: 10px; }
.table-select { width: 100%; padding: 0 7px; }
.mm-input { width: 60px; padding: 0 6px; text-align: right; }
.money-positive { color: #157447; font-weight: 800; }
.money-negative { color: var(--red); font-weight: 800; }
.replace-row { width: 48px; height: 30px; border: 1px solid #cae1d2; border-radius: 8px; color: #187246; background: #f2faf5; font-size: 9px; font-weight: 850; }
.replace-row:hover { border-color: #8dc9a5; background: #e7f6ec; }
.replace-row:focus-visible { outline: 2px solid #68c28f; outline-offset: 2px; }
.order-row-actions { display: flex; justify-content: center; gap: 3px; }
.order-row { width: 25px; height: 30px; padding: 0; border: 1px solid #dfe5e1; border-radius: 7px; color: #52645b; background: #f8faf8; font-size: 12px; font-weight: 850; }
.order-row:hover:not(:disabled) { color: #167247; border-color: #9bcbb0; background: #edf8f1; }
.order-row:focus-visible { outline: 2px solid #68c28f; outline-offset: 2px; }
.order-row:disabled { color: #bec6c1; background: #f3f5f3; cursor: not-allowed; }
.edit-row { width: 30px; height: 30px; border: 0; border-radius: 8px; color: #6c7a73; background: transparent; }
.edit-row:hover { background: #edf4ef; }
.switch { position: relative; width: 34px; height: 20px; display: inline-block; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: #ccd4cf; transition: .2s; }
.switch i::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::before { transform: translateX(14px); }
.empty-state { padding: 60px; color: var(--muted); text-align: center; font-size: 12px; }
.table-footer { padding: 11px 4px 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
footer { padding: 30px clamp(20px,4vw,64px); display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #8c9792; font-size: 9px; }

.modal { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto; border: 0; border-radius: 22px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(5,20,13,.28); }
.modal::backdrop { background: rgba(6,20,14,.54); backdrop-filter: blur(4px); }
.modal form { padding: 28px; }
.modal-heading { display: flex; justify-content: space-between; gap: 20px; }
.modal h2 { font-size: 27px; }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #f1f4f0; font-size: 20px; }
.form-grid { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid label, .save-name { display: grid; gap: 7px; }
.form-grid label > span, .save-name span { color: var(--muted); font-size: 10px; font-weight: 700; }
.form-grid input, .form-grid select, .save-name input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-row { margin-top: 20px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.check-row input { accent-color: var(--green); }
.modal-note, .privacy-note { margin: 18px 0 0; padding: 12px 14px; border-radius: 9px; color: #68776f; background: #f4f7f3; font-size: 9px; line-height: 1.55; }
.modal-actions { margin-top: 25px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; align-items: center; }
.replacement-modal { width: min(560px, calc(100vw - 32px)); }
.replacement-person { margin-top: 24px; padding: 14px 16px; border-radius: 11px; background: #f4f8f5; }
.replacement-person span, .replacement-person strong, .replacement-person small { display: block; }
.replacement-person span { color: var(--muted); font-size: 9px; }
.replacement-person strong { margin-top: 5px; font-size: 15px; }
.replacement-person small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.replacement-grade-grid { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.replacement-grade-field { display: grid; gap: 8px; }
.replacement-grade-field span { color: var(--muted); font-size: 10px; font-weight: 750; }
.replacement-grade-field select { width: 100%; height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 12px; }
.replacement-preview { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.replacement-preview > div { min-width: 0; padding: 11px 12px; border: 1px solid #e3e9e4; border-radius: 10px; background: #fafcfb; }
.replacement-preview span, .replacement-preview strong { display: block; }
.replacement-preview span { color: var(--muted); font-size: 8px; }
.replacement-preview strong { margin-top: 5px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.replacement-preview .accent { color: white; border-color: var(--green); background: var(--green); }
.replacement-preview .accent span { color: #d8f5e5; }
.side-modal { width: min(560px, calc(100vw - 32px)); }
.cost-modal { width: min(780px, calc(100vw - 32px)); }
.cost-summary { margin-top: 24px; padding: 17px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; border: 1px solid #dce8df; border-radius: 15px; background: #f6faf7; }
.cost-summary > div { min-width: 0; padding: 11px 12px; border-radius: 10px; background: white; }
.cost-summary > div span, .cost-summary > div strong { display: block; }
.cost-summary > div span { color: var(--muted); font-size: 9px; }
.cost-summary > div strong { margin-top: 6px; overflow: hidden; font-size: 15px; letter-spacing: -.025em; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cost-summary > div.total { color: white; background: var(--ink); }
.cost-summary > div.total span { color: #acc2b8; }
.cost-summary p { grid-column: 1 / -1; margin: 3px 2px 0; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 9px; }
.cost-summary p b { color: var(--ink); }
.customer-showing-policy { margin-top: 18px; padding: 18px 20px; border: 1px solid #ead8b3; border-radius: 14px; background: #fffaf0; }
.customer-showing-policy .assumption-heading > span { color: #9a6410; background: #f7e8c7; }
.customer-showing-controls { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.showing-uplift-input { min-width: 0; padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #eadfc9; border-radius: 11px; background: white; }
.showing-uplift-input > span:first-child b, .showing-uplift-input > span:first-child small { display: block; }
.showing-uplift-input > span:first-child b { font-size: 10px; }
.showing-uplift-input > span:first-child small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.showing-uplift-input > span:last-child { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.showing-uplift-input input { width: 76px; height: 34px; padding: 0 8px; border: 1px solid #dfd4be; border-radius: 8px; background: white; text-align: right; font-size: 10px; }
.showing-uplift-input em { color: #8b7858; font-size: 9px; font-style: normal; font-weight: 800; }
.customer-showing-metrics { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.customer-showing-metrics > div { min-width: 0; padding: 10px 11px; border: 1px solid #eee3ce; border-radius: 9px; background: rgba(255,255,255,.82); }
.customer-showing-metrics span, .customer-showing-metrics strong { display: block; }
.customer-showing-metrics span { color: #8b7858; font-size: 8px; }
.customer-showing-metrics strong { margin-top: 5px; overflow: hidden; font-size: 13px; letter-spacing: -.02em; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.customer-showing-metrics .accent { color: white; border-color: #9a6410; background: #9a6410; }
.customer-showing-metrics .accent span { color: #f7e5c0; }
.customer-showing-metrics .accent.inactive { color: var(--ink); border-color: #eee3ce; background: rgba(255,255,255,.82); }
.customer-showing-metrics .accent.inactive span { color: #8b7858; }
.transport-policy { margin-top: 18px; padding: 18px 20px; border: 1px solid #cfe6d6; border-radius: 14px; background: #f8fcf9; }
.transport-toggle-list { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.transport-toggle { min-width: 0; padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #dfe9e2; border-radius: 11px; background: white; cursor: pointer; }
.transport-toggle > span:first-child b, .transport-toggle > span:first-child small { display: block; }
.transport-toggle > span:first-child b { font-size: 10px; }
.transport-toggle > span:first-child small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.toggle-option { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.toggle-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-option i { position: relative; width: 32px; height: 19px; border-radius: 20px; background: #cbd4ce; transition: .2s; }
.toggle-option i::before { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.toggle-option input:checked + i { background: var(--green); }
.toggle-option input:checked + i::before { transform: translateX(13px); }
.toggle-option input:focus-visible + i { outline: 2px solid #68c28f; outline-offset: 2px; }
.toggle-option em { min-width: 28px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 800; }
.toggle-option input:checked ~ em { color: var(--green); }
.assumption-group { margin-top: 24px; padding: 19px 20px 4px; border: 1px solid var(--line); border-radius: 14px; }
.assumption-group.compact { padding-bottom: 4px; }
.assumption-heading { display: flex; align-items: start; gap: 11px; }
.assumption-heading > span { width: 25px; height: 25px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 900; }
.assumption-heading h3 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.assumption-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.rate-editor-section { padding-bottom: 18px; }
.rate-editor-summary { margin-top: 15px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 10px; color: #24543f; background: var(--green-soft); }
.rate-editor-summary span { font-size: 9px; font-weight: 750; }
.rate-editor-summary strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.rate-editor-summary.quote { color: #73520a; background: #fff1c9; }
.rate-editor-note { margin: 10px 2px 0; color: #7b6c4e; font-size: 8px; line-height: 1.55; }
.rate-editor-note b { color: #624811; }
.rate-editor-list { max-height: 440px; margin-top: 15px; padding-right: 6px; display: grid; gap: 18px; overflow-y: auto; overscroll-behavior: contain; }
.rate-editor-group h4 { margin: 0 0 8px; color: #53655c; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.rate-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.rate-editor-grid label { min-width: 0; min-height: 58px; padding: 9px 10px; display: grid; grid-template-columns: 1fr 94px; align-items: center; gap: 10px; border: 1px solid #e5eae5; border-radius: 10px; background: #fafbf9; }
.rate-editor-grid label.used { border-color: #cfe5d6; background: #f8fcf9; }
.rate-editor-grid span b, .rate-editor-grid span small { display: block; }
.rate-editor-grid span b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rate-editor-grid span small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.rate-editor-grid label.used span small { color: #278357; font-weight: 750; }
.rate-editor-grid input { width: 94px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; text-align: right; font-size: 10px; }
.rate-input-stack { min-width: 0; display: grid; justify-items: end; gap: 4px; }
.rate-input-stack em { color: #6f7c75; font-size: 8px; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.assumption-list { margin-top: 10px; display: grid; gap: 2px; }
.assumption-list label { min-height: 65px; padding: 10px 0; display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 18px; border-bottom: 1px solid #edf0ec; }
.assumption-list label:last-child { border-bottom: 0; }
.assumption-list span b, .assumption-list span small { display: block; }
.assumption-list span b { font-size: 11px; }
.assumption-list span small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.assumption-list input { width: 120px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; text-align: right; }
.assumption-list input:disabled { color: #9ca7a1; background: #f2f4f1; cursor: not-allowed; }
.cost-actions { margin-top: 22px; }
.compact-modal { width: min(500px, calc(100vw - 32px)); }
.access-modal { width: min(460px, calc(100vw - 32px)); }
.access-description { margin: 24px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.access-password-field { margin-top: 20px; display: grid; gap: 8px; }
.access-password-field span { color: var(--muted); font-size: 10px; font-weight: 750; }
.access-password-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 14px; letter-spacing: .08em; }
.access-password-field input:focus { border-color: #55a879; outline: 3px solid rgba(85,168,121,.14); }
.access-error { margin: 9px 0 0; color: var(--red); font-size: 10px; font-weight: 750; }
.access-actions { grid-template-columns: 1fr 1fr auto auto; }
.access-actions .button:disabled { opacity: .58; cursor: wait; }
.export-options { margin-top: 24px; display: grid; gap: 8px; }
.export-options button, .import-option { min-height: 75px; padding: 15px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfa; text-align: left; }
.export-options b { font-size: 12px; }
.export-options small { color: var(--muted); font-size: 9px; }
.export-options span { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--green); font-size: 18px; }
.import-option { position: relative; cursor: pointer; }
.import-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.save-name { margin-top: 25px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 17px; border-radius: 11px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  .margin-stage { justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .workspace-grid { grid-template-columns: 1fr 1fr; }
  .reference-panel { grid-column: 1 / -1; min-height: 210px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-actions { width: 100%; }
  .search-box { flex: 1; }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 112px; padding: 10px 16px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 8px 12px; }
  .brand { grid-column: 1 / -1; }
  .brand small { display: none; }
  .topbar-actions { width: 100%; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); gap: 6px; }
  .scenario-select-wrap { width: 100%; max-width: none; min-width: 0; height: 38px; padding: 0 9px; }
  .scenario-select-wrap select { width: 100%; max-width: none; min-width: 0; }
  .topbar .button { min-height: 38px; padding: 0 11px; }
  main { padding-inline: 16px; }
  .hero { min-height: auto; padding: 38px 0 32px; }
  .margin-stage { grid-template-columns: 180px 1fr; gap: 18px; }
  .margin-ring { width: 180px; }
  .margin-ring::before { width: 156px; }
  .margin-ring-inner strong { font-size: 36px; }
  .margin-formula b { font-size: 13px; }
  .kpi-grid, .workspace-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 132px; }
  .reference-panel { grid-column: auto; }
  .people-section { margin-top: 58px; }
  .section-actions { flex-wrap: wrap; }
  .search-box { min-width: 100%; }
  .source-alert { align-items: start; }
  .table-footer, footer { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .replacement-grade-grid { grid-template-columns: 1fr; }
  .replacement-preview { grid-template-columns: 1fr; }
  .modal form { padding: 22px; }
  .mini-stats { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .cost-summary { grid-template-columns: 1fr 1fr; }
  .customer-showing-controls { grid-template-columns: 1fr; }
  .customer-showing-metrics { grid-template-columns: 1fr 1fr; }
  .transport-toggle-list { grid-template-columns: 1fr; }
  .rate-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .brand strong { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .scenario-select-wrap { display: flex; }
  .scenario-select-wrap span { display: none; }
  .topbar-actions { grid-template-columns: minmax(0, 1fr) repeat(3, auto); }
  .topbar .button { padding-inline: 8px; font-size: 10px; }
  .margin-stage { grid-template-columns: 1fr; }
  .margin-ring { margin: 0 auto; }
  .margin-formula { grid-template-columns: 1fr auto; }
  .margin-formula i { display: none; }
  .panel { padding: 22px; }
  .cost-summary { padding: 12px; }
  .cost-summary p { display: grid; gap: 4px; }
  .customer-showing-policy { padding-inline: 15px; }
  .customer-showing-metrics > div { padding-inline: 9px; }
  .assumption-group { padding-inline: 15px; }
  .assumption-list label { grid-template-columns: 1fr 104px; }
  .assumption-list input { width: 104px; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .55s both; }
  .reveal:nth-of-type(2) { animation-delay: .06s; }
  .reveal:nth-of-type(3) { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
