:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #667085;
  --line: #d8dee9;
  --primary: #174ea6;
  --primary-dark: #0f3675;
  --soft: #eaf1ff;
  --good: #0f766e;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar {
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #fff;
  padding: 22px clamp(16px, 4vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 20px; }
.brand-logo { width: min(260px, 34vw); height: auto; max-height: 96px; object-fit: contain; background: #fff; padding: 8px; border-radius: 14px; box-shadow: 0 10px 28px rgba(0,0,0,.16); }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; opacity: .8; font-size: 12px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 5vw, 48px); line-height: 1; }
.topbar p { max-width: 850px; margin-bottom: 0; opacity: .88; }
.status { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); padding: 10px 14px; border-radius: 999px; white-space: nowrap; font-size: 14px; }
.shell { max-width: 1480px; margin: 0 auto; padding: clamp(14px, 3vw, 32px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.intro { padding: 24px; display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
.intro h2 { margin-bottom: 6px; }
.intro p { color: var(--muted); margin-bottom: 0; }
.instruction-steps { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.instruction-steps span { background: var(--soft); color: var(--primary-dark); padding: 9px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.instruction-steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.flow { display: grid; gap: 20px; }
.step { padding: 24px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-head.compact { margin-bottom: 12px; }
.step-head.split { justify-content: space-between; gap: 16px; }
.head-left { display: flex; gap: 14px; }
.step-no { display: inline-grid; place-items: center; min-width: 34px; height: 34px; background: var(--primary); color: #fff; border-radius: 12px; font-weight: 800; }
.step-head h2 { margin-bottom: 4px; }
.step-head p { color: var(--muted); margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label span, .vehicle-line > span { display: block; font-weight: 750; margin-bottom: 7px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(23,78,166,.16); border-color: var(--primary); }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.choice { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.choice strong { display: block; margin-bottom: 5px; }
.choice span { color: var(--muted); }
.choice.active { border-color: var(--primary); background: var(--soft); box-shadow: inset 0 0 0 1px var(--primary); }
.vehicle-line { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 18px; background: #f8fafc; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.segmented button { border: 0; padding: 10px 18px; background: transparent; }
.segmented button.active { background: var(--primary); color: #fff; }
.visual { padding: 24px; }
.map { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; }
.zone { min-height: 125px; text-align: left; border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: #f8fafc; display: flex; flex-direction: column; justify-content: space-between; }
.zone b { font-size: 18px; }
.zone span { color: var(--muted); line-height: 1.35; }
.zone.driver { background: #fff7ed; }
.zone.work { background: #eff6ff; }
.zone.radio { background: #ecfdf5; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.small-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 12px; }
.product-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.product-card > div { min-width: 0; }
.product-card .name { font-weight: 750; line-height: 1.25; word-break: break-word; }
.product-card .meta { color: var(--muted); font-size: 12px; margin-top: 5px; word-break: break-word; }
.product-card .qty { width: 72px; max-width: 100%; padding: 8px; border-radius: 10px; justify-self: end; }
.product-card.selected { border-color: var(--primary); background: var(--soft); }
.group-title { font-weight: 850; margin: 18px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.profile-list { display: grid; gap: 16px; }
.profile-card { border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: #fbfdff; }
.profile-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 14px; }
.profile-name { font-size: 18px; font-weight: 850; border: 0; background: transparent; padding: 4px 0; border-radius: 0; }
.profile-sub { color: var(--muted); font-size: 13px; }
.stepper { display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; flex: 0 0 auto; }
.stepper button { width: 42px; border: 0; background: #eef2ff; font-size: 20px; }
.stepper input { width: 70px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); gap: 12px; align-items: end; margin-bottom: 14px; }
.auto-license { background: #ecfdf5; color: #064e3b; border: 1px solid #99f6e4; border-radius: 16px; padding: 12px; font-weight: 700; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { font-weight: 850; cursor: pointer; }
.profile-actions, .button-row, .submit-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.profile-actions { margin-top: 14px; justify-content: flex-end; }
.primary, .secondary, .danger { border: 0; border-radius: 14px; padding: 11px 15px; font-weight: 800; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #eef2ff; color: var(--primary-dark); }
.danger { background: #fee4e2; color: var(--danger); }
.big { padding: 14px 20px; font-size: 16px; }
.radio-rows { display: grid; gap: 10px; }
.radio-row { display: grid; grid-template-columns: minmax(0,1fr) 90px auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 12px; }
.hint { margin-top: 12px; background: #ecfdf5; color: #064e3b; border: 1px solid #99f6e4; padding: 13px; border-radius: 16px; font-weight: 800; }
.system-groups { display: grid; gap: 4px; }
.full { display: block; }
.result { margin-top: 14px; }
.result a { display: inline-block; margin: 8px 8px 0 0; padding: 10px 13px; border-radius: 12px; background: var(--soft); color: var(--primary-dark); font-weight: 800; text-decoration: none; }
.summary { padding: 20px; }
.sticky { position: sticky; top: 18px; }
.summary h2 { margin-bottom: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.metric-grid div { background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.metric-grid span { display: block; color: var(--muted); font-size: 12px; }
.metric-grid b { font-size: 23px; }
.summary-lines { display: grid; gap: 8px; max-height: 54vh; overflow: auto; padding-right: 4px; }
.summary-line { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; border-bottom: 1px solid #edf2f7; padding-bottom: 8px; font-size: 13px; }
.summary-line .q { font-weight: 850; color: var(--primary-dark); }
.summary-line .n { line-height: 1.25; }
.summary-line .p { white-space: nowrap; font-weight: 800; }
.total { border-top: 2px solid var(--ink); margin-top: 14px; padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.total strong { font-size: 24px; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .summary { order: -1; }
  .summary-lines { max-height: none; }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .status { white-space: normal; }
  .brand { align-items: flex-start; flex-direction: column; }
  .brand-logo { width: min(240px, 78vw); max-height: 88px; }
  .intro { flex-direction: column; align-items: flex-start; }
  .instruction-steps { justify-content: flex-start; }
  .form-grid, .choice-row, .map, .profile-grid { grid-template-columns: 1fr; }
  .step-head, .step-head.split, .head-left, .profile-head { flex-direction: column; }
  .vehicle-line { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .radio-row { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 1fr; }
  .product-card .qty { width: 100%; }
}
