/* Pico is conditional, but its variables are global. Explicit light V1 tokens
   override its responsive/default theme without applying .pico to the app shell. */
:root[data-theme="light"], .pico[data-theme="light"] {
  color-scheme: light;
  --pico-font-family: var(--font);
  --pico-font-size: 16px;
  --pico-line-height: 1.45;
  --pico-color: var(--ink);
  --pico-background-color: var(--bg);
  --pico-muted-color: var(--muted);
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent);
  --pico-primary-inverse: #fff;
  --pico-primary-hover: var(--accent-press);
  --pico-primary-hover-background: var(--accent-press);
  --pico-primary-hover-border: var(--accent-press);
  --pico-primary-focus: var(--accent-soft);
  --pico-secondary-background: var(--fill);
  --pico-secondary-border: var(--fill);
  --pico-secondary-inverse: var(--ink);
  --pico-secondary-hover-background: var(--fill-hover);
  --pico-secondary-hover-border: var(--fill-hover);
  --pico-secondary-focus: var(--accent-soft);
  --pico-border-radius: var(--r-btn);
  --pico-form-element-background-color: var(--card);
  --pico-form-element-border-color: #c7ccd5;
  --pico-form-element-color: var(--ink);
  --pico-form-element-active-background-color: var(--card);
  --pico-form-element-active-border-color: var(--accent);
  --pico-form-element-focus-color: var(--accent-soft);
  --pico-form-element-placeholder-color: var(--muted);
  --pico-form-element-spacing-vertical: 12px;
  --pico-form-element-spacing-horizontal: 16px;
  --pico-card-background-color: var(--card);
  --pico-card-sectioning-background-color: var(--card);
  --pico-card-border-color: transparent;
  --pico-card-box-shadow: 0 16px 48px -16px rgb(22 23 27 / 24%);
  --pico-modal-overlay-background-color: rgb(22 23 27 / 48%);
  --pico-modal-overlay-backdrop-filter: none;
}
.f.pico input,.f.pico textarea {margin-bottom:0}
.v-uppercase {text-transform:uppercase}
.btn.v-width-auto {width:auto}
.stack.v-gap-small {gap:6px}
::selection {background:var(--accent-soft);color:var(--ink)}
input,textarea {caret-color:var(--accent)}
.pico :focus-visible,.seg button:focus-visible,.seg3 button:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
/* Pico owns the backdrop, article, button and form foundations. Only geometry
   and V1 composition are adapted here. No runtime CSSOM sizing. */
.pico .v-sheet {align-items:flex-end;overflow-y:auto;overscroll-behavior:contain}
.pico .v-sheet:not([open]) {display:none}
.pico .v-sheet>article {
  width:100%;max-width:720px;max-height:92vh;max-height:92dvh;
  margin:0 auto;padding:24px 16px calc(24px + env(safe-area-inset-bottom));
  border-radius:var(--r-card) var(--r-card) 0 0;
  font-family:var(--font);color:var(--ink);overflow-wrap:anywhere;
}
.pico .v-sheet>article>header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px;padding:0;border:0}
.pico .v-sheet h2 {margin:0;font-size:20px;line-height:1.2;font-weight:800}
.pico .v-sheet button {min-height:48px;font-weight:700;flex-shrink:0}
.v-photo-original {margin:0;display:grid;gap:12px}
.v-photo-original img {width:100%;max-height:64vh;max-height:64dvh;object-fit:contain;border-radius:var(--r-row);background:var(--fill)}
.v-photo-original figcaption {font:400 14px/1.4 var(--font);color:var(--ink-2)}
#toasts .v-feedback .link {color:var(--ink);text-align:left;min-height:44px}
#toasts .v-feedback {border:1px solid var(--line);border-radius:var(--r-row);background:var(--card);color:var(--ink);overflow-wrap:anywhere}
@media (min-width:768px) {
  .pico .v-sheet {align-items:center;padding:24px}
  .pico .v-sheet>article {margin:auto;border-radius:var(--r-card);padding:24px}
}
@media (prefers-reduced-motion:reduce) {
  .pico {--pico-transition:0s}
  .pico .v-sheet,.v-feedback {animation:none;transition:none}
}
.v-feedback-region:empty {display:none}
.v-feedback-region {position:sticky;top:0;z-index:110;max-width:1000px;max-height:40vh;max-height:40dvh;overflow-y:auto;margin:16px auto;padding:0 16px}
/* The menu is a sibling of the header; native modal dialogs stay in the top layer. */
.menu {z-index:120}
.v-feedback-region .v-feedback {pointer-events:auto;opacity:1;transform:none;border:0;background:var(--st-stop);color:var(--ink);box-shadow:none;overflow-wrap:anywhere}
.v-feedback-region .v-feedback .link {color:var(--ink);min-height:44px;text-align:left}
body:has(.v-sheet[open]) {overflow:hidden}

#toasts .v-feedback-error {pointer-events:auto;background:var(--st-stop)}

/* Editable photos keep preview, caption and removal in separate rows. */
.ph:has(>.phx) {display:grid;gap:4px;align-content:start}
.ph:has(>.phx)>img {min-height:84px}
.ph>.phx {position:static;justify-self:end;width:44px;height:44px;min-width:44px;min-height:44px}

/* Reserve scroll space for the new-request dock, including wrapped labels. */
html:has([data-a="submitReq"]) {scroll-padding-bottom:calc(160px + env(safe-area-inset-bottom))}
@media (max-width:960px) {
  body:has([data-a="submitReq"]) #main {padding-bottom:calc(160px + env(safe-area-inset-bottom))}
}

/* Phase B: request, estimate and journey composition in the existing V1 shell. */
.v-journey {background:var(--card);border-radius:var(--r-card);padding:12px 16px;margin:8px 0 12px;min-width:0}
.v-journey>ol {display:flex;gap:8px;overflow-x:auto;list-style:none;padding:0 0 6px;margin:0;scrollbar-width:thin}
.v-journey>ol>li {position:relative;flex:1 0 auto;min-width:0;border-top:3px solid var(--line);padding:8px 0 0;font-size:14px;line-height:1.3;white-space:nowrap;overflow-wrap:normal;word-break:normal}
.v-journey>ol>.v-journey-current {border-color:var(--accent);color:var(--accent-press);font-weight:800}
.v-journey>ol>.v-journey-recorded {border-color:var(--ink-2)}
.v-journey>ol>.v-journey-waiting {border-top-style:dashed}
.v-now b {font-size:20px;line-height:1.3;overflow-wrap:normal;word-break:normal}
.v-journey-cancel {background:var(--st-stop);border-radius:12px;padding:12px;margin-top:12px;overflow-wrap:anywhere}
.v-branches {margin-top:12px;border-top:1px solid var(--line)}
.v-branches ol {display:grid;gap:8px;list-style:none;margin:0;padding:0}
.v-branches li {background:var(--fill);border-radius:12px;padding:12px;overflow-wrap:anywhere}
.v-branches li.v-branch-current {background:var(--st-wait)}
.v-branches li span {display:block;font-size:14px;margin-top:4px}
.v-journey>.link {font-size:14px;text-align:left}
.v-receipt>summary {font-size:18px;font-weight:800;gap:8px}
.v-receipt>summary::before,.v-branches>summary::before {content:'+';font-size:20px;flex:none}
.v-receipt[open]>summary::before,.v-branches[open]>summary::before {content:'−'}
.v-version {font-size:14px;overflow-wrap:anywhere;margin-top:8px}
.v-form-error,.v-field-error {color:#852c24;background:var(--st-stop);border-radius:12px;padding:12px;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.v-field-error {display:block;margin-top:4px}
.v-form-error {margin:0 0 8px}
[aria-invalid="true"] {border-color:#852c24}
.v-estimate-editor .erow {align-items:flex-start}
.v-estimate-editor .f {font-size:14px}
.v-estimate-selection {display:grid;gap:8px}
.v-request-source h2,.v-request-car h2,.v-request-summary h2 {margin:0}
.v-request-summary p,.v-request-summary b {overflow-wrap:anywhere}
.v-action-area .v-choices {display:grid;gap:8px}
.v-action-area .v-choices .item>.ln {display:flex;align-items:baseline;gap:16px;justify-content:space-between;margin-bottom:12px}
.v-action-area .v-choices .item>.ln>b:first-child {min-width:0;overflow-wrap:anywhere}
.v-action-area .v-choices .item>.ln>b:last-child {flex:none;white-space:nowrap}
.v-qsum>button span,.v-filters>button {font-size:14px}
/* Four readable queue filters retain a full touch target at 390px. */
.v-qsum>button {padding:10px 6px;min-height:64px}
.v-qsum>button span {white-space:nowrap;overflow-wrap:normal}
.v-rowtext>small,.v-sync,.v-blkh>span {font-size:14px}
/* One menu remains in the shared header on mobile order screens. */
@media (max-width:960px) {
  .top.v-order-top {display:flex}
  .v-dock:not(.v-choice-dock):has(.v-form-error) {position:sticky;left:auto;transform:none;max-width:none;padding:12px 0;background:var(--bg);box-shadow:none}
}
@media (min-width:961px) {
  .col {max-width:960px}
  body:has(.v-request-car) .col {max-width:760px}
  .split {grid-template-columns:360px minmax(0,1fr)}
  .pane.detail .v-hdr h1 {font-size:30px}
  .empty.big {padding:32px 24px;font-size:20px;min-height:0}
}

/* Intake / damage map: original twelve-zone top view, with a full text alternative. */
.v-body-map {display:block;width:100%;max-width:400px;min-width:280px;height:auto;margin:0 auto;overflow:visible}
/* Override legacy svg stroke only for lettering, including nested tspans and compass. */
.v-body-map text,.v-body-map tspan {stroke:none}
.v-body-outline {fill:var(--fill);stroke:var(--muted);stroke-width:2;stroke-linejoin:round}
.v-body-glass {fill:var(--accent-soft);stroke:var(--line);stroke-width:2}
.v-body-zone {cursor:pointer;outline:none}
.v-body-zone path {fill:var(--card);stroke:var(--muted);stroke-width:2;stroke-linejoin:round}
.v-body-zone text {fill:var(--ink);font:700 20px var(--font);text-anchor:middle;dominant-baseline:middle;pointer-events:none}
/* The tapered side panels need shorter glyphs to keep both lines inside the shape. */
.v-body-zone[data-v="left-side"] text,.v-body-zone[data-v="right-side"] text {font-size:14px}
.v-body-zone.is-selected path {fill:var(--accent-soft);stroke:var(--accent);stroke-width:3}
.v-body-zone:focus-visible path {stroke:var(--accent);stroke-width:5;stroke-dasharray:6 3}
.v-body-zone[role="button"]:hover path {fill:var(--accent-soft)}
.v-zone-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.v-zone-list .btn {white-space:normal;text-align:left;justify-content:flex-start;font-size:14px;padding:12px;min-height:56px}
.v-zone-choice.is-selected,.v-none-choice[aria-pressed="true"] {background:var(--accent-soft);color:var(--accent-press);box-shadow:inset 0 0 0 2px var(--accent)}
.v-zone-choice:focus-visible,.v-none-choice:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
.v-damage-text {white-space:pre-wrap;overflow-wrap:anywhere;font:400 14px/1.5 var(--font);color:var(--ink);margin:12px 0}
.v-damage small {white-space:normal}
.v-diff dt small {display:block;font-size:14px;font-weight:400;margin-top:4px}
.v-save-state {padding:12px 16px;border-radius:var(--r-row);background:var(--st-wait);color:var(--ink);font-size:14px}
.v-stop-note {padding:16px;border-radius:var(--r-row);background:var(--st-stop);color:var(--ink)}
.v-attempts {padding:16px 0}
.v-attempts article {padding:12px 0}
body[data-role="service"] .v-action-area :is(button,.btn,input:not([type="checkbox"]),select),
body[data-role="service"] .v-action-area summary {min-height:56px}
body[data-role="service"] .v-action-area button {min-width:56px}
.v-body-zone[role="img"] {cursor:default}
body[data-role="service"] .v-action-area summary {display:flex;align-items:center}
body[data-role="service"] .v-action-area .phx {width:56px;height:56px;min-width:56px}
@media (max-width:360px) {.v-zone-list {grid-template-columns:1fr}}

.v-body-front {fill:var(--ink-2);font:600 14px var(--font);text-anchor:middle;stroke:none}
.v-zone-sheet :is(button,select,textarea) {min-height:56px}
.v-zone-sheet .phs {margin:8px 0}

body[data-role="service"] .pico .v-sheet button {min-height:56px;min-width:56px}

/* Phase D: related originals, a factual closing report, and car-centred history. */
.v-preserve {white-space:pre-wrap;overflow-wrap:anywhere}
.v-result-item {display:grid;gap:12px;min-width:0}
.v-result-item h3,.v-warranty h3,.v-history-record h3 {margin:0;font-size:18px;font-weight:800;line-height:1.3}
.v-result-item .ihead {align-items:baseline;gap:12px}
.v-result-item .ihead h3 {min-width:0;overflow-wrap:anywhere}
.v-not-done {background:var(--st-stop)}
.v-comparison {min-width:0;display:grid;gap:12px}
.v-photo-pair {display:grid;grid-template-columns:minmax(0,1fr);gap:16px;min-width:0}
.v-photo-side {display:grid;align-content:start;gap:8px;min-width:0}
.v-photo-side h4 {font-size:16px;line-height:1.4;font-weight:800;margin:0}
.v-evidence-photo {margin:0;min-width:0;display:grid;gap:8px}
.v-evidence-photo>img {display:block;width:100%;height:200px;object-fit:contain;border-radius:var(--r-row);background:var(--fill);cursor:zoom-in}
.v-evidence-photo>img:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
.v-evidence-photo figcaption {font:400 14px/1.4 var(--font);overflow-wrap:anywhere;color:var(--ink)}
.v-evidence-photo figcaption small {display:block;font-size:14px;color:var(--ink-2);margin-top:4px}
.v-photo-empty {min-height:120px;padding:24px 16px;border-radius:var(--r-row);background:var(--bg);color:var(--ink-2);display:grid;place-items:center;text-align:center}
.v-photo-viewer .v-evidence-photo>img {height:50vh;height:50dvh;cursor:default}
.v-garage {gap:24px}
.v-garage-head h1 {margin-bottom:8px}
.v-garage-summary {border-radius:28px;background:var(--t-sand);padding:24px}
.v-garage-summary>strong {display:block;font-size:28px;font-weight:800;line-height:1.2;margin-bottom:12px}
.v-garage-summary>p {color:var(--ink-2);max-width:60ch}
.v-garage-cars {display:grid;gap:12px}
.v-garage .v-secondary {display:grid;grid-template-columns:1fr;gap:8px;margin:0}
.v-garage .v-secondary .btn {min-height:56px}
.v-history-record {gap:12px}
.v-reminder,.v-access-link {padding:16px 0;overflow-wrap:anywhere}
.v-source-receipt p {margin:8px 0}
.v-garage .sleeping {margin-bottom:0}
@media (max-width:767px) {
  .v-comparison[data-phase="before"] [data-photo-phase="after"],
  .v-comparison[data-phase="after"] [data-photo-phase="before"] {display:none}
}
@media (min-width:768px) {
  .v-photo-segments {display:none}
  .v-photo-pair {grid-template-columns:repeat(2,minmax(0,1fr))}
  .v-garage-cars {grid-template-columns:repeat(2,minmax(0,1fr))}
  .v-garage .v-secondary {grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Available primary stays blue; disabled is explicitly grey with a dock hint. */
.v-dock>.btn:not(.pri),.v-secondary>.btn {background:var(--card);color:var(--ink)}
.v-dock .btn.pri:disabled {background:var(--fill-hover)!important;color:var(--ink-2)!important;opacity:1;cursor:not-allowed}
.v-body-wheel {fill:var(--ink);stroke:var(--ink);stroke-width:3;stroke-linejoin:round}
.v-body-detail {fill:none;stroke:var(--muted);stroke-width:3;stroke-linecap:round}
.v-body-zone[data-v="glass"] path {fill:var(--accent-soft)}
.v-body-zone[data-v="glass"].is-selected path {stroke:var(--accent);stroke-width:3}

.v-action-area .btn:not(.pri):not(.badb):not(.okb):not(.is-selected):not([aria-pressed="true"]),
.v-request-summary .btn:not(.pri) {background:var(--card);color:var(--ink)}

/* P-V3: the reason travels with the client action, including before scrolling. */
.v-choice-dock {display:grid;gap:8px}
.v-choice-dock .v-dock-hint {margin:0;color:var(--ink-2);font-size:14px;line-height:1.35}
body:has(.v-choice-dock) #main {padding-bottom:calc(180px + env(safe-area-inset-bottom))}
@media (min-width:961px) {
  .v-choice-dock {position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:calc(100% - 64px);max-width:960px;padding:12px 0}
  .pane.detail .v-choice-dock {left:auto;transform:none;right:max(32px,calc((100vw - 1240px)/2 + 32px));width:calc(min(100vw,1240px) - 448px);max-width:none}
}

/* R3B: keep all six journey labels visible at 390 without reducing type. */
@media (max-width:420px) {
  .v-journey {padding-left:8px;padding-right:8px}
  .v-journey>ol {gap:4px}
}
