:root {
  color-scheme: light;
  --ink: #102a29;
  --deep: #0c2423;
  --dark: #112f2d;
  --muted: #536765;
  --paper: #f4f6f2;
  --white: #fff;
  --line: #d6dfd8;
  --accent: #f8c660;
  --accent-dark: #9a5709;
  --error: #9b2523;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ad640b; outline-offset: 3px; }
a { color: inherit; }
.shell { width: min(100% - 64px, 1184px); margin-inline: auto; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 5; background: white; padding: 12px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.topbar { background: var(--deep); color: white; border-bottom: 1px solid #34504b; }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 69px; }
.wordmark, .summary-brand { font-weight: 850; font-size: 29px; letter-spacing: -.09em; line-height: 1; }
.wordmark { text-decoration: none; }
.wordmark span, .summary-brand span, h1 span { color: var(--accent); }
.header-label { color: #bbcac6; border-left: 1px solid #43605a; padding-left: 20px; font-size: .82rem; }
.quiet-button { margin-left: auto; color: #e8eeeb; background: transparent; border: 1px solid #4e6862; border-radius: 6px; padding: 9px 13px; font-size: .82rem; font-weight: 650; }
.quiet-button:hover { background: #25433e; }

.hero { background: var(--deep); color: white; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; min-height: 363px; }
.hero-copy { padding: 43px 26px 42px 0; align-self: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; font-size: .69rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 750; color: #c3d6ce; }
.eyebrow span { width: 18px; height: 2px; background: var(--accent); }
h1 { margin: 0; font-size: clamp(3rem, 6.3vw, 5.75rem); font-weight: 790; line-height: .96; letter-spacing: -.077em; }
.hero-copy > p:not(.eyebrow) { margin: 20px 0 18px; max-width: 350px; color: #ccdad4; line-height: 1.53; font-size: .96rem; }
.hero-link { font-size: .82rem; font-weight: 700; color: var(--accent); text-underline-offset: 4px; }
.hero-link span { margin-left: 4px; }
.hero-image { position: relative; overflow: hidden; min-width: 0; margin: 0; min-height: 100%; background: white; border-radius: 8px 8px 0 0; }
.machine-photo { display: block; position: absolute; top: 0; left: 0; width: 78%; height: 100%; object-fit: contain; }
.machine-detail { position: absolute; overflow: hidden; right: 5%; bottom: 16%; width: 29%; height: 30%; background: #f2f5f0; border: 1px solid #d1ddd4; border-radius: 7px; }
.machine-detail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.machine-detail span { position: absolute; left: 0; right: 0; bottom: 0; background: #0c2423e8; color: #fff; padding: 5px 8px; font-size: .65rem; }
.hero-image figcaption { position: absolute; right: 5%; bottom: 5%; font-size: .73rem; font-weight: 670; color: #3a5850; }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .41fr); align-items: start; gap: 32px; padding-block: 40px 62px; }
.form-section { padding: 0 0 28px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 24px; }
.section-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 15px; }
.step { background: #e5ece4; border: 1px solid #d7e2d9; border-radius: 4px; color: #36534d; min-width: 28px; min-height: 25px; display: grid; place-items: center; font-size: .7rem; font-weight: 770; font-variant-numeric: tabular-nums; }
h2 { margin: 0; font-size: 1.39rem; line-height: 1.15; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 1rem; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.model-card { position: relative; display: block; min-width: 0; padding: 16px 14px; background: white; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.model-card:hover { border-color: #79928a; }
.model-card:has(:checked) { border-color: #266352; background: #eef5ec; box-shadow: inset 0 0 0 1px #266352; }
.model-card:has(:focus-visible) { outline: 3px solid #ad640b; outline-offset: 3px; }
.model-card .model-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.model-card strong { display: block; line-height: 1.12; font-size: 1.12rem; letter-spacing: -.035em; }
input[type="radio"], input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; flex: none; accent-color: #246b58; }
.model-features { display: block; font-weight: 450; color: var(--muted); font-size: .77rem; line-height: 1.48; }

.process-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; }
.product-field { grid-column: 1 / -1; }
label { display: block; font-size: .83rem; font-weight: 690; }
input:not([type="radio"], [type="checkbox"]), select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #bacac1; border-radius: 6px; background: white; color: var(--ink); font-weight: 450; }
label > input:not([type="radio"], [type="checkbox"]), label > select, label > .unit-input { margin-top: 6px; }
input::placeholder { color: #6b7d76; opacity: 1; }
.unit-input { display: flex; align-items: center; position: relative; }
.unit-input input { padding-right: 70px; }
.unit-input span { position: absolute; right: 10px; color: #435f57; font-size: .77rem; pointer-events: none; }
[aria-invalid="true"]:not(fieldset) { border-color: var(--error) !important; }

.option-list { display: grid; gap: 8px; }
.option { display: flex; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.option:has(:checked) { border-color: #498172; background: #f5faf3; }
.option input { margin-top: 1px; }
.option > span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.option small, label small { display: block; margin-top: 4px; color: var(--muted); font-weight: 450; line-height: 1.4; }
.option-price { margin-inline-start: auto; color: #285c4f; font-size: .77rem; white-space: nowrap; }
.option-group { border: 1px solid var(--line); margin: 10px 0 0; border-radius: 6px; padding: 9px 12px; font-size: .81rem; }
.option-group legend { padding: 0 4px; font-weight: 750; }
.option-group[aria-invalid="true"] { border-color: var(--error); }
.muted { color: var(--muted); font-size: .85rem; line-height: 1.48; margin: 7px 0; }

.summary { position: sticky; top: 22px; background: var(--dark); border: 1px solid #284940; color: white; border-radius: 10px; padding: 24px; box-shadow: 0 5px 20px #183e2520; }
.summary-brand { font-size: 19px; color: #e8eeeb; margin: 0 0 12px; }
.summary h2 { font-size: 1.44rem; }
.summary-list { margin: 17px 0 0; font-size: .82rem; }
.summary-list > div { display: grid; grid-template-columns: .85fr 1.15fr; gap: 8px; border-bottom: 1px solid #35524a; padding: 9px 0; }
.summary-list dt { color: #c5d4ce; }
.summary-list dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.summary-prices { display: grid; gap: 7px; margin: 14px 0; }
.summary-price { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: .81rem; }
.summary-price strong { text-align: right; }
.summary-total { border-top: 1px solid #35524a; padding-top: 9px; font-weight: 750; }
.summary-total strong { color: var(--accent); font-size: 1.14rem; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding: 9px 13px; border: 1px solid transparent; border-radius: 6px; font-size: .85rem; font-weight: 750; }
.primary-button { color: #132a23; background: var(--accent); }
.primary-button:hover:not(:disabled) { background: #ffda8b; }
.summary .primary-button { width: 100%; justify-content: space-between; }
.summary .primary-button span { font-size: 1.12rem; }
.summary .message.error { color: #ffd7cc; }
.secondary-button { color: var(--ink); border-color: #afc1b6; background: #fff; }
.secondary-button:hover:not(:disabled) { background: #eef4ef; }
.message { font-size: .83rem; line-height: 1.4; margin: 10px 0 0; }
.error { color: var(--error); }

.footer { background: #e8eee7; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; align-items: center; min-height: 56px; color: #405953; font-size: .76rem; }
.footer a { text-underline-offset: 3px; }
.footer img { display: block; width: 98px; height: auto; }

dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 70px #061c1c40; }
dialog::backdrop { background: #081e1cc7; }
.admin-dialog { width: min(calc(100% - 24px), 720px); }
.dialog-header, .dialog-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-header { margin-bottom: 18px; }
.dialog-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.close-button { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.27rem; line-height: 1; }
.close-button:hover { background: #e6eee7; }
#admin-login p { color: var(--muted); }
#admin-login button { margin-top: 14px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 13px; }
.admin-toolbar label { width: min(100%, 260px); }
.admin-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 17px; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.admin-row { margin: 9px 0 0; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.admin-row > label + label { margin-top: 7px; }
.option-copy { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.option-copy summary { cursor: pointer; font-size: .83rem; font-weight: 690; }
.copy-targets { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 9px; }
.copy-targets label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; }
.copy-targets label:has(:disabled) { color: var(--muted); }
.remove-button { min-height: 34px; margin-top: 8px; padding: 5px 9px; color: var(--error); border: 1px solid #dfc7c3; border-radius: 5px; background: #fff; font-size: .8rem; }
.remove-button:hover { background: #fff2ec; }
.result-details { margin: 0; font-size: .91rem; }
.result-details div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.result-details dd { font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.print-title { margin: 0 0 22px; font-size: 2.15rem; }
#print-sheet { display: none; }

@media (max-width: 900px) {
  .shell { width: min(100% - 40px, 1184px); }
  .page-grid { gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(245px, .51fr); }
  .summary { padding: 17px; }
  .model-card { padding: 13px 9px; }
  .model-card strong { font-size: 1rem; }
}
@media (max-width: 700px) {
  .hero-inner, .page-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 33px 0 27px; }
  .hero-image { min-height: 210px; aspect-ratio: 1.8; }
  .machine-detail { height: 37%; }
  .page-grid { padding-block: 28px; }
  .form-section:last-child { padding-bottom: 0; }
  .summary { position: static; }
}
@media (max-width: 400px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { gap: 10px; min-height: 59px; }
  .header-label { display: none; }
  .model-grid, .process-grid { grid-template-columns: 1fr; }
  dialog { padding: 15px; }
}
@media print {
  body > :not(#print-sheet) { display: none !important; }
  #print-sheet { display: block; }
  .result-details { break-inside: avoid; }
}
