/* Simulator with the next driving inside: the engine frame, the first-visit question and the
   Debrief's checklist, in the page's own tokens (toy.css). */
#fit-engine { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; border: 0; display: block; background: #BFE6FF; z-index: 0; pointer-events: none; }
#fit-engine[hidden] { display: none; }
/* After the drive the page's Debrief opens over the finished drive (the panel and the top bar above it). */
body.fit-debrief #fit-engine { z-index: 5; }
body.fit-debrief #scene, body.fit-debrief #pins, body.fit-debrief #labels { visibility: hidden; }
body.fit-debrief .db-scrub, body.fit-debrief .db-watch, body.fit-debrief .db-tags { display: none !important; }
body.fit-driving #pins, body.fit-driving #labels, body.fit-driving #rain-layer, body.fit-driving #tilt { visibility: hidden; }

.fit-checks { margin: .9em 0 .2em; }
.fit-checks h3 { font: 700 .78em/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .5em; }
.fit-checks ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5em, 1fr)); gap: .4em .6em; }
.fit-checks li { display: flex; align-items: center; gap: .5em; font-weight: 600; font-size: .92em; color: var(--ink); }
.fit-checks li i { flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8em;
  border: 2px solid var(--ink); }
.fit-checks li.ok i { background: var(--go-soft); color: var(--go-ink); }
.fit-checks li.miss i { background: var(--hot-soft); color: var(--hot-ink); }

.fit-onboard { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1.2em calc(1.2em + var(--safe-r)) 1.2em calc(1.2em + var(--safe-l));
  background: rgba(24, 38, 74, .38); }
.fit-card { width: min(34em, 100%); background: var(--surface); color: var(--ink); border: var(--outline) solid var(--ink); border-radius: var(--r-panel);
  box-shadow: var(--shadow-panel); padding: 1.5em 1.5em 1.4em; }
.fit-eyebrow { margin: 0 0 .3em; font-weight: 700; font-size: .8em; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.fit-card h2 { font: 800 2em/1.05 var(--font-display); margin: 0 0 .35em; letter-spacing: -.01em; }
.fit-lead { margin: 0 0 1.1em; color: var(--ink-2); line-height: 1.45; }
.fit-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.fit-choices button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: .35em; align-content: start; padding: 1em 1.05em 1.1em;
  background: var(--surface-2); border: var(--outline) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-btn); transition: transform .12s, box-shadow .12s, background .12s; }
.fit-choices button b { font: 800 1.35em/1.1 var(--font-display); }
.fit-choices button span { color: var(--ink-2); font-size: .93em; line-height: 1.4; }
.fit-choices button:hover { background: var(--sun-soft); }
.fit-choices button:active { transform: translate(.12em, .12em); box-shadow: .06em .06em 0 var(--ink); }
.fit-choices button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 520px) {
  .fit-choices { grid-template-columns: 1fr; }
  .fit-card h2 { font-size: 1.7em; }
}
/* The page's own minimap follows its own world, not the street in the frame. */
body.fit-driving #h-map-wrap, body.fit-driving #h-map-toggle { display: none !important; }

/* Country skin: one chip in the top bar that opens the full list (instead of 16 pills). */
#header.topbar .ltd-region-bar, #header .ltd-region-switch { display: none !important; }
#header.topbar .fit-region { position: relative; flex: none; margin-inline-start: auto; }
#header.topbar .fit-region + .me { margin-inline-start: 0; }
.fit-region-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px 0 13px;
  border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #18264a); border: 2.5px solid var(--ink, #18264a); box-shadow: var(--shadow-btn, .18em .18em 0 #18264a);
  font: 800 14px/1 var(--font-display, inherit); direction: ltr; transition: transform .12s, box-shadow .12s, background-color .12s; }
.fit-region-btn:hover { background: var(--surface-2, #edf6ff); }
.fit-region-btn:active { transform: translate(.1em, .1em); box-shadow: .06em .06em 0 var(--ink, #18264a); }
.fit-region-btn:focus-visible, .fit-region-item:focus-visible { outline: 3px solid #ffc20e; outline-offset: 2px; }
.fit-region-btn .fit-caret { color: var(--ink-2, #44537c); transition: transform .15s; }
.fit-region-btn[aria-expanded="true"] .fit-caret { transform: rotate(180deg); }
.fit-region .ltd-flag { flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(17, 20, 36, .22), 0 1px 1.5px rgba(17, 20, 36, .28); }
.fit-region-pop { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 70; width: min(31em, calc(100vw - 24px)); max-height: min(72vh, 34em); overflow: auto;
  background: var(--surface, #fff); color: var(--ink, #18264a); border: var(--outline, 2.5px) solid var(--ink, #18264a); border-radius: var(--r-panel, 18px);
  box-shadow: var(--shadow-panel, .3em .3em 0 #18264a); padding: .7em .55em .55em; }
.fit-region-pop[hidden] { display: none; }
.fit-region-h { margin: 0 .55em .45em; font: 700 .72em/1.2 var(--font-body, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2, #44537c); }
.fit-region-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px; }
.fit-region-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 .6em; border-radius: 11px;
  font-weight: 650; font-size: .92em; color: var(--ink, #18264a); min-width: 0; }
.fit-region-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit-region-item small { flex: none; font-weight: 800; font-size: .78em; color: var(--ink-3, #7c8bb0); letter-spacing: .02em; }
.fit-region-item:hover { background: var(--surface-2, #edf6ff); }
.fit-region-item.on { background: var(--ink, #18264a); color: #fff; }
.fit-region-item.on small { color: rgba(255, 255, 255, .7); }
.fit-region-item.fit-wide { grid-column: 1 / -1; }
.fit-sep { grid-column: 1 / -1; height: 1.5px; margin: 5px .4em; background: var(--line, rgba(24, 38, 74, .14)); }
@media (max-width: 1240px) and (min-width: 761px) and (min-height: 501px) { #header.topbar .fit-region { order: 4; } }
@media (max-width: 760px) {
  #header.topbar .fit-region { order: 4; margin-inline-start: 0; }
  #header.topbar .fit-region + .me { margin-inline-start: auto; }
  .fit-region-pop { position: fixed; inset: auto 12px 12px 12px; top: auto; width: auto; max-height: 72vh; }
  .fit-region-list { grid-template-columns: 1fr; }
}
@media (max-height: 500px) and (min-width: 560px) {
  #header.topbar .fit-region { order: 0; }
  .fit-region-btn { min-height: 38px; }
  .fit-region-pop { position: fixed; top: 56px; inset-inline-end: 12px; max-height: calc(100vh - 68px); }
  .fit-region-list { grid-template-columns: 1fr 1fr; }
}

/* A crash in the new driving: the card that says what was hit and why (fit/app.js fitCrashCard). */
body.fit-crashed #fit-engine { filter: saturate(.55) brightness(.8); transition: filter .4s; }
.fit-crash { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, rgba(120, 10, 30, .18), rgba(10, 14, 30, .55)); animation: fit-crash-in .28s ease-out; }
.fit-crash-card { width: min(31em, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; padding: 1.1em 1.25em 1.05em; border-radius: var(--r-panel, 18px);
  background: var(--surface, #fff); color: var(--ink, #18264a); border: var(--outline, 2.5px) solid var(--ink, #18264a); box-shadow: var(--shadow-panel, 0 12px 40px rgba(0,0,0,.35));
  font: 500 1rem/1.42 var(--font-body, system-ui, sans-serif); }
.fit-crash-tag { display: inline-flex; align-items: center; gap: .45em; margin: 0 0 .35em; padding: .2em .65em; border-radius: 999px; background: var(--hot, #e23b5a); color: #fff;
  font: 800 .82em/1.3 var(--font-display, inherit); letter-spacing: .02em; }
.fit-crash-tag::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: #fff; }
.fit-crash h2 { margin: 0 0 .3em; font-size: 1.45em; line-height: 1.15; }
.fit-crash h3 { margin: .85em 0 .3em; font-size: .95em; }
.fit-crash-real { margin: 0; color: var(--ink-2, #44537c); }
.fit-crash ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .4em; }
.fit-crash li { position: relative; padding: .45em .6em .45em 1.7em; border-radius: var(--r-row, 12px); background: var(--surface-2, #edf6ff); }
.fit-crash li::before { content: ""; position: absolute; left: .7em; top: .95em; width: .45em; height: .45em; border-radius: 50%; background: var(--hot, #e23b5a); }
.fit-crash-note { margin: .85em 0 0; padding: .5em .65em; border-radius: .6em; background: var(--sun-soft, #fff1c2); font-weight: 700; font-size: .93em; }
.fit-crash-go { display: flex; flex-wrap: wrap; gap: .55em; margin-top: .9em; }
.fit-crash-go .btn { flex: 1 1 11em; justify-content: center; }
.fit-crash-go kbd { margin-inline-start: .45em; padding: .05em .4em; border-radius: .35em; font: 700 .72em/1.4 var(--font-body, system-ui); background: rgba(255,255,255,.22); border: 1px solid currentColor; opacity: .75; }
@keyframes fit-crash-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fit-crash { animation: none; } }
@media (max-height: 500px) { .fit-crash-card { font-size: .88rem; padding: .8em 1em; } .fit-crash h3 { margin-top: .55em; } .fit-crash-note { margin-top: .55em; } .fit-crash-go { margin-top: .6em; } }
.fit-crash-go .btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 1em; border-radius: var(--r-btn, 14px); font: 800 1em/1.2 var(--font-display, inherit); cursor: pointer; }
.fit-crash-go .btn.ghost { visibility: visible; opacity: 1; background: var(--surface-2, #edf6ff); color: var(--ink, #18264a); border: 2px solid var(--ink, #18264a); box-shadow: none; }
.fit-crash-go .btn.ghost kbd { background: rgba(24, 38, 74, .08); }
@media (max-height: 500px) {
  .fit-crash-card { width: min(46em, 100%); font-size: .84rem; padding: .7em 1em .8em; }
  .fit-crash h2 { font-size: 1.3em; }
  .fit-crash li { padding: .3em .6em .3em 1.6em; }
  .fit-crash li::before { top: .8em; }
  .fit-crash-go .btn { min-height: 40px; }
}
@media (pointer: coarse) { .fit-crash-go kbd { display: none; } }
