/* ==========================================================
   Road issue reporting – styles
   Based on the UDOT Branding & Style Guide v2.0:
   primary colors, gray scale, Arial body + Oswald headings,
   slanted stripe motif (29.29°), WCAG 2.1 AA contrast.
   ========================================================== */

:root {
  /* UDOT primary */
  --udot-dark-blue: #0b2444;
  --udot-light-blue: #5a87c6;
  --udot-orange: #e86924;
  /* UDOT secondary / tertiary (accents) */
  --udot-medium-blue: #09549c;
  --udot-light-green: #abc746;
  --udot-dark-green: #6b7a31;
  /* UDOT gray scale */
  --udot-gray-dark: #454545;
  --udot-gray: #888888;
  --udot-gray-light: #eeeeee;

  /* Tints and accessible shades derived from the palette */
  --blue-tint: #e7eef8;
  --blue-tint-line: #bdd0ea;
  --orange-tint: #fdf0e8;
  --green-tint: #f2f6e4;
  --muted: #5e5e5e;          /* gray text that passes 4.5:1 on white and light gray */
  --line: #d6d6d6;
  --danger: #b3261e;         /* darker than UDOT red, which is 4.45:1 on white */
  --danger-bg: #fdeceb;
  --danger-line: #f1bfbb;

  --font-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-head: "Oswald", "Arial Narrow", Arial, sans-serif;

  --slant: -29.29deg;
  --r-sm: 4px;
  --r-md: 6px;
  --focus-ring: 0 0 0 2px #fff, 0 0 0 5px var(--udot-medium-blue);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--udot-gray-dark);
  background: var(--udot-gray-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
main:focus { outline: none; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
iframe { max-width: 100%; border: 0; }
/* Grid and flex children default to min-width:auto, which lets wide embedded
   content (maps, images) push past its column. */
.summary dd, .summary > div, .panel, .portal-main, .review-side { min-width: 0; }
h1, h2 { color: var(--udot-dark-blue); line-height: 1.2; }
a { color: var(--udot-medium-blue); }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

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

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: #fff; color: var(--udot-dark-blue);
  padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); }
h1:focus, h1:focus-visible { box-shadow: none; }

/* ---------- Header: logo bar + light blue band ---------- */
.site-header { background: #fff; }
.header-inner { display: flex; align-items: center; min-height: 88px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-block; border-radius: var(--r-sm); }
.brand-logo { height: 52px; width: auto; }

.app-band {
  position: relative;
  overflow: hidden;
  background: var(--udot-light-blue);
}
.app-band::before {
  /* three white slanted stripes, as in the guide's page headers */
  content: "";
  position: absolute; top: 0; bottom: 0; left: 36px;
  width: 94px;
  background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 40px);
  transform: skewX(var(--slant));
}
.app-band-inner { display: flex; justify-content: flex-end; align-items: center; min-height: 56px; }
.app-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;          /* large text: dark blue on light blue meets 3:1 */
  letter-spacing: .01em;
  color: var(--udot-dark-blue);
}
.app-title a { color: inherit; text-decoration: none; }
.app-title a:hover { text-decoration: underline; }
.app-title a:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

.demo-notice {
  background: var(--orange-tint);
  border-bottom: 3px solid var(--udot-orange);
  color: var(--udot-gray-dark);
}
.demo-notice p { margin: 0; padding: 10px 20px; font-size: .9375rem; line-height: 1.45; }
.demo-notice strong { color: #8a3b0f; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--udot-dark-blue); color: #fff; }
.btn-primary:hover { background: var(--udot-medium-blue); }
.btn-secondary { background: #fff; color: var(--udot-medium-blue); border-color: var(--udot-gray); }
.btn-secondary:hover { background: var(--blue-tint); border-color: var(--udot-medium-blue); }
.btn-ghost { background: transparent; color: var(--udot-dark-blue); }
.btn-ghost:hover { background: rgba(11, 36, 68, .07); }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.0625rem; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .9375rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.is-busy { opacity: .85; cursor: progress; }
.btn.is-busy::before {
  content: ""; width: 16px; height: 16px; flex: none;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.link-btn {
  appearance: none; background: none; border: 0; padding: 2px;
  font: inherit; font-weight: 700; color: var(--udot-medium-blue);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; border-radius: 3px;
}
.link-btn:hover { color: var(--udot-dark-blue); }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Orange three-stripe accent */
.stripes {
  display: block;
  width: 84px; height: 12px;
  margin: 0 0 20px 4px;
  background: repeating-linear-gradient(90deg, var(--udot-orange) 0 24px, transparent 24px 30px);
  transform: skewX(var(--slant));
}

/* ---------- Landing ---------- */
.landing { padding-top: 32px; padding-bottom: 56px; }

.hero {
  background: var(--udot-dark-blue);
  color: #fff;
  border-radius: var(--r-md);
  padding: 44px 40px 48px;
}
.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.08;
  color: #fff;
  max-width: 18ch;
}
.hero p { margin: 0; font-size: 1.1875rem; line-height: 1.5; max-width: 54ch; color: #dde5ef; }

.choices { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 760px) { .choices { grid-template-columns: 1.25fr 1fr; } }
.choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 26px 26px 28px;
}
.choice h2 { margin: 0 0 6px; font-size: 1.375rem; }
.choice p { margin: 0 0 20px; color: var(--muted); max-width: 46ch; }
.choice-guest { box-shadow: inset 0 4px 0 var(--udot-orange); }

.emergency {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 20px; padding: 14px 18px;
  background: var(--orange-tint);
  border: 1px solid #f5c7ad; border-left: 5px solid var(--udot-orange);
  border-radius: var(--r-md);
  color: var(--udot-gray-dark);
}
.emergency p { margin: 0; }
.emergency-icon { flex: none; margin-top: 1px; }

/* ---------- Flow pages ---------- */
.page { padding-top: 28px; padding-bottom: 56px; }
.page-head { margin: 14px 0 22px; }
.page-head h1 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.75rem, 3.4vw, 2.25rem); }

.stepper {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: .9375rem; color: var(--muted);
}
.stepper li { display: flex; align-items: center; gap: 8px; }
.stepper li + li::before { content: ""; width: 28px; height: 2px; background: var(--udot-gray); margin-right: 2px; }
.stepper .num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8125rem; font-weight: 700; line-height: 1;
  background: #fff; border: 2px solid var(--udot-gray); color: var(--udot-gray-dark);
}
.stepper [aria-current="step"] { color: var(--udot-dark-blue); font-weight: 700; }
.stepper [aria-current="step"] .num { background: var(--udot-dark-blue); border-color: var(--udot-dark-blue); color: #fff; }
.stepper .is-done .num { background: var(--blue-tint); border-color: var(--udot-light-blue); color: var(--udot-dark-blue); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 1.25rem; }
.panel-head h2 .req { font-size: .875rem; }

.report-layout, .review-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.review-side { display: grid; gap: 20px; min-width: 0; }
@media (min-width: 960px) {
  .report-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .map-col { position: sticky; top: 20px; }
  .review-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}

/* ---------- Fields ---------- */
.field + .field,
#dynamic-fields > .field,
#dynamic-fields + .field { margin-top: 24px; }
.label { display: block; font-weight: 700; color: var(--udot-dark-blue); margin-bottom: 6px; }
.req { font-weight: 400; font-size: .875rem; color: var(--muted); margin-left: 6px; }
.hint { color: var(--muted); font-size: .9375rem; margin: 0 0 8px; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit; color: var(--udot-gray-dark);
  background: #fff;
  border: 1px solid var(--udot-gray);
  border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230b2444' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input:hover, select:hover, textarea:hover { border-color: var(--udot-gray-dark); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--udot-medium-blue);
  box-shadow: 0 0 0 1px var(--udot-medium-blue), 0 0 0 4px rgba(9, 84, 156, .22);
}
input:disabled, select:disabled { background: #f5f5f5; color: var(--muted); }
[aria-invalid="true"] { border-color: var(--danger) !important; }

.field-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 6px; }
.field-meta .hint { margin: 0; }
.counter { margin: 0; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.counter.is-near { color: var(--udot-dark-blue); font-weight: 700; }

.field-error {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 8px 0 0; color: var(--danger); font-size: .9375rem; font-weight: 700;
}
.field-error::before {
  content: "!"; flex: none;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1;
}

.inline-retry { margin: 8px 0 0; color: var(--danger); font-weight: 700; display: flex; gap: 8px; flex-wrap: wrap; }

.field[data-dynamic-field].reveal { animation: reveal .22s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Photo ---------- */
.dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border: 2px dashed var(--udot-gray); border-radius: var(--r-md);
  background: #fafafa; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--udot-medium-blue); background: var(--blue-tint); }
#photo:focus-visible + .dropzone { box-shadow: var(--focus-ring); }
.dropzone-icon {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-tint); color: var(--udot-dark-blue);
}
.dropzone strong { display: block; color: var(--udot-dark-blue); }
.dropzone-sub { display: block; font-size: .9rem; color: var(--muted); }
.photo-busy { margin-top: 8px; }

.preview {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md);
}
.preview img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--r-sm); flex: none; background: var(--udot-gray-light); }
.preview-meta { min-width: 0; }
.preview-name { margin: 0; font-weight: 700; color: var(--udot-dark-blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-size { margin: 0 0 4px; font-size: .875rem; color: var(--muted); }

/* ---------- Map ---------- */
.map-shell {
  position: relative; overflow: hidden;
  border: 1px solid var(--udot-gray); border-radius: var(--r-md);
  background: #e4e7eb;
}
.map-shell:focus-visible { box-shadow: var(--focus-ring); }
/* overflow:hidden clips the map SDK's absolutely-positioned tiles, which are
   wider than the container while it is sizing itself. */
.map { position: relative; width: 100%; max-width: 100%; height: 340px; overflow: hidden; }
@media (min-width: 960px) { .map { height: 500px; } }
.map-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 24px; text-align: center;
  background: #e4e7eb; color: var(--udot-gray-dark); font-weight: 700;
}
.map-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.map-loc { min-width: 0; flex: 1 1 220px; }
.address { display: block; margin: 0 0 2px; font-weight: 700; color: var(--udot-dark-blue); overflow-wrap: anywhere; }
.address.is-pending { font-weight: 400; color: var(--muted); font-style: italic; }
.coords { display: block; margin: 0; font-size: .875rem; color: var(--muted); }
.map-status {
  margin: 10px 0 0; padding: 8px 12px;
  border-radius: var(--r-sm); font-size: .9375rem;
  background: var(--blue-tint); color: var(--udot-dark-blue);
  border-left: 4px solid var(--udot-light-blue);
}
.map-status.is-warn { background: var(--orange-tint); color: var(--udot-gray-dark); border-left-color: var(--udot-orange); }

/* ---------- Alerts ---------- */
.alert { margin: 0 0 20px; padding: 12px 16px; border: 1px solid; border-radius: var(--r-md); font-weight: 700; }
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: #8a1c16; }
.alert-info { background: var(--blue-tint); border-color: var(--blue-tint-line); color: var(--udot-dark-blue); }
.landing .alert { margin: 16px 0 0; }

/* ---------- Actions ---------- */
.actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--udot-gray);
}
.submit-error { margin-top: 20px; }
.submit-hint { margin: 10px 0 0; text-align: right; color: var(--udot-dark-blue); font-weight: 700; font-size: .9375rem; }
.recaptcha-note { margin: 18px 0 0; text-align: right; font-size: .8125rem; color: var(--muted); }
.grecaptcha-badge { visibility: hidden; }

/* ---------- Review summary ---------- */
.summary { margin: 0; }
.summary > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (min-width: 560px) { .summary > div { grid-template-columns: 150px minmax(0, 1fr); gap: 16px; } }
.summary dt { font-weight: 700; font-size: .9375rem; color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; }
.not-provided { color: var(--muted); font-style: italic; }
.review-map { position: relative; width: 100%; max-width: 100%; overflow: hidden; height: 200px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; background: #e4e7eb; }
.review-photo { max-width: 240px; max-height: 240px; border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ---------- Notification opt-ins ---------- */
.notify-intro { margin-bottom: 16px; }
.optin { margin: 0 0 12px; padding: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.optin:last-child { margin-bottom: 0; }
.optin.is-checked { border-color: var(--udot-medium-blue); }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--udot-dark-blue); }
.check-title { display: block; font-weight: 700; color: var(--udot-dark-blue); }
.check-sub { display: block; font-size: .875rem; color: var(--muted); }
.optin-body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }

.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row input { flex: 1 1 auto; min-width: 0; }
.input-row .btn { flex: none; }
.code-input { letter-spacing: .3em; font-size: 1.125rem !important; font-weight: 700; }
.input-row .code-input { flex: 0 1 190px; }

.code-step { margin-top: 14px; padding: 14px; background: var(--udot-gray-light); border-radius: var(--r-sm); }
.code-dest { font-weight: 700; overflow-wrap: anywhere; }
.code-help { margin: 10px 0 0; font-size: .9375rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cooldown { font-size: .875rem; }
.sms-consent { margin: 8px 0 0; font-size: .8125rem; line-height: 1.45; color: var(--muted); }

.verified {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 0 0; padding: 5px 12px;
  font-size: .9375rem; font-weight: 700;
  color: var(--udot-dark-blue); background: var(--green-tint);
  border: 1px solid var(--udot-light-green); border-radius: 999px;
}
.verified svg { color: var(--udot-dark-green); }
.verified:focus-visible { box-shadow: var(--focus-ring); }

/* ---------- Done ---------- */
.done { max-width: 640px; margin: 22px auto 0; padding: 40px 28px; text-align: center; }
.done h1 { margin: 0 0 8px; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.75rem, 3.4vw, 2.25rem); }
.done-icon {
  width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--udot-dark-blue); color: #fff;
  box-shadow: 0 0 0 5px var(--blue-tint);
}
.done-msg { margin: 0 auto; max-width: 46ch; font-size: 1.0625rem; }
.request-id {
  display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px;
  margin: 22px 0 14px; padding: 14px 18px;
  background: var(--udot-gray-light); border-radius: var(--r-md);
  border-left: 5px solid var(--udot-orange);
}
.request-id-label { font-size: .9375rem; font-weight: 700; color: var(--muted); }
.request-id strong { font-size: 1.6rem; font-weight: 700; color: var(--udot-dark-blue); letter-spacing: .02em; overflow-wrap: anywhere; }
.done-actions { margin-top: 26px; }

/* ---------- Signed-in form ---------- */
html.auth-pending body { visibility: hidden; }   /* hidden until Firebase reports an auth state */
.header-action { margin-left: auto; }
.auth-error { max-width: 1140px; margin: 20px auto 0; padding-left: 20px; padding-right: 20px; }

/* ---------- Portal shell (signed-in pages) ---------- */
/* <main> sits inside .portal here, so the wrapper has to take the spare height
   or the footer floats up on short pages. */
.portal { flex: 1; display: flex; flex-direction: column; }
.portal-inner { flex: 1; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .portal-inner { grid-template-columns: 232px minmax(0, 1fr); }
  .portal-nav { position: sticky; top: 20px; padding-top: 28px; }
}
.portal-main { min-width: 0; }

.portal-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
@media (min-width: 900px) { .portal-nav ul { flex-direction: column; gap: 4px; } }
@media (max-width: 899px) {
  .portal-nav { margin-top: 16px; overflow-x: auto; }
  .portal-nav ul { flex-wrap: nowrap; }
  .portal-nav a { white-space: nowrap; }
}
.portal-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  color: var(--udot-dark-blue);
  font-weight: 700; text-decoration: none;
  border-left: 3px solid transparent;
}
.portal-nav a:hover { background: var(--blue-tint); }
.portal-nav a.is-current { background: var(--blue-tint); border-left-color: var(--udot-orange); }
.nav-icon { display: grid; place-items: center; color: var(--udot-medium-blue); flex: none; }
.portal-nav a.is-current .nav-icon { color: var(--udot-dark-blue); }

.page-head .hint { margin-top: 6px; }
.section-label {
  margin: 0 0 14px; font-size: .8125rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.back-link { margin: 0 0 4px; font-size: .9375rem; }
.list-status { padding: 18px 0; color: var(--muted); }

/* Time range buttons */
.range-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.range-btn {
  appearance: none; font: inherit; font-weight: 700; font-size: .9375rem;
  min-height: 40px; padding: 8px 16px; cursor: pointer;
  background: #fff; color: var(--udot-medium-blue);
  border: 1px solid var(--udot-gray); border-radius: 999px;
}
.range-btn:hover { background: var(--blue-tint); border-color: var(--udot-medium-blue); }
.range-btn[aria-pressed="true"] { background: var(--udot-dark-blue); border-color: var(--udot-dark-blue); color: #fff; }

/* Request list */
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.request-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.request-card:hover { border-color: var(--udot-medium-blue); }
.request-link { display: block; padding: 16px 18px; text-decoration: none; color: inherit; border-radius: var(--r-md); }
.request-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.request-type { font-family: var(--font-head); font-size: 1.125rem; font-weight: 600; color: var(--udot-dark-blue); }
.request-meta { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }
.request-address { margin: 8px 0 0; color: var(--udot-gray-dark); overflow-wrap: anywhere; }

.badge {
  display: inline-block; padding: 3px 12px 2px;
  border-radius: 999px; font-size: .8125rem; font-weight: 700;
  background: var(--udot-gray-light); color: var(--udot-gray-dark); border: 1px solid var(--line);
}
/* Received -> Assigned -> In Progress -> Completed, each its own hue.
   Anything unrecognised falls back to the neutral .badge style above. */
.badge.is-new { background: var(--blue-tint); color: var(--udot-dark-blue); border-color: var(--blue-tint-line); }
.badge.is-assigned { background: #e3f5f7; color: #0e5a60; border-color: #9ddfe4; }
.badge.is-active { background: var(--orange-tint); color: #8a3b0f; border-color: #f4b48f; }
.badge.is-done { background: var(--green-tint); color: #3f4a1c; border-color: var(--udot-light-green); }
.badge.is-closed { background: #f0f0f0; color: var(--muted); border-color: var(--line); }

.empty-state {
  background: #fff; border: 1px dashed var(--udot-gray); border-radius: var(--r-md);
  padding: 36px 24px; text-align: center;
}
.empty-title { margin: 0 0 4px; font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; color: var(--udot-dark-blue); }
.empty-state .btn { margin-top: 14px; }

/* Request detail */
.detail-status-line { margin: 0 0 14px; }
.detail-map-shell {
  position: relative; overflow: hidden;   /* clips Safari's content-sized iframe */
  width: 100%; max-width: 100%; height: 220px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #e4e7eb;
  -webkit-overflow-scrolling: auto;
}
.detail-map {
  display: block; width: 100%; height: 220px;
  border: 0; background: #e4e7eb;
}
.detail-address { margin: 8px 0 0; overflow-wrap: anywhere; }
/* The map needs the full panel width, so the location row stacks its label on top. */
.summary > div.sum-wide { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.map-link { display: inline-block; margin-top: 4px; font-size: .9375rem; }
.resolution-date { margin: 10px 0 0; font-size: .875rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--blue-tint-line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--udot-medium-blue);
}
.timeline li:first-child::before { border-color: var(--udot-orange); }
.timeline-status { margin: 0; font-weight: 700; color: var(--udot-dark-blue); }
.timeline-date { margin: 2px 0 0; font-size: .875rem; color: var(--muted); }
.timeline-note { margin: 6px 0 0; }
.no-timeline .timeline { display: none; }

/* Profile */
.profile-panel { max-width: 620px; }
.profile-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
  padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.profile-row-main { min-width: 0; }
.profile-row.is-editing { border-color: var(--udot-medium-blue); background: #fcfdff; }
.profile-form { flex: 1 0 100%; padding-top: 4px; }
.profile-form input { max-width: 340px; }
.profile-form .code-input { max-width: 190px; }
.profile-form .hint { margin-top: 8px; }
.reauth-note { margin-bottom: 10px; }
.email-note { margin: 6px 0 0; font-size: .875rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.alert-success { background: var(--green-tint); border-color: var(--udot-light-green); color: #3f4a1c; }
.profile-label { margin: 0 0 2px; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.profile-value { margin: 0; font-size: 1.0625rem; overflow-wrap: anywhere; }
.profile-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Legal pages (privacy policy, terms) ---------- */
.legal-page { max-width: 860px; }
.legal-toc {
  margin: 0 0 20px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
}
.legal-toc .section-label { margin-bottom: 10px; }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: .9375rem; }
@media (max-width: 559px) { .legal-toc ol { columns: 1; } }
.legal-toc li { margin-bottom: 4px; break-inside: avoid; }

.legal-doc { padding: 28px 32px; }
.legal-doc h2 {
  font-family: var(--font-head); font-weight: 600; font-size: 1.375rem;
  margin: 32px 0 10px; padding-top: 20px; border-top: 1px solid var(--line);
  scroll-margin-top: 20px;
}
.legal-doc h2:first-of-type { margin-top: 20px; }
.legal-num { color: var(--udot-orange); }
.legal-doc h3 { font-size: 1.0625rem; font-weight: 700; color: var(--udot-dark-blue); margin: 20px 0 6px; }
.legal-doc p { margin: 0 0 14px; max-width: 72ch; }
.legal-meta {
  display: inline-block; margin: 0 0 6px !important;
  padding: 5px 12px; border-radius: 999px;
  background: var(--blue-tint); border: 1px solid var(--blue-tint-line);
  color: var(--udot-dark-blue); font-weight: 700; font-size: .9375rem;
}
.legal-list { margin: 0 0 16px; padding-left: 22px; max-width: 72ch; }
.legal-list li { margin-bottom: 7px; }
.legal-switch { margin: 20px 0 0; font-size: .9375rem; }
@media (max-width: 559px) { .legal-doc { padding: 22px 18px; } }

/* ---------- Photo thumbnails and lightbox ---------- */
.thumb-btn {
  appearance: none; position: relative; display: block; flex: none;
  padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--r-sm);
}
.thumb-btn img { transition: filter .15s; }
.thumb-btn:hover img { filter: brightness(.92); }
.thumb-zoom {
  position: absolute; right: 6px; bottom: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--udot-dark-blue); color: #fff;
  box-shadow: 0 0 0 2px #fff;
}
.lightbox {
  padding: 0; border: 0; border-radius: var(--r-md);
  background: #fff; color: var(--udot-gray-dark);
  max-width: min(94vw, 1100px); max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4);
}
.lightbox::backdrop { background: rgba(11, 36, 68, .82); }
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line);
}
.lightbox-title { margin: 0; min-width: 0; font-weight: 700; color: var(--udot-dark-blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-close {
  appearance: none; flex: none; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--udot-dark-blue); cursor: pointer;
}
.lightbox-close:hover { background: var(--udot-gray-light); }
.lightbox-img {
  display: block; margin: 0 auto;
  width: auto; height: auto;
  max-width: min(94vw, 1100px); max-height: calc(92vh - 61px);
  background: var(--udot-gray-light);
}
body.modal-open { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--udot-dark-blue); color: #d6deea; font-size: .875rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px; padding-top: 24px; padding-bottom: 24px;
}
.footer-logo { height: 38px; width: auto; }
.site-footer p { margin: 0; }
.footer-legal a { color: #dde5ef; }
.footer-legal { margin-top: 4px !important; }

/* ---------- Small screens ---------- */
@media (max-width: 559px) {
  .brand-logo { height: 38px; }
  .header-inner { min-height: 72px; }
  .app-band::before { left: 16px; width: 80px; background: repeating-linear-gradient(90deg, #fff 0 12px, transparent 12px 34px); }
  .app-band-inner { min-height: 48px; }
  .app-title { font-size: 1.25rem; }  /* 20px bold still qualifies as large text */
  .hero { padding: 32px 24px 36px; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn { width: 100%; }
  .submit-hint, .recaptcha-note { text-align: left; }
}
@media (max-width: 440px) {
  .stepper { gap: 6px; font-size: .875rem; }
  .stepper li + li::before { width: 12px; }
  .request-id strong { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
