:root {
  --red: #e31837;
  --red-dark: #bd102a;
  --red-soft: #fff1f3;
  --navy: #111123;
  --ink: #20202c;
  --muted: #626574;
  --line: #e3e4e8;
  --soft: #f5f6f8;
  --green: #16784a;
  color: var(--ink);
  background: var(--soft);
  font: 14px/1.5 "Be Vietnam Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--soft); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ff8da0; outline-offset: 2px; }
.page { width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 36px; }
.intro { margin-bottom: 18px; }
.intro p { max-width: 820px; margin: 0; color: var(--muted); }
.intro .eyebrow { margin-bottom: 4px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0 0 6px; font-size: clamp(28px, 4vw, 43px); line-height: 1.14; letter-spacing: -.035em; }
h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; }
.config-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #ead199; border-radius: 10px; background: #fff8e8; color: #805100; }
.config-status.error { border-color: #f1a7b3; background: var(--red-soft); color: var(--red-dark); }
.retry { min-height: 38px; padding: 0 13px; border: 1px solid currentColor; border-radius: 8px; background: #fff; color: inherit; font-weight: 800; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 8px 28px rgba(17,17,35,.08); }
.booking { overflow: hidden; }
.step-nav { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); background: #fafafb; }
.step-tab { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; }
.step-tab:last-child { border-right: 0; }
.step-tab[aria-current="step"] { background: #fff; color: var(--red); box-shadow: inset 0 -3px var(--red); }
.step-tab span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #e9e9ed; font-size: 12px; }
.step-tab[aria-current="step"] span { background: var(--red); color: #fff; }
.step-panel { padding: 20px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 10px; font-weight: 800; }
hr { height: 1px; margin: 18px 0; border: 0; background: var(--line); }
.services { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.service { position: relative; }
.service-check { position: absolute; opacity: 0; pointer-events: none; }
.service-card { position: relative; min-height: 76px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.service-label { min-width: 0; display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.service-label::after { content: ""; position: absolute; inset: 0; }
.service-card:hover { border-color: #f2a8b4; background: #fffafb; }
.service-check:checked + .service-card { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.service-check:focus-visible + .service-card { outline: 3px solid #ff8da0; outline-offset: 2px; }
.checkmark { flex: 0 0 19px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #c9cad1; border-radius: 5px; background: #fff; color: transparent; font-size: 12px; }
.service-check:checked + .service-card .checkmark { border-color: var(--red); background: var(--red); color: #fff; }
.service-copy { min-width: 0; display: grid; gap: 3px; }
.service-title { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.service-title strong { font-size: 13px; }
.service-price { color: var(--red); font-size: 11px; font-weight: 800; white-space: nowrap; }
.service-detail { color: var(--muted); font-size: 11px; line-height: 1.35; }
.quantity { position: relative; z-index: 2; display: grid; grid-template-columns: 44px; overflow: hidden; border: 1px solid #cfd0d6; border-radius: 8px; background: #fff; }
.quantity [data-quantity-step="-1"], .quantity input { display: none; }
.service-check:checked + .service-card .quantity { grid-template-columns: 44px 46px 44px; }
.service-check:checked + .service-card .quantity [data-quantity-step="-1"], .service-check:checked + .service-card .quantity input { display: block; }
.quantity button, .quantity input { min-height: 44px; padding: 0; border: 0; border-radius: 0; background: #fff; text-align: center; }
.quantity button { font-size: 18px; font-weight: 800; }
.quantity input { width: 46px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 800; appearance: textfield; }
.distance-row { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: end; }
.field { position: relative; display: grid; gap: 6px; }
.field > span, .field > label { font-size: 12px; font-weight: 800; }
input, textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #cfd0d6; border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #999ba6; }
#distance:focus, #distance:focus-visible { border-color: #8d8f99; outline: none; box-shadow: none; }
.distance-status { min-height: 44px; display: flex; align-items: center; margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 12px; }
.distance-status.contact { background: #fff8e8; color: #805100; }
.price-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(105px,1fr); overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.price-cell { min-height: 66px; padding: 8px 7px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink); text-align: center; }
.price-cell:last-child { border-right: 0; }
.price-cell:hover { background: #fffafb; }
.price-cell.active { background: var(--red-soft); box-shadow: inset 0 -3px var(--red); }
.price-cell span { display: block; color: var(--muted); font-size: 11px; }
.price-cell strong { font-size: 13px; }
.hint, .field small { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-fields { display: grid; grid-template-columns: minmax(72px,1fr) 12px minmax(72px,1fr); gap: 8px; align-items: center; }
.time-fields input { text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.time-fields b { text-align: center; }
.ward-list { position: absolute; top: calc(100% - 20px); right: 0; left: 0; z-index: 12; max-height: 240px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 14px 34px rgba(17,17,35,.16); }
.ward-option { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: #fff; color: var(--ink); text-align: left; }
.ward-option:hover, .ward-option:focus { background: var(--red-soft); }
.ward-option small { color: var(--muted); white-space: nowrap; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.turnstile { margin-top: 14px; }
.submit-status { margin-top: 12px; padding: 11px 12px; border-radius: 8px; background: #fff7e7; color: #8b5700; font-size: 12px; font-weight: 700; }
.submit-status.success { background: #eaf8f1; color: var(--green); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.inline-error { min-height: 20px; margin: 0; color: var(--red-dark); font-size: 12px; font-weight: 700; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 800; }
.primary { background: var(--red); color: #fff; }
.primary:hover { background: var(--red-dark); }
.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
button:disabled { opacity: .48; cursor: not-allowed; }
.quote { position: sticky; top: 16px; overflow: hidden; }
.quote > header { padding: 16px 18px; background: var(--navy); color: #fff; }
.quote > header p { margin: 0; color: #c8c8d1; font-size: 11px; }
.quote-body { padding: 16px 18px; }
.selected-list { min-height: 50px; display: grid; gap: 6px; margin-bottom: 12px; }
.selected-item, .quote-body > p { display: flex; justify-content: space-between; gap: 10px; }
.selected-item { font-size: 12px; }
.selected-item span:last-child { color: var(--green); font-weight: 800; }
.empty { color: var(--muted); font-size: 12px; }
.quote-body > p { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.quote-body > p span { color: var(--muted); }
.quote-body .total { align-items: end; padding-top: 13px; }
.total span { color: var(--ink) !important; font-weight: 800; }
.total strong { color: var(--red); font-size: 25px; line-height: 1; }
.quote-alert { margin-top: 10px; padding: 9px 10px; border-radius: 7px; background: var(--red-soft); color: var(--red-dark); font-size: 11px; }
.quote footer { padding: 12px 18px; border-top: 1px solid var(--line); background: #fafafb; color: var(--muted); font-size: 11px; }

@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
  .quote { position: static; order: -1; }
  .services { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .page { width: calc(100% - 20px); padding-top: 16px; }
  .step-tab span { display: none; }
  .step-panel { padding: 14px; }
  .services, .distance-row, .form-grid, .schedule { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .actions .button { width: 100%; }
}
