:root {
  --ink: #17211b;
  --paper: #f3f0e8;
  --paper-deep: #e9e4d8;
  --accent: #a63f22;
  --accent-soft: #f8d9c9;
  --line: rgba(23, 33, 27, 0.17);
  --muted: #626963;
  --white: #fffefa;
  --shadow: 0 26px 70px rgba(30, 37, 31, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 18px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.header-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3c8b58;
  box-shadow: 0 0 0 4px rgba(60, 139, 88, 0.13);
}

.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 510px;
  margin: 0 auto;
  padding: 88px 0 76px;
  position: relative;
}

.hero::after {
  content: "₩";
  position: absolute;
  right: 1%;
  bottom: 0;
  color: rgba(23, 33, 27, 0.045);
  font-family: Georgia, serif;
  font-size: clamp(280px, 37vw, 520px);
  line-height: 0.8;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.19em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-size: clamp(58px, 8.2vw, 112px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.hero h1 em { color: var(--accent); font-style: italic; }

.hero-copy {
  position: absolute;
  right: 1%;
  top: 120px;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.calculator-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 150px;
  position: relative;
  z-index: 2;
  background: var(--white);
  border: 1px solid rgba(23, 33, 27, 0.09);
  box-shadow: var(--shadow);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.mode-button {
  height: 72px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.mode-button + .mode-button { border-left: 1px solid var(--line); }
.mode-button.is-active { color: var(--white); background: var(--ink); }
.mode-button:disabled, .result-actions button:disabled { cursor: not-allowed; opacity: .55; }
.mode-button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr); }
.input-panel { padding: 52px; }

.section-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.section-heading--spaced { margin-top: 54px; }
.section-heading > span {
  padding-top: 4px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.section-heading p { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -0.045em; }

.auction-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.auction-card {
  min-height: 122px;
  padding: 17px 15px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.auction-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.auction-card.is-selected { color: var(--white); background: var(--ink); border-color: var(--ink); }
.auction-card input { position: absolute; opacity: 0; pointer-events: none; }
.auction-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.auction-name { font-size: 13px; font-weight: 850; }
.auction-type { margin-top: 2px; color: var(--muted); font-size: 11px; }
.is-selected .auction-type { color: rgba(255,255,255,.6); }
.auction-card strong { margin-top: auto; font-family: Georgia, serif; font-size: 18px; }
.auction-card strong small { display: block; margin-top: 2px; color: var(--muted); font-family: inherit; font-size: 9px; opacity: 1; }
.auction-card.is-selected strong small { color: #c8cec9; }

.custom-rate {
  margin-top: 12px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--paper);
}

.custom-rate label { display: grid; gap: 8px; font-size: 12px; font-weight: 800; }
.custom-field { min-width: 0; }
.custom-rate input, .custom-rate select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 0 12px;
}
.input-suffix-wrap { position: relative; }
.input-suffix-wrap span { position: absolute; right: 12px; top: 13px; color: var(--muted); }

.field-help, .field-error {
  display: block;
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.45;
}
.field-help { color: var(--muted); }
.field-error { color: #a62e20; font-weight: 800; }
.custom-field .field-help, .custom-field .field-error { margin-top: 6px; }
[aria-invalid="true"] { border-color: #b43b2b !important; box-shadow: inset 0 -2px #b43b2b; }

.money-field { display: block; }
.money-field > span:first-child { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 750; }
.money-input-wrap { position: relative; display: block; }
.money-input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 48px 0 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 21px;
  font-weight: 800;
  text-align: right;
}
.money-input-wrap b { position: absolute; right: 14px; top: 19px; font-size: 13px; }
.money-field--primary .money-input-wrap input { height: 78px; padding-right: 54px; background: var(--paper); font-family: Georgia, serif; font-size: 34px; }
.money-field--primary .money-input-wrap b { top: 30px; right: 18px; }

.quick-amounts { margin-top: 10px; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.quick-amounts button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.quick-amounts button:hover { color: var(--ink); border-color: var(--ink); }

.extra-costs { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.result-panel {
  min-width: 0;
  padding: 48px 42px;
  color: var(--white);
  background: var(--ink);
  display: flex;
  flex-direction: column;
}
.result-panel > * { min-width: 0; }
.result-topline { display: flex; justify-content: space-between; color: rgba(255,255,255,.55); font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.total-block { padding: 58px 0 38px; border-bottom: 1px solid rgba(255,255,255,.16); }
.total-block p { margin: 0 0 14px; color: rgba(255,255,255,.58); font-size: 13px; }
.total-block strong { display: block; max-width: 100%; color: var(--accent-soft); font-family: Georgia, serif; font-size: clamp(30px, 4vw, 53px); font-weight: 500; letter-spacing: -.05em; white-space: nowrap; }
.total-block strong small { margin-left: 5px; font-family: sans-serif; font-size: 13px; }
.total-block > span { display: block; margin-top: 12px; color: rgba(255,255,255,.6); font-size: 11px; }
.total-block .bid-unit-notice { color: var(--accent-soft); line-height: 1.55; }

.breakdown { padding: 30px 0 22px; border-bottom: 1px solid rgba(255,255,255,.16); }
.breakdown div { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; font-size: 12px; }
.breakdown span { color: rgba(255,255,255,.56); }
.breakdown b { font-weight: 700; }
.formula-note { padding: 23px 0 28px; }
.formula-note span { color: var(--accent-soft); font-size: 10px; font-weight: 850; }
.formula-note p { margin: 7px 0 0; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.55; }

.result-actions { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.result-actions button { height: 48px; border: 0; cursor: pointer; font-size: 12px; font-weight: 850; }
.primary-action { background: var(--accent); color: var(--white); }
.primary-action span { margin-right: 5px; }
.secondary-action { padding: 0 17px; color: var(--white); background: rgba(255,255,255,.1); }
.copy-status { min-height: 14px; margin: 8px 0 0; color: var(--accent-soft); font-size: 10px; text-align: center; }
.copy-fallback { margin-top: 10px; }
.copy-fallback label { display: block; margin-bottom: 6px; color: var(--accent-soft); font-size: 10px; font-weight: 800; }
.copy-fallback textarea {
  width: 100%;
  padding: 10px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.3);
  color: var(--ink);
  background: var(--white);
  font-size: 11px;
  line-height: 1.5;
}

.guide-section, .source-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 100px;
}
.guide-section { padding-bottom: 150px; }
.guide-title h2, .source-section h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(34px, 4.2vw, 58px); font-weight: 500; letter-spacing: -.05em; line-height: 1.08; }
.guide-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.guide-list li { padding: 27px 0; display: grid; grid-template-columns: 52px 1fr; border-bottom: 1px solid var(--line); }
.guide-list li > span { color: var(--accent); font-family: Georgia, serif; font-size: 13px; }
.guide-list strong { font-size: 16px; }
.guide-list p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.source-section { padding: 90px 0; border-top: 1px solid var(--line); }
.source-date { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.source-links { border-top: 1px solid var(--line); }
.source-links a { padding: 21px 4px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: none; }
.source-links a:hover span { color: var(--accent); }

footer {
  margin-top: 40px;
  padding: 55px max(20px, calc((100vw - 1180px) / 2));
  color: rgba(255,255,255,.58);
  background: var(--ink);
  display: grid;
  grid-template-columns: .65fr 1.4fr .65fr;
  gap: 50px;
  align-items: start;
  font-size: 10px;
  line-height: 1.7;
}
.brand--footer { color: var(--white); }
.brand--footer .brand-mark { color: var(--ink); background: var(--paper); }
footer p { margin: 0; }
footer > span { text-align: right; }

@media (max-width: 980px) {
  .hero-copy { position: static; margin-top: 35px; }
  .calculator-grid { grid-template-columns: 1fr; }
  .result-panel { min-height: 610px; }
  .auction-options { grid-template-columns: repeat(3, 1fr); }
  .guide-section, .source-section { gap: 50px; }
}

@media (max-width: 680px) {
  .site-header { width: calc(100% - 28px); height: 72px; }
  .header-badge { display: none; }
  .hero { width: calc(100% - 32px); min-height: 420px; padding: 65px 0 55px; }
  .hero::after { font-size: 250px; }
  .hero h1 { font-size: 54px; }
  .hero-copy { font-size: 14px; }
  .calculator-shell { width: 100%; margin-bottom: 100px; border-left: 0; border-right: 0; }
  .mode-button { height: 62px; padding: 0 15px; font-size: 12px; }
  .input-panel { padding: 36px 20px 44px; }
  .auction-options { grid-template-columns: repeat(2, 1fr); }
  .auction-card { min-height: 108px; }
  .auction-card--custom { grid-column: 1 / -1; min-height: 90px; }
  .custom-rate { grid-template-columns: 1fr; }
  .section-heading--spaced { margin-top: 42px; }
  .section-heading h2 { font-size: 19px; }
  .money-field--primary .money-input-wrap input { font-size: 29px; }
  .extra-costs { grid-template-columns: 1fr; }
  .result-panel { min-height: 590px; padding: 38px 24px; }
  .total-block { padding-top: 48px; }
  .total-block strong { font-size: clamp(27px, 9vw, 40px); }
  .guide-section, .source-section { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 42px; }
  .guide-section { padding-bottom: 100px; }
  .source-section { padding: 70px 0; }
  footer { grid-template-columns: 1fr; gap: 25px; padding: 45px 20px; }
  footer > span { text-align: left; }
}

@media (max-width: 360px) {
  .hero { min-height: 390px; }
  .hero h1 { font-size: 48px; }
  .mode-button { padding: 0 9px; font-size: 11px; line-height: 1.35; }
  .input-panel { padding-right: 16px; padding-left: 16px; }
  .auction-card { padding: 15px 12px; }
  .money-field--primary .money-input-wrap input { padding-right: 45px; font-size: 25px; }
  .result-panel { padding-right: 18px; padding-left: 18px; }
  .result-topline { gap: 10px; }
  .breakdown div { gap: 10px; }
  .result-actions { grid-template-columns: 1fr; }
  .secondary-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .hero, .guide-section, .source-section, footer, .input-panel, .mode-switch, .result-actions { display: none !important; }
  body, .calculator-shell, .result-panel { background: white; color: black; box-shadow: none; }
  .calculator-shell { width: 100%; margin: 0; border: 0; }
  .calculator-grid { display: block; }
  .result-panel { min-height: 0; }
}
