:root {
  --ink: #17332d;
  --muted: #687872;
  --green: #175c4b;
  --green-dark: #12372f;
  --mint: #dff4e9;
  --mint-strong: #8dd9b9;
  --cream: #f7f4eb;
  --paper: #fffefa;
  --yellow: #fff1a8;
  --yellow-line: #e3c857;
  --red: #c34a46;
  --blue-gray: #e9eff7;
  --line: #dbe3df;
  --shadow: 0 22px 60px rgba(25, 59, 49, .09);
}

* { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body { max-width: 100%; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--cream); font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif; line-height: 1.5; }
button, input, select { font: inherit; }
button, input, select, summary { touch-action: manipulation; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(23, 92, 75, .25); outline-offset: 2px; }

.site-header { height: 78px; padding: 0 max(24px, calc((100vw - 1380px) / 2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255, 254, 250, .95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--green-dark); color: #fff; border-radius: 13px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.basis-badge { border: 1px solid #c6ddd3; color: var(--green); background: #f4fbf7; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

main { max-width: 1380px; margin: 0 auto; padding: 0 24px 80px; }
.hero { margin: 30px 0 22px; min-height: 260px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 44px; align-items: center; padding: 42px 48px; color: #fff; background: var(--green-dark); border-radius: 28px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 420px; height: 420px; border: 70px solid rgba(141, 217, 185, .11); border-radius: 50%; right: -170px; top: -210px; }
.hero-copy, .hero-control { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; color: #b8ead5; font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 12px; }
h1 { margin: 0; font-size: clamp(35px, 4vw, 56px); line-height: 1.12; letter-spacing: -.055em; }
h1 em { color: #9ce1c4; font-style: normal; }
.hero-copy p { max-width: 700px; margin: 20px 0 0; color: #d8e6e1; font-size: 15px; }
.hero-control { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 22px; }
.quick-title { display: block; font-size: 12px; font-weight: 800; color: #bfe8d7; margin-bottom: 9px; }
.quick-scenario-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.quick-field { display: block; min-width: 0; }
.quick-field > span { display: block; margin-bottom: 5px; color: #d8e6e1; font-size: 10px; font-weight: 750; }
.quick-field input { width: 100%; min-width: 0; height: 44px; border: 0; border-radius: 11px; padding: 0 42px 0 12px; background: #fff; color: var(--ink); text-align: right; }
.quick-field .unit-input b { color: #5e706a; }
.quick-scenario-grid .button { min-height: 44px; }
.quick-help { margin: 9px 0 0; color: #b7cbc3; font-size: 10px; }
.text-button { padding: 12px 0 0; border: 0; background: transparent; color: #d8e6e1; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.button { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 750; font-size: 13px; }
.button-primary { background: #9ce1c4; color: var(--green-dark); }
.button-quiet { color: var(--green); background: #edf6f2; border: 1px solid #d3e7de; }
.button-download { width: 100%; padding: 14px; color: #fff; background: var(--green); margin-top: 20px; }

.workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.model-column, .result-column { min-width: 0; }
.model-column { display: grid; gap: 18px; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: 0 10px 32px rgba(36, 69, 59, .045); }
.panel-heading, .heading-group { display: flex; align-items: flex-start; gap: 14px; }
.panel-heading { margin-bottom: 22px; }
.panel-heading.with-action { justify-content: space-between; align-items: center; }
.step { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--green); background: var(--mint); font-size: 12px; font-weight: 900; }
.panel h2 { font-size: 20px; letter-spacing: -.025em; margin: 1px 0 3px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid.three { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 7px; color: #4f635c; font-weight: 700; font-size: 12px; }
.field select, .field input { width: 100%; min-width: 0; height: 44px; border: 1px solid var(--yellow-line); border-radius: 10px; background: #fffbed; color: var(--ink); padding: 0 12px; }
.unit-input { min-width: 0; position: relative; }
.unit-input input { padding-right: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.unit-input b { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #7b7046; font-size: 11px; pointer-events: none; }
.switch-field { display: grid; grid-template-columns: 1fr auto; align-content: center; background: #f6f8f7; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.switch-field > span { margin: 0; }
.switch-field small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; margin-top: 3px; }
.switch-field input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-field i { width: 42px; height: 24px; border-radius: 999px; background: #b9c5c0; position: relative; transition: .2s; }
.switch-field i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch-field input:checked + i { background: var(--green); }
.switch-field input:checked + i::after { transform: translateX(18px); }
.inline-note { margin: 14px 0 0; color: var(--muted); background: #f6f8f7; border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.allowance-guide { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 1px solid #cfe2d9; border-radius: 11px; background: #f3faf7; }
.allowance-guide strong { color: var(--green); font-size: 11px; white-space: nowrap; }
.allowance-guide span { color: #5c7069; font-size: 11px; overflow-wrap: anywhere; }

.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
.data-table, .scenario-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td, .scenario-table th, .scenario-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: right; font-size: 12px; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child, .scenario-table th:first-child, .scenario-table td:first-child { text-align: left; }
.data-table thead th, .scenario-table thead th { color: #52665f; background: #f2f6f4; font-weight: 800; }
.data-table thead th:first-child, .scenario-table thead th:first-child { border-radius: 10px 0 0 10px; }
.data-table thead th:last-child, .scenario-table thead th:last-child { border-radius: 0 10px 10px 0; }
.data-table tfoot th, .data-table tfoot td { font-weight: 850; color: var(--green-dark); background: var(--mint); border-bottom: 0; }
.table-input { width: 88px; height: 34px; text-align: right; background: #fffbed; border: 1px solid #eadb8a; border-radius: 7px; padding: 0 7px; }
.table-input.short { width: 66px; }
.table-input:disabled { background: #f1f4f2; border-color: #dce3e0; color: #66756f; }
.grade-pill { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; font-weight: 850; background: var(--blue-gray); color: #38536f; }
.validation-message { margin: 10px 0 0; min-height: 18px; font-size: 12px; color: var(--red); }
.service-controls { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; margin-bottom: 16px; }
.service-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.service-kpis > div { min-height: 88px; padding: 14px; background: #f4f7f5; border: 1px solid var(--line); border-radius: 13px; }
.service-kpis > div.accent { background: var(--mint); border-color: #b9e0cf; }
.service-kpis span, .service-kpis strong, .service-kpis small { display: block; }
.service-kpis span { color: var(--muted); font-size: 10px; font-weight: 750; }
.service-kpis strong { margin-top: 6px; color: var(--green-dark); font-size: 18px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.service-kpis small { margin-top: 2px; color: #537066; font-size: 9px; }
.service-table { min-width: 900px; }
.service-table tr.selected-row th, .service-table tr.selected-row td { background: #effbea; color: var(--green-dark); font-weight: 800; }

.cost-groups { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cost-group { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.cost-group h3 { margin: 0; padding: 10px 12px; background: var(--blue-gray); color: #3c5269; font-size: 12px; }
.cost-row { min-width: 0; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, 42%); gap: 10px; align-items: center; padding: 6px 9px 6px 12px; border-top: 1px solid #edf0ef; }
.cost-row span { min-width: 0; font-size: 12px; color: #40544d; overflow-wrap: anywhere; }
.cost-row small { display: block; color: var(--muted); font-size: 10px; }
.cost-row .unit-input { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; overflow: hidden; background: #fffbed; border: 1px solid var(--yellow-line); border-radius: 8px; }
.cost-row .unit-input input { width: 100%; min-width: 0; height: 36px; padding: 0 3px 0 7px; border: 0; outline: 0; background: transparent; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.cost-row .unit-input b { position: static; transform: none; padding-right: 7px; text-align: right; }
.cost-row .unit-input:focus-within { outline: 3px solid rgba(23, 92, 75, .2); outline-offset: 1px; }

.result-column { position: sticky; top: 98px; }
.result-card { color: #fff; background: var(--green-dark); border-radius: 24px; padding: 25px; box-shadow: var(--shadow); }
.result-card-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.result-card-heading span:first-child { display: block; color: #9fceb9; font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.result-card-heading h2 { margin: 4px 0 0; font-size: 19px; }
.live-dot { color: #bce8d4; background: rgba(156, 225, 196, .12); border: 1px solid rgba(156, 225, 196, .22); border-radius: 999px; padding: 5px 8px; font-size: 10px; }
.primary-result { margin: 24px 0 18px; padding: 19px; color: var(--green-dark); background: #9ce1c4; border-radius: 16px; }
.primary-result span, .take-home span { font-size: 11px; font-weight: 800; }
.primary-result strong { display: block; margin: 3px 0 1px; font-size: 31px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.primary-result small { color: #315d4e; font-size: 11px; }
.primary-result.negative { background: #ffd6cd; color: #772b28; }
.primary-result.negative small { color: #93514e; }
.result-list { margin: 0; }
.result-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.result-list dt { color: #b8cbc4; font-size: 12px; }
.result-list dd { margin: 0; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.result-list .total { padding-top: 12px; border-bottom: 0; }
.result-list .total dt, .result-list .total dd { color: #fff; font-weight: 850; }
.take-home { margin: 15px 0; padding: 14px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.07); border-radius: 13px; }
.take-home strong { display: block; margin: 2px 0; color: #f9dc72; font-size: 20px; font-variant-numeric: tabular-nums; }
.take-home small { display: block; color: #aabdb6; font-size: 9px; }
.break-even { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.break-even div { padding: 11px; background: rgba(255,255,255,.06); border-radius: 11px; }
.break-even span, .break-even strong { display: block; }
.break-even span { color: #aabdb6; font-size: 10px; }
.break-even strong { margin-top: 3px; font-size: 16px; }
.bar-visual { margin-top: 16px; }
.bar-labels { display: flex; justify-content: space-between; color: #aabdb6; font-size: 9px; }
.stacked-bar { display: flex; height: 8px; margin-top: 7px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.12); }
.stacked-bar i { display: block; min-width: 0; transition: width .25s ease; }
#laborBar { background: #73b99d; } #costBar { background: #f3cd6b; } #profitBar { background: #fff; }
.saved-status { margin: 9px 0 0; text-align: center; color: #8fa69e; font-size: 9px; }

.scenario-table { min-width: 620px; }
.scenario-table td.positive { color: var(--green); font-weight: 850; }
.scenario-table td.negative { color: var(--red); font-weight: 850; }
.notes-panel { overflow: hidden; background: #eef2ef; border: 1px solid #dae3de; border-radius: 19px; color: #52645e; }
.notes-heading { padding: 22px 24px 17px; background: var(--green-dark); color: #fff; }
.notes-heading span { color: #9fceb9; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.notes-heading h2 { margin: 4px 0 2px; font-size: 19px; }
.notes-heading p { margin: 0; color: #bed0c9; font-size: 11px; }
.notes-panel details { border-top: 1px solid #d8e0dc; }
.notes-panel summary { padding: 13px 20px; color: var(--green-dark); background: #f5f7f5; font-size: 12px; font-weight: 800; cursor: pointer; }
.notes-panel details > div { padding: 3px 20px 13px; font-size: 11px; }
.notes-panel p { margin: 8px 0; }
footer { max-width: 1380px; margin: 0 auto; padding: 25px 24px 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
footer a { color: var(--green); }

@media (max-width: 1060px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .workspace { grid-template-columns: 1fr; }
  .result-column { position: static; order: -1; }
  .result-card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .result-card-heading, .primary-result, .take-home, .bar-visual, .button-download, .saved-status { grid-column: 1 / -1; }
  .field-grid.three { grid-template-columns: repeat(2, 1fr); }
  .service-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  main { padding-inline: 16px; }
  .field-grid, .field-grid.three, .service-controls { grid-template-columns: 1fr !important; }
  .cost-groups { grid-template-columns: 1fr; }
  .service-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allowance-guide { grid-template-columns: 1fr; }
  .allowance-guide strong { white-space: normal; }
}
@media (max-width: 700px) {
  .site-header { height: 68px; padding: 0 16px; }
  .brand small, .basis-badge { display: none; }
  main { padding: 0 10px 55px; }
  h1 { font-size: clamp(31px, 9.5vw, 40px); }
  .hero { margin-top: 12px; padding: 27px 18px; border-radius: 18px; }
  .hero-copy p { font-size: 13px; }
  .quick-scenario-grid { grid-template-columns: 1fr 1fr; }
  .quick-scenario-grid .button { grid-column: 1 / -1; }
  .panel { padding: 18px 12px; border-radius: 16px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .service-controls { grid-template-columns: 1fr !important; }
  .service-kpis { grid-template-columns: repeat(2, 1fr); }
  .panel-heading.with-action { align-items: flex-start; gap: 12px; }
  .heading-group { gap: 10px; }
  .result-card { display: block; padding: 22px; }
  .result-card > * + * { margin-top: 14px; }
  footer { display: block; padding: 20px 16px 30px; }
}
@media (max-width: 430px) {
  .site-header { padding-inline: 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand strong { font-size: 13px; }
  .header-actions { gap: 6px; }
  .header-actions .button { padding-inline: 10px; }
  .quick-scenario-grid { grid-template-columns: 1fr; }
  .quick-scenario-grid .button { grid-column: auto; }
  .panel-heading, .heading-group { gap: 9px; }
  .panel-heading.with-action { display: grid; }
  .panel-heading.with-action .button { width: 100%; min-height: 42px; }
  .panel h2 { font-size: 18px; }
  .panel-heading p { font-size: 12px; }
  .step { width: 32px; height: 32px; }
  .service-kpis { grid-template-columns: 1fr; }
  .service-kpis > div { min-height: 72px; }
  .primary-result strong { font-size: 27px; }
  .break-even { grid-template-columns: 1fr; }
  .cost-row { grid-template-columns: minmax(0, 1fr) minmax(108px, 44%); padding-left: 10px; }
  .notes-heading { padding: 19px 16px 15px; }
  .notes-panel summary { padding-inline: 14px; }
  .notes-panel details > div { padding-inline: 14px; }
}
@media print {
  .site-header, .hero-control, .button, .text-button, .saved-status { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .hero { min-height: 0; margin: 0 0 15px; padding: 24px; color: #000; background: #fff; border: 2px solid #17332d; box-shadow: none; }
  .hero-copy p { color: #333; }
  h1 em { color: #175c4b; }
  .workspace { display: block; }
  .result-column { position: static; margin-bottom: 15px; }
  .result-card { color: #000; background: #fff; border: 2px solid #17332d; box-shadow: none; }
  .model-column { display: block; }
  .panel { box-shadow: none; break-inside: avoid; margin-bottom: 12px; }
}
