/* ========================================
   Road Raksha — Industrial Artifact Design
   ========================================
   A Neo-Brutalist / Industrial Utility design
   system. Sharp edges, hard shadows, high-
   contrast safety signaling.
   ======================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — Industrial Artifact (always dark) */
  --surface: #161310;
  --surface-dim: #161310;
  --surface-bright: #3c3835;
  --surface-container-lowest: #100e0b;
  --surface-container-low: #1e1b18;
  --surface-container: #221f1c;
  --surface-container-high: #2d2926;
  --surface-container-highest: #383430;
  --on-surface: #e9e1dc;
  --on-surface-variant: #e1bfb2;
  --inverse-surface: #e9e1dc;
  --inverse-on-surface: #34302c;
  --outline: #a98a7e;
  --outline-variant: #594137;
  --surface-tint: #ffb596;

  --primary: #ffb596;
  --on-primary: #581e00;
  --primary-container: #f26411;
  --on-primary-container: #4d1900;
  --inverse-primary: #a33e00;
  --primary-fixed: #ffdbcd;
  --primary-fixed-dim: #ffb596;

  --secondary: #ffb77d;
  --on-secondary: #4d2600;
  --secondary-container: #d97707;
  --on-secondary-container: #432100;
  --secondary-fixed: #ffdcc3;
  --secondary-fixed-dim: #ffb77d;

  --tertiary: #2be500;
  --on-tertiary: #053900;
  --tertiary-container: #1da800;
  --on-tertiary-container: #043200;
  --tertiary-fixed: #79ff5b;
  --tertiary-fixed-dim: #2be500;

  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;

  --background: #161310;
  --on-background: #e9e1dc;

  /* Brand Safety Colors */
  --asphalt-black: #111111;
  --caution-yellow: #FFD60A;
  --safety-orange: #FF4500;
  --scan-green: #37F712;

  /* Typography */
  --font-sans: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --container-margin: 20px;
  --stack-gap: 12px;
  --section-gap: 32px;
  --touch-min: 48px;

  /* Border & Shadow */
  --border-thick: 3px;
  --shadow-offset: 6px;
  --shadow-color: rgba(0, 0, 0, 1);

  /* Radius — all sharp for industrial aesthetic */
  --radius-none: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-2xl: 0px;
  --radius-full: 9999px; /* Only for LED indicators */

  /* Transitions */
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--asphalt-black);
  color: var(--on-surface);
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  padding-bottom: 88px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--safety-orange);
  color: #000;
}

/* ---------- Dither Pattern ---------- */
.dither-pattern {
  background-image: radial-gradient(#383430 1px, transparent 1px);
  background-size: 4px 4px;
}

.dither-light {
  background-image: radial-gradient(#ffffff22 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

/* ---------- Hazard Stripe ---------- */
.hazard-stripe {
  background: repeating-linear-gradient(
    45deg,
    #000000,
    #000000 10px,
    #FFD60A 10px,
    #FFD60A 20px
  );
}

/* ---------- LED Glow Effects ---------- */
.led-glow-orange {
  box-shadow: 0 0 12px #FF4500;
}

.led-glow-green {
  box-shadow: 0 0 12px #37F712;
}

.led-glow-yellow {
  box-shadow: 0 0 12px #FFD60A;
}

/* ---------- Neo-Brutalist Card/Plate ---------- */
.plate {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
}

.plate-dark {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface);
}

.plate-black {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--asphalt-black);
}

/* Press interaction — shift down-right, shadow disappears */
.press-effect {
  transition: all var(--transition-fast);
  cursor: pointer;
}

.press-effect:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

/* ---------- Typography ---------- */
.font-headline-md {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
}

.font-headline-lg {
  font-family: var(--font-sans);
  font-size: 40px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.font-display-xl {
  font-family: var(--font-sans);
  font-size: 64px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.font-body-md {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.font-body-lg {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
}

.font-label-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.font-label-caps {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Focus States ---------- */
:focus-visible {
  outline: 2px solid var(--safety-orange);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--safety-orange);
  outline-offset: 2px;
}

/* ---------- View Transitions ---------- */
.view {
  display: none !important;
}

.view.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
}

/* ---------- Top App Bar ---------- */
.app-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0 20px;
  height: 64px;
  background: var(--surface);
  border-bottom: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
}

.app-bar-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 900;
  color: var(--safety-orange);
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 80px;
  background: var(--surface);
  border-top: var(--border-thick) solid #000;
  box-shadow: 0 calc(-1 * var(--shadow-offset)) 0px 0px var(--shadow-color);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  height: 100%;
  flex: 1;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  gap: 4px;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-container-high);
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-item.active {
  background: var(--safety-orange);
  color: #000;
}

.nav-item .material-symbols-outlined {
  font-size: 24px;
}

.nav-item.active .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ---------- Hero CTA ---------- */
.hero-cta {
  width: 100%;
  background: var(--safety-orange);
  border: var(--border-thick) solid #000;
  box-shadow: 8px 8px 0px 0px var(--shadow-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.hero-cta:active {
  transform: translate(6px, 6px);
  box-shadow: none !important;
}

.hero-cta-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 900;
  color: #000;
  line-height: 1;
  text-transform: uppercase;
}

.hero-cta-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  letter-spacing: 0.05em;
}

.hero-cta-icon-box {
  align-self: flex-end;
  background: #000;
  padding: 16px;
  border: var(--border-thick) solid #000;
  box-shadow: 4px 4px 0px 0px #000;
}

.hero-cta-icon-box .material-symbols-outlined {
  font-size: 48px;
  color: var(--caution-yellow);
  font-variation-settings: 'FILL' 1;
}

/* ---------- Bento Card Grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bento-card {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
  cursor: default;
}

.bento-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0px 0px var(--shadow-color);
}

.bento-card:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    45deg,
    #000000,
    #000000 10px,
    #FFD60A 10px,
    #FFD60A 20px
  );
}

.bento-card-icon {
  font-size: 24px;
  color: var(--safety-orange);
  font-variation-settings: 'FILL' 1;
}

.bento-card .stat-value {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 900;
  color: var(--scan-green);
  line-height: 1;
}

.bento-card .stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--outline);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Highlighted CTA card */
.bento-card-cta {
  background: var(--primary-container);
  color: #000;
  cursor: pointer;
}

.bento-card-cta::before {
  display: none;
}

.bento-card-cta .stat-label {
  color: rgba(0, 0, 0, 0.7);
}

.bento-card-cta-icon {
  position: absolute;
  right: -16px;
  bottom: -16px;
  opacity: 0.1;
  font-size: 120px;
  font-variation-settings: 'FILL' 1;
  pointer-events: none;
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.section-header-icon {
  color: var(--safety-orange);
  font-size: 24px;
}

/* ---------- Map Preview ---------- */
.map-container {
  width: 100%;
  height: 220px;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--asphalt-black);
  position: relative;
  overflow: hidden;
}

.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  background: var(--surface);
  border: 2px solid #000;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--on-surface);
  letter-spacing: 0.05em;
}

.map-legend-dot {
  width: 8px;
  height: 8px;
  border: 1px solid #000;
  flex-shrink: 0;
}

/* ---------- Report View — Mobile Capture Flow ---------- */
.report-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 calc(96px + env(safe-area-inset-bottom));
}

.report-intro {
  margin: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--safety-orange);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-intro h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
  color: var(--on-surface);
  text-transform: uppercase;
}

.report-intro p {
  margin: 0;
  max-width: 32rem;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.45;
}

.viewfinder {
  position: relative;
  margin: 0 20px;
  border: 3px dashed var(--caution-yellow);
  background: var(--asphalt-black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  height: 40dvh;
  max-height: 420px;
}

.viewfinder-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0.6;
  filter: grayscale(0.3);
  width: 100%;
  height: 100%;
}

.viewfinder-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.viewfinder-dither {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#ffffff10 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}

.capture-panel-content {
  position: relative;
  z-index: 25;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  text-align: center;
}

.capture-status {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  background: rgba(17, 17, 17, 0.88);
  border: 2px solid var(--scan-green);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--scan-green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.capture-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--scan-green);
  box-shadow: 0 0 8px var(--scan-green);
  animation: led-pulse 2s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.capture-btn {
  width: min(220px, 78%);
  min-height: 76px;
  background: var(--caution-yellow);
  border: 4px solid #000;
  box-shadow: 6px 6px 0px 0px var(--shadow-color);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  color: var(--asphalt-black);
  font-family: var(--font-mono);
  appearance: none;
  -webkit-appearance: none;
}

.capture-btn:active {
  transform: translate(6px, 6px);
  box-shadow: none !important;
}

.capture-btn .material-symbols-outlined {
  font-size: 30px;
  color: var(--asphalt-black);
  font-variation-settings: 'FILL' 1;
}

.capture-btn-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--asphalt-black);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.capture-hint {
  margin: 0;
  max-width: 17rem;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- GPS Panel (Report) ---------- */
.gps-panel {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 14px;
  margin: 0 20px;
}

.gps-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gps-panel-icon {
  color: var(--safety-orange);
  margin-top: 2px;
  font-variation-settings: 'FILL' 1;
}

.gps-panel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--outline);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gps-coords-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gps-panel-coords {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-surface);
  margin-top: 4px;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.gps-reveal-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  background: var(--surface-container-high);
  color: var(--safety-orange);
  box-shadow: 3px 3px 0 0 var(--shadow-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gps-reveal-btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.gps-reveal-btn[aria-pressed="true"] {
  background: var(--safety-orange);
  color: #000;
}

.gps-reveal-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.gps-reveal-btn .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
}

.gps-panel-info {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin-top: 6px;
}

.gps-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-container-high);
  border: 2px solid #000;
  padding: 6px 16px;
  color: var(--on-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gps-btn:active {
  transform: translate(4px, 4px);
}

.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 20px;
  padding: 12px;
  border: 2px solid var(--outline-variant);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
}

.privacy-notice .material-symbols-outlined {
  flex: 0 0 auto;
  color: var(--scan-green);
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
}

.privacy-notice p {
  margin: 0;
}

/* Image upload area (styled as part of viewfinder) */
.image-upload-area {
  display: none;
}

/* Preview after capture */
.preview-box {
  margin: 0 20px;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface);
  overflow: hidden;
}

.preview-box img {
  width: 100%;
  max-height: 24dvh;
  object-fit: cover;
  display: block;
}

.preview-box figcaption {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  border-top: 2px solid #000;
}

/* Submit button */
.submit-btn {
  position: sticky;
  top: calc(100dvh - 140px - env(safe-area-inset-bottom));
  z-index: 35;
  margin: 4px 20px 0;
  height: 52px;
  background: var(--safety-orange);
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.submit-btn:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

.submit-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.submit-btn:disabled:active {
  transform: none;
  box-shadow: none;
}

/* ---------- Result View — Submission Status ---------- */
.result-hero {
  background: var(--caution-yellow);
  color: #000;
  padding: 24px 20px;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  position: relative;
  overflow: hidden;
  margin: 0 20px;
}

.result-hero-title {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 10;
}

.result-hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 12px;
  position: relative;
  z-index: 10;
}

.result-hero-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.result-hero-check {
  font-size: 36px;
  font-variation-settings: 'FILL' 1;
}

.result-hero-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-top: 8px;
  position: relative;
  z-index: 10;
}

.result-not-found {
  margin: 0 20px;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 24px 20px 20px;
}

.result-not-found h2 {
  font-family: var(--font-sans);
  font-size: clamp(20px, 3.2vw, 42px);
  font-weight: 900;
  line-height: 0.95;
  color: var(--error);
  font-style: italic;
  letter-spacing: 0;
  white-space: nowrap;
  margin: 0;
}

.result-not-found-gif {
  display: block;
  width: 100%;
  max-width: 498px;
  height: auto;
  margin: 24px auto 0;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: #000;
}

/* AI Analysis section */
.analysis-section {
  margin: 16px 20px;
}

.analysis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--scan-green);
}

.analysis-header .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.analysis-card {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 20px;
}

.analysis-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--scan-green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-bar {
  height: 32px;
  width: 100%;
  background: var(--asphalt-black);
  border: 2px solid var(--surface-container-highest);
  padding: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #000000,
    #000000 10px,
    #FFD60A 10px,
    #FFD60A 20px
  );
  position: relative;
  overflow: hidden;
}

.progress-bar-indeterminate {
  width: 40%;
  animation: indeterminate-bar 2s ease-in-out infinite;
}

@keyframes indeterminate-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.analysis-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.analysis-data-cell {
  background: var(--asphalt-black);
  border: 1px solid var(--outline-variant);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.analysis-data-cell .highlight {
  color: var(--caution-yellow);
}

.analysis-data-cell .success {
  color: var(--scan-green);
}

/* ---------- Positive Result Follow-up ---------- */
.pothole-thanks-section {
  margin: 0 20px;
}

.pothole-thanks-card {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pothole-thanks-card p {
  margin: 0;
  background: var(--asphalt-black);
  border: 1px solid var(--outline-variant);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--error);
}

.pothole-thanks-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pothole-thanks-link:focus-visible {
  outline: 3px solid var(--caution-yellow);
  outline-offset: 3px;
}

.pothole-thanks-media {
  width: 100%;
  overflow: hidden;
  background: var(--asphalt-black);
  border: 2px solid var(--outline-variant);
}

.pothole-thanks-media img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* Inspection data */
.inspection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 20px;
}

@media (min-width: 640px) {
  .inspection-grid {
    grid-template-columns: 2fr 3fr;
  }
}

.inspection-image-wrap {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  padding: 4px;
  background: var(--surface-container);
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.inspection-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25) brightness(0.75);
  transition: all 0.5s;
}

.inspection-image-wrap:hover img {
  filter: grayscale(0);
}

.inspection-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--safety-orange);
  color: #000;
  padding: 6px 12px;
  border: 2px solid #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspection-data-panel {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  display: flex;
  flex-direction: column;
}

.inspection-data-panel .hazard-stripe-top {
  height: 8px;
  width: 100%;
}

.inspection-data-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspection-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspection-field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inspection-field-value {
  background: var(--asphalt-black);
  border: 1px solid var(--outline);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-surface);
  letter-spacing: 0.03em;
}

.inspection-coords-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.inspection-coords-value {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.result-coords-reveal-btn {
  width: 38px;
  height: auto;
  min-height: 42px;
  margin-top: 0;
}

.inspection-status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hazard-level-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hazard-led {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.hazard-led.critical {
  background: var(--safety-orange);
  box-shadow: 0 0 10px var(--safety-orange);
}

.hazard-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--safety-orange);
  letter-spacing: 0.05em;
}

.inspection-footer {
  padding: 12px 20px;
  border-top: 2px solid var(--outline-variant);
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspection-footer .material-symbols-outlined {
  color: var(--scan-green);
  font-variation-settings: 'FILL' 1;
}

.inspection-footer-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--on-surface);
  letter-spacing: 0.03em;
}

/* ---------- Missed Detection Reporting ---------- */
.missed-detection-section {
  margin: 0 20px;
}

.missed-detection-card {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.missed-detection-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  color: var(--on-surface);
}

.missed-detection-header .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 1;
}

.missed-detection-media {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  background: var(--asphalt-black);
  border: 2px solid var(--outline-variant);
}

.missed-detection-media img {
  display: block;
  width: 100%;
  max-width: 374px;
  height: auto;
  object-fit: contain;
}

.missed-detection-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  letter-spacing: 0.03em;
  margin: 0;
}

.missed-detection-input {
  width: 100%;
  border: 2px solid var(--outline-variant);
  background: var(--asphalt-black);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-surface);
  resize: none;
  outline: none;
  min-height: 60px;
  transition: border-color var(--transition-fast);
}

.missed-detection-input:focus {
  border-color: var(--caution-yellow);
}

.missed-detection-input::placeholder {
  color: var(--outline);
  opacity: 0.6;
}

.missed-detection-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.missed-detection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.missed-btn {
  height: 44px;
  padding: 0 20px;
  background: var(--caution-yellow);
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.missed-btn:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

.missed-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.missed-btn:disabled:active {
  transform: none;
  box-shadow: none;
}

.missed-detection-result {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  min-height: 16px;
}

.missed-detection-result.success {
  color: var(--scan-green);
}

.missed-detection-result.error {
  color: var(--error);
}

/* Return home CTA */
.return-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 16px;
}

.return-btn {
  width: 100%;
  max-width: 400px;
  padding: 20px 48px;
  background: var(--safety-orange);
  color: #000;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  border: var(--border-thick) solid #000;
  box-shadow: 8px 8px 0px 0px var(--shadow-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.return-btn:active {
  transform: translate(8px, 8px);
  box-shadow: none !important;
}

/* ---------- Map View ---------- */
.map-full {
  flex: 1;
  width: 100%;
  min-height: 400px;
  z-index: 0;
  background: var(--surface);
}

#mapView {
  min-height: calc(100dvh - 64px - 80px);
}

/* Override Leaflet dark tile background so tiles pop against our dark UI */
.leaflet-layer {
  filter: brightness(1.15) contrast(1.1);
}

.map-search-wrap {
  position: absolute;
  top: 80px;
  left: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-search-box {
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface-container);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
}

.map-search-box .material-symbols-outlined {
  color: var(--outline);
  margin-right: 12px;
  font-size: 20px;
}

.map-search-box input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-surface);
  letter-spacing: 0.03em;
  outline: none;
}

.map-search-box input::placeholder {
  color: var(--outline);
  opacity: 0.7;
}

.map-search-results {
  border: var(--border-thick) solid #000;
  background: var(--surface-container);
  max-height: 260px;
  overflow-y: auto;
}

.map-search-results li {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--on-surface);
  letter-spacing: 0.03em;
}

.map-search-results li:last-child {
  border-bottom: none;
}

.map-search-results li:hover,
.map-search-results li.selected {
  background: var(--surface-container-high);
}

.map-search-results .search-name {
  font-weight: 700;
  color: var(--on-surface);
}

.map-search-results .search-detail {
  font-size: 11px;
  color: var(--outline);
  margin-top: 2px;
}

/* Filter chips */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 2px solid #000;
  padding: 6px 14px;
  background: var(--surface-container);
  color: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:active {
  transform: translate(4px, 4px);
}

.filter-chip.active {
  background: var(--on-surface);
  color: var(--inverse-on-surface);
}

.filter-chip .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid #000;
  margin-right: 4px;
}

/* ---------- Contact ---------- */
.contact-panel {
  width: 100%;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-icon {
  width: 52px;
  height: 52px;
  border: var(--border-thick) solid #000;
  background: var(--safety-orange);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 4px 4px 0px 0px var(--shadow-color);
}

.contact-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--surface-tint);
  margin-bottom: 4px;
}

.contact-panel h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 900;
  color: var(--on-surface);
  line-height: 1;
  text-transform: uppercase;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.contact-textarea {
  width: 100%;
  border: 2px solid #000;
  background: var(--surface-container);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-surface);
  resize: vertical;
  outline: none;
  min-height: 132px;
}

.contact-textarea:focus {
  border-color: var(--safety-orange);
  box-shadow: 0 0 0 2px #000;
}

.contact-textarea::placeholder {
  color: var(--outline);
  opacity: 0.75;
}

.contact-submit {
  height: 48px;
  background: var(--safety-orange);
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact-submit:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

.contact-message {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}

/* ---------- FAB ---------- */
.fab-wrap {
  position: fixed;
  bottom: 96px;
  right: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fab-locate {
  width: auto;
  height: 44px;
  padding: 0 16px;
  background: var(--surface-container);
  color: var(--safety-orange);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fab-locate:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: none !important;
}

/* ---------- Leaflet Overrides ---------- */
.leaflet-control-zoom {
  display: none !important;
}

#map .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(22, 19, 16, 0.8) !important;
  color: var(--on-surface-variant) !important;
  border: 1px solid #000;
}

#map .leaflet-control-attribution a {
  color: var(--on-surface-variant) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  border: var(--border-thick) solid #000;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0px 0px var(--shadow-color);
  background: var(--surface);
  color: var(--on-surface);
}

.leaflet-popup-tip {
  border: 2px solid #000 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.leaflet-popup-content {
  margin: 0;
  min-width: 220px;
}

.popup-card {
  font-family: var(--font-sans);
}

.popup-card img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  filter: grayscale(0.6);
}

.popup-card .popup-body {
  padding: 12px;
}

.popup-card .popup-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid #000;
}

.popup-card .popup-badge.pothole {
  background: var(--error-container);
  color: var(--on-error-container);
}

.popup-card .popup-badge.clear {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.popup-card .popup-meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--outline);
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.popup-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid #000;
}

.status-open {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.status-progress {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.status-resolved {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

/* Vote button */
.popup-vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  padding: 6px 14px;
  border: 2px solid var(--error);
  background: var(--surface);
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1.2;
  /* Grow to fill the row; when both fit side-by-side they split it evenly,
     otherwise the second one wraps to its own line at full width. */
  flex: 1 1 auto;
  min-width: 0;
}

.popup-vote-btn:hover {
  background: var(--error-container);
}

.popup-vote-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.popup-vote-btn:active {
  transform: translate(4px, 4px);
}

/* View Details button in popup */
.popup-details-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  border: 2px solid var(--safety-orange);
  background: var(--surface);
  color: var(--safety-orange);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}

.popup-details-btn:hover {
  background: rgba(255, 69, 0, 0.1);
}

.popup-details-btn:active {
  transform: translate(4px, 4px);
}

/* Form message */
.form-message {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  min-height: 20px;
  padding: 8px 20px;
}

.form-message-error {
  color: var(--error);
}

.form-message-success {
  color: var(--scan-green);
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-container-low) 25%,
    var(--surface-container) 50%,
    var(--surface-container-low) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border: 1px solid #000;
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
}

.skeleton-card {
  height: 100px;
  border: var(--border-thick) solid #000;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  :root {
    --container-margin: 40px;
  }

  .hero-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Hidden utility ---------- */
.hidden {
  display: none !important;
}

/* ---------- Spacing utilities ---------- */
.px-margin {
  padding-left: var(--container-margin);
  padding-right: var(--container-margin);
}

.py-section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

/* ---------- Custom marker styles ---------- */
.road-marker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #000;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.road-marker:active {
  transform: scale(0.9);
}

.road-marker .marker-arrow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #000;
}

.road-marker.critical {
  background: var(--safety-orange);
  color: #000;
}

.road-marker.warning {
  background: var(--caution-yellow);
  color: #000;
}

.road-marker.fixed {
  background: var(--scan-green);
  color: #000;
}
