.driver-view {
  color-scheme: dark;
  --bg: #050d17;
  --surface: #0e2034;
  --card-soft: #142a42;
  --ink: #f5f2ea;
  --muted: #9aafc2;
  --line: #ffffff20;
  --lime: #d7fc03;
  --deep: #081523;
  --green: #e2ff38;
  --pale: #d7fc0320;
  color: var(--ink);
  background: var(--bg);
}
.driver-view :is(button, a, input, select):focus-visible { outline-color: var(--lime); }
.driver-view .button { color: var(--ink); background: var(--card-soft); }
.driver-view .button.outline { border-color: var(--line); }
.driver-view .button.outline:hover, .driver-view .button.soft:hover, .driver-view .icon-button:hover { background: #203a55; }
.driver-view .button.green, .driver-view .button.lime { color: var(--deep); background: var(--lime); }
.driver-view .button.green:hover, .driver-view .button.lime:hover { background: var(--green); }
.driver-view .button.soft { background: var(--pale); color: var(--lime); }
.driver-view .button.text { color: var(--lime); background: transparent; }
.driver-view .button.danger { color: #ffd3cb; background: #542c32; }
.driver-view .dialog { margin: auto auto 0; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--ink); }
.driver-view .dialog::backdrop { background: #0009; }
.driver-view .dialog .badge { background: var(--card-soft); color: var(--ink); }
.driver-view .modal-form label:not(.check), .driver-view .check strong { color: var(--ink); }
.driver-view .modal-form :is(input:not([type=checkbox]), select) { background: var(--deep); color: var(--ink); border-color: var(--line); }
.driver-view .modal-form select { appearance: auto; background-image: none; padding-right: 10px; }
.driver-view .check { background: var(--card-soft); }
.driver-view .check input { accent-color: var(--lime); }
.driver-view .notice { background: var(--card-soft); color: var(--ink); border-color: var(--line); }
.driver-view .form-error { color: #ffb5aa; }
.driver-view .admin-notice { color: var(--lime); }
.driver-view #toast { bottom: max(16px, env(safe-area-inset-bottom)); color: var(--deep); background: var(--lime); }
.driver-view .modal-links { display: grid; gap: 10px; }
.driver-view .modal-links form { margin: 0; }
.modal-form + .invite-link { margin-top: 16px; }
.invite-status:empty { display: none; }
.driver-view .modal-form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--deep); color: var(--ink); font: inherit; resize: vertical;
}
.driver-view .modal-form textarea:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.driver-view .dialog .board-list a { color: var(--lime); }
.charge-plans { min-width: 0; margin: 0; padding: 0; border: 0; }
.charge-plans legend { padding: 0; font-size: 1rem; font-weight: 750; }
.charge-plans p { margin: 5px 0 10px; font-size: .875rem; }
.charge-plan-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.charge-plan-buttons .button { display: grid; justify-items: start; align-content: center; gap: 3px; min-height: 58px; white-space: normal; }
.charge-plan-buttons small { color: var(--muted); font-size: .75rem; }
.charge-plans legend small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.battery-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.battery-options label { position: relative; cursor: pointer; }
.modal-form .battery-options input[type="radio"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; clip-path: inset(50%); }
.driver-view .battery-options input:checked + .button { color: var(--deep); background: var(--lime); }
.battery-options input:focus-visible + .button { outline: 3px solid var(--lime); outline-offset: 2px; }
.modal-form label.battery-custom { margin-top: 8px; }
.modal-form label.battery-custom[hidden] { display: none; }
.check-in { display: grid; gap: 12px; }
.check-in form[data-form="start-at"] { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 5px 8px; }
.check-in form[data-form="start-at"] button { min-height: 45px; }
#check-in-day { grid-area: 2 / 1; color: var(--muted); }

.driver-shell {
  width: min(100%, 410px);
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--deep);
}
.driver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(env(safe-area-inset-top), 23px) 24px 10px;
}
.wordmark { display: inline-block; flex-shrink: 0; }
.wordmark img { display: block; width: 145px; height: auto; }
.driver-view .driver-profile {
  border-radius: 999px;
  min-width: 0;
  padding-inline: 10px;
  font-size: .78rem;
  background: var(--surface);
}
.driver-profile .handle { overflow: hidden; text-overflow: ellipsis; }
.driver-score { padding: 3px 7px; border-radius: 99px; color: var(--lime); background: var(--pale); }
.driver-sites { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 3px 24px 10px; scrollbar-width: thin; }
.driver-sites a, .driver-sites button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
  text-decoration: none;
}
.driver-sites [aria-current], .driver-sites :is(a, button):hover { color: var(--lime); background: var(--pale); border-color: #d7fc0340; }
.driver-content { flex: 1; padding: 4px 24px 22px; display: grid; align-content: start; gap: 24px; }
.driver-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.driver-view .driver-action {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  white-space: normal;
  gap: 12px;
  background: var(--surface);
}
.driver-view .driver-action.green { background: var(--lime); }
.driver-action strong, .driver-action small { display: block; }
.driver-action strong { font-size: 1rem; font-weight: 850; }
.driver-action small { margin-top: 3px; font-weight: 550; }
.driver-action:not(.green) small { color: var(--muted); }
.driver-action-icon, .driver-charger-id {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  color: var(--lime);
  border-radius: 14px;
  background: var(--pale);
}
.driver-action.green .driver-action-icon { color: var(--deep); background: #08152319; }
.driver-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px; margin-bottom: 10px; }
.driver-section-title h2 { color: var(--muted); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
.driver-section-title span { color: var(--lime); font-size: .74rem; white-space: nowrap; }
.driver-rows { display: grid; gap: 8px; }
.driver-slot, .driver-banner, .driver-message, .driver-empty, .driver-queue {
  background: var(--surface);
  border-radius: 17px;
}
.driver-slot, .driver-banner { display: flex; align-items: center; gap: 10px; padding: 13px; min-width: 0; }
.highlight-open-slots .driver-slot:has(> [data-action="spot"].green) {
  background: color-mix(in srgb, var(--lime) 20%, var(--surface));
  box-shadow: inset 0 0 0 2px var(--lime);
}
@media (prefers-reduced-motion: no-preference) {
  .driver-slot:has(> [data-action="spot"].green) { transition: background-color 100ms ease, box-shadow 100ms ease; }
}
.driver-slot .button { min-height: 39px; }
.charger-report { margin-block: 12px; padding-block: 10px; border-block: 1px solid var(--line); }
.driver-view .charger-observation { color: var(--muted); font-size: .85rem; }
.driver-slot .button, .driver-banner .button { white-space: normal; }
.driver-slot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.driver-slot:has(.driver-slot-actions) { flex-wrap: wrap; }
.driver-slot:has(.driver-slot-actions) .driver-slot-info { min-width: 94px; }
.driver-slot-info { flex: 1; min-width: 0; }
.driver-slot-info strong, .driver-slot-info small { display: block; overflow-wrap: anywhere; }
.driver-slot-info strong { font-size: .88rem; }
.driver-slot-info small { color: var(--muted); margin-top: 4px; font-size: .76rem; }
.driver-charger-id { width: 41px; height: 41px; font-size: .84rem; font-weight: 850; background: var(--card-soft); }
.driver-banner { border: 1px solid #d7fc0360; border-radius: 24px; padding: 17px; flex-wrap: wrap; }
.driver-banner .driver-slot-info { min-width: 130px; }
.driver-banner .driver-slot-info strong { font-size: 1.12rem; }
.driver-banner .driver-slot-info small:first-child { color: var(--lime); margin: 0 0 4px; }
.driver-banner.highlight { background: var(--lime); color: var(--deep); }
.driver-banner.highlight small { color: #2c390d; }
.driver-banner.highlight .driver-slot-info small:first-child { color: var(--deep); }
.driver-empty, .driver-message { padding: 15px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.driver-empty h1 { color: var(--ink); font-size: 1.15rem; }
.driver-empty > * + * { margin-top: 10px; }
.driver-empty > :empty { margin-top: 0; }
.driver-empty .driver-pricing { padding-block-start: 10px; border-top: 1px solid var(--line); }
.driver-pricing strong { color: var(--ink); }
.driver-pricing a { color: var(--lime); text-underline-offset: 3px; }
.handoff-demo { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.handoff-demo-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.handoff-demo-header h2 { font-size: 1.05rem; }
.handoff-demo-header .handoff-replay { padding-inline: 8px; }
.handoff-demo-steps { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.handoff-demo-steps li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 8px; border-radius: 11px; }
.handoff-demo-steps strong, .handoff-demo-steps small { display: block; }
.handoff-demo-steps strong { font-size: .88rem; }
.handoff-demo-steps small { margin-top: 3px; font-size: .76rem; line-height: 1.35; color: var(--muted); }
.handoff-demo-icon, .handoff-smile { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; }
.handoff-demo-icon { color: var(--lime); background: var(--pale); }
.handoff-demo-icon .icon { width: 17px; height: 17px; }
.handoff-demo-finish { background: var(--pale); }
.handoff-demo-finish .handoff-point { color: var(--lime); }
.handoff-smile { position: relative; color: var(--deep); background: #e5e0ff; }
.handoff-smile-sam { margin-inline-start: auto; background: var(--lime); }
.handoff-smile::before { content: ''; position: absolute; top: 10px; left: 10px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; box-shadow: 11px 0 currentColor; }
.handoff-smile::after { content: ''; width: 13px; height: 8px; margin-top: 7px; border-bottom: 2px solid currentColor; border-radius: 50%; }
.handoff-demo.is-playing li { animation: handoff-step 1.25s ease-out; }
.handoff-demo.is-playing li:nth-child(2) { animation-delay: 1.1s; }
.handoff-demo.is-playing li:nth-child(3), .handoff-demo.is-playing .handoff-smile { animation-delay: 2.2s; }
.handoff-demo.is-playing .handoff-smile { animation-name: handoff-smile; animation-duration: .55s; }
@keyframes handoff-step {
  32% { box-shadow: inset 0 0 0 1px #d7fc0380; background-color: #d7fc0326; }
}
@keyframes handoff-smile {
  45% { transform: translateY(-4px) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .handoff-demo.is-playing li, .handoff-demo.is-playing .handoff-smile { animation: none; }
  .handoff-demo-header .handoff-replay { display: none; }
}
.driver-view .button[aria-disabled="true"] { opacity: .7; cursor: wait; }
.nearby-overview, .nearby-results, .nearby-add { display: grid; gap: 10px; }
.nearby-overview, .nearby-add { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.nearby-overview { border-color: #d7fc0350; }
.driver-content .nearby-overview h1 { font-size: 1.42rem; }
.nearby-results h2, .nearby-add h2 { font-size: 1rem; }
.nearby-overview p, .nearby-add p { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.nearby-overview strong { color: var(--lime); }
.nearby-results .driver-message { padding: 10px 12px; }
.nearby-sites { margin: 0; padding: 0; list-style: none; }
.nearby-sites a { color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.nearby-sites a:hover { border-color: var(--lime); }
.nearby-sites .driver-slot-info strong { font-size: .95rem; }
.nearby-sites .driver-slot > .icon { color: var(--muted); }
.nearby-distance { flex-shrink: 0; padding: 4px 7px; border-radius: 9px; background: var(--pale); color: var(--lime); font-size: .72rem; white-space: nowrap; }
.driver-queue { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.driver-queue li { display: flex; align-items: center; gap: 10px; padding: 11px 13px; font-size: .82rem; }
.driver-queue li + li { border-top: 1px solid var(--line); }
.driver-queue .queue-you { background: var(--pale); }
.driver-queue .queue-you strong { color: var(--lime); }
.driver-position { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--card-soft); color: var(--muted); font-size: .74rem; }
.driver-leaves { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.driver-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 14px; padding: 3px 15px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.driver-footer :is(button, a) { font: inherit; font-size: .77rem; min-height: 43px; display: inline-flex; align-items: center; border: 0; color: var(--muted); background: transparent; text-decoration: none; padding: 0 3px; }
.driver-footer :is(button, a):hover { color: var(--lime); }
.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.legal-links a { display: inline-flex; align-items: center; min-height: 36px; }
.legal-links a:hover, .legal-links a[aria-current="page"] { color: var(--lime); }
.guide-card a { color: var(--lime); overflow-wrap: anywhere; }
.oauth-branding label { margin-top: 10px; }
.driver-content h1, .sticker-page h1 { font-size: 1.15rem; }
.sticker-page h1 { margin-bottom: 12px; }
.sticker-page .sticker { background: var(--surface); border-color: var(--line); }
.sticker-page .sticker img { background: white; border-radius: 6px; }
.sticker-page .sticker p { color: var(--muted); }
.sticker-page .sticker-brand, .sticker-page .copy-sticker { color: var(--lime); }
.account-page { display: grid; place-items: center; min-height: 100dvh; padding: 18px; }
.account-card { display: grid; align-content: start; gap: 14px; width: min(100%, 410px); padding: 24px; border-radius: 25px; background: var(--surface); border: 1px solid var(--line); }
.account-card h1 { font-size: 1.5rem; }
.account-card p, .account-card small { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.account-card .driver-message { padding: 11px; background: var(--card-soft); color: var(--ink); }
.discovery-fields { display: grid; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.discovery-fields legend { padding: 0 4px; font-weight: 650; }
.discovery-fields p:empty { display: none; }
.guide-shell { width: min(100%, 640px); margin-inline: auto; }
.guide-content { display: grid; gap: 16px; padding: 14px 24px 30px; }
.guide-intro, .guide-card { display: grid; gap: 10px; }
.guide-intro h1 { font-size: clamp(1.65rem, 5vw, 2.15rem); line-height: 1.13; }
.guide-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.guide-card h2 { font-size: 1.12rem; }
.guide-content :is(p, li) { color: var(--muted); line-height: 1.5; }
.guide-content strong { color: var(--ink); }
.guide-content .ordered-rules { margin: 0; }
.guide-example { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--card-soft); }
.guide-example h3 { color: var(--lime); font-size: .92rem; }
.guide-example dl { margin: 0; }
.guide-example dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; }
.guide-example dl div + div { border-top: 1px solid var(--line); }
.guide-example dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (min-width: 520px) {
  .driver-shell { min-height: min(810px, calc(100dvh - 36px)); max-height: calc(100dvh - 36px); margin-block: 18px; border: 1px solid var(--line); border-radius: 40px; overflow: hidden; }
  .driver-content { overflow: auto; scrollbar-width: thin; }
  .driver-header, .driver-sites, .driver-footer { flex-shrink: 0; }
  .driver-view .dialog { width: min(calc(100% - 24px), 410px); margin: auto; border-radius: 26px; }
}

@media print {
  .driver-view, .driver-shell { color: #111; background: white; }
  .driver-header, .driver-sites, .driver-footer, .sticker-page h1 { display: none; }
  .driver-shell { display: block; width: auto; min-height: 0; max-height: none; margin: 0; border: 0; overflow: visible; }
  .driver-content { display: block; padding: 0; overflow: visible; }
  .sticker-page .sticker { background: white; border-color: #444; }
  .sticker-page .sticker p, .sticker-page .sticker-brand { color: #111; }
}
