:root {
  color-scheme: dark;
  --bg: #0b1114;
  --bg-road: #11181d;
  --surface: #151f25;
  --surface-strong: #1d2930;
  --surface-soft: #202a30;
  --border: #34424a;
  --border-strong: #53636b;
  --text: #f5f7f4;
  --muted: #aab7bd;
  --muted-strong: #d1d9dc;
  --accent: #f3b54b;
  --accent-strong: #ffd071;
  --found: #50c878;
  --found-dark: #113d26;
  --danger: #ef6f67;
  --danger-dark: #4d201f;
  --shadow: 0 18px 50px rgb(0 0 0 / 32%);
  --body-background:
    radial-gradient(circle at 24% 4%, rgb(243 181 75 / 14%), transparent 26rem),
    linear-gradient(180deg, #0b1114 0%, #11191e 46%, #0b1114 100%);
  --sticky-bg: linear-gradient(180deg, rgb(11 17 20 / 98%) 0%, rgb(11 17 20 / 88%) 84%, transparent 100%);
  --brand-mark-bg:
    linear-gradient(90deg, rgb(255 255 255 / 0%) 0 18%, rgb(255 255 255 / 8%) 18% 20%, transparent 20% 80%, rgb(255 255 255 / 8%) 80% 82%, transparent 82%),
    #11191e;
  --panel-bg: linear-gradient(180deg, rgb(29 41 48 / 94%), rgb(18 27 32 / 94%));
  --stat-bg: rgb(11 17 20 / 54%);
  --country-score-bg:
    linear-gradient(135deg, rgb(255 255 255 / 6%), transparent 52%),
    rgb(11 17 20 / 58%);
  --country-score-usa-bg:
    linear-gradient(135deg, rgb(42 96 180 / 30%), transparent 54%),
    rgb(11 17 20 / 70%);
  --country-score-canada-bg:
    linear-gradient(135deg, rgb(239 111 103 / 24%), transparent 54%),
    rgb(11 17 20 / 70%);
  --track-bg: rgb(7 11 13 / 78%);
  --card-bg: linear-gradient(180deg, var(--surface), #11191d);
  --card-found-bg:
    linear-gradient(135deg, rgb(80 200 120 / 18%), transparent 44%),
    linear-gradient(180deg, #14251c, #101a16);
  --empty-bg: rgb(21 31 37 / 70%);
  --map-state-bg:
    linear-gradient(135deg, rgb(255 255 255 / 5%), transparent 48%),
    #111a1f;
  --radius: 8px;
  --tap: 52px;
  --page-max: 1240px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-road: #e7eee9;
  --surface: #ffffff;
  --surface-strong: #eef4f0;
  --surface-soft: #e5ede8;
  --border: #bac9c1;
  --border-strong: #859891;
  --text: #172026;
  --muted: #58686f;
  --muted-strong: #31434b;
  --accent: #d7961c;
  --accent-strong: #9d6800;
  --found: #247845;
  --found-dark: #d9f2e2;
  --danger: #c94640;
  --danger-dark: #f9dddc;
  --shadow: 0 14px 34px rgb(34 54 62 / 14%);
  --body-background:
    radial-gradient(circle at 24% 4%, rgb(215 150 28 / 16%), transparent 26rem),
    linear-gradient(180deg, #f3f6f4 0%, #e9f0ec 46%, #f7f9f7 100%);
  --sticky-bg: linear-gradient(180deg, rgb(243 246 244 / 98%) 0%, rgb(243 246 244 / 90%) 84%, transparent 100%);
  --brand-mark-bg:
    linear-gradient(90deg, rgb(23 32 38 / 0%) 0 18%, rgb(23 32 38 / 8%) 18% 20%, transparent 20% 80%, rgb(23 32 38 / 8%) 80% 82%, transparent 82%),
    #ffffff;
  --panel-bg: linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(235 242 238 / 96%));
  --stat-bg: rgb(255 255 255 / 68%);
  --country-score-bg:
    linear-gradient(135deg, rgb(255 255 255 / 74%), transparent 52%),
    rgb(246 250 248 / 94%);
  --country-score-usa-bg:
    linear-gradient(135deg, rgb(42 96 180 / 16%), transparent 54%),
    rgb(249 252 255 / 96%);
  --country-score-canada-bg:
    linear-gradient(135deg, rgb(201 70 64 / 15%), transparent 54%),
    rgb(255 249 248 / 96%);
  --track-bg: rgb(213 224 218 / 82%);
  --card-bg: linear-gradient(180deg, #ffffff, #eef5f1);
  --card-found-bg:
    linear-gradient(135deg, rgb(36 120 69 / 14%), transparent 44%),
    linear-gradient(180deg, #f4fbf6, #e5f3ea);
  --empty-bg: rgb(255 255 255 / 68%);
  --map-state-bg:
    linear-gradient(135deg, rgb(255 255 255 / 62%), transparent 48%),
    #edf4f0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--body-background);
}

body.has-safety-disclosure {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 12px;
  background: var(--sticky-bg);
  backdrop-filter: blur(10px);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 56px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--accent);
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--brand-mark-bg);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-title {
  display: block;
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.appearance-button,
.reset-button,
.view-tab,
.filter-tab,
.confirm-secondary,
.confirm-danger {
  min-height: var(--tap);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.appearance-button,
.reset-button {
  flex: 0 0 auto;
  width: 56px;
  padding: 0;
  font-weight: 800;
}

.appearance-button {
  color: var(--accent-strong);
  background: var(--surface);
  border-color: var(--border);
}

.reset-button {
  color: #ffd1ce;
  background: rgb(77 32 31 / 72%);
  border-color: rgb(239 111 103 / 55%);
}

.icon-button {
  display: grid;
  place-items: center;
}

.material-icon {
  width: 28px;
  height: 28px;
  display: block;
  fill: currentColor;
  pointer-events: none;
}

.appearance-button:focus-visible,
.reset-button:focus-visible,
.view-tab:focus-visible,
.filter-tab:focus-visible,
.country-score:focus-visible,
.plate-card:focus-visible,
.map-state:focus-visible,
.confirm-secondary:focus-visible,
.confirm-danger:focus-visible,
.search-field:focus-within {
  outline: 3px solid rgb(243 181 75 / 80%);
  outline-offset: 3px;
}

.status-message {
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgb(243 181 75 / 52%);
  border-radius: var(--radius);
  color: #ffe2a2;
  background: rgb(82 54 13 / 72%);
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-panel {
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-heading h1 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.trip-count {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: 0.93rem;
  font-weight: 800;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: var(--radius);
  background: var(--stat-bg);
}

.stat-value {
  display: block;
  color: var(--text);
  font-size: clamp(1.65rem, 8vw, 2.55rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.stat-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.country-scoreboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0;
}

.country-score {
  min-width: 0;
  width: 100%;
  padding: 13px;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--country-score-bg);
  box-shadow: 0 12px 26px rgb(0 0 0 / 18%);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: opacity 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.country-score:active {
  transform: scale(0.99);
}

.country-score.is-usa {
  border-color: rgb(105 151 255 / 42%);
  background: var(--country-score-usa-bg);
}

.country-score.is-canada {
  border-color: rgb(239 111 103 / 48%);
  background: var(--country-score-canada-bg);
}

.country-score.is-hidden-region {
  opacity: 0.58;
}

.country-score.is-region-active {
  border-color: var(--accent-strong);
  box-shadow:
    0 14px 30px rgb(0 0 0 / 24%),
    0 0 0 3px rgb(243 181 75 / 20%);
}

.country-score-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.country-mark {
  width: 44px;
  height: 28px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgb(255 255 255 / 28%);
  box-shadow: 0 8px 18px rgb(0 0 0 / 26%);
}

.country-mark.is-usa {
  position: relative;
  background: repeating-linear-gradient(
    180deg,
    #c82333 0 3px,
    #f8f8f8 3px 6px
  );
}

.country-mark.is-usa::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 19px;
  height: 15px;
  background:
    radial-gradient(circle, rgb(255 255 255 / 90%) 0 1px, transparent 1px) 2px 2px / 6px 5px,
    #214a9a;
}

.country-mark.is-canada {
  display: grid;
  place-items: center;
  color: #d92727;
  background: linear-gradient(90deg, #d92727 0 24%, #fff 24% 76%, #d92727 76%);
  font-size: 1rem;
  line-height: 1;
}

.country-score-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 10px;
  color: var(--text);
  font-size: clamp(1.7rem, 7vw, 2.35rem);
  line-height: 1;
  font-weight: 950;
}

.country-score-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 850;
  text-transform: uppercase;
}

.country-score-track {
  height: 8px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track-bg);
  border: 1px solid rgb(255 255 255 / 10%);
}

.country-score-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.country-score-fill.is-usa {
  background: linear-gradient(90deg, #6997ff, #f5f7f4, #ef6f67);
}

.country-score-fill.is-canada {
  background: linear-gradient(90deg, #ef6f67, #f5f7f4, #ef6f67);
}

.completion-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgb(80 200 120 / 52%);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(80 200 120 / 20%), transparent 48%),
    rgb(17 61 38 / 82%);
}

.completion-panel[hidden] {
  display: none;
}

.completion-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 38%, var(--found) 38% 54%, transparent 54%),
    linear-gradient(45deg, transparent 44%, var(--found) 44% 60%, transparent 60%),
    rgb(255 255 255 / 8%);
  border: 2px solid var(--found);
}

.completion-panel h2,
.completion-panel p {
  margin: 0;
}

.completion-panel h2 {
  font-size: 1.2rem;
  line-height: 1.15;
}

.completion-panel p {
  margin-top: 4px;
  color: #d5f5df;
  font-weight: 700;
}

.control-deck {
  position: sticky;
  top: 68px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 14px 0;
  padding: 10px 0;
  background: var(--sticky-bg);
  backdrop-filter: blur(10px);
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.view-tab {
  padding: 0;
  color: var(--muted-strong);
  font-weight: 900;
}

.view-tab.is-active {
  color: #14110b;
  background: var(--accent);
  border-color: var(--accent-strong);
}

.search-field {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-field svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1.05rem;
  font-weight: 700;
}

.search-field input::placeholder {
  color: #839299;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.filter-tab {
  padding: 0;
  color: var(--muted-strong);
  font-weight: 900;
}

.filter-tab.is-active {
  color: #14110b;
  background: var(--accent);
  border-color: var(--accent-strong);
}

.plates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr));
  gap: 12px;
  align-items: stretch;
  padding-bottom: 22px;
}

.plates-grid[hidden] {
  display: none;
}

.plate-card {
  min-width: 0;
  min-height: 246px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--card-bg);
  box-shadow: 0 12px 28px rgb(0 0 0 / 18%);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.plate-card:active {
  transform: scale(0.985);
}

.plate-card.is-found {
  border-color: rgb(80 200 120 / 82%);
  background: var(--card-found-bg);
}

.plate-card.is-canada:not(.is-found) {
  border-color: rgb(239 111 103 / 26%);
}

.plate-card.is-canada .state-abbr {
  color: #ffd7d4;
  background: rgb(239 111 103 / 14%);
}

.plate-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgb(255 255 255 / 12%);
  background: #e9edf0;
}

.plate-image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: filter 140ms ease, opacity 140ms ease;
}

.plate-card:not(.is-found) .plate-image-frame img {
  filter: saturate(0.72) brightness(0.82);
  opacity: 0.74;
}

.plate-fallback {
  display: none;
  color: #172026;
  font-size: clamp(2rem, 16vw, 4rem);
  font-weight: 900;
}

.plate-image-frame.has-image-error img {
  display: none;
}

.plate-image-frame.has-image-error .plate-fallback {
  display: block;
}

.plate-card-body {
  display: grid;
  gap: 8px;
}

.state-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.state-name {
  min-width: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.16;
  font-weight: 900;
}

.state-abbr {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--accent-strong);
  background: rgb(243 181 75 / 13%);
  font-size: 0.76rem;
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6f7d84;
}

.plate-card.is-found .status-row {
  color: #dcfbe5;
}

.plate-card.is-found .status-dot {
  background: var(--found);
  box-shadow: 0 0 0 5px rgb(80 200 120 / 14%);
}

.found-time {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: var(--empty-bg);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.map-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.map-panel[hidden] {
  display: none;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.map-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #718088;
}

.legend-dot.is-found {
  background: var(--found);
}

.map-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.state-map {
  min-width: 820px;
  display: grid;
  grid-template-columns: repeat(11, minmax(64px, 1fr));
  grid-template-rows: repeat(10, 68px);
  gap: 8px;
  align-items: stretch;
}

.state-map.is-us-only {
  grid-template-rows: repeat(7, 68px);
}

.state-map.is-canada-only {
  grid-template-rows: repeat(2, 68px);
}

.map-state {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 7px 6px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: var(--map-state-bg);
  box-shadow: 0 10px 20px rgb(0 0 0 / 16%);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: transform 120ms ease, opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.map-state:active {
  transform: scale(0.97);
}

.map-state.is-district {
  border-color: rgb(243 181 75 / 68%);
  color: #ffe8b2;
  background:
    linear-gradient(135deg, rgb(243 181 75 / 18%), transparent 48%),
    #171d1d;
}

.map-state.is-canada {
  border-color: rgb(239 111 103 / 62%);
  color: #ffe3e1;
  background:
    linear-gradient(135deg, rgb(239 111 103 / 18%), transparent 48%),
    #171d1d;
}

.map-state.is-found {
  color: #ebfff1;
  border-color: rgb(80 200 120 / 75%);
  background:
    linear-gradient(135deg, rgb(80 200 120 / 34%), transparent 52%),
    var(--found-dark);
}

.map-state.is-filtered-out {
  opacity: 0.28;
}

.map-abbr {
  display: block;
  font-size: 1.18rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.map-name {
  display: block;
  width: 100%;
  overflow: hidden;
  color: currentColor;
  font-size: 0.63rem;
  line-height: 1.05;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.86;
}

.found-plate-celebration {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  cursor: pointer;
  pointer-events: auto;
  background:
    radial-gradient(circle at center, rgb(11 17 20 / 40%), rgb(11 17 20 / 12%) 44%, transparent 72%);
}

.found-plate-celebration[hidden] {
  display: none;
}

.found-plate-display {
  width: min(92vw, 760px);
  max-height: calc(100vh - 36px);
  display: grid;
  justify-items: center;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  animation: found-plate-pop 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.found-plate-kicker {
  padding: 9px 14px;
  border: 1px solid rgb(80 200 120 / 65%);
  border-radius: 999px;
  color: #ebfff1;
  background: rgb(17 61 38 / 88%);
  box-shadow: 0 12px 26px rgb(0 0 0 / 26%);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

.found-plate-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / 22%);
  border-radius: 10px;
  background: #e9edf0;
  box-shadow:
    0 24px 70px rgb(0 0 0 / 48%),
    0 0 0 9px rgb(243 181 75 / 12%);
}

.found-plate-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.found-plate-fallback {
  display: none;
  color: #172026;
  font-size: clamp(4rem, 30vw, 9rem);
  line-height: 1;
  font-weight: 950;
}

.found-plate-frame.has-image-error img {
  display: none;
}

.found-plate-frame.has-image-error .found-plate-fallback {
  display: block;
}

.found-plate-name {
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 12px 32px rgb(0 0 0 / 30%);
  font-size: clamp(1.45rem, 5.8vw, 2.35rem);
  line-height: 1.1;
  font-weight: 950;
  text-align: center;
}

.found-plate-info {
  width: min(100%, 720px);
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
}

.found-plate-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.found-plate-facts div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 7px;
  background: rgb(255 255 255 / 5%);
}

.found-plate-facts dt {
  color: var(--muted);
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
}

.found-plate-facts dd {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.12rem, 3.7vw, 1.35rem);
  line-height: 1.12;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: normal;
}

.found-plate-info p {
  margin: 12px 2px 0;
  color: var(--muted-strong);
  font-size: clamp(1.08rem, 3.4vw, 1.28rem);
  line-height: 1.42;
  font-weight: 750;
  text-align: center;
}

.found-plate-dismiss {
  color: #ffe2a2;
  font-size: clamp(0.9rem, 2.7vw, 1.05rem);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 91;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.confetti-canvas[hidden] {
  display: none;
}

.safety-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgb(0 0 0 / 78%);
}

.safety-layer[hidden] {
  display: none;
}

.safety-box {
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgb(243 181 75 / 42%);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.safety-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgb(243 181 75 / 12%);
}

.safety-box h2 {
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.25rem);
  line-height: 1.05;
}

.safety-box p {
  max-width: 36rem;
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(1.06rem, 3.8vw, 1.28rem);
  line-height: 1.42;
  font-weight: 750;
}

.safety-acknowledge {
  width: 100%;
  min-height: 62px;
  margin-top: 4px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  color: #14110b;
  background: var(--accent);
  font-size: clamp(1.05rem, 3.5vw, 1.28rem);
  font-weight: 950;
  cursor: pointer;
  touch-action: manipulation;
}

.safety-acknowledge:focus-visible {
  outline: 3px solid rgb(243 181 75 / 80%);
  outline-offset: 3px;
}

@keyframes found-plate-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .found-plate-display {
    animation: none;
  }
}

.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 72%);
}

.confirm-layer[hidden] {
  display: none;
}

.confirm-box {
  width: min(100%, 430px);
  padding: 20px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.confirm-box h2 {
  margin: 0;
  font-size: 1.35rem;
}

.confirm-box p {
  margin: 8px 0 18px;
  color: var(--muted-strong);
  line-height: 1.4;
  font-weight: 650;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-secondary,
.confirm-danger {
  padding: 0;
  font-weight: 900;
}

.confirm-secondary {
  background: #26333a;
}

.confirm-danger {
  border-color: rgb(239 111 103 / 65%);
  color: #fff1ef;
  background: var(--danger-dark);
}

.app-footer {
  padding: 22px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  text-align: center;
}

.app-footer a,
.policy-content a,
.storage-consent a,
.policy-home-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.app-footer a:hover,
.policy-content a:hover,
.storage-consent a:hover,
.policy-home-link:hover {
  text-decoration: underline;
}

.storage-consent {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  z-index: 110;
  display: grid;
  gap: 14px;
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgb(243 181 75 / 42%);
  border-radius: var(--radius);
  color: var(--text);
  background: rgb(29 41 48 / 96%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.storage-consent[hidden] {
  display: none;
}

.storage-consent h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.2;
}

.storage-consent p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.42;
  font-weight: 650;
}

.storage-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.storage-consent-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 850;
}

.storage-consent-actions button,
.policy-home-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  font-weight: 900;
}

.storage-consent-actions button {
  min-width: 88px;
  padding: 0 18px;
  color: #14110b;
  background: var(--accent);
  cursor: pointer;
}

.storage-consent-actions .storage-consent-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.policy-page {
  background: var(--body-background);
}

.policy-shell {
  max-width: 980px;
}

.policy-home-link {
  flex: 0 0 auto;
  padding: 0 14px;
  background: rgb(243 181 75 / 10%);
}

.policy-content {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.policy-content h1,
.policy-content h2,
.policy-content p {
  margin: 0;
}

.policy-content h1 {
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.02;
}

.policy-content h2 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.policy-content p,
.policy-content li {
  color: var(--muted-strong);
  line-height: 1.55;
  font-weight: 650;
}

.policy-date {
  color: var(--muted);
  font-weight: 800;
}

.policy-content section {
  display: grid;
  gap: 8px;
}

.policy-content ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.2rem;
}

:root[data-theme="light"] .reset-button {
  color: #7d211f;
  background: #fff4f3;
  border-color: rgb(201 70 64 / 45%);
}

:root[data-theme="light"] .plate-card.is-found .status-row {
  color: #1b6b3a;
}

:root[data-theme="light"] .map-state.is-district {
  color: #7a5800;
  background:
    linear-gradient(135deg, rgb(215 150 28 / 16%), transparent 48%),
    #fff8e6;
}

:root[data-theme="light"] .map-state.is-canada {
  color: #792a27;
  background:
    linear-gradient(135deg, rgb(201 70 64 / 14%), transparent 48%),
    #fff3f2;
}

:root[data-theme="light"] .map-state.is-found {
  color: #123821;
  background:
    linear-gradient(135deg, rgb(36 120 69 / 18%), transparent 52%),
    var(--found-dark);
}

:root[data-theme="light"] .confirm-danger {
  color: #7d211f;
  background: #fff4f3;
  border-color: rgb(201 70 64 / 55%);
}

:root[data-theme="light"] .storage-consent {
  color: var(--text);
  background: rgb(255 255 255 / 96%);
}

:root[data-theme="light"] .storage-consent-actions .storage-consent-secondary {
  color: var(--text);
  background: #ffffff;
}

:root[data-theme="light"] .policy-home-link {
  color: #7a5800;
  background: #fff8e6;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 18px;
  }

  .storage-consent {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .progress-panel {
    padding: 18px;
  }

  .control-deck {
    top: 76px;
    grid-template-columns: minmax(170px, 0.42fr) minmax(280px, 1fr);
    align-items: center;
  }

  .filter-tabs {
    grid-column: auto / span 1;
  }

  .plates-grid {
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  }

  .state-map {
    grid-template-rows: repeat(10, 74px);
  }

  .state-map.is-us-only {
    grid-template-rows: repeat(7, 74px);
  }

  .state-map.is-canada-only {
    grid-template-rows: repeat(2, 74px);
  }
}

@media (min-width: 1040px) {
  .progress-panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.6fr);
    gap: 18px;
    align-items: center;
  }

  .country-scoreboard {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .progress-heading {
    display: block;
    margin: 0;
  }

  .trip-count {
    display: block;
    margin-top: 8px;
  }

  .control-deck {
    grid-template-columns: minmax(150px, 0.35fr) minmax(270px, 1fr) minmax(220px, 0.48fr);
  }

  .filter-tabs {
    grid-column: auto;
  }

  .plates-grid {
    grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  }
}

@media (max-width: 430px) {
  .app-header {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 32px;
  }

  .appearance-button,
  .reset-button {
    width: 48px;
    min-height: 44px;
  }

  .progress-stats {
    gap: 7px;
  }

  .stat {
    padding: 11px 7px;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
