/* =========================================================
   PorterVac Field Worker PWA — app.css
   Mobile-first responsive styles
   ========================================================= */

/* ---------------------------------------------------------
   CSS Custom Properties (Brand Palette)
   --------------------------------------------------------- */
:root {
  /* Brand colours */
  --clr-navy:        #033E5E;
  --clr-orange:      #DB731C;
  --clr-blue:        #4F8AA5;
  --clr-light-panel: #E8F0F4;
  --clr-white:       #FFFFFF;
  --clr-bg:          #F3F5F7;
  --clr-text:        #1A1A2E;
  --clr-text-muted:  #5A6270;
  --clr-border:      #D6DCE1;

  /* Inspection status colours */
  --clr-status-good:      #00C875;
  --clr-status-attention:  #FFCB00;
  --clr-status-poor:       #DF2F4A;

  /* Works-type badge colours */
  --clr-badge-gutter:     #00C875;
  --clr-badge-domestic:   #DF2F4A;
  --clr-badge-roof:       #FFCB00;

  /* Spacing scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
  --font-size-xs:   0.75rem;   /* 12px */
  --font-size-sm:   0.8125rem; /* 13px */
  --font-size-base: 0.9375rem; /* 15px */
  --font-size-md:   1rem;      /* 16px */
  --font-size-lg:   1.125rem;  /* 18px */
  --font-size-xl:   1.25rem;   /* 20px */
  --font-size-2xl:  1.5rem;    /* 24px */

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:    0 1px 3px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --shadow-raised:  0 4px 14px rgba(0,0,0,.12);
  --shadow-nav:     0 -1px 6px rgba(0,0,0,.08);

  /* Transitions */
  --ease-out: cubic-bezier(.25, .46, .45, .94);
  --duration: 250ms;

  /* Safe areas (iOS notch / dynamic island) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* Layout dimensions */
  --header-height: 56px;
  --nav-height:    64px;
}

/* ---------------------------------------------------------
   Reset & Base
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--clr-text);
  background: var(--clr-bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--clr-blue);
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------
   Loading Screen
   --------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--clr-white);
  transition: opacity 400ms var(--ease-out);
}

.loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--clr-light-panel);
  border-top-color: var(--clr-navy);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
}

.loading-text {
  margin-top: var(--space-md);
  color: var(--clr-text-muted);
  font-size: var(--font-size-sm);
}

/* ---------------------------------------------------------
   Toast Notifications
   --------------------------------------------------------- */
.toast-area {
  position: fixed;
  top: calc(var(--safe-top) + var(--header-height) + var(--space-sm));
  left: var(--space-md);
  right: var(--space-md);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--clr-navy);
  color: var(--clr-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  font-size: var(--font-size-sm);
  pointer-events: auto;
  animation: toast-in 300ms var(--ease-out) forwards;
}

.toast--success { background: var(--clr-status-good); color: #fff; }
.toast--error   { background: var(--clr-status-poor); color: #fff; }
.toast--warning { background: var(--clr-status-attention); color: var(--clr-text); }

.toast.is-leaving {
  animation: toast-out 250ms var(--ease-out) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-12px) scale(.96); }
}

/* ---------------------------------------------------------
   App Header
   --------------------------------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  background: var(--clr-navy);
  color: var(--clr-white);
  padding-top: var(--safe-top);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--space-md);
  gap: var(--space-sm);
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  color: var(--clr-white);
  transition: background var(--duration) var(--ease-out);
}

.header-btn:active {
  background: rgba(255,255,255,.12);
}

.header-btn[hidden] {
  display: none;
}

.header-brand {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
}

.header-brand__name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-brand__tagline {
  font-size: var(--font-size-sm);
  color: var(--clr-orange);
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: var(--space-xs);
}

/* ---------------------------------------------------------
   Main Content Area
   --------------------------------------------------------- */
.app-main {
  padding-top: calc(var(--safe-top) + var(--header-height));
  padding-bottom: calc(var(--safe-bottom) + var(--nav-height) + var(--space-md));
  min-height: 100dvh;
}

/* ---------------------------------------------------------
   View Management
   --------------------------------------------------------- */
.view {
  display: none;
  animation: view-in 300ms var(--ease-out);
}

.view--active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Search Bar
   --------------------------------------------------------- */
.search-bar {
  position: sticky;
  top: calc(var(--safe-top) + var(--header-height));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md);
  padding: 0 var(--space-md);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration) var(--ease-out);
}

.search-bar:focus-within {
  border-color: var(--clr-blue);
}

.search-bar__icon {
  flex-shrink: 0;
  color: var(--clr-text-muted);
}

.search-bar__input {
  flex: 1;
  height: 48px;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--font-size-base);
  color: var(--clr-text);
}

.search-bar__input::placeholder {
  color: var(--clr-text-muted);
}

.search-bar__clear {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--clr-text-muted);
}

.search-bar__clear:active {
  background: var(--clr-light-panel);
}

.search-bar__clear[hidden] {
  display: none;
}

/* ---------------------------------------------------------
   Job List Meta
   --------------------------------------------------------- */
.job-list-meta {
  padding: 0 var(--space-md) var(--space-sm);
}

.job-count {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  font-weight: 500;
}

/* ---------------------------------------------------------
   Job Cards
   --------------------------------------------------------- */
.job-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: 0 var(--space-md) var(--space-md);
}

.job-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}

.job-card:active {
  transform: scale(.98);
  box-shadow: var(--shadow-raised);
}

.job-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.job-card__customer {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--clr-navy);
  line-height: 1.3;
}

.job-card__number {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.job-card__address {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.job-card__address svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.job-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.job-card__date {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
}

/* Works-type badges */
.works-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.works-badge--gutter-clean {
  background: rgba(0,200,117,.12);
  color: #00915a;
}

.works-badge--domestic {
  background: rgba(223,47,74,.10);
  color: #c12040;
}

.works-badge--gutter-roof {
  background: rgba(255,203,0,.15);
  color: #8a6d00;
}

.works-badge--default {
  background: var(--clr-light-panel);
  color: var(--clr-navy);
}

/* Arrow indicator on card */
.job-card__arrow {
  color: var(--clr-border);
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Skeleton Loading Cards
   --------------------------------------------------------- */
.job-card--skeleton {
  cursor: default;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--clr-light-panel) 25%,
    #dde6eb 50%,
    var(--clr-light-panel) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

.skeleton--title {
  height: 20px;
  width: 65%;
  margin-bottom: var(--space-sm);
}

.skeleton--text {
  height: 14px;
  width: 90%;
  margin-bottom: var(--space-sm);
}

.skeleton--short {
  width: 40%;
}

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

/* ---------------------------------------------------------
   Empty State
   --------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--clr-text-muted);
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  margin: 0 auto var(--space-md);
  opacity: .4;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--clr-text);
}

.empty-state__subtitle {
  font-size: var(--font-size-sm);
}

/* ---------------------------------------------------------
   Detail View
   --------------------------------------------------------- */
.detail-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-md);
  box-shadow: var(--shadow-card);
}

.detail-card--header {
  background: var(--clr-navy);
  color: var(--clr-white);
}

.detail-card--action {
  background: transparent;
  box-shadow: none;
  padding: 0 var(--space-md) var(--space-lg);
  margin-top: var(--space-sm);
}

.detail-card__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-md);
}

.detail-card--header .detail-card__title {
  color: rgba(255,255,255,.6);
}

/* Detail Header */
.detail-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.detail-header__name {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  line-height: 1.2;
}

.detail-header__top .works-badge {
  margin-top: 4px;
  flex-shrink: 0;
}

.detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.8);
}

.meta-item svg {
  opacity: .6;
  flex-shrink: 0;
}

/* Address */
.detail-address {
  font-size: var(--font-size-base);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-md);
}

/* ---------------------------------------------------------
   Map Container
   --------------------------------------------------------- */
.job-map {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  background: var(--clr-light-panel);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

/* Override Leaflet font */
.job-map .leaflet-control {
  font-family: var(--font-family);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  min-height: 48px;
  transition: transform var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out),
              opacity var(--duration) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(.97);
}

.btn--full {
  width: 100%;
}

.btn--primary {
  background: var(--clr-navy);
  color: var(--clr-white);
}

.btn--primary:active {
  background: #02304a;
}

.btn--outline {
  background: transparent;
  color: var(--clr-blue);
  border: 1.5px solid var(--clr-border);
}

.btn--outline:active {
  background: var(--clr-light-panel);
}

/* Photo capture button */
.btn--photo {
  width: 100%;
  margin-top: var(--space-md);
  padding: 14px;
  background: var(--clr-light-panel);
  color: var(--clr-navy);
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn--photo:active {
  background: #d8e5eb;
}

/* Generate report button */
.btn--generate {
  width: 100%;
  padding: 18px var(--space-lg);
  font-size: var(--font-size-lg);
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: var(--clr-navy);
  color: var(--clr-white);
  box-shadow: 0 4px 20px rgba(3,62,94,.3);
  position: relative;
  overflow: hidden;
}

.btn--generate::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--clr-orange);
}

.btn--generate:active {
  background: #02304a;
  box-shadow: 0 2px 10px rgba(3,62,94,.4);
}

.btn--generate:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Contact buttons */
.contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.btn--contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  min-height: 48px;
  transition: transform var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out);
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

.btn--contact:active {
  transform: scale(.97);
}

.btn--phone {
  background: rgba(0,200,117,.10);
  color: #00915a;
}

.btn--phone:active {
  background: rgba(0,200,117,.18);
}

.btn--email {
  background: rgba(79,138,165,.10);
  color: var(--clr-blue);
}

.btn--email:active {
  background: rgba(79,138,165,.18);
}

/* ---------------------------------------------------------
   Photo Grid
   --------------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.photo-grid__item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-light-panel);
  aspect-ratio: 4 / 3;
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-grid__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tablet+ photo grid: 3 columns */
@media (min-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------
   Inspection / Subitems List
   --------------------------------------------------------- */
.inspection-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.inspection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--clr-light-panel);
  border-radius: var(--radius-md);
  min-height: 48px;
}

.inspection-item__name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--clr-text);
  flex: 1;
}

.inspection-item__notes {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* Inspection status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge--good {
  background: rgba(0,200,117,.12);
  color: #00915a;
}

.status-badge--attention {
  background: rgba(255,203,0,.18);
  color: #8a6d00;
}

.status-badge--poor {
  background: rgba(223,47,74,.10);
  color: #c12040;
}

/* Status badge thumb icons */
.status-badge__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Report Generation Progress
   --------------------------------------------------------- */
.report-progress {
  margin-top: var(--space-md);
  text-align: center;
}

.report-progress[hidden] {
  display: none;
}

.report-progress__bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--clr-border);
  overflow: hidden;
}

.report-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--clr-orange), var(--clr-blue));
  transition: width 400ms var(--ease-out);
}

.report-progress__status {
  font-size: var(--font-size-sm);
  color: var(--clr-text-muted);
  margin-top: var(--space-sm);
}

/* ---------------------------------------------------------
   Bottom Navigation Bar
   --------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  display: flex;
  background: var(--clr-white);
  border-top: 1px solid var(--clr-border);
  box-shadow: var(--shadow-nav);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 0;
  min-height: var(--nav-height);
  color: var(--clr-text-muted);
  transition: color var(--duration) var(--ease-out);
  position: relative;
}

.bottom-nav__item--active {
  color: var(--clr-navy);
}

.bottom-nav__item--active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--clr-orange);
}

.bottom-nav__label {
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Hide bottom nav when camera is active */
.camera-active .bottom-nav {
  display: none;
}

.camera-active .app-header {
  display: none;
}

.camera-active .app-main {
  padding-top: 0;
  padding-bottom: 0;
}

/* ---------------------------------------------------------
   Camera View
   --------------------------------------------------------- */
.view--camera {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: #000;
}

.view--camera.view--active {
  display: flex;
}

.camera-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-canvas {
  display: none;
}

/* Camera Overlay */
.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.camera-overlay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + var(--space-md)) var(--space-md) var(--space-md);
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  pointer-events: auto;
}

.camera-overlay__label {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--clr-white);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.camera-overlay__guide {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.camera-guide-frame {
  width: 85%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: var(--radius-lg);
}

.camera-overlay__bottom {
  padding: var(--space-lg) var(--space-md) calc(var(--safe-bottom) + var(--space-xl));
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  pointer-events: auto;
}

/* Camera Buttons */
.camera-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
}

.camera-btn--close,
.camera-btn--flip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.camera-btn--close:active,
.camera-btn--flip:active {
  background: rgba(255,255,255,.25);
}

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-controls__spacer {
  flex: 1;
}

.camera-btn--capture {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--clr-white);
  position: relative;
}

.camera-btn--capture:active {
  transform: scale(.92);
}

.capture-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 3px solid var(--clr-navy);
}

/* ---------------------------------------------------------
   Responsive — Tablet & Up
   --------------------------------------------------------- */
@media (min-width: 600px) {
  .job-list {
    max-width: 640px;
    margin: 0 auto;
  }

  .detail-card {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .search-bar {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .job-list-meta {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .job-map {
    height: 280px;
  }
}

/* Desktop — wider cards grid */
@media (min-width: 960px) {
  .job-list {
    max-width: 800px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card {
    max-width: 800px;
  }

  .search-bar,
  .job-list-meta {
    max-width: 800px;
  }
}

/* ---------------------------------------------------------
   Utility — Focus Visible
   --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--clr-orange);
  outline-offset: 2px;
}

/* Remove outline for pointer interactions */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------
   Print — hide chrome
   --------------------------------------------------------- */
@media print {
  .app-header,
  .bottom-nav,
  .search-bar,
  .btn--photo,
  .btn--generate,
  .camera-overlay {
    display: none !important;
  }

  .app-main {
    padding: 0;
  }
}
