/* =====================================================================
   Bunk-a-Biker — account pages

   Shares the map's token set. Light surfaces, dark text, 44px targets.
   R14 (light UI), R15 (no inline styles).
   ===================================================================== */

:root {
  /* Warmer than the old flat grey, and a clear step between the page
     and the things sitting on it. */
  --surface:        #f4f2ee;
  --surface-raised: #ffffff;
  --surface-sunk:   #ebe8e2;
  --hairline:       #d9d5cd;

  /* Ink. --ink-3 was #767f86 and was being used for HEADINGS -- roughly
     3.5:1 on the page background, which fails WCAG AA and reads as
     washed-out on any screen in daylight. Headings now use --ink.
     --ink-3 is for genuinely secondary text only, and is darkened. */
  --ink:            #16181c;
  --ink-2:          #454d55;
  --ink-3:          #666e76;

  /* Accent, taken from the navy in their own infographics rather than
     invented. Used for links, section rules and the active state. */
  --accent:         #23357a;
  --accent-soft:    #eef1fa;

  --alert:          #a3231f;
  --alert-bg:       #fdecea;
  --notice-bg:      #fdf1d8;
  --notice-ink:     #6d4c00;

  --tap:            44px;
  --radius:         14px;
  --shadow-1:       0 1px 2px rgba(22,24,28,.05),
                    0 4px 14px rgba(22,24,28,.05);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

.page {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;

  /* Space for the fixed bars. Set as variables so the main content's
     padding and the bars' heights cannot drift apart -- if they do, the
     first and last lines of every page hide behind a bar. */
  --head-h: 60px;
  --foot-h: 52px;
}

.page-head {
  box-shadow: 0 1px 0 rgba(22,24,28,.04);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: calc(var(--head-h) + env(safe-area-inset-top));
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-raised);
}
.wordmark-link {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

.page-main {
  padding: 24px 16px 40px;
  padding-top: calc(var(--head-h) + env(safe-area-inset-top) + 24px);
  padding-bottom: calc(var(--foot-h) + env(safe-area-inset-bottom) + 32px);
}

.page-foot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  min-height: calc(var(--foot-h) + env(safe-area-inset-bottom));
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: var(--surface-raised);
  font-size: 13px;
  /* The footer carries every content page, so on a narrow phone it
     scrolls sideways rather than growing tall and eating the screen. */
  overflow-x: auto;
  scrollbar-width: none;
}
.page-foot::-webkit-scrollbar { display: none; }
.page-foot { display: flex; align-items: center; gap: 14px; }
.page-foot a { color: var(--ink-2); }
.version {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ink-3);
}

.card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 28px 26px 30px;
}
@media (max-width: 520px) { .card { padding: 22px 18px 24px; } }
.card-wide { max-width: 720px; }
/* Long-form reading. One measure, on the container, so every element
   inside lines up with every other one. Roughly 70 characters at this
   font size, which is a comfortable line without a gutter beside it. */
.card-read { max-width: 640px; }

h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4.4vw, 34px);
  line-height: 1.12;
  letter-spacing: -.03em;
  color: var(--ink);
}
h2 {
  margin: 30px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
}

.lede {
  margin: 0 0 22px;
  font-size: 17px; line-height: 1.55;
  color: var(--ink-2);
}
.hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.foot-note { margin: 20px 0 0; font-size: 13.5px; color: var(--ink-2); }

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

.field { display: flex; flex-direction: column; gap: 5px; }
.field .label { font-size: 12px; font-weight: 700; letter-spacing: .07em;
                text-transform: uppercase; color: var(--ink-3); }
.field input {
  min-height: var(--tap);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;              /* 16px stops iOS zooming the page on focus */
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.field input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }

.check {
  display: flex; gap: 10px; align-items: center;
  min-height: var(--tap);
  padding: 6px 0;
  font-size: 14px; line-height: 1.45; color: var(--ink-2);
}
.check input {
  width: 22px; height: 22px; margin: 0; flex: 0 0 auto;
}
/* Inside a fieldset the checks stack, so they need a divider and their
   own rhythm -- otherwise five of them read as one block of text. */
.fieldset .check + .check,
.fieldset .radio + .radio { border-top: 1px solid var(--hairline); }
.fieldset .check span, .fieldset .radio span { color: var(--ink); }
.check a { color: var(--ink); }

.btn {
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 11px;
  font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.btn-primary { border: 0; background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1b2a63; }
.btn-quiet {
  border: 1px solid var(--hairline);
  background: var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.inline-form { margin: 14px 0 0; }

.alert {
  margin: 0 0 16px; padding: 11px 13px;
  border-radius: 10px;
  background: var(--alert-bg); color: var(--alert);
  font-size: 13.5px; line-height: 1.45;
}
.notice {
  margin: 0 0 16px; padding: 12px 14px;
  border-radius: 10px;
  background: var(--notice-bg); color: var(--notice-ink);
  font-size: 13.5px; line-height: 1.5;
}
.notice strong { display: block; margin-bottom: 3px; }

.rows { margin: 16px 0 0; }
.row {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--hairline);
  font-size: 14px;
}
.row dt {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3); padding-top: 2px;
}
.row dd { margin: 0; overflow-wrap: anywhere; }

.prose {
  white-space: pre-wrap;
  font-size: 14.5px; line-height: 1.65;
  margin-top: 18px;
}

/* =====================================================================
   Navigation — CSS-only hamburger.

   A checkbox toggle rather than JavaScript: the menu then works before
   any script loads, and on a bad rural connection that matters more than
   the tidiness of the markup.
   ===================================================================== */

.page-head { display: flex; align-items: center; gap: 12px; }

.nav { margin-left: auto; position: relative; }
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; }

.nav-button {
  display: flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-raised);
  cursor: pointer;
}
.nav-toggle:focus-visible + .nav-button { outline: 3px solid var(--ink); outline-offset: 2px; }

.nav-bars, .nav-bars::before, .nav-bars::after {
  display: block; width: 18px; height: 2px;
  background: var(--ink); border-radius: 1px;
}
.nav-bars { position: relative; }
.nav-bars::before, .nav-bars::after { content: ""; position: absolute; left: 0; }
.nav-bars::before { top: -6px; }
.nav-bars::after  { top: 6px; }

.nav-panel {
  display: none;
  position: absolute; right: 0; top: calc(var(--tap) + 8px);
  min-width: 220px; z-index: 30;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20,23,26,.16);
  overflow: hidden;
}
.nav-toggle:checked ~ .nav-panel { display: flex; }

.nav-link {
  display: flex; align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  font-size: 14.5px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.nav-link:last-child { border-bottom: 0; }
.nav-link:hover { background: var(--surface-sunk); }
.nav-link-cta { background: var(--accent); color: #fff; }
.nav-link-cta:hover { background: #1b2a63; }
.nav-link-staff { color: var(--notice-ink); background: var(--notice-bg); }
.nav-link-button {
  width: 100%; border: 0; background: none; font: inherit;
  font-weight: 600; text-align: left; cursor: pointer;
}
.nav-form { margin: 0; border-bottom: 1px solid var(--hairline); }
.nav-who {
  padding: 10px 16px; font-size: 12px; color: var(--ink-3);
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .nav-button { display: none; }
  .nav-panel {
    display: flex; flex-direction: row; position: static;
    border: 0; box-shadow: none; background: none; min-width: 0;
  }
  .nav-link { border-bottom: 0; border-radius: 9px; padding: 0 12px; }
  .nav-form { border-bottom: 0; }
  .nav-who { display: none; }
}

/* --- Forms: rows, fieldsets, radios ---------------------------------- */

.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 160px; }
.field-narrow { flex: 0 0 110px; }

.field textarea, .field select {
  min-height: var(--tap);
  padding: 10px 12px;
  font: inherit; font-size: 16px;
  color: var(--ink); background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: 10px;
}
.field textarea:focus-visible, .field select:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 1px;
}

.fieldset {
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 14px 16px; margin: 0;
}
.fieldset legend { padding: 0 6px; }

.radio {
  display: flex; gap: 10px; align-items: flex-start;
  min-height: var(--tap); padding: 8px 0;
  font-size: 14px; line-height: 1.45;
}
.radio input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; }
.radio strong { display: block; }
.radio .hint { display: block; }

/* --- Pin picker ------------------------------------------------------- */

.picker-map {
  height: 300px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--hairline);
}
/* Actions sit ABOVE the map so they are not below the fold on a phone. */
.picker-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 10px;
}
.picker-status { font-size: 13px; line-height: 1.4; }
.picker-status--ok   { color: #1b5e20; }
.picker-status--todo { color: #8a5a00; }
.picker-status--busy { color: var(--ink-3); }

/* --- Admin ------------------------------------------------------------ */

.dash-head { display: flex; align-items: baseline; gap: 12px; }
.dash-who { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); background: var(--accent-soft); padding: 3px 10px;
  border-radius: 999px; font-weight: 600; }
.dash-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin: 22px 0 10px; }
.dtiles {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.dtile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--hairline); background: var(--surface-raised);
  color: var(--ink); text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.dtile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(35,53,122,.10);
  transform: translateY(-1px); }
.dtile-icon { flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); }
.dtile-icon svg { width: 19px; height: 19px; }
.dtile-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dtile-l { font-size: 13.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtile-n { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.dtile-x { font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
/* A tile with work waiting: navy accent fill and icon inverted. */
.dtile-live { border-color: var(--accent); background: var(--accent-soft); }
.dtile-live .dtile-icon { background: var(--accent); color: #fff; }
.dtile-live .dtile-n { color: var(--accent); }
/* Read-only stat tiles: quieter, no hover lift. */
.dtile-stat { background: transparent; }
.dtile-stat .dtile-icon { background: var(--surface-raised); color: var(--ink-3); }
.dtile-stat .dtile-n { color: var(--ink-2); }

.queue-item {
  border-top: 1px solid var(--hairline);
  padding: 18px 0;
}
.queue-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.queue-head h2 { margin: 0; font-size: 16px; }
.queue-where { font-size: 12.5px; color: var(--ink-3); }
.queue-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin-top: 12px;
}
.desc { white-space: pre-wrap; font-size: 14px; line-height: 1.55; margin: 10px 0 0; }
.sheet-photo { width: 100%; max-height: 200px; object-fit: cover;
  border-radius: 10px; margin: 4px 0 10px; display: block; }

/* Account avatar on the profile page. Private to the owner. */
.avatar-block { margin: 8px 0 20px; }
.avatar-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.avatar-img { width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--hairline); display: block;
  background: var(--surface-sunk); }
.avatar-img--empty { display: inline-block; }
.avatar-controls { display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; }

.table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); }
.table th {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3);
}
.row-overdue { background: var(--alert-bg); }

.mail-body { margin-top: 10px; }
.mail-body summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
  min-height: 28px; display: flex; align-items: center;
}

/* =====================================================================
   Home page and site content
   ===================================================================== */

.hero {
  max-width: 660px;
  margin: 0 auto 34px;
  padding: 18px 4px 0;
  text-align: center;
}
.hero-logo { display: block; margin: 0 auto 18px; max-width: 40vw; height: auto; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.hero-lede {
  margin: 0 auto 12px;
  max-width: 46ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
}
.hero-tag {
  display: inline-block;
  margin: 0 0 24px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.hero-actions .btn { text-decoration: none; }
.hero-stat {
  margin: 18px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink-3);
}

.prose-p {
  margin: 0 0 15px;
  font-size: 16px;
  line-height: 1.68;
  color: var(--ink-2);
}
.prose-p a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 2px;
}
.prose-p a:hover { text-decoration-color: var(--accent); }

.steps { margin: 0 0 18px; padding-left: 20px; }
.steps li { margin-bottom: 12px; font-size: 16px; line-height: 1.6;
             color: var(--ink-2); }
.steps li strong { color: var(--ink); }
.steps li::marker { color: var(--accent); font-weight: 700; }

/* --- Wordmark with logo ------------------------------------------------ */

.wordmark-link { display: inline-flex; align-items: center; gap: 9px; }
.wordmark-logo { display: block; flex: 0 0 auto; }

/* --- Site footer -------------------------------------------------------- */

.page-foot { flex-wrap: wrap; }
.foot-nav {
  display: flex; flex-wrap: nowrap; gap: 0 16px;
  font-size: 13px;
  white-space: nowrap;
}
.foot-nav a {
  color: var(--ink-2);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
}
.foot-nav a:hover { color: var(--accent); text-decoration: underline; }

/* Long-form content pages ------------------------------------------------ */

/* Section headings were 12px grey micro-caps at about 3.5:1 contrast --
   the same weight as body text and harder to read. They are headings
   now: full ink, real size, and a short accent rule so the eye finds
   them without reading. */
.prose-h {
  margin: 34px 0 12px;
  padding-top: 14px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
  position: relative;
}
.prose-h::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 34px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.prose-h:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose-h:first-child::before { display: none; }

.split { display: flex; flex-wrap: wrap; gap: 20px; margin: 4px 0 20px; }
.split-col { flex: 1 1 240px; }
.split-col h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.015em;
                 color: var(--ink); }

/* Trip planner ----------------------------------------------------------- */

.trip-day { border-top: 1px solid var(--hairline); padding: 14px 0 4px; }
.trip-day h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: -.01em; }
.trip-mark { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.trip-host { padding: 8px 0; font-size: 14px; line-height: 1.45; }
.trip-where { display: block; font-size: 12.5px; color: var(--ink-3); }
.trip-tag {
  display: inline-block; margin-top: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--surface-sunk); color: var(--ink-2);
  padding: 3px 7px; border-radius: 5px;
}
.trip-caps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.trip-cap {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-sunk); color: var(--ink-2);
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--hairline);
}

/* =====================================================================
   Privacy notice
   ===================================================================== */

.notice-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--foot-h) + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
}
.notice-bar[hidden] { display: none; }
.notice-bar-text { flex: 1 1 320px; }
.notice-bar strong { display: block; margin-bottom: 2px; }
.notice-bar a { color: #fff; }
.notice-bar-ok { flex: 0 0 auto; background: #fff; color: var(--ink); }

/* On the map the site footer is shorter. */
.map-foot ~ .notice-bar,
body:has(.map-foot) .notice-bar {
  bottom: calc(42px + env(safe-area-inset-bottom));
}

/* =====================================================================
   Confirmation dialog

   Never closes on a backdrop click. The backdrop is deliberately not a
   click target -- see app/static/js/confirm.js.
   ===================================================================== */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 23, 26, .55);
}
.dialog-backdrop[hidden] { display: none; }
body.dialog-open { overflow: hidden; }

.dialog {
  width: 100%;
  max-width: 440px;
  background: var(--surface-raised);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 18px 50px rgba(20, 23, 26, .3);
}
.dialog-head { display: flex; align-items: flex-start; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.dialog-close {
  margin-left: auto;
  width: var(--tap); height: var(--tap);
  border: 0; background: none;
  font-size: 26px; line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
}
.dialog-close:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dialog-body {
  margin: 10px 0 16px;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-2);
}
.dialog-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}

.btn-danger {
  border: 0;
  background: var(--alert);
  color: #fff;
}
.btn-danger[disabled] {
  background: var(--surface-sunk);
  color: var(--ink-3);
  cursor: default;
}

h3 { margin: 22px 0 6px; font-size: 15px; letter-spacing: -.01em; }

/* Link directory --------------------------------------------------------- */

.linkrow { padding: 12px 0; border-top: 1px solid var(--hairline); }
.linkrow:first-of-type { border-top: 0; }
.linkrow-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.linkrow-name a { color: var(--ink); }
.linkrow-desc { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

.chiplist { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.namechip {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface-raised);
  font-size: 13px; color: var(--ink); text-decoration: none;
}
.namechip:hover { background: var(--surface-sunk); }

.foot-social { display: flex; gap: 12px; align-items: center; }
.foot-social a { color: var(--ink-2); font-size: 13px; }

.linkedit {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px 0; border-top: 1px solid var(--hairline);
}
.linkedit input[type=text], .linkedit input:not([type]) {
  flex: 1 1 140px; min-height: 36px; padding: 0 8px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--hairline); border-radius: 8px;
}
.linkedit-num { flex: 0 0 70px !important; }
.linkedit-pub { font-size: 12px; color: var(--ink-3); display: flex; gap: 5px; align-items: center; }
.linkedit .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* Link logos ------------------------------------------------------------- */

.linkrow-withlogo { display: flex; gap: 14px; align-items: flex-start; }
.linkrow-logo {
  flex: 0 0 auto; width: 72px; height: 72px;
  object-fit: contain; border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
}
.linkrow-body { flex: 1 1 auto; min-width: 0; }

.linklogo {
  display: flex; align-items: center; gap: 8px;
  padding-top: 8px; font-size: 12px;
}
.linklogo-img {
  width: 44px; height: 44px; object-fit: contain;
  border: 1px solid var(--hairline); border-radius: 6px;
  background: var(--surface-raised);
}
.linklogo-none {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--hairline); border-radius: 6px;
  font-size: 10px; color: var(--ink-3); text-align: center;
}
.linklogo input[type=file] { font-size: 12px; flex: 1 1 auto; min-width: 0; }

/* Logo grid -------------------------------------------------------------- */

.logogrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
  margin: 6px 0 22px;
}
.logotile {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 8px;
  border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--surface-raised);
  text-decoration: none;
  overflow: hidden;
}
.logotile:hover { border-color: var(--ink-3); }
.logotile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logotile-flat { cursor: default; }
.logotile-name {
  font-size: 12px; line-height: 1.3; text-align: center;
  color: var(--ink-2);
}
.linkdel { padding-top: 4px; }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 12px; }

/* Secondary nav: present, not competing with the primary one. */
.foot-nav-minor { margin-top: 2px; }
.foot-nav-minor a { font-size: 11.5px; color: var(--ink-3); }
.page-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
.foot-nav-minor .version { margin-left: 4px; }

/* Children of a hub page. */
.childlinks { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 4px; }
.childlink {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--hairline); border-radius: 11px;
  background: var(--surface-raised);
  font-size: 15px; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.childlink:hover { background: var(--surface-sunk); }

/* Page gallery ----------------------------------------------------------- */

.pagegallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.galleryitem {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0;
  text-decoration: none; color: var(--ink);
}
.galleryitem img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
  background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 8px;
}
.galleryitem:hover img { border-color: var(--ink-3); }
.gallerycap { font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* =====================================================================
   Page blocks -- what makes a page a page rather than a document
   ===================================================================== */

.block-head {
  margin: 34px 0 12px;
  padding-top: 14px;
  font-size: 19px; font-weight: 700; letter-spacing: -.015em;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
  position: relative;
}
.block-head::before {
  content: ""; position: absolute; top: -1px; left: 0;
  width: 34px; height: 3px; background: var(--accent); border-radius: 2px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 14px 0 26px;
}
.card-item {
  display: flex; flex-direction: column;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(22,24,28,.06), 0 10px 26px rgba(22,24,28,.09);
}
.card-img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--surface-sunk);
  display: block;
}
.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column;
             gap: 7px; flex: 1 1 auto; }
.card-title { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.card-text { margin: 0; font-size: 13.5px; line-height: 1.5;
             color: var(--ink-2); flex: 1 1 auto; }
.card-btn { align-self: flex-start; margin-top: 4px; text-decoration: none; }

.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 24px; }
.btnrow .btn { text-decoration: none; }

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 11px 12px 13px; }
  .card-title { font-size: 14px; }
  .card-text { font-size: 12.5px; }
  .card-btn { padding: 0 12px; font-size: 13px; }
}

/* Regional groups -------------------------------------------------------- */

.grouplist { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; }
.groupchip {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface-raised);
  font-size: 13.5px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.groupchip:hover { background: var(--accent-soft); border-color: var(--accent); }
.groupchip-flat { color: var(--ink-3); font-weight: 500; }

/* Logo cards: a brand mark contained on a pale panel rather than cropped
   to a photo header. Cropping a wide logo to 4:3 cuts the ends off it. */
.cards-logo .card-img {
  aspect-ratio: 16 / 7;
  object-fit: contain;
  padding: 14px 18px;
  background: var(--surface-sunk);
}

/* Terms acceptance ------------------------------------------------------- */

.termsdoc { margin: 26px 0 8px; }
.termsdoc h2 { margin: 0 0 10px; }
.termsver { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.termsbody {
  max-height: 46vh;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-raised);
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.termsbody p { margin: 0 0 12px; }
.termsh {
  margin: 18px 0 8px; font-size: 15px; font-weight: 700;
  letter-spacing: -.01em; color: var(--ink);
}
.termsh:first-child { margin-top: 0; }
.termsdoc .check { margin-top: 12px; }

/* Saved trips ------------------------------------------------------------ */

.triplist { margin: 8px 0 22px; }
.triprow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--hairline);
}
.triprow-name {
  flex: 1 1 200px; font-size: 15.5px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.triprow-name:hover { text-decoration: underline; }
.triprow-meta { font-size: 12.5px; color: var(--ink-3); }

/* Multiple motorcycles --------------------------------------------------- */
.bikelist { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; }
.bikerow { display: flex; gap: 8px; align-items: center; }
.bikerow input { flex: 1 1 auto; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* Pin sheet close button ------------------------------------------------- */
.sheet-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #1a1a1a;
  font-size: 28px;
  line-height: 40px;
  cursor: pointer;
  border-radius: 8px;
  z-index: 2;
}
.sheet-close:hover { background: rgba(0,0,0,0.06); }
.sheet-close:focus-visible { outline: 2px solid #1565c0; outline-offset: 2px; }

/* Geocode review --------------------------------------------------------- */
.review-list { list-style: none; padding: 0; margin: 16px 0; }
.review-item { border: 1px solid #d9dde1; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.review-done { opacity: 0.6; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-addr { margin: 6px 0 0; color: #33383d; }
.review-map { margin-top: 12px; }
.picker-mini { width: 100%; height: 320px; border-radius: 8px; overflow: hidden; }
.review-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; margin-left: 8px; }
.pill--not_found { background: #fde8e8; color: #8a1f1f; }
.pill--ambiguous { background: #fef3c7; color: #854d0e; }
.pill--pending { background: #e0e7ff; color: #3730a3; }
.pill--ok { background: #dcfce7; color: #166534; }

/* Accounts management ---------------------------------------------------- */
.acct-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.acct-table th, .acct-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
.acct-table th { font-size: 13px; color: #4b5563; }
.acct-form { display: flex; gap: 6px; align-items: center; }
.acct-search { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.acct-search input { flex: 1; max-width: 340px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.pill--god { background: #fce7f3; color: #9d174d; }
.pill--admin { background: #dbeafe; color: #1e40af; }
.pill--moderator { background: #d1fae5; color: #065f46; }
.pill--member { background: #f3f4f6; color: #374151; }
.change-log { list-style: none; padding: 0; font-size: 13px; }
.change-log .when { opacity: 0.7; }
.notice--error { background: #fde8e8; color: #8a1f1f; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.notice--ok { background: #dcfce7; color: #166534; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }

.change-fields { margin: 4px 0 0; padding-left: 18px; }
.change-fields li { font-size: 13px; margin: 2px 0; }

/* Front-page sponsor block */
.sponsor-block { text-align: center; }
.sponsor-head { margin-bottom: 2px; }
.sponsor-sub { margin-top: 0; }
.sponsor-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: center; margin-top: 14px; }
.sponsor-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: inherit; width: 150px; }
.sponsor-logo { max-width: 140px; max-height: 80px; object-fit: contain; }
.sponsor-name { font-size: 13px; color: #4b5563; }

/* Sponsor tier pills (light bg, dark text — R14) */
.pill--bronze   { background: #f3e8d8; color: #7c4a1e; }
.pill--silver   { background: #eef1f4; color: #475569; }
.pill--gold     { background: #fef3c7; color: #854d0e; }
.pill--platinum { background: #e0e7ff; color: #3730a3; }
.field-inline { display: inline-flex; gap: 6px; align-items: center; }

/* Sponsor admin: compact list + edit modal */
.sponsor-thumb { max-width: 56px; max-height: 40px; object-fit: contain; vertical-align: middle; }
.sponsor-cell-logo { width: 70px; }
.sponsor-list td { vertical-align: middle; }
.dialog-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.dialog-row { display: flex; gap: 12px; }
.dialog-row .field { flex: 1; }
.dialog-sep { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.dialog-note { margin-top: 6px; font-size: 12px; }

/* Analytics dashboard */
.stat-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.stat { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 18px; min-width: 110px; }
.stat-n { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: #111827; }
.stat-l { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.hourbars { display: flex; gap: 3px; align-items: flex-end; height: 120px; margin: 12px 0; }
.hourbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.hourbar-fill { width: 100%; background: #2563eb; border-radius: 3px 3px 0 0; min-height: 2px; }
.hourbar-l { font-size: 9px; color: #9ca3af; margin-top: 2px; }

/* Hour-bar heights (bucketed; avoids inline styles) */
.hb-0   { height: 2px; }
.hb-20  { height: 20%; }
.hb-40  { height: 40%; }
.hb-60  { height: 60%; }
.hb-80  { height: 80%; }
.hb-100 { height: 100%; }

/* Sponsor tier editor rows */
.tier-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.tier-row input[type="text"], .tier-row input:not([type]) { min-width: 120px; }
.num-sm { width: 64px; }
.tier-lbl { font-size: 12px; color: #6b7280; }

/* Link admin compact list */
.link-list td { vertical-align: middle; }
.link-url { font-size: 12px; word-break: break-all; }

/* Browse screens: filter bar + pagination */
.browse-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.browse-filters input[type="text"] { min-width: 200px; }
.browse-filters select { max-width: 190px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.pager-at { font-size: 13px; color: var(--ink-3); }
.pager-off { opacity: .4; pointer-events: none; }

/* Public sponsor pricing tiers */
.tier-cards { display: grid; gap: 14px; margin: 18px 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tier-card { border: 1px solid var(--hairline); border-radius: 14px;
  padding: 18px; background: var(--surface-raised); }
.tier-card-name { margin: 0 0 4px; font-size: 17px; }
.tier-card-price { margin: 0 0 10px; font-size: 26px; font-weight: 700;
  letter-spacing: -.02em; color: var(--accent); }
.tier-card-per { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.tier-card-desc { font-size: 13.5px; color: var(--ink-2); margin: 0 0 10px; }
.tier-card-perks { margin: 0; padding-left: 18px; }
.tier-card-perks li { font-size: 13px; color: var(--ink-2); margin: 3px 0; }

/* Tiny advertise link under the home sponsor block */
.sponsor-cta { text-align: center; margin: 8px 0 0; font-size: 13px; }
.sponsor-cta a { color: var(--ink-3); }

/* Grouped checkboxes on the host form */
.check-group { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0; }

/* Supporter acknowledgment badge (B18: cosmetic, gates nothing) */
.supporter-badge { display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: #fde8ef; color: #b0114e; font-size: 12px; font-weight: 600;
  letter-spacing: .01em; }
.supporter-toggle { display: inline-block; margin-left: 10px; }

.rule { border: none; border-top: 1px solid #e2e2e2; margin: 28px 0; }

/* Email template editor: collapsed, scannable rows that expand one at a time */
.email-list { margin-top: 16px; }
.email-tpl { border: 1px solid #e2e2e2; border-radius: 8px; margin-bottom: 10px;
  background: #fff; overflow: hidden; }
.email-tpl-head { list-style: none; cursor: pointer; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px; }
.email-tpl-head::-webkit-details-marker { display: none; }
.email-tpl[open] .email-tpl-head { border-bottom: 1px solid #eee; background: #fafafa; }
.email-tpl-name { font-weight: 600; color: #1a1a1a; }
.email-tpl-subj { color: #666; font-size: 14px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.email-tpl-body { padding: 16px; }
.email-tpl-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; }

/* Host form: collapsible field groups. Name, map and privacy stay open
   above these; each group here starts collapsed to tame the field wall.
   Mirrors the email-tpl idiom: native <details>, no default marker, a
   rotating caret, light surface + dark ink (R14). */
.host-section { border: 1px solid var(--hairline); border-radius: 10px;
  margin: 12px 0; background: var(--surface-raised); overflow: hidden; }
.host-section-head { list-style: none; cursor: pointer;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  background: var(--surface-sunk); color: var(--ink); }
.host-section-head::-webkit-details-marker { display: none; }
.host-section-head h2 { margin: 0; font-size: 16px; letter-spacing: -.01em;
  color: var(--ink); border: 0; padding: 0; }
.host-section-head::before { content: ""; flex: 0 0 auto;
  width: 9px; height: 9px; margin-right: 2px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg); transition: transform .15s ease; }
.host-section[open] .host-section-head::before { transform: rotate(45deg); }
.host-section[open] .host-section-head { border-bottom: 1px solid var(--hairline); }
.host-section-body { padding: 16px; }
.host-section-body > .fieldset:first-child,
.host-section-body > .field-row:first-child { margin-top: 0; }

/* Host photo preview: the current image beside its moderation state. */
.host-photo { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start;
  margin: 12px 0; }
.host-photo-img { width: 220px; max-width: 100%; height: auto;
  border-radius: 10px; border: 1px solid var(--hairline); display: block; }
.host-photo-side { display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start; }
