/* Shared foundation for every page. Mobile first; the desktop rules are at the end.
   Visual language: design/UI_UX_V3_MAP_VIDEO_PLAN.md section 7. */
:root {
  --ink: #243d37;
  --muted: #626e65;
  --paper: #f8f7f3;
  --line: #dce1d7;
  --accent: #b7482f;
  --soft: #eeeee6;
  --danger: #a32c25;
  --ok: #2f6b4f;
  --radius: 12px;
  --radius-lg: 18px;
  --gutter: 16px;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-weight: 500;
  letter-spacing: -0.8px;
  font-size: 27px;
  line-height: 1.15;
  margin-bottom: 6px;
}
h1:focus {
  outline: none;
}
h2 {
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 17px;
  margin-bottom: 6px;
}
p {
  color: var(--muted);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
[hidden] {
  display: none !important;
}

/* Controls: 44px minimum touch target everywhere. */
button,
.button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
}
button:hover,
.button:hover {
  border-color: var(--ink);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
}
.quiet {
  background: transparent;
}
.danger {
  color: var(--danger);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.text-link {
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  display: inline;
  color: inherit;
  font-size: inherit;
}
.link {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.help {
  font-size: 12.5px;
  color: var(--muted);
}
.pill,
.tag,
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--soft);
  display: inline-block;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
}
.tag {
  background: #f3dccd;
  color: #6d2a18;
  margin-left: 6px;
}
.tag.quiet {
  background: var(--soft);
  color: var(--muted);
}
.badge:empty {
  display: none;
}
.badge {
  background: var(--ink);
  color: white;
}
.locale-control {
  flex: 0 0 auto;
  margin: 0;
}
.locale-control select {
  width: 72px;
  min-height: 44px;
  padding: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 6000;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
}
.skip-link:focus {
  top: 8px;
}
.loading {
  padding: 40px 0;
  text-align: center;
}

/* Header: brand and the three main tabs stay at the top; nothing is pinned to the bottom. */
header.site {
  padding: 12px var(--gutter) 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  background: var(--paper);
}
.logo {
  font-size: 22px;
  letter-spacing: -0.8px;
  font-weight: 800;
  line-height: 1;
}
.logo > span,
.logo > b {
  white-space: nowrap;
}
.logo b {
  color: var(--accent);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-right: auto;
  min-height: 44px;
}
.brand small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
header.site nav {
  order: 3;
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: var(--soft);
  border-radius: var(--radius);
  padding: 4px;
}
header.site nav a {
  text-align: center;
  padding: 10px 6px;
  border-radius: 9px;
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
header.site nav a[aria-current='page'] {
  background: var(--ink);
  color: white;
}
header.site nav a[aria-current='page'] .badge {
  background: white;
  color: var(--ink);
}
.menu-button {
  padding: 8px 12px;
}
.menu-button span[aria-hidden] {
  font-size: 20px;
  line-height: 1;
}
.account-link {
  font-size: 13px;
  margin-left: auto;
}
.notice {
  background: var(--soft);
  font-size: 11px;
  padding: 6px var(--gutter);
  text-align: center;
  color: var(--muted);
  margin: 0;
}
/* Shown to signed-in staff only. Padded so the link is a comfortable touch target. */
.notice .staff-entry {
  display: inline-block;
  padding: 12px 6px;
  margin: -12px 0;
  font-weight: 650;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-banner {
  background: #e8dcb9;
  color: #473c26;
  padding: 8px var(--gutter);
  font-size: 12px;
  display: flex;
  gap: 8px 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}
.demo-banner button {
  min-height: 36px;
  padding: 5px 14px;
  font-size: 12px;
}
.container {
  max-width: 1240px;
  padding: 18px var(--gutter) 28px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head p {
  margin-bottom: 0;
}
.page-head.compact {
  margin-bottom: 10px;
}
.back {
  margin-bottom: 14px;
}
footer {
  padding: 26px var(--gutter) max(26px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Forms. 16px inputs keep iOS Safari from zooming the page on focus. */
label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 14px;
}
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 11px 13px;
  min-height: 46px;
  margin-top: 6px;
  font-size: 16px;
}
label.inline select,
label.inline input {
  width: auto;
  margin-top: 0;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0 8px 0 0;
  vertical-align: middle;
  accent-color: var(--ink);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
input:disabled {
  background: var(--soft);
  color: var(--muted);
}
[role='alert'] {
  color: var(--danger);
  font-size: 13px;
  white-space: pre-wrap;
}
[role='alert']:empty {
  display: none;
}
.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 14px;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card.narrow {
  max-width: 520px;
  margin-bottom: 18px;
}
.source-box {
  padding: 14px 16px;
  background: var(--soft);
  border-radius: var(--radius);
  font-size: 13px;
  margin: 16px 0;
}
.source-box p {
  margin: 4px 0 0;
}
.secret {
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  background: var(--soft);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 16px;
  user-select: all;
  margin-bottom: 12px;
}
.empty {
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed #b8c3b6;
  border-radius: 20px;
  width: 100%;
}
.empty h2 {
  font-size: 22px;
  font-weight: 500;
}
.empty .symbol {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
}
.empty p {
  max-width: 360px;
  margin: 0 auto 18px;
}
/* The map library has its own <details> for attribution; leave that one alone. */
details:not(.maplibregl-ctrl) > summary {
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 560px;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop {
  background: #10271fb0;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.dialog-heading h2 {
  margin: 0;
}
.dialog-heading button {
  min-width: 44px;
  font-size: 20px;
}
.menu-list {
  display: grid;
  gap: 6px;
}
.menu-list a,
.menu-list button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--line);
  font-size: 15px;
}
/* Status line at the top. On a phone it stays on the left and stops short of the menu
   button, and taps pass through it, so it never blocks navigation while it is shown. */
#toast {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  pointer-events: none;
  z-index: 5000;
  background: var(--ink);
  color: white;
  box-shadow: 0 8px 30px #0003;
  padding: 10px 16px;
  border-radius: var(--radius);
  width: max-content;
  max-width: calc(100% - var(--toast-reserve, 140px));
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#toast button {
  padding: 4px 12px;
  min-height: 36px;
  flex: none;
  pointer-events: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
td,
th {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}
.table-wrap {
  overflow-x: auto;
  padding: 4px;
}

/* Sign-in and account pages. */
.auth-shell {
  max-width: 1100px;
  margin: 12px auto;
  padding: var(--gutter);
}
.auth-story {
  padding: 8px 4px 16px;
}
.auth-story h1 {
  font-size: 30px;
  margin: 10px 0;
}
.auth-story .line,
.auth-story .story-extra {
  display: none;
}
.auth-card h2 {
  margin: 12px 0 6px;
}
.auth-card form > .primary {
  width: 100%;
  margin: 8px 0;
}
.auth-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
}
.auth-tabs a {
  font-size: 14px;
  padding: 10px 0;
  min-height: 44px;
  border-bottom: 2px solid transparent;
}
.auth-tabs a.active {
  border-color: var(--accent);
  color: var(--accent);
}
.account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.account-grid .card {
  margin-bottom: 18px;
}
.prose {
  max-width: 720px;
}
.prose h2 {
  margin-top: 28px;
}
.prose li {
  margin-bottom: 6px;
  color: var(--muted);
}

/* Very narrow phones: the menu button keeps its dots and drops its word. */
@media (max-width: 380px) {
  :root {
    --toast-reserve: 84px;
  }
  .menu-label {
    display: none;
  }
}
@media (min-width: 801px) {
  :root {
    --gutter: 24px;
  }
  #toast {
    left: 50%;
    transform: translateX(-50%);
    max-width: 520px;
  }
  h1 {
    font-size: 40px;
    letter-spacing: -1.2px;
  }
  h2 {
    font-size: 24px;
  }
  header.site {
    padding: 16px 4%;
    flex-wrap: nowrap;
    gap: 28px;
  }
  .logo {
    font-size: 38px;
  }
  .brand {
    margin-right: 0;
  }
  header.site nav {
    order: 0;
    width: auto;
    background: none;
    padding: 0;
    grid-auto-columns: auto;
    margin-right: auto;
  }
  header.site nav a {
    padding: 10px 18px;
  }
  .notice {
    font-size: 12px;
  }
  .container {
    padding: 30px var(--gutter) 40px;
  }
  .fields {
    grid-template-columns: 1fr 1fr;
  }
  .card {
    padding: 24px;
  }
  dialog {
    padding: 26px;
  }
  input,
  select,
  textarea {
    font-size: 15px;
  }
  .auth-shell {
    margin: 48px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  .auth-story {
    padding: 36px 16px;
  }
  .auth-story h1 {
    font-size: 52px;
    line-height: 1.15;
    letter-spacing: -1.8px;
    margin: 22px 0;
  }
  .auth-story .line {
    display: block;
    height: 1px;
    background: var(--line);
    margin: 36px 0;
  }
  .auth-story .story-extra {
    display: block;
  }
  .auth-card {
    max-width: 470px;
    width: 100%;
    justify-self: center;
  }
  .account-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  .button,
  a {
    transition:
      background 0.18s,
      color 0.18s,
      border-color 0.18s;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

#dialog {
  max-height: calc(100dvh - 128px);
}
/* Private evidence: shared by customer receipts and the reviewer inbox. */
.contribution-evidence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 14px 0;
}
.contribution-evidence figure {
  margin: 0;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line, #ddd);
  border-radius: 14px;
  background: var(--paper, #fff);
}
.contribution-evidence img,
.contribution-evidence video {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
  background: #152523;
}
.contribution-evidence audio {
  width: 100%;
  max-width: 100%;
}
.contribution-evidence figcaption {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 8px;
}
