/* UI v2 design layer, loaded on every LoadSniper page (include it with ?v=N and bump N on any change: Cloudflare caches it).
   1. tokens (docs/ui-v2-tokens.md is the readable version: colours, radii, heights, spacing, type, icons, shadows, modal spec)
   2. base: the same look for the shared Tailwind utility classes the pages use (links, ink / green / grey buttons,
      amber, monospace, table heads, icon font), written as `html body .x` so it outranks the Tailwind CDN's own rules
   3. form controls: select, checkbox, radio, switch, slider, number, date, scrollbars, focus (v2-controls.js adds the
      faces; the native elements stay in the page with their ids, values and events). Opt out with data-v2="native".
   No coloured edge stripes anywhere. */
:root {
    /* colour */
    --c-ink: #111111; --c-ink-hover: #262626; --c-ink-2: #374151; --c-muted: #6b7280; --c-faint: #9ca3af;
    --c-line: #e5e7eb; --c-line-2: #d1d5db; --c-line-3: #9ca3af;
    --c-page: #f5f5f5; --c-card: #ffffff; --c-subtle: #f9fafb; --c-hover: #f3f4f6; --c-selected: #f3f4f6;
    --c-go: #15803d; --c-go-hover: #166534; --c-go-bg: #f0fdf4; --c-go-line: #bbf7d0;
    --c-warn: #b45309; --c-warn-ink: #78350f; --c-warn-bg: #fffbeb; --c-warn-line: #fde68a;
    --c-bad: #b91c1c; --c-red: #b91c1c; --c-bad-bg: #fef2f2; --c-bad-line: #fecaca;
    --c-ring: 0 0 0 3px rgba(17, 17, 17, 0.12); --c-ring-bad: 0 0 0 3px rgba(185, 28, 28, 0.14);
    /* radius */
    --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
    /* control heights */
    --h-sm: 32px; --h-md: 40px; --h-lg: 48px;
    /* spacing (4-pt) */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
    /* type */
    --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-field: 15px; --t-lg: 15px; --t-xl: 18px; --t-2xl: 22px;
    /* shadows */
    --sh-raised: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --sh-pop: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    --sh-modal: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 24px 48px rgba(0, 0, 0, 0.18);
    --c-backdrop: rgba(17, 17, 17, 0.4);
    /* motion */
    --c-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- base: one look for the shared utility classes ---------- */
html body { -webkit-font-smoothing: antialiased; }
/* icons: one set, one weight (Material Symbols Sharp, 300, unfilled) */
html body .material-symbols-sharp { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; line-height: 1; vertical-align: middle; }
/* links: ink + underline, no blue */
html body a.text-blue-500, html body a.text-blue-600, html body a.text-blue-700, html body a.text-blue-800,
html body button.text-blue-500, html body button.text-blue-600, html body button.text-blue-700 { color: var(--c-ink); text-decoration: underline; text-underline-offset: 2px; }
html body .text-blue-500, html body .text-blue-600, html body .text-blue-700, html body .text-blue-800, html body .text-indigo-600 { color: var(--c-ink); }   /* unslop-ignore: this rule removes blue/indigo (maps it to ink) */
html body a.text-blue-500:hover, html body a.text-blue-600:hover, html body a.text-blue-700:hover { color: var(--c-ink-2); }
html body .bg-blue-50, html body .bg-blue-100 { background-color: var(--c-hover); }
html body .border-blue-200, html body .border-blue-300 { border-color: var(--c-line-2); }
/* numbers: the UI font with even digits, never monospace */
html body .font-mono { font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: 0; }
html body .tabular-nums, html body .tnum { font-variant-numeric: tabular-nums; }
/* ink: one black for text and primary buttons */
html body .bg-gray-900, html body .bg-gray-800, html body .bg-black { background-color: var(--c-ink); }
html body .hover\:bg-gray-700:hover, html body .hover\:bg-gray-800:hover, html body .hover\:bg-black:hover { background-color: var(--c-ink-hover); }
html body .text-gray-900 { color: var(--c-ink); }
html body .border-gray-900, html body .border-gray-800 { border-color: var(--c-ink); }
/* green = money and "go" only, one shade */
html body .bg-green-500, html body .bg-green-600, html body .bg-green-700 { background-color: var(--c-go); }
html body .hover\:bg-green-600:hover, html body .hover\:bg-green-700:hover, html body .hover\:bg-green-800:hover { background-color: var(--c-go-hover); }
html body .text-green-500, html body .text-green-600, html body .text-green-700 { color: var(--c-go); }
html body .text-green-800, html body .text-green-900 { color: var(--c-go-hover); }
/* amber = needs you / warning; yellow folds into it */
html body .bg-yellow-50, html body .bg-yellow-100, html body .bg-yellow-200, html body .bg-amber-50, html body .bg-amber-100 { background-color: var(--c-warn-bg); }   /* unslop-ignore: folds yellow into the one warning amber; not a page background */
html body .text-yellow-600, html body .text-yellow-700, html body .text-yellow-800, html body .text-amber-700, html body .text-amber-800 { color: var(--c-warn-ink); }
html body .border-yellow-200, html body .border-yellow-300, html body .border-yellow-400, html body .border-amber-200, html body .border-amber-300 { border-color: var(--c-warn-line); }
html body .hover\:bg-yellow-100:hover, html body .hover\:bg-yellow-200:hover, html body .hover\:bg-yellow-300:hover { background-color: #fef3c7; }
/* secondary buttons: white with a hairline, not grey blocks */
html body button.bg-gray-200, html body a.bg-gray-200, html body button.bg-gray-100:not([role="tab"]) {
    background-color: #fff; border: 1px solid var(--c-line-2); color: var(--c-ink); }
html body button.bg-gray-200:hover, html body a.bg-gray-200:hover, html body button.bg-gray-100:not([role="tab"]):hover { background-color: var(--c-hover); }
/* radius: controls md, chips sm */
html body button:not([role="switch"]):not(.rounded-full):not(.v2seg button), html body a.inline-flex[class*="border"], html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html body select, html body textarea { border-radius: var(--r-md); }   /* unslop-ignore: sets the 8px control radius (not a pill) */
/* press feedback on buttons */
html body button:not(:disabled):active:not([role="switch"]):not([role="option"]) { scale: 0.96; }
html body button { transition-property: background-color, border-color, color, box-shadow, scale, opacity; transition-duration: 150ms; transition-timing-function: var(--c-ease); }
/* table heads: sentence case, small, muted */
html body thead th { text-transform: none; letter-spacing: 0; font-size: var(--t-xs); font-weight: 600; color: var(--c-muted); }
/* close buttons made from a text "x" get the icon (v2-controls.js swaps the glyph) */
.v2-x { width: 40px; height: 40px; display: inline-grid !important; place-content: center; border-radius: var(--r-md) !important; color: var(--c-ink-2) !important; flex: none; }
.v2-x:hover { background: var(--c-hover); color: var(--c-ink) !important; }
.v2-x .material-symbols-sharp { font-size: 20px; }

/* ---------- scrollbars: thin, grey, no arrows ---------- */
* { scrollbar-width: thin; scrollbar-color: #c4c7cc transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #c4c7cc; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }   /* unslop-ignore: a scrollbar thumb is round by geometry */
*::-webkit-scrollbar-thumb:hover { background-color: var(--c-line-3); }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------- focus ---------- */
:is(button, a, summary, [role="button"], [role="option"], [role="radio"], [tabindex]):focus-visible {
    outline: 2px solid var(--c-ink) !important; outline-offset: 2px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
textarea:focus, select:focus {
    outline: none; border-color: var(--c-ink) !important; box-shadow: var(--c-ring);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], .v2sel-btn[aria-invalid="true"] { border-color: var(--c-red) !important; }
input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14); }

/* ---------- checkbox ---------- */
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"]) {
    -webkit-appearance: none; appearance: none; margin: 0; flex: none; width: 18px; height: 18px;
    display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer;
    background: var(--c-card); border: 1.5px solid var(--c-line-3); border-radius: 5px;
    transition-property: background-color, border-color, box-shadow; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
input[type="checkbox"].w-5:not([role="switch"]) { width: 20px; height: 20px; }
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"])::before {
    content: ""; width: 10px; height: 10px; background: var(--c-card); transform: scale(0.25); opacity: 0;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transition-property: transform, opacity; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"]):checked { background: var(--c-ink); border-color: var(--c-ink); }
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"]):checked::before { transform: scale(1); opacity: 1; }
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"]):indeterminate { background: var(--c-ink); border-color: var(--c-ink); }
input[type="checkbox"]:not([role="switch"]):not([data-v2="native"]):indeterminate::before { clip-path: none; height: 2px; transform: none; opacity: 1; }
input[type="checkbox"]:not([data-v2="native"]):hover:not(:disabled):not(:checked) { border-color: var(--c-ink-2); }

/* ---------- radio ---------- */
input[type="radio"]:not([data-v2="native"]) {
    -webkit-appearance: none; appearance: none; margin: 0; flex: none; width: 18px; height: 18px;
    display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer;
    background: var(--c-card); border: 1.5px solid var(--c-line-3);
    border-radius: 999px;   /* unslop-ignore: a radio is round by convention */
    transition-property: border-color, box-shadow; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
input[type="radio"]:not([data-v2="native"])::before {
    content: ""; width: 8px; height: 8px; background: var(--c-ink); transform: scale(0.25); opacity: 0;
    border-radius: 999px;   /* unslop-ignore: the radio dot */
    transition-property: transform, opacity; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
input[type="radio"]:not([data-v2="native"]):checked { border-color: var(--c-ink); border-width: 2px; }
input[type="radio"]:not([data-v2="native"]):checked::before { transform: scale(1); opacity: 1; }
input[type="radio"]:not([data-v2="native"]):hover:not(:disabled):not(:checked) { border-color: var(--c-ink-2); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; opacity: 0.45; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }

/* ---------- switch: <input type="checkbox" role="switch"> for on/off settings ---------- */
input[type="checkbox"][role="switch"] {
    -webkit-appearance: none; appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
    width: 38px; height: 22px; background: var(--c-line-2); border: 0;
    border-radius: 999px;   /* unslop-ignore: a switch track is a pill by geometry */
    transition-property: background-color; transition-duration: 160ms; transition-timing-function: var(--c-ease);
}
input[type="checkbox"][role="switch"]::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff;
    border-radius: 999px;   /* unslop-ignore: the switch knob */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
    transition-property: transform; transition-duration: 160ms; transition-timing-function: var(--c-ease);
}
input[type="checkbox"][role="switch"]:checked { background: var(--c-ink); }
input[type="checkbox"][role="switch"]:checked::before { transform: translateX(16px); }
input[type="checkbox"][role="switch"]:active::before { width: 19px; }
input[type="checkbox"][role="switch"]:checked:active::before { transform: translateX(13px); }

/* ---------- slider ---------- */
input[type="range"]:not([data-v2="native"]) {
    -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; --v2-fill: 50%;
}
input[type="range"]:not([data-v2="native"])::-webkit-slider-runnable-track {
    height: 4px; border-radius: 999px;   /* unslop-ignore: track */
    background: linear-gradient(to right, var(--c-ink) var(--v2-fill), var(--c-line) var(--v2-fill));   /* unslop-ignore: the filled part of a slider, not a decorative gradient */
}
input[type="range"]:not([data-v2="native"])::-moz-range-track { height: 4px; border-radius: 999px; background: var(--c-line); }   /* unslop-ignore: track */
input[type="range"]:not([data-v2="native"])::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--c-ink); }   /* unslop-ignore: track */
input[type="range"]:not([data-v2="native"])::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; background: #fff; border: 2px solid var(--c-ink);
    border-radius: 999px;   /* unslop-ignore: slider handle */
    transition-property: transform; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
input[type="range"]:not([data-v2="native"])::-moz-range-thumb { width: 14px; height: 14px; background: #fff; border: 2px solid var(--c-ink); border-radius: 999px; }   /* unslop-ignore: slider handle */
input[type="range"]:not([data-v2="native"]):active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--c-ring); }

/* ---------- number: no spinners, tabular digits; stepper + unit when the page asks (data-step / data-unit) ---------- */
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.v2num {
    display: inline-flex; align-items: stretch; background: #fff; border: 1px solid var(--c-line-3); border-radius: 8px; overflow: hidden;
    transition-property: border-color, box-shadow; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
.v2num.w-full { display: flex; }
.v2num:focus-within { border-color: var(--c-ink); box-shadow: var(--c-ring); }
.v2num[data-invalid="true"] { border-color: var(--c-red); }
.v2num > input { flex: 1 1 auto; min-width: 0; width: 100% !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; background: transparent; margin: 0 !important; }
.v2num > input:focus { box-shadow: none !important; }
.v2num-unit { align-self: center; padding-right: 10px; color: var(--c-muted); font-size: 0.875em; white-space: nowrap; user-select: none; }
.v2num-btn {
    flex: none; width: 40px; display: grid; place-content: center; background: #f6f7f8; color: var(--c-ink-2); border: 0 !important;
    border-radius: 0 !important; cursor: pointer; font-size: 18px; line-height: 1;   /* a shade, not a divider line */
    transition-property: background-color, color; transition-duration: 120ms;
}
.v2num-btn:hover { background: #eceef0; color: var(--c-ink); }
.v2num-btn + .v2num-btn { margin-left: 1px; }
.v2num-btn:active { background: var(--c-line); }
.v2num-btn:disabled { color: #c4c7cc; cursor: default; background: #f6f7f8; }
.v2num-btn .v2i { font-size: 18px; }
.v2num.v2num-sm .v2num-btn { width: 32px; }

/* ---------- date: the native field (typing still works on a computer) + our calendar ---------- */
input[type="date"] { font-variant-numeric: tabular-nums; }
.v2date { position: relative; display: inline-flex; align-items: stretch; }
.v2date.w-full, .v2date.flex-1 { display: flex; }
.v2date > input[type="date"] { flex: 1 1 auto; min-width: 0; padding-right: 40px !important; }
.v2date > input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.v2date-btn {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; max-height: calc(100% - 4px);
    display: grid; place-content: center; background: transparent; border: 0 !important; color: var(--c-ink-2); cursor: pointer; border-radius: 6px !important;
}
.v2date-btn:hover { background: var(--c-hover); color: var(--c-ink); }
.v2date-btn .v2i { font-size: 18px; color: var(--c-muted); }
.v2cal { width: 288px; padding: 12px; }
.v2cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.v2cal-title { font-weight: 700; font-size: 14px; color: var(--c-ink); }
.v2cal-nav { width: 40px; height: 40px; display: grid; place-content: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--c-ink-2); }
.v2cal-nav:hover { background: var(--c-hover); color: var(--c-ink); }
.v2cal-nav .v2i { font-size: 20px; }
.v2cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.v2cal-dow { font-size: 11px; font-weight: 700; color: var(--c-muted); text-align: center; padding: 4px 0; }
.v2cal-day {
    height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--c-ink);
    font-variant-numeric: tabular-nums; transition-property: background-color, color; transition-duration: 120ms;
}
.v2cal-day:hover:not(:disabled) { background: var(--c-hover); }
.v2cal-day[data-out="1"] { color: #b6bac1; }
.v2cal-day[data-today="1"] { font-weight: 700; box-shadow: inset 0 0 0 1px var(--c-line-2); }
.v2cal-day[aria-selected="true"] { background: var(--c-ink); color: #fff; font-weight: 700; }
.v2cal-day:disabled { color: #d1d5db; cursor: not-allowed; }
.v2cal-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--c-line); }
.v2cal-foot button { border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--c-ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.v2cal-foot button:hover { background: var(--c-hover); }

/* ---------- select: native <select> kept for the page, a button + list on top ---------- */
select.v2sel-native {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important;
}
/* the defaults sit in :where() (no weight) so the page's own classes / rules for its control (copied onto the button)
   still decide size, colour and border, as they did for the native select */
:where(.v2sel-btn) { background-color: #fff; color: var(--c-ink); border: 1px solid var(--c-line-3); border-radius: 8px; min-height: 30px; }
.v2sel-btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer;
    font-family: inherit; line-height: 1.35; white-space: nowrap; background-image: none;
    transition-property: border-color, box-shadow, background-color; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
.v2sel-btn.w-full { display: flex; width: 100%; }
.v2sel-btn:hover:not(:disabled) { border-color: var(--c-ink-2); }
.v2sel-btn:focus-visible, .v2sel-btn[aria-expanded="true"] { outline: none !important; border-color: var(--c-ink) !important; box-shadow: var(--c-ring); }
.v2sel-btn:disabled { opacity: 0.55; cursor: not-allowed; background: #f9fafb; }
.v2sel-btn[hidden] { display: none !important; }
.v2sel-btn .v2sel-text { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.v2sel-btn .v2sel-text[data-empty="1"] { color: var(--c-muted); }
.v2sel-btn .v2sel-chev { flex: none; font-size: 20px; margin-right: -4px; color: var(--c-muted); transition-property: transform; transition-duration: 150ms; transition-timing-function: var(--c-ease); }
.v2sel-btn[aria-expanded="true"] .v2sel-chev { transform: rotate(180deg); }

/* the floating panel shared by select lists and the calendar */
.v2pop {
    position: fixed; z-index: 2147483000; background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    font-family: inherit; color: var(--c-ink); transform-origin: top center;
    animation: v2pop-in 140ms var(--c-ease);
}
.v2pop[data-up="1"] { transform-origin: bottom center; }
@keyframes v2pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.v2pop-list { max-height: min(300px, 50vh); overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.v2opt {
    display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
    color: var(--c-ink); user-select: none; min-height: 38px;
}
.v2opt[data-active="1"] { background: var(--c-hover); }
.v2opt[aria-selected="true"] { font-weight: 700; }
.v2opt[aria-disabled="true"] { color: #b6bac1; cursor: not-allowed; background: transparent; }
.v2opt .v2opt-check { font-size: 18px; width: 18px; flex: none; visibility: hidden; color: var(--c-ink); }
.v2opt[aria-selected="true"] .v2opt-check { visibility: visible; }
.v2optgroup { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; color: var(--c-muted); letter-spacing: 0.04em; text-transform: uppercase; }
/* phone: the list is a sheet from the bottom with big rows */
.v2scrim { position: fixed; inset: 0; z-index: 2147482999; background: rgba(17, 17, 17, 0.32); animation: v2fade 160ms var(--c-ease); }
@keyframes v2fade { from { opacity: 0; } to { opacity: 1; } }
.v2pop.v2pop-sheet {
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: auto !important; border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: v2sheet-in 180ms var(--c-ease);
}
@keyframes v2sheet-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.v2pop-sheet .v2pop-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-weight: 700; font-size: 15px; }
.v2pop-sheet .v2pop-title button .v2i { font-size: 20px; }
.v2pop-sheet .v2pop-title button { width: 40px; height: 40px; display: grid; place-content: center; border: 0; background: transparent; border-radius: 10px; color: var(--c-ink-2); }
.v2pop-sheet .v2pop-list { max-height: 60vh; padding: 4px 8px 12px; }
.v2pop-sheet .v2opt { min-height: 48px; font-size: 16px; }
.v2pop-sheet .v2cal { width: auto; }

/* segmented choice (a <select data-v2="segmented"> with 2-4 options): selected = ink, like every other "on" marker */
.v2seg { display: flex; padding: 3px; gap: 3px; background: #fff; border: 1px solid var(--c-line-2); border-radius: var(--r-lg); }
.v2seg button {
    flex: 1 1 0; min-height: 36px; padding: 6px 10px; border: 0 !important; background: transparent; border-radius: var(--r-md) !important;
    font: inherit; font-size: var(--t-md); font-weight: 600; color: var(--c-ink-2); cursor: pointer; white-space: nowrap;
    transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
.v2seg button:hover:not([aria-checked="true"]) { background: var(--c-hover); color: var(--c-ink); }
.v2seg button[aria-checked="true"] { background: var(--c-ink); color: #fff; }
.v2seg button:active { scale: 0.96; }
@media (max-width: 400px) { .v2seg button { font-size: 13px; padding: 6px 4px; } }

@media (prefers-reduced-motion: reduce) {
    .v2pop, .v2scrim, .v2pop.v2pop-sheet { animation: none; }
    input[type="checkbox"], input[type="radio"], input[type="checkbox"]::before, input[type="radio"]::before, .v2sel-chev, .v2seg button { transition: none !important; }
}

/* signup wizard: its fields are taller, 10px radius, grey #b0b0b0 */
.v2num:has(> input.field) { border-color: #b0b0b0; border-radius: 10px; }
.v2num:has(> input.field):focus-within { border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08); }
.v2num > input.field { padding: 14px 16px; }
.v2num:has(> input.field) .v2num-unit { padding-right: 16px; font-size: 15px; }
.v2num:has(> input.field) .v2num-btn { width: 48px; }

/* small date fields (filters): a narrower calendar button */
.v2date > input[type="date"].py-1, .v2date > input[type="date"].nav-ctl { padding-right: 32px !important; }
.v2date > input[type="date"].py-1 ~ .v2date-btn, .v2date > input[type="date"].nav-ctl ~ .v2date-btn { width: 28px; height: 28px; }
.v2num:has(> input.field) { display: flex; width: 100%; }

/* ---------- form modal (Edit driver on the dashboard, "Update your information" on the driver page) ----------
   The one modal spec (docs/ui-v2-tokens.md): centered, md width, r-xl, sh-modal, header 20px with title 18/700 and a
   40x40 close, body scrolls, footer with a hairline and right-aligned actions; full screen on a phone.
   Markup: .v2ds > .v2ds-panel > .v2ds-head + form.v2ds-form > .v2ds-body + .v2ds-foot */
.v2ds { background: var(--c-backdrop); justify-content: center; align-items: center; padding: var(--s-6); }
.v2ds.flex, .v2ds.v2ds-open { display: flex; }
.v2ds > .v2ds-panel {
    width: min(600px, 100%); max-height: calc(100dvh - 48px); background: var(--c-card); display: flex; flex-direction: column;
    border-radius: var(--r-xl) !important; border: 0 !important; overflow: hidden; color: var(--c-ink);
    box-shadow: var(--sh-modal) !important; animation: v2ds-in 160ms var(--c-ease);
}
@keyframes v2ds-in { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.v2ds-head { flex: none; padding: var(--s-5) var(--s-5) 0; border-bottom: 1px solid var(--c-line); }
.v2ds-titlerow { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.v2ds-title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; line-height: 1.3; color: var(--c-ink); }
.v2ds-sub { font-size: var(--t-sm); color: var(--c-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2ds-x { flex: none; width: 40px; height: 40px; display: grid; place-content: center; border-radius: var(--r-md) !important; color: var(--c-ink-2); margin: -8px -8px 0 0; background: transparent; border: 0; cursor: pointer; }
.v2ds-x:hover { background: var(--c-hover); color: var(--c-ink); }
.v2ds-x .material-symbols-sharp { font-size: 20px; }
.v2ds-jump { display: flex; gap: 2px; margin: var(--s-3) -6px 0; overflow-x: auto; scrollbar-width: none; }
.v2ds-jump::-webkit-scrollbar { display: none; }
.v2ds-jump a { flex: none; padding: 10px 8px 9px; font-size: var(--t-sm); font-weight: 600; color: var(--c-muted); border-bottom: 2px solid transparent;
    white-space: nowrap; text-decoration: none; transition-property: color, border-color; transition-duration: 150ms; }
.v2ds-jump a:hover { color: var(--c-ink); }
.v2ds-jump a[aria-current="true"] { color: var(--c-ink); border-bottom-color: var(--c-ink); }
.v2ds-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.v2ds-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--s-5) var(--s-6); overscroll-behavior: contain; }
.v2ds-sec { padding: var(--s-5) 0 var(--s-2); border-bottom: 1px solid var(--c-line); scroll-margin-top: 4px; }
.v2ds-sec:last-child { border-bottom: 0; }
.v2ds-h { display: block; font-size: var(--t-lg); font-weight: 700; color: var(--c-ink); margin-bottom: 14px; text-wrap: balance; }
.v2ds-field { margin-bottom: var(--s-4); min-width: 0; }
.v2ds-label { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--c-ink); margin-bottom: 6px; }
.v2ds-sublabel { display: block; font-size: var(--t-xs); color: var(--c-muted); margin-bottom: 4px; }
.v2ds-req { color: var(--c-muted); font-weight: 500; }
.v2ds-help { font-size: var(--t-xs); line-height: 1.45; color: var(--c-muted); margin-top: 6px; text-wrap: pretty; }
.v2ds-help.-mt-2 { margin-top: -6px; margin-bottom: var(--s-3); }
.v2ds-err { font-size: 12.5px; line-height: 1.4; color: var(--c-bad); margin-top: 6px; font-weight: 500; }
.v2ds-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-sm); color: var(--c-ink-2); background: var(--c-subtle); border-radius: var(--r-lg); padding: var(--s-3) 14px; margin-top: var(--s-4); text-wrap: pretty; }
.v2ds-note .material-symbols-sharp { font-size: 18px; color: var(--c-muted); margin-top: 1px; }
.v2ds-lock { display: none; align-items: center; gap: 4px; }
.v2ds-lock .material-symbols-sharp { font-size: 14px; }
.v2ds input:read-only ~ .v2ds-lock { display: flex; }
.v2ds input.v2ds-input:read-only { background: var(--c-subtle) !important; color: var(--c-muted); cursor: not-allowed; }
.v2ds .v2ds-input, .v2ds .v2num, .v2ds .v2sel-btn.v2ds-input {
    width: 100%; min-height: var(--h-md); padding: 9px 12px; font-size: var(--t-field); color: var(--c-ink); background: var(--c-card);
    border: 1px solid var(--c-line-2); border-radius: var(--r-md) !important; transition-property: border-color, box-shadow; transition-duration: 150ms;
}
.v2ds .v2ds-input::placeholder { color: var(--c-faint); }
.v2ds .v2ds-input:hover:not(:focus):not([aria-invalid="true"]):not(:read-only), .v2ds .v2num:hover:not(:focus-within) { border-color: var(--c-line-3); }
.v2ds textarea.v2ds-input { min-height: 88px; resize: vertical; line-height: 1.45; }
.v2ds .v2num { padding: 0; display: flex; }
.v2ds .v2num > input { padding: 9px 12px; font-size: var(--t-field); min-height: 38px; }
.v2ds .v2num[data-invalid="true"] { border-color: var(--c-bad); }
.v2ds input.border-red-600 { border-color: var(--c-bad) !important; }
.v2ds input.border-green-600 { border-color: var(--c-go) !important; }
.v2ds-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.v2ds-grid2 > .v2ds-field { margin-bottom: var(--s-4); }
.v2ds-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; margin-top: -8px; }
.v2ds-more > summary::-webkit-details-marker { display: none; }
.v2ds-more > summary .v2ds-h { margin: 0; flex: none; }
.v2ds-moresum { flex: 1 1 auto; min-width: 0; font-size: var(--t-xs); color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2ds-morechev { color: var(--c-muted); transition-property: transform; transition-duration: 160ms; transition-timing-function: var(--c-ease); }
.v2ds-more[open] > summary { margin-bottom: 8px; }
.v2ds-more[open] .v2ds-morechev { transform: rotate(180deg); }
.v2ds-switchrow { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-3) 14px; border: 1px solid var(--c-line); border-radius: var(--r-lg); cursor: pointer; }
.v2ds-switchrow .v2ds-label { margin-bottom: 2px; }
.v2ds-switchrow .v2ds-help { margin-top: 0; }
.v2ds-foot { flex: none; border-top: 1px solid var(--c-line); background: var(--c-card); padding: var(--s-4) var(--s-5); padding-bottom: max(var(--s-4), env(safe-area-inset-bottom)); }
.v2ds-footrow { display: flex; align-items: center; gap: var(--s-2); }
.v2ds-state { flex: 1 1 auto; min-width: 0; font-size: var(--t-sm); color: var(--c-muted); display: flex; align-items: center; gap: 8px; }
.v2ds-state[data-dirty="1"] { color: var(--c-ink); font-weight: 600; }
.v2ds-state[data-dirty="1"]::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--c-ink); flex: none; }   /* unslop-ignore: a status dot is round by geometry */
.v2ds-pricenote { font-size: var(--t-sm); color: var(--c-ink-2); background: var(--c-subtle); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 8px 12px; margin-bottom: 10px; text-wrap: pretty; }
.v2ds .v2ds-btn { flex: none; min-height: var(--h-md); padding: 0 18px; border: 1px solid var(--c-line-2) !important; background: var(--c-card) !important; color: var(--c-ink) !important;
    border-radius: var(--r-md) !important; font-weight: 600; font-size: var(--t-md); cursor: pointer; transition-property: background-color, scale, opacity; transition-duration: 150ms; }
.v2ds .v2ds-btn:hover { background: var(--c-hover) !important; }
.v2ds .v2ds-btn:active { scale: 0.96; }
.v2ds .v2ds-primary { background: var(--c-ink) !important; color: var(--c-card) !important; border-color: var(--c-ink) !important; }
.v2ds .v2ds-primary:hover { background: var(--c-ink-hover) !important; }
.v2ds .v2ds-btn:disabled { opacity: 0.5; cursor: progress; }
.v2ds-link { font-size: var(--t-xs); font-weight: 600; color: var(--c-ink-2); text-decoration: underline; min-height: 32px; padding: 0 2px; background: none; border: 0; cursor: pointer; }
@media (max-width: 640px) {
    .v2ds { padding: 0; align-items: stretch; }
    .v2ds > .v2ds-panel { width: 100%; height: 100%; height: 100dvh; max-height: none; border-radius: 0 !important; box-shadow: none !important; animation-name: v2ds-up; }
    @keyframes v2ds-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
    .v2ds-head { padding: 12px var(--s-4) 0; padding-top: max(12px, env(safe-area-inset-top)); }
    .v2ds-body { padding: 0 var(--s-4) var(--s-6); }
    .v2ds-foot { padding-left: var(--s-4); padding-right: var(--s-4); }
    .v2ds .v2ds-input, .v2ds .v2num > input, .v2ds .v2sel-btn.v2ds-input { font-size: 16px; min-height: 44px; }   /* 16px so iOS keeps the zoom */
    .v2ds .v2num { min-height: 44px; }
    .v2ds-footrow { flex-wrap: wrap; row-gap: 8px; }
    .v2ds-state { flex-basis: 100%; font-size: var(--t-xs); }
    .v2ds-state:empty, .v2ds-state:not([data-dirty="1"]):not(:empty) { display: none; }
    .v2ds .v2ds-footrow .v2ds-btn { flex: 1 1 0; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .v2ds > .v2ds-panel { animation: none; } }

/* ---------- page header controls (admin, control, costs, leads: the /costs look, token sizes) ---------- */
.nav-btn {
    height: var(--h-sm); box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
    font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--c-ink); background: #fff;
    border: 1px solid var(--c-line-2); border-radius: var(--r-md); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.nav-btn:hover { background: var(--c-hover); border-color: var(--c-line-3); }
.nav-btn:active { background: var(--c-line); }
.nav-btn.icon { width: var(--h-sm); padding: 0; justify-content: center; }
.nav-btn.primary { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.nav-btn.primary:hover { background: var(--c-ink-hover); border-color: var(--c-ink-hover); }
.nav-btn.nav-bad { color: var(--c-bad); }
.nav-btn .nav-ico, .nav-btn .material-symbols-sharp { font-size: 18px; }
.nav-ctl { height: var(--h-sm) !important; }
.v2-pagetag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-sm); background: var(--c-hover);
    color: var(--c-ink); font-size: var(--t-xs); font-weight: 700; white-space: nowrap; }
/* internal pages' cards: white header with a hairline, card radius */
html body .card { border-radius: var(--r-lg); border-color: var(--c-line) !important; }
html body .card > .bg-gray-200:first-child, html body .card > .bg-gray-100:first-child { background: #fff; border-bottom: 1px solid var(--c-line); }
html body .card thead, html body .card thead tr { background: var(--c-subtle); }
/* every dialog: modal radius, shadow, one backdrop (pages whose dialogs are .card panels in a fixed *Modal) */
html body [id$="Modal"].fixed:not(.v2ds) { background-color: var(--c-backdrop); }
html body [id$="Modal"].fixed > .card { border-radius: var(--r-xl); border: 0 !important; box-shadow: var(--sh-modal); overflow: hidden; }

/* a leading icon on an ordinary button keeps its 6px gap */
:not(.nav-btn) > .nav-ico:first-child { margin-right: 6px; }
/* page header on a phone: the buttons wrap under the title and show their icon only */
.v2-pagehead > div:last-child { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
    .v2-pagehead .nav-btn { padding: 0; width: var(--h-sm); justify-content: center; font-size: 0; gap: 0; }
    .v2-pagehead .nav-btn .material-symbols-sharp { font-size: 18px; margin: 0; }
}
/* a stepper never squeezes its number: small fields keep room for 4 digits */
.v2num > input { min-width: 3.5em; }

/* ---------- the button: one component for bars, cards, menus and sheets (Nov 16 polish) ----------
   <button class="v2-btn [primary|go|quiet] [sm|lg] [icon] [block]">[svg.ii] Label</button>   (works on <a> too)
   Default 40px high, 8px radius, 14/600, icon 16px with an 8px gap, label never wraps. Contexts may set height (bar: 48 on a phone). */
html body .v2-btn {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
    height: var(--h-md); padding: 0 14px; border: 1px solid var(--c-line-2); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink);
    font-family: inherit; font-size: var(--t-md); font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; position: relative;
    transition-property: background-color, border-color, color, box-shadow, scale, opacity; transition-duration: 150ms; transition-timing-function: var(--c-ease);
}
html body .v2-btn.hidden, html body .v2-btn[hidden] { display: none; }
html body .v2-btn:hover { background: var(--c-hover); }
html body .v2-btn:active:not(:disabled) { scale: 0.96; }
html body .v2-btn:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }
html body .v2-btn:disabled, html body .v2-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
html body .v2-btn.primary { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-card); }
html body .v2-btn.primary:hover { background: var(--c-ink-hover); }
html body .v2-btn.go { background: var(--c-go); border-color: var(--c-go); color: #fff; }
html body .v2-btn.go:hover { background: var(--c-go-hover); }
html body .v2-btn.quiet { border-color: transparent; background: transparent; color: var(--c-ink-2); }
html body .v2-btn.quiet:hover { background: var(--c-hover); color: var(--c-ink); }
html body .v2-btn.sm { height: var(--h-sm); padding: 0 10px; font-size: var(--t-sm); gap: 6px; }
html body .v2-btn.lg { height: var(--h-lg); padding: 0 18px; }
html body .v2-btn.icon { width: var(--h-md); padding: 0; }
html body .v2-btn.icon.sm { width: var(--h-sm); }
html body .v2-btn.icon.lg { width: var(--h-lg); }
html body .v2-btn.block { width: 100%; }
html body .v2-btn > svg, html body .v2-btn > .v2-swap > svg { flex: none; width: 16px; height: 16px; }
html body .v2-btn.icon > svg, html body .v2-btn.icon > .v2-swap > svg, html body .v2-btn.lg > svg { width: 18px; height: 18px; }
html body .v2-btn > .material-symbols-sharp { font-size: 18px; flex: none; }
/* small controls keep a 40px hit area */
html body .v2-btn.sm::after { content: ""; position: absolute; inset: -4px; }

/* two icons in one slot, cross-faded (copy -> check): .v2-swap > svg + svg, the button gets .done for a moment */
.v2-swap { position: relative; display: inline-grid; place-items: center; flex: none; }
.v2-swap > svg { grid-area: 1 / 1; transition-property: opacity, scale, filter; transition-duration: 150ms; transition-timing-function: var(--c-ease); }
.v2-swap > svg + svg, .done > .v2-swap > svg:first-child { opacity: 0; scale: 0.25; filter: blur(4px); }
.done > .v2-swap > svg + svg { opacity: 1; scale: 1; filter: none; color: var(--c-go); }
@media (prefers-reduced-motion: reduce) { .v2-swap > svg { transition: none; } }

/* ---------- sheet content (inside .v2ds-body): cards, label/value rows, contact lines, option rows ---------- */
.v2ds-sec.flush { padding-bottom: var(--s-5); }
.v2ds-hrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: 10px; min-height: var(--h-sm); }
.v2ds-hrow > .v2ds-h { margin: 0; }
.v2-card { background: var(--c-subtle); border-radius: var(--r-lg); padding: var(--s-3) 14px; font-size: var(--t-md); color: var(--c-ink); min-width: 0; }
.v2-card + .v2-card { margin-top: var(--s-2); }
.v2-prose { line-height: 1.5; color: var(--c-ink-2); text-wrap: pretty; overflow-wrap: anywhere; }
.v2-kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 7px 0; }
.v2-kv > div + div { box-shadow: inset 0 1px 0 var(--c-line); }
.v2-kv .k { flex: none; color: var(--c-muted); }
.v2-kv .v { min-width: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-kv > .strong .k { color: var(--c-ink); font-weight: 600; }
.v2-kv > .strong .v { font-size: var(--t-xl); font-weight: 700; }
.v2-kv.left > div { justify-content: flex-start; gap: var(--s-3); }
.v2-kv.left .k { width: 96px; }
.v2-kv.left .v { text-align: left; font-weight: 500; }
.v2-line { display: flex; align-items: center; gap: 10px; min-height: var(--h-md); }
.v2-line > svg { flex: none; width: 18px; height: 18px; color: var(--c-muted); }
.v2-line > .v { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 500; color: var(--c-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.v2-line > .v2-btn { margin-right: -8px; }
.v2-acts { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.v2-acts > .v2-btn { flex: 1 1 0; min-width: 0; }
.v2-opts { display: grid; gap: var(--s-2); }
.v2-opt { display: flex; align-items: center; gap: var(--s-3); min-height: var(--h-lg); padding: 8px 14px; border: 1px solid var(--c-line-2); border-radius: var(--r-md);
    font-size: var(--t-md); color: var(--c-ink); cursor: pointer; transition-property: border-color, background-color, box-shadow; transition-duration: 150ms; transition-timing-function: var(--c-ease); }
.v2-opt:hover { background: var(--c-subtle); }
.v2-opt:has(input:checked) { border-color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-ink); }
.v2-opt > input { flex: none; margin: 0; }
.v2-opt small { display: block; margin-top: 1px; font-size: var(--t-xs); color: var(--c-muted); }
/* text links inside a sheet keep a finger-sized hit area */
.v2ds-body a.v2ds-link { position: relative; }
.v2ds-body a.v2ds-link::after { content: ""; position: absolute; inset: -12px -6px; }
/* buttons in a sheet footer: same component, full-width halves on a phone */
.v2ds-footrow > .v2-btn { padding: 0 18px; }
@media (max-width: 640px) { .v2ds .v2ds-footrow > .v2-btn { flex: 1 1 0; height: 44px; } }
