/* Screen-specific layouts: home, garage, scan, detail, feed, map. */

/* Account */
.login-cta { display: grid; gap: 10px; margin-bottom: 14px; border-color: var(--ink); box-shadow: var(--bevel), inset 0 0 0 2px var(--accent-2); }
.login-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.login-open { width: 100%; }
.login-status { margin-top: 12px; text-align: center; }

/* Home: spotter licence */
.license { padding: 0; }
.license-head {
  padding: 8px 12px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent-ink);
  background: var(--accent);
  border-bottom: var(--px) solid var(--ink);
}
/* The compact licence on the home screen: the nickname (a link to the profile) and level over the XP bar, which is a
   button opening the level infographic (js/screens/levels.js). */
a.license-name { text-decoration: none; }
.license-xp-button { width: 100%; color: inherit; font: inherit; text-align: left; background: none; border: 0; border-top: 2px dashed var(--line); cursor: pointer; }
.license-xp-button:hover { background: var(--panel-2); }

/* The level infographic sheet. */
.level-now { display: grid; gap: 6px; }
.level-now p { margin: 0; }
.level-now-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.level-now-lv { font-family: var(--font-pixel); font-size: 18px; color: var(--accent); }
.level-note { margin: 10px 0 6px; font-size: 13px; }
.level-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.level-step {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
  padding: 8px 10px; background: var(--panel-2); border-left: 4px solid var(--line);
}
.level-step .bar, .level-step-left { grid-column: 1 / -1; }
.level-step-lv { font-family: var(--font-pixel); font-size: 9px; }
.level-step-xp { font-family: var(--font-pixel); font-size: 8px; color: var(--accent-2); }
.level-step-left { font-size: 13px; }
.level-step.reached { border-left-color: var(--accent-2); }
.level-step.current { border-left-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.license-compact { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px 12px 4px; }
.license-level { font-family: var(--font-pixel); font-size: 9px; color: var(--accent-2); }
.license-name {
  padding: 0;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  word-break: break-all;
}
.license-rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 14px; }
.license-rows dt { font-family: var(--font-pixel); font-size: 7px; color: var(--muted); align-self: center; }
.license-rows dd { margin: 0; }
.license-xp {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px 12px;
  border-top: 2px dashed var(--line);
  font-size: 14px;
}
.license-xp .muted { grid-column: 1 / -1; font-size: 13px; }

.streak-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.streak-title { font-family: var(--font-pixel); font-size: 10px; color: var(--accent); }
.streak-cells { display: flex; gap: 3px; }
.streak-cells i { width: 10px; height: 10px; background: var(--panel-3); border: 2px solid var(--ink); }
.streak-cells i.on { background: var(--accent); }
.challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.challenge-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 15px; }
.challenge-reward { font-family: var(--font-pixel); font-size: 8px; color: var(--accent-2); white-space: nowrap; align-self: center; }
.challenge.done .challenge-top > span:first-child { color: var(--muted); text-decoration: line-through; }
.challenge-count { font-size: 12px; }

.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.activity-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 10px; padding: 8px; }
.activity-info { min-width: 0; display: grid; gap: 4px; }
.activity-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.activity-xp { font-family: var(--font-pixel); font-size: 10px; color: var(--accent-2); }

.thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 2px solid var(--ink); background: var(--panel-2); }
.thumb-sprite { display: grid; place-items: center; padding: 4px; background: linear-gradient(#2a3a5e 0 62%, #20263a 62%); }
.empty { display: grid; justify-items: start; gap: 12px; }

/* Garage */
.counter { font-family: var(--font-pixel); font-size: 10px; color: var(--accent); }
.garage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.garage-card {
  display: grid;
  gap: 4px;
  padding: 6px 6px 8px;
  background: var(--panel-2);
  border: var(--px) solid var(--ink);
  box-shadow: var(--bevel);
}
.garage-card.caught { box-shadow: var(--bevel), inset 0 0 0 2px var(--rc); background: var(--panel-3); }
.garage-num { justify-self: end; font-family: var(--font-pixel); font-size: 7px; color: var(--muted); }
.garage-make { font-family: var(--font-pixel); font-size: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.garage-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9em); gap: 8px; margin: 6px 0 8px; }
.garage-tools .search-input { margin: 0; }
.garage-tools-single { grid-template-columns: minmax(0, 1fr); }
.garage-level { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.garage-level-title { margin: 0; font-family: var(--font-pixel); font-size: 12px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-card .garage-name { font-size: 8px; }
.brand-count { text-align: center; }
.make-select {
  min-width: 0; padding: 10px 8px; font: inherit; color: var(--text); background: var(--panel-2);
  border: var(--px) solid var(--ink); box-shadow: var(--bevel);
}
.garage-status { margin: 6px 0; }
.garage-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.garage-card:not(.caught) .garage-name { color: var(--muted); }

/* Scan */
.status-pill {
  padding: 6px 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink);
  background: var(--accent-2);
  border: 2px solid var(--ink);
}
.viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: #0a0d16;
  background-image:
    linear-gradient(rgba(46, 196, 182, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 196, 182, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  border: var(--px) solid var(--ink);
  box-shadow: 0 0 0 var(--px) var(--line);
}
.vf-video, .vf-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
/* The photo being scanned is the cropped one, shown whole and in its own proportions, not stretched over the
   portrait viewfinder. */
.vf-image { object-fit: contain; }
.viewfinder[data-mode='live'] .vf-video { display: block; }
.viewfinder[data-mode='analyzing'] .vf-image,
.viewfinder[data-mode='done'] .vf-image { display: block; }
.vf-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 0 32px 56px;
  text-align: center;
  color: var(--muted);
}
.viewfinder:not([data-mode='idle']) .vf-hint { display: none; }
.vf-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  height: 6px;
  background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent-2);
  opacity: 0;
}
.viewfinder[data-mode='analyzing'] .vf-scanline { opacity: 0.85; animation: scan-sweep 1.2s steps(24) infinite alternate; }
@keyframes scan-sweep { to { top: 94%; } }
/* The guide frame (corner brackets, landscape like every catch photo) sits in the middle of the viewfinder: the
   player centres the car in it, and the crop step starts from exactly this area. While a photo is analysed it
   spreads back to the viewfinder edges. */
.vf-guide {
  position: absolute; left: 4%; right: 4%; top: 50%;
  aspect-ratio: 3 / 2; transform: translateY(-50%);
  pointer-events: none;
}
.vf-guide-label {
  position: absolute; left: 0; right: 0; bottom: -26px; text-align: center;
  font-family: var(--font-pixel); font-size: 8px; color: var(--accent);
}
.viewfinder[data-mode='framing'] .vf-guide,
.viewfinder[data-mode='analyzing'] .vf-guide,
.viewfinder[data-mode='done'] .vf-guide { inset: 12px; aspect-ratio: auto; transform: none; }
.viewfinder[data-mode='framing'] .vf-guide-label,
.viewfinder[data-mode='analyzing'] .vf-guide-label,
.viewfinder[data-mode='done'] .vf-guide-label { display: none; }
.vf-corner { position: absolute; width: 28px; height: 28px; border: 4px solid var(--accent); }
.vf-tl { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.vf-tr { top: -4px; right: -4px; border-left: 0; border-bottom: 0; }
.vf-bl { bottom: -4px; left: -4px; border-right: 0; border-top: 0; }
.vf-br { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.scan-controls { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; margin-top: 14px; }
.scan-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.new-tag { font-family: var(--font-pixel); font-size: 9px; color: var(--ink); background: var(--accent); padding: 4px 6px; border: 2px solid var(--ink); }
.result-stage, .detail-stage {
  padding: 18px 14%;
  background: linear-gradient(#2a3a5e 0 64%, #3a3f4f 64% 66%, #20263a 66%);
  border: var(--px) solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--rc, var(--line));
}
.result-name { margin-top: 12px; font-family: var(--font-pixel); font-size: 14px; line-height: 1.4; }
.result-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.result-xp { margin-left: auto; font-family: var(--font-pixel); font-size: 11px; color: var(--accent-2); }
.batch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.batch-row { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; }

/* Detail */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 14px 0 12px; }
.stat-table { margin: 0; padding: 0; display: grid; grid-template-columns: auto 1fr; }
/* Both cells of a row stretch to the row height so their dividers line up; content is centred inside. */
.stat-table dt, .stat-table dd { margin: 0; padding: 7px 10px; border-bottom: 2px solid var(--panel-2); display: flex; align-items: center; }
.stat-table dt { font-family: var(--font-pixel); font-size: 8px; color: var(--muted); }
.stat-table dd { justify-content: flex-end; text-align: right; }
.stat-table dt:last-of-type, .stat-table dd:last-of-type { border-bottom: 0; }
.about { line-height: 1.5; display: grid; gap: 10px; }
.about p { margin: 0; }
.fun-fact { display: grid; gap: 6px; padding: 10px; background: var(--panel-2); border-left: 4px solid var(--accent); }
.fun-fact .pixel-sm { color: var(--accent); }
.spotters { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; font-family: var(--font-pixel); font-size: 9px; color: var(--accent-2); }
.spotters-dot { width: 10px; height: 10px; background: var(--accent-2); box-shadow: 0 0 0 2px var(--ink); }
/* Catches of a model: tiles that open their trading cards. */
.catch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.catch-tile {
  display: grid; gap: 6px; padding: 6px; color: var(--text); text-decoration: none;
  background: var(--panel); border: var(--px) solid var(--ink); box-shadow: inset 0 0 0 2px var(--rc, var(--line));
  transition: transform 120ms ease-out;
}
.catch-tile:hover, .catch-tile:focus-visible { transform: translateY(-2px); }
.catch-tile .muted { font-size: 12px; }
.catch-tile-label { font-family: var(--font-pixel); font-size: 8px; overflow-wrap: anywhere; }
.catch-tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* Trading card of a catch: the screen is exactly the window's height, the card fills it, only its details scroll. */
.screen[data-screen="catch"] {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
}
.tcard-stage { flex: 1; min-height: 0; display: flex; padding-bottom: 6px; overflow: hidden; }
.tcard {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel) 45%);
  border: var(--px) solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--rc, var(--line)), 0 6px 0 var(--ink);
  touch-action: pan-y; user-select: none;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}
.tcard.dragging { transition: none; cursor: grabbing; }
.tcard.leaving { opacity: 0; }
.tcard.enter-next { animation: tcard-in-next 240ms ease-out; }
.tcard.enter-prev { animation: tcard-in-prev 240ms ease-out; }
@keyframes tcard-in-next { from { transform: translateX(70%) rotate(5deg); opacity: 0; } }
@keyframes tcard-in-prev { from { transform: translateX(-70%) rotate(-5deg); opacity: 0; } }
.tcard-head { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tcard-model { margin: 0; font-family: var(--font-pixel); font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.tcard-make { font-family: var(--font-pixel); font-size: 9px; color: var(--muted); }
.tcard-corner { display: grid; justify-items: end; gap: 6px; flex-shrink: 0; }
.tcard-count { color: var(--rc, var(--accent)); }
/* The player's own photo is shown whole, in its own proportions (it was framed in the crop step); a tall photo
   is as high as the card allows and sits centred. */
.tcard-photo {
  flex: none; width: 100%; height: auto; max-height: min(40dvh, 320px); object-fit: contain; display: block;
  border: var(--px) solid var(--ink); background: var(--panel-2); -webkit-user-drag: none;
}
.tcard-sprite { height: min(34dvh, 280px); display: grid; place-items: center; padding: 4% 14%; background: linear-gradient(#2a3a5e 0 62%, #20263a 62%); }
.tcard-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  display: grid; gap: 10px; align-content: start; padding-right: 4px;
}
.tcard-build { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--ink); font-family: var(--font-pixel); font-size: 8px; color: var(--rc, var(--text)); }
.tcard-line { margin: 0; font-size: 14px; color: var(--muted); }
.tcard-bars { display: grid; gap: 8px; }
.tcard-bar { display: grid; grid-template-columns: 6.5em 1fr 6.5em; align-items: center; gap: 8px; }
.tcard-bar .bar > i { background: var(--rc, var(--accent-2)); }
.tcard-bar strong { text-align: right; font-weight: 600; white-space: nowrap; }
.tcard-key, .tcard-title { font-family: var(--font-pixel); font-size: 7px; color: var(--muted); }
.tcard-title { margin: 6px 0 0; font-size: 8px; color: var(--accent); }
.tcard-sheet { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.tcard-sheet dt, .tcard-sheet dd { margin: 0; padding: 6px 0; border-bottom: 2px dashed var(--panel-3); }
.tcard-sheet dt { font-family: var(--font-pixel); font-size: 7px; color: var(--muted); display: flex; align-items: center; }
.tcard-sheet dd { text-align: right; }
.tcard-sheet dt:last-of-type, .tcard-sheet dd:last-of-type { border-bottom: 0; }
.tcard-disclaimer { margin: 4px 0 0; font-size: 12px; }
.tcard-note { display: grid; gap: 8px; justify-items: start; user-select: text; }
.tcard-note p { margin: 0; font-style: italic; }
.tcard-note .search-input { margin: 0; }
.tcard-note .sheet-actions { width: 100%; margin-top: 0; }
.tcard-foot { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 3px solid var(--ink); }
.tcard-foot strong { font-family: var(--font-pixel); font-size: 10px; color: var(--rc, var(--text)); overflow-wrap: anywhere; }
.tcard-pips { display: flex; gap: 5px; flex-shrink: 0; }
.tcard-pips .pip { width: 12px; height: 12px; border: 2px solid var(--rc, var(--line)); }
.tcard-pips .pip.on { background: var(--rc, var(--accent)); }
.tcard-actions { flex: none; display: flex; gap: 8px; margin-top: 8px; }
.tcard-close { margin-left: auto; }

/* Feed */
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px; }
.post-info { min-width: 0; display: grid; gap: 4px; align-content: start; }
.post-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-user { font-family: var(--font-pixel); font-size: 7px; color: var(--muted); }
.post-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.post-actions .muted { margin-left: auto; font-size: 13px; }
.react {
  min-height: 34px;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 2px solid var(--ink);
  cursor: pointer;
  font-size: 14px;
}
.react[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }

.post-tags { display: flex; align-items: center; gap: 8px; }
.post-user { text-decoration: underline; text-decoration-color: var(--line); }
.feed-more { width: 100%; margin-top: 10px; }

/* Leaderboard and friends */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board-row { display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; }
.board-row.self { box-shadow: var(--bevel), inset 0 0 0 2px var(--accent); }
.board-rank { font-family: var(--font-pixel); font-size: 9px; color: var(--accent); }
.board-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-xp { font-family: var(--font-pixel); font-size: 9px; color: var(--accent-2); }
.search-input {
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 16px;
  background: var(--panel-2);
  border: var(--px) solid var(--ink);
  color: var(--text);
}
.user-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px; }
.user-row .muted { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-body { padding: 12px; display: grid; gap: 6px; }
.profile-actions { padding: 0 12px 12px; margin-top: 0; }
.profile-clan { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* Map */
.map-frame { padding: 0; overflow: hidden; }
.map-canvas { height: min(62vh, 520px); min-height: 300px; display: grid; place-items: center; }
.map-canvas.leaflet-container { display: block; background: var(--panel); font-family: var(--font-body); }
/* Dark-mode the standard OSM tiles to match the app instead of using a third-party dark tile service. */
.map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.85) saturate(0.6); }
.map-canvas .leaflet-control-attribution { background: rgba(16, 20, 31, 0.8); color: var(--muted); }
.map-canvas .leaflet-control-attribution a { color: var(--text); }
.map-canvas .leaflet-bar a { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.map-status { margin: 0; }
.map-pin { background: var(--r1); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.map-pin-r2 { background: var(--r2); }
.map-pin-r3 { background: var(--r3); }
.map-pin-r4 { background: var(--r4); }
.map-pin-r5 { background: var(--r5); }
.map-pin-r6 { background: var(--r6); }
.map-pin-r7 { background: var(--r7); }

/* Generations of a model on the car card; caught ones are lit with an accent bar */
.gen-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; }
.gen-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); color: var(--muted); border-left: 4px solid transparent; }
.gen-row.caught { color: var(--text); border-left-color: var(--accent); background: var(--panel-3); }
.gen-row.caught strong { color: var(--accent); }
.gen-count { font-family: var(--font-pixel); font-size: 8px; color: var(--accent-2); }
.gen-years { margin-left: auto; }

/* Rarity: rules screen, scan breakdown, Custom / Tribute notes */
.detail-rarity { align-self: flex-start; }
.note-tag { font-family: var(--font-pixel); font-size: 8px; padding: 4px 6px; border: 2px solid var(--line); color: var(--accent-2); }
.rarity-why { list-style: none; margin: 10px 0 0; padding: 8px 10px; display: grid; gap: 4px; background: var(--panel-2); font-size: 14px; }
.rarity-why li::before { content: '▸ '; color: var(--accent); }
.rarity-why a { color: var(--accent); }
.ladder { padding: 0; }
.ladder-row { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 2px solid var(--panel-2); }
.ladder-row:last-child { border-bottom: 0; }
.ladder-row .badge { justify-self: start; }
.rules-list { list-style: none; margin: 0; padding: 0; }
.rules-list li { position: relative; padding: 10px 12px 10px 34px; border-bottom: 2px solid var(--panel-2); }
.rules-list li:last-child { border-bottom: 0; }
.rules-list li::before { content: ''; position: absolute; left: 12px; top: 15px; width: 10px; height: 10px; background: var(--accent); }
.trim-table { display: grid; gap: 8px; }
.trim-table p { margin: 0; }
.trim-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 2px solid var(--panel-2); }
.trim-row strong { display: block; }
.trim-examples { display: block; font-family: var(--font-pixel); font-size: 7px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.trim-points { font-family: var(--font-pixel); color: var(--accent); }
.map-me { fill: var(--accent-2); fill-opacity: 0.9; stroke: var(--ink); stroke-width: 2; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Framing after a shot: the scanner window narrows to the landscape catch-photo frame (it stays in the middle of its
   slot, so the buttons below do not move) and the photo is moved and zoomed inside it. */
.vf-slot { position: relative; aspect-ratio: 3 / 4; display: grid; align-content: center; }
.viewfinder[data-mode='framing'],
.viewfinder[data-mode='analyzing'],
.viewfinder[data-mode='done'] { box-sizing: content-box; width: calc(100% - 2 * var(--px)); aspect-ratio: 3 / 2; margin-inline: auto; }
.vf-crop {
  position: absolute; inset: 0; overflow: hidden; display: none; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.vf-crop:active { cursor: grabbing; }
.viewfinder[data-mode='framing'] .vf-crop { display: block; }
.crop-image { position: absolute; max-width: none; height: auto; display: block; pointer-events: none; -webkit-user-drag: none; }
.framing-tools { position: absolute; left: 0; right: 0; bottom: 4px; display: grid; justify-items: center; gap: 8px; }
.framing-hint { margin: 0; font-size: 13px; text-align: center; }
.framing-actions { grid-template-columns: 1fr 1fr; }
