/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/figtree-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/figtree-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;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --text: #101114;
  --text-2: #3F444D;
  --muted: #5E6470;
  --placeholder: #737A86;
  --faint: #9AA0AA;
  --disabled: #B4B9C2;
  --border: #E4E6EA;
  --border-strong: #D5D8DE;
  --dashed: #C9CDD4;
  --line: #EEF0F2;
  --track: #DCDFE5;
  --subtle: #F6F7F9;
  --subtle-2: #F7F8FA;
  /* iCare colours: purple #31295C for the accent, teal #009F98 for highlights. */
  --accent: #31295C;
  --accent-hover: #241E45;
  --accent-soft: #ECEAF3;
  --accent-pale: #CBC6DD;
  --focus: #CCEDEB;
  --ink: #101114;
  --lime: #009F98;
  --lime-2: #66C5C1;
  --ok-soft: #D9F1EF;
  --ok-ink: #00625E;
  --warn: #C2410C;
  --warn-ink: #9A3412;
  --warn-text: #7C2D12;
  --warn-soft: #FFF1E6;
  --warn-border: #FDBA8C;
  --warn-fill: #FB923C;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --alert: #FF2D2D;
  --plate: #1D3A9E;

  --radius-input: 14px;
  --radius-card: 22px;
  --input-h: 52px;
  --gutter: 56px;
  --shadow-pop: 0 12px 32px rgba(16, 17, 20, 0.16);
  --shadow-dialog: 0 24px 64px rgba(16, 17, 20, 0.28);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); font-weight: 700; text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, p { margin: 0; }

input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.optional { font-weight: 500; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* FocusOnNavigate moves focus to the page heading for screen readers; it isn't a control, so no ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ---------- Inputs ---------- */
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=number], textarea, select {
  width: 100%;
  height: var(--input-h);
  padding: 0 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
textarea { height: auto; padding: 14px 18px; line-height: 1.5; font-weight: 500; resize: vertical; }
input:disabled { background: var(--subtle); color: var(--placeholder); }
input::placeholder, textarea::placeholder { color: var(--placeholder); font-weight: 500; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}
.has-error input[type=text], .has-error input[type=tel], .has-error input[type=email], .has-error textarea,
input.invalid, textarea.invalid {
  border-color: var(--danger);
}

input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* Drop-down styled like the design's inputs, with a chevron. */
select.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235E6470' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
select.select:has(option[value=""]:checked) { color: var(--placeholder); font-weight: 500; }
select.select option { color: var(--text); font-weight: 600; }

/* A text input with a unit or prefix inside it */
.affix { position: relative; display: block; }
.affix > .affix-pre, .affix > .affix-post {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}
.affix > .affix-pre { left: 18px; }
.affix > .affix-post { right: 18px; }
.affix > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.affix.pre-icon input { padding-left: 46px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--text); }
.btn-dark { background: var(--accent); color: #FFFFFF; padding: 0 20px; }
.btn-dark:hover { background: var(--accent-hover); color: #FFFFFF; }
/* Broker-only actions: iCare purple with the teal accent. */
.btn-broker { background: var(--accent); color: #FFFFFF; font-weight: 800; }
.btn-broker:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn-broker svg { color: var(--lime); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--subtle); }
.btn-danger { background: var(--danger); color: #FFFFFF; font-weight: 800; }
.btn-danger:hover { background: #991B1B; color: #FFFFFF; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-xl { height: 56px; padding: 0 24px; font-size: 16px; gap: 10px; }
.btn-dialog { height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn-wide { min-width: 240px; font-weight: 800; }
.btn:disabled, .btn[aria-disabled=true] { background: var(--border-strong); color: var(--muted); border-color: transparent; cursor: not-allowed; }
.btn-round {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-round:hover { background: var(--line); color: var(--text); }
/* Round icon buttons with a tooltip (claim and dashboard actions) */
.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: var(--subtle); color: var(--text); }
.icon-btn.primary { border-color: var(--accent); background: var(--accent); }
.icon-btn.primary:hover { background: var(--accent-hover); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  transform: translate(-50%, 4px);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}
.icon-btn:hover .tooltip, .icon-btn:focus-visible .tooltip { opacity: 1; transform: translate(-50%, 0); }
/* The last button in a right-aligned group keeps its tooltip inside the page. */
.icon-group > :last-child .tooltip { left: auto; right: 0; transform: translateY(4px); }
.icon-group > :last-child:hover .tooltip, .icon-group > :last-child:focus-visible .tooltip { transform: none; }
.icon-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Touch screens: no hover, so no tooltip; the aria-label still names the button. */
@media (hover: none) {
  .icon-btn:hover .tooltip { opacity: 0; }
}

.btn-dashed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  border-radius: 16px;
  border: 2px dashed var(--dashed);
  background: var(--surface);
  color: var(--accent);
  font-size: 15.5px;
  font-weight: 700;
}
.btn-dashed:hover { border-color: var(--accent); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 14.5px; font-weight: 700; }
.link-btn:hover { color: var(--accent-hover); }

/* ---------- Cards ---------- */
.card {
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.card-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; flex-direction: column; gap: 4px; }
.card-head p { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Blue feature card with rings */
.blue-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 24px;
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.blue-card > * { position: relative; }
.blue-card > .rings { position: absolute; right: -150px; top: -160px; pointer-events: none; }
.blue-card .glass {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.blue-card .glass-label { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.blue-card .glass-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.blue-card-title { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.85); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg);
  color: var(--text-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-alert { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent-hover); }
.badge-muted { background: var(--bg); color: var(--muted); }
.badge-lg { height: 28px; padding: 0 12px; font-size: 13px; font-weight: 800; flex-shrink: 0; }
/* The design's "Required" tag (screen 13); the small one sits next to field labels. */
.req-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}
.req-tag.sm { height: 22px; padding: 0 9px; margin-left: 8px; font-size: 12px; vertical-align: 1px; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; font-weight: 700; min-width: 0; }
.field-hint { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }

.grid-2, .grid-3 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.narrow { max-width: 340px; }
.wz-content { display: contents; }
fieldset.wz-content { margin: 0; padding: 0; border: 0; min-width: 0; }
/* A read-only step: inputs are disabled by the fieldset; tappable drawings are switched off too. */
.view-only svg, .view-only label, .view-only .btn-dashed, .view-only .link-btn, .view-only .upload { pointer-events: none; }
.view-only .btn-dashed, .view-only .link-btn, .view-only .drop { display: none; }
.choose-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -4px; font-size: 14.5px; font-weight: 700; color: var(--muted); }
.choose-head:not(:has(.req-tag)) { display: none; }
.pad-unit { padding-right: 64px !important; }
.pad-key { padding-left: 76px !important; }
.key-sets { display: flex; flex-direction: column; gap: 10px; }
.affix > .key-label { font-weight: 700; }
.garda-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
.caps { text-transform: uppercase; letter-spacing: 0.04em; }
.spaced { letter-spacing: 0.04em; }

/* Option tiles (Yes/No and friends) */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.opt input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.opt:hover { border-color: #C9CDD4; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); font-weight: 800; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opts.sm { grid-template-columns: repeat(2, 120px); gap: 8px; flex-shrink: 0; }
.opts.sm .opt, .opt.sm { height: 52px; padding: 0 16px; border-radius: 14px; font-size: 15.5px; }
.opts.sm .opt input, .opt.sm input { width: 20px; height: 20px; }

/* Question card (fieldset) */
.question {
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.question.required { box-shadow: inset 0 0 0 2px var(--warn-border); }
.question.has-error { box-shadow: inset 0 0 0 2px var(--danger); }
.question > legend {
  float: left;
  width: 100%;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.question > legend + * { clear: both; }
.question-sub { margin-top: -6px; font-size: 15px; color: var(--muted); }

/* Inline Yes/No row (small) */
.inline-q {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}
.inline-q > legend { float: left; padding: 0; font-size: 16px; font-weight: 700; }
.inline-q-wrap { display: flex; flex-direction: column; gap: 6px; }
.inset { padding: 16px 18px; border-radius: 16px; background: var(--subtle); display: flex; flex-direction: column; gap: 14px; }
.inset-lg { padding: 20px; border-radius: 18px; background: var(--subtle); display: flex; flex-direction: column; gap: 16px; }
.rows > .inline-q { padding: 12px 0; border-top: 1px solid var(--bg); }
.rows > .inline-q:last-child { border-bottom: 1px solid var(--bg); }
.rows > .inline-q-wrap { padding: 12px 0; border-top: 1px solid var(--bg); }
.rows > .inline-q-wrap:last-child { border-bottom: 1px solid var(--bg); }

.info-line { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); }
.warn-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--warn-soft);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--warn-text);
}
.warn-box svg { flex-shrink: 0; margin-top: 1px; color: var(--warn); }
.error-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
}

/* Number badge in lists */
.step-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-tile {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-tile.warn { background: var(--warn-soft); color: var(--warn); }
.icon-tile.alert { background: var(--danger-soft); color: var(--danger); }

/* Irish number plate */
.plate {
  display: inline-flex;
  align-items: center;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: #FFFFFF;
  overflow: hidden;
  color: var(--ink);
}
.plate::before { content: ''; width: 16px; align-self: stretch; background: var(--plate); }
.plate span { padding: 0 8px; font-size: 13.5px; font-weight: 800; letter-spacing: 0.08em; }

/* Number plate input */
.plate-input {
  display: flex;
  align-items: stretch;
  height: 68px;
  max-width: 380px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #FFFFFF;
  overflow: hidden;
}
.plate-input:focus-within { box-shadow: 0 0 0 4px var(--focus); }
.plate-flag {
  width: 46px;
  flex-shrink: 0;
  background: var(--plate);
  color: #FFFFFF;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.plate-input input[type=text] {
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0 20px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: none;
}

/* − n + stepper */
.stepper {
  display: flex;
  align-items: center;
  height: var(--input-h);
  border-radius: var(--radius-input);
  border: 2px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.stepper button { width: 56px; height: 100%; border: 0; background: var(--subtle); font-size: 22px; font-weight: 700; }
.stepper button:disabled { color: var(--disabled); cursor: not-allowed; }
.stepper input[type=text] { flex-grow: 1; width: auto; height: 100%; border: 0; border-radius: 0; text-align: center; font-size: 18px; font-weight: 800; }

/* Multi-select chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.chip input { margin: 0; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); font-weight: 800; }

/* Date + time rows */
.date-input { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.date-field { position: relative; display: block; }
.date-field input[type=text] { padding-right: 52px; font-variant-numeric: tabular-nums; }
.date-pick {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.date-pick:hover, .date-pick:focus-within { background: var(--bg); color: var(--accent); }
.date-pick:focus-within { box-shadow: 0 0 0 4px var(--focus); }
/* The native date input covers the icon, invisible: a tap lands on it and opens the native picker. */
.date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}
.date-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.date-native:disabled { cursor: not-allowed; }
.time-row { display: flex; gap: 8px; }
.time-row > .time-text { width: 128px; flex-shrink: 0; }
.time-row .ampm { display: contents; }
.time-row .ampm .opt { flex: 1 1 0; padding: 0 14px; }
.when-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 96px 96px; gap: 8px; }
.when-row .ampm { display: contents; }
.when-row .ampm .opt { padding: 0 14px; }
/* The fieldset gap (8px) spaces it from the controls, the same as a .field label; no extra padding, or grouped controls sit lower than their neighbours. */
.sub-legend { float: left; width: 100%; padding: 0; font-size: 14.5px; font-weight: 700; }
.plain-fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plain-fieldset > legend + * { clear: both; }

/* Upload drop zone */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 20px;
  border-radius: 18px;
  border: 2px dashed var(--dashed);
  background: var(--subtle);
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop:focus-within { border-color: var(--accent); }
.drop.compact { min-height: 132px; background: var(--surface); border-radius: 16px; gap: 8px; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { width: 52px; height: 52px; border-radius: 999px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.drop-title { font-size: 16px; font-weight: 800; }
.drop-hint { font-size: 14px; color: var(--muted); }
.files { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 700;
  min-width: 0;
}
.file-name { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name button { border: 0; background: none; padding: 0; font-weight: 700; color: var(--text); text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.file-size { flex-shrink: 0; font-weight: 600; color: var(--muted); font-size: 13.5px; }
.file .btn-round { width: 36px; height: 36px; }

/* ---------- Pages ---------- */
.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page-title { font-size: 44px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.back-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 15px; font-weight: 700; }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Boot screen before Blazor starts */
.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal dialog */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 17, 20, 0.48);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 16px;
  overflow-y: auto;
}
.dialog {
  width: 520px;
  max-width: 100%;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-dialog);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}
#blazor-error-ui .reload { color: var(--lime); margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; border: 0; background: none; color: #FFFFFF; font-size: 20px; line-height: 1; }

/* ---------- Mobile ---------- */
.mobile-only { display: none; }

@media (max-width: 1100px) {
  :root { --gutter: 32px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  .page { padding: 24px var(--gutter) 40px; gap: 16px; }
  .page-title { font-size: 32px; }
  .card { padding: 20px; gap: 16px; border-radius: 18px; }
  .question { padding: 20px; border-radius: 18px; }
  .question > legend { font-size: 17px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .garda-grid { grid-template-columns: minmax(0, 1fr); }
  .opt { height: 56px; font-size: 16px; }
  .inline-q { flex-direction: column; align-items: stretch; gap: 10px; }
  .opts.sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blue-card { padding: 22px; border-radius: 20px; }
  .plate-input { height: 60px; max-width: none; }
  .plate-input input[type=text] { font-size: 26px; }
  .when-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .when-row .ampm .opt { height: 48px; }
  .time-row { flex-wrap: wrap; }
  .time-row > .time-text { width: 100%; }
  .drop { min-height: 150px; }
  .backdrop { padding-top: 16px; align-items: flex-end; }
  .dialog { padding: 22px; border-radius: 22px; }
}
