/* ========================================
   Salva kahjuteade — 2026 design system
   ======================================== */

/* Inter (variable, 300-900) omast serverist: Google Fontsi kaudu läheks külastaja IP Google'ile.
   Failid: assets/fonts/, litsents OFL.txt. Kreeka/vietnami komplektid on välja jäetud. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(./assets/fonts/inter-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(./assets/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(./assets/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(./assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-primary: #0b6b56;
  --color-primary-light: #0e8a6f;
  --color-primary-pale: rgba(11, 107, 86, .06);
  --color-primary-glow: rgba(11, 107, 86, .15);
  --color-bg: #f7f8f9;
  --color-surface: #ffffff;
  --color-border: #e2e5e9;
  --color-border-hover: #c5cbd3;
  --color-text: #1a1d21;
  --color-muted: #6b7280;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-success: #059669;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.09), 0 4px 12px rgba(0,0,0,.04);
  --shadow-glow: 0 0 0 4px var(--color-primary-glow), 0 8px 24px rgba(11,107,86,.12);
  --shadow-glow-soft: 0 0 0 2px rgba(11,107,86,.10), 0 4px 14px rgba(11,107,86,.12);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition-fast: .15s cubic-bezier(.4, 0, .2, 1);
  --transition-med: .25s cubic-bezier(.4, 0, .2, 1);
  --transition-spring: .4s cubic-bezier(.175, .885, .32, 1.275);
  /* Legacy aliases */
  --g: var(--color-primary);
  --bg: var(--color-bg);
  --bd: var(--color-border);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 15px;
}

/* ---- Layout ---- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.header {
  margin-bottom: 32px;
}
.headerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--color-primary);
}
html[lang="ru"] .header h1 { font-weight: 700; }
.langSwitch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.langSwitchLabel {
  font-size: 13px;
  color: var(--color-muted);
  font-weight: 700;
}
.langSwitchGroup {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
  background: var(--color-surface);
}
.langBtn {
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.langBtn:hover {
  background: var(--color-primary);
  color: #fff;
}
.langBtn.active {
  background: var(--color-primary);
  color: #fff;
}
.view.hidden { display: none; }
.hidden { display: none !important; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.topBackBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-primary);
  background: var(--color-primary-pale);
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.topBackBtn:hover {
  background: var(--color-primary);
  color: #fff;
}
.topbar h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: -.01em;
}
html[lang="ru"] .topbar h2 { font-weight: 700; }

/* ---- Link / back button ---- */
.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.link:hover { background: var(--color-primary-pale); }
.link:hover {
  background: var(--color-primary);
  color: #fff;
}
.link:active { background: var(--color-primary-glow); }

/* ========================================
   Grid & Entry Cards
   ======================================== */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 720px; }

.card {
  position: relative;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  cursor: pointer;
  text-align: center;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-med),
    transform var(--transition-spring);
  outline: none;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-pale), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}
.card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}
.card:hover::before { opacity: 1; }
.card:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.card:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.card.card-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 180px;
}
.card-icon-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  transition: transform var(--transition-spring);
}
.card:hover .card-icon-img { transform: scale(1.08); }
.card.card-icon span {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
}
html[lang="ru"] .card.card-icon span { font-weight: 700; }

/* ---- Footer / hints ---- */
.foot {
  margin-top: 28px;
  color: var(--color-muted);
  font-size: 14px;
}
.foot a { color: var(--color-primary); font-weight: 700; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.hint { color: var(--color-muted); max-width: 720px; font-size: 14px; margin-top: 16px; line-height: 1.6; }
.motorToggleGrid { max-width: 100%; margin-top: 14px; }
.motorToggle,
.motorToggle.card,
.motorToggle.card.card-icon {
  min-height: 140px !important;
  height: 140px !important;
  padding: 16px 14px !important;
  gap: 12px !important;
  flex-direction: column !important;
  justify-content: center !important;
  isolation: isolate;
}
.motorToggle::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  box-shadow: 0 0 0 1px rgba(11, 107, 86, .08), 0 2px 8px rgba(11, 107, 86, .20);
  opacity: 0;
  transform: scaleX(.45);
  transform-origin: center;
  transition: opacity var(--transition-med), transform var(--transition-med);
  pointer-events: none;
}
.motorToggle:hover::after {
  opacity: .45;
  transform: scaleX(.75);
}
.motorToggle .card-icon-img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}
.motorToggle span {
  font-size: 15px !important;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.motorToggle.is-active,
.motorToggle[aria-pressed="true"] {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px rgba(11, 107, 86, .24), 0 10px 24px rgba(11, 107, 86, .18);
  background: linear-gradient(155deg, rgba(11, 107, 86, .17), #fff 72%);
}
.motorToggle.is-active::after,
.motorToggle[aria-pressed="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}
.motorToggle.is-active span,
.motorToggle[aria-pressed="true"] span {
  color: #075843;
}
.motorSubPanels {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-width: 920px;
}
.motorSubPanel {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 10px;
}
.motorSubPanel.hidden { display: none; }
.motorSubPanel > label { display: block; margin-bottom: 6px; }
.motorChips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.motorChip {
  text-align: center;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.1;
}
.choice.motorChip[data-motor-vehicles],
.choice.motorChip[data-motor-injury] {
  text-align: center;
}
.motorChip[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary-pale);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.motorActions { margin-top: 10px; width: 100%; display:flex; justify-content:flex-end; }
.motorActions .btn.primary {
  margin-left: auto;
  padding: 10px 18px;
  font-size: 13px;
}

/* Keep participant toggles on one row in desktop/laptop widths */
@media (min-width: 621px) {
  .motorToggleGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .motorChips {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }
  .motorChips .motorChip {
    flex: 1 1 0 !important;
    width: 0;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ========================================
   Wizard Container
   ======================================== */
.wizardBox {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ---- Progress Stepper ---- */
.stepper {
  display: flex;
  align-items: stretch;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  overflow: hidden;
}
.stepper-step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  position: relative;
  transition: color var(--transition-med), background var(--transition-med);
}
.stepper-step.active {
  color: var(--color-primary);
  background: var(--color-surface);
}
.stepper-step.done {
  color: var(--color-success);
}
.stepper-step.clickable {
  cursor: pointer;
  transition: background var(--transition-fast);
}
.stepper-step.clickable:hover {
  background: var(--color-primary-pale);
}
.stepper-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition-med);
  flex-shrink: 0;
}
.stepper-step.active .stepper-num {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.stepper-step.done .stepper-num {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}
.stepper-label { white-space: nowrap; }

/* ---- Wizard body ---- */
.wizardBody {
  padding: 32px 28px 28px;
  position: relative;
  overflow: hidden;
}

/* Step slide animation — only on step change, not on same-step rerender */
.wizardBody .stepContent.stepSlideIn {
  animation: stepSlideIn .35s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.wizardBody .stepContent.slideOut {
  animation: stepSlideOut .2s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes stepSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-24px); }
}
.wizardBody .stepContent.stepSlideInReverse {
  animation: stepSlideInReverse .35s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes stepSlideInReverse {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Step header ---- */
.whead {
  margin-bottom: 24px;
}
.whead-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.01em;
  margin: 0 0 6px;
}
.whead-hint {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
}
.pill {
  display: none; /* replaced by stepper */
}

/* ---- Small text ---- */
.small { color: var(--color-muted); font-size: 13px; line-height: 1.5; }

/* ========================================
   Forms & Fields
   ======================================== */
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.span2 { grid-column: span 2; }

label {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
}
.req { color: var(--color-danger); }

input, select, textarea {
  font-family: var(--font);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
input::placeholder, textarea::placeholder {
  color: #a1a8b4;
}
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* ---- Box (panel) ---- */
.box {
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.summaryBox .summaryList {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}
.summaryBox .summarySectionTitle {
  list-style: none;
  margin: 10px 0 4px -18px;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: .01em;
}
.summaryBox .summarySpacer {
  list-style: none;
  height: 6px;
  margin: 0;
}

/* ========================================
   Choice Cards (radio / toggle)
   ======================================== */
.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.choice {
  position: relative;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 14px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
  outline: none;
}
.choice:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm), var(--shadow-glow-soft);
  transform: translateY(-1px);
}
.choice[aria-pressed="true"],
.choice:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-pale);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.choice[aria-pressed="true"]:hover,
.choice:has(input:checked):hover {
  box-shadow: var(--shadow-glow), 0 4px 14px rgba(11,107,86,.16);
}

/* Hide native radio inside choice cards */
.choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ---- Rows & errors ---- */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.err {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid rgba(220, 38, 38, .15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  white-space: pre-line;
  line-height: 1.45;
  margin-top: 16px;
  animation: errShake .4s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes errShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    color var(--transition-fast);
  outline: none;
}
.btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-glow-soft);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.btn.primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 800;
  padding: 14px 32px;
  font-size: 15px;
}
.btn.primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 16px rgba(11, 107, 86, .25);
  transform: translateY(-2px);
}
.btn.primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(11, 107, 86, .2);
}

.btn.secondary {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
  font-size: 13px;
  padding: 8px 14px;
}
.btn.secondary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Quick action pill buttons (Täna / Eile) */
.quickBtn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1.5px solid var(--color-primary);
  border-radius: 999px;
  background: var(--color-primary-pale);
  color: var(--color-primary);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 0 0 1px rgba(11,107,86,.06);
}
.quickBtn:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-soft), 0 2px 8px rgba(11, 107, 86, .25);
  transform: translateY(-1px);
}
.quickBtn:active {
  transform: translateY(0);
}

/* ========================================
   Date / Time — compact inline layout
   ======================================== */
.dtRow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.dtCell { position: relative; }

.dtInputGroup {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-fast);
}
.dtInputGroup:focus-within {
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.dtInputGroup:focus-within .dtInput,
.dtInputGroup:focus-within .dtIconBtn {
  border-color: var(--color-primary);
}
.dtInput {
  width: 130px;
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: 0;
  font-variant-numeric: tabular-nums;
}
.dtInput:focus {
  box-shadow: none;
}
.dtInputNarrow {
  width: 90px;
}
.dtIconBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: auto;
  border: 1.5px solid var(--color-border);
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(180deg, #f9fbfb 0%, #f1f6f5 100%);
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(11,107,86,.04);
}
.dtIconBtn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-soft);
  transform: translateY(-1px);
}
.dtIconBtn:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-glow);
  outline: none;
}
.dtInput:focus + .dtIconBtn {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-soft);
}
.dtIconBtn[aria-expanded="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-soft), 0 0 0 2px rgba(11,107,86,.14);
}

.dtQuickBtns {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 4px;
}

.pickerPopover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  max-width: 420px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  animation: popIn .2s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Legacy compat — remove old dtGrid rules */
.dtGrid {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.popHost { position: relative; }
.inputIcon { position: relative; }
.inputIcon input { padding-right: 46px; }

.iconBtnSm {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
  transition: all var(--transition-fast);
}
.iconBtnSm:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
  transform: translateY(calc(-50% - 1px));
}
.iconBtnSm:active { transform: translateY(-50%); }

/* Calendar */
.calHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.calTitle { font-weight: 800; text-transform: capitalize; font-size: 15px; }
.calNav {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border); background: var(--color-surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--color-text);
  transition: all var(--transition-fast);
}
.calNav:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.calNav:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.calGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calDow { font-size: 11px; color: var(--color-muted); text-align: center; padding: 4px 0; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.calEmpty { height: 36px; }

.calDay {
  height: 36px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer; font-weight: 700; font-size: 14px;
  transition: all var(--transition-fast);
  color: var(--color-text);
}
.calDay:hover { background: var(--color-primary-pale); border-color: var(--color-primary-glow); }
.calDay.today { border-color: var(--color-primary); font-weight: 900; }
.calDay.sel { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.calDay:disabled, .calDay.disabled { opacity: .3; cursor: not-allowed; }

.calFoot { margin-top: 12px; font-size: 12px; color: var(--color-muted); }

/* Time picker (wheel) */
.timePickerWheel { display: flex; flex-direction: column; gap: 12px; }
.timeHead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.timeHead .lbl { font-size: 12px; color: var(--color-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.timeHead .val { font-size: 28px; font-weight: 900; color: var(--color-primary); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.wheels {
  --wheel-item-h: 38px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.wheelCol { display: flex; flex-direction: column; gap: 6px; }
.wheelLabel {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
  text-align: center;
}

.wheel {
  --wheel-item-h: 38px;
  --wheel-item-half: 19px;
  height: calc(var(--wheel-item-h) * 5);
  overflow: auto;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  position: relative;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: ns-resize;
}
.wheel::-webkit-scrollbar { width: 0; }

/* Selection indicator lines — overlay that stays fixed in center */
.wheelOverlay {
  position: sticky;
  top: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}
.wheelOverlay::before, .wheelOverlay::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1.5px;
  background: var(--color-primary);
  opacity: .4;
}
/* 5 items visible, center item is at index 2 (0-based), so lines at 2*itemH and 3*itemH */
.wheelOverlay::before { top: calc(var(--wheel-item-h) * 2); }
.wheelOverlay::after { top: calc(var(--wheel-item-h) * 3); }

.wheelPad { height: calc(var(--wheel-item-h) * 2); }
.wheelItem {
  all: unset; box-sizing: border-box;
  height: var(--wheel-item-h); width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  color: rgba(0,0,0,.22);
  scroll-snap-align: center; cursor: pointer; user-select: none;
  transition: all var(--transition-fast);
  font-variant-numeric: tabular-nums;
}
.wheelItem.sel {
  color: var(--color-primary); font-size: 28px; font-weight: 900;
  background: var(--color-primary-pale);
  border-radius: var(--radius-sm);
}
.wheelItem:hover:not(.sel) { color: rgba(0,0,0,.45); }
.wheelItem.sel:hover { color: var(--color-primary); }

.timeActions { display: flex; justify-content: flex-end; }

/* ========================================
   Vehicle rows
   ======================================== */
.vehRow {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.vehRow + .vehRow {
  border-top: 1px solid var(--color-border);
}
.vehLabel {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 13px;
  white-space: nowrap;
  min-width: 90px;
}
.vehInput {
  width: 140px;
  max-width: 160px;
  padding: 8px 12px !important;
  font-size: 14px !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.vehRemove {
  background: transparent;
  border: 0;
  color: var(--color-danger);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  opacity: .7;
  transition: opacity var(--transition-fast);
}
.vehRemove:hover { opacity: 1; }
.vehDriverBlock {
  margin: 8px 0 12px;
  min-width: 0;
  width: 100%;
}
.vehDriverBlock > label {
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.vehDriverGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.vehDriverGrid > input {
  min-width: 0;
  width: 100%;
}

/* ========================================
   Wizard nav footer
   ======================================== */
.wizardNav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ========================================
   Reduced motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .wrap { padding: 20px 16px 48px; }
  .headerRow { align-items: flex-start; flex-direction: column; }
  .stepper-label { display: none; }
  .stepper-step { padding: 14px 8px; }
  .stepper-num { width: 30px; height: 30px; font-size: 13px; }
  .wizardBody { padding: 24px 18px 20px; overflow-x: clip; }
  .wizardNav { padding: 16px 18px; }
  .form { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .choices { grid-template-columns: 1fr; }
  .dtRow { flex-direction: column; gap: 8px; }
  .dtInput { width: 100%; }
  .dtInputNarrow { width: 100%; }
  .dtInputGroup { width: 100%; }
  .dtInputGroup .dtInput { flex: 1; }
  .pickerPopover { left: 0; right: 0; max-width: none; }
  .motorChips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .motorChip { min-height: 32px; font-size: 12px; }

  .vehRow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
  }
  .vehLabel {
    grid-column: 1 / -1;
    min-width: 0;
    white-space: normal;
  }
  .vehRow input {
    min-width: 0 !important;
    width: 100%;
  }
  .vehRow .vehInput {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }
  .vehRemove {
    grid-column: 1 / -1;
    justify-self: end;
    padding: 4px 0;
  }
  .vehDriverGrid {
    grid-template-columns: 1fr !important;
    min-width: 0;
    width: 100%;
  }
  .vehDriverGrid > input {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
  }
  .box,
  .field {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  #wizardMount .vehDriverBlock {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  #wizardMount .vehDriverBlock > label {
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  #wizardMount .vehDriverGrid {
    display: block !important;
    width: 100%;
    min-width: 0;
  }
  #wizardMount .vehDriverGrid > input {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 8px;
    box-sizing: border-box;
  }
  #wizardMount .vehDriverGrid > input:first-child {
    margin-top: 0;
  }
  #wizardMount input[name="vehOtherDriverName"],
  #wizardMount input[name="vehOtherDriverPhone"],
  #wizardMount input[name="vehOtherDriverEmail"] {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 620px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .card.card-icon { min-height: 140px; padding: 20px 16px; }
  .motorToggleGrid { grid-template-columns: 1fr; }
}


