/* BOA — a calm field tool. Tokens first, then the shell, then components. */

:root {
  --brand: #1f4e3d;
  --brand-ink: #ffffff;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --subtle: #eef2ef;
  --ink: #18211d;
  --muted: #5c6c63;
  --divider: #dde5df;
  --control: #82968a;
  --action: #1f4e3d;
  --action-ink: #ffffff;
  --tint: #e6f0ea;
  --focus: #2d775b;

  --ok: #256447;      --ok-bg: #e9f4ed;
  --warn: #85500f;    --warn-bg: #fff3dc;
  --bad: #aa352f;     --bad-bg: #fcedeb;
  --info: #295e91;    --info-bg: #eaf2fb;
  --wa: #128c4a;      --wa-ink: #ffffff;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow: 0 4px 16px rgba(16, 37, 26, .08);
  --nav-h: 64px;
  --top-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Dark tokens: follow the system unless the person picked a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101713;
    --surface: #19231d;
    --subtle: #233128;
    --ink: #eff5f0;
    --muted: #abbab0;
    --divider: #33443a;
    --control: #6d8374;
    --action: #9ed6bb;
    --action-ink: #10251a;
    --tint: #233d30;
    --focus: #9ed6bb;
    --ok: #a0dcb7;      --ok-bg: #213b2a;
    --warn: #f2ca82;    --warn-bg: #3e3120;
    --bad: #ffb4ad;     --bad-bg: #432b29;
    --info: #b2d1fa;    --info-bg: #223448;
    --wa: #4fd38a;      --wa-ink: #08210f;
    --shadow: 0 4px 16px rgba(0, 0, 0, .24);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101713;
  --surface: #19231d;
  --subtle: #233128;
  --ink: #eff5f0;
  --muted: #abbab0;
  --divider: #33443a;
  --control: #6d8374;
  --action: #9ed6bb;
  --action-ink: #10251a;
  --tint: #233d30;
  --focus: #9ed6bb;
  --ok: #a0dcb7;      --ok-bg: #213b2a;
  --warn: #f2ca82;    --warn-bg: #3e3120;
  --bad: #ffb4ad;     --bad-bg: #432b29;
  --info: #b2d1fa;    --info-bg: #223448;
  --wa: #4fd38a;      --wa-ink: #08210f;
  --shadow: 0 4px 16px rgba(0, 0, 0, .24);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
body.bare { padding-bottom: 0; }

a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font-size: 1.75rem; line-height: 2.125rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; }
p { margin: 0; }
p + p { margin-top: 8px; }

.icon { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.icon.lg { width: 24px; height: 24px; }
.icon.sm { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Shell ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: var(--brand-ink);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 960px; margin: 0 auto; height: var(--top-h); padding: 0 16px;
}
.topbar a { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 28px; width: auto; display: block; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0; padding: 0;
  border-radius: 999px; background: transparent; color: inherit; border: 0;
}
.icon-btn:hover { background: rgba(255,255,255,.14); filter: none; }
.account { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.14);
  font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
}
.account:hover { background: rgba(255,255,255,.22); }
.topnav { display: none; }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 0; }
main.bare { max-width: none; padding: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--divider);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .75rem; line-height: 1rem; font-weight: 600; text-decoration: none;
  min-width: 0; -webkit-tap-highlight-color: transparent;
}
.tabs a .icon { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--action); }
.tabs a[aria-current="page"] .tab-ico { background: var(--tint); }
.tab-ico { display: flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; transition: background .12s ease-out; }

@media (min-width: 900px) {
  body { padding-bottom: 48px; }
  .tabs { display: none; }
  .topnav { display: flex; gap: 2px; margin-left: 24px; }
  .topnav a { padding: 8px 12px; border-radius: 999px; font-size: .9375rem; font-weight: 500; opacity: .82; }
  .topnav a:hover { opacity: 1; background: rgba(255,255,255,.1); text-decoration: none; }
  .topnav a[aria-current="page"], .topnav summary[aria-current="page"] { opacity: 1; background: rgba(255,255,255,.18); }
  .navmenu { position: relative; }
  .navmenu > summary {
    list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 999px; font-size: .9375rem; font-weight: 500; opacity: .82;
    display: flex; align-items: center; gap: 6px;
  }
  .navmenu > summary::-webkit-details-marker { display: none; }
  .navmenu > summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
  .navmenu > summary:hover { opacity: 1; background: rgba(255,255,255,.1); }
  .navmenu-list {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 6px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--divider); border-radius: var(--r-md); box-shadow: var(--shadow);
  }
  .topbar .navmenu-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--ink); opacity: 1; font-size: .9375rem; }
  .topbar .navmenu-list a:hover { background: var(--subtle); }
  .navmenu-list .icon { color: var(--muted); }
  main { padding-top: 32px; }
}

/* ---------- Page structure ---------- */

.back { display: inline-flex; align-items: center; gap: 2px; font-size: .875rem; font-weight: 500; margin: -4px 0 8px -4px; color: var(--muted); }
.back .icon { width: 18px; height: 18px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); font-size: .9375rem; margin-top: 4px; }
.page-head .btn { flex: none; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .link { font-size: .875rem; font-weight: 600; }
.eyebrow { color: var(--muted); font-size: .8125rem; font-weight: 600; }

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-lg);
  padding: 16px; margin: 12px 0;
}
.card > h3:first-child, .card > h2:first-child { margin-bottom: 8px; }
.card.tinted { background: var(--tint); border-color: transparent; }
.card.notice { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.card.notice a { color: inherit; text-decoration: underline; }
.stack > * + * { margin-top: 12px; }

/* Grouped list: one surface, inset dividers. */
.group {
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-lg);
  overflow: hidden; margin: 12px 0;
}
.group > .item + .item { border-top: 1px solid var(--divider); }
.group > .item + .item { box-shadow: none; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit;
  text-decoration: none; min-height: 56px;
}
a.item:hover { text-decoration: none; background: var(--subtle); }
a.item:active { background: var(--subtle); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; overflow-wrap: anywhere; }
.item-title.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { color: var(--muted); font-size: .875rem; line-height: 1.25rem; margin-top: 2px; }
.item-meta + .item-meta { margin-top: 2px; }
.item-side { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .chev { color: var(--control); width: 18px; height: 18px; flex: none; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.item-row .amount { flex: none; }
.amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount .lbl { color: var(--muted); font-weight: 500; font-size: .8125rem; margin-right: 4px; }
.group > .item.static { min-height: 0; }

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--tint); color: var(--action);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem;
}
.avatar.off { background: var(--subtle); color: var(--muted); }

/* ---------- Job board (open tours) ---------- */

.job {
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-lg);
  padding: 20px; margin: 12px 0;
}
.job-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); display: block; }
.job-title:hover { text-decoration: none; color: var(--action); }
.job-when { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 1rem; font-weight: 600; }
.job-when span { display: inline-flex; align-items: center; gap: 6px; }
.job-when .icon { color: var(--muted); }
.job-note { color: var(--muted); margin-top: 10px; font-size: .9375rem; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.job form { margin-top: 16px; }

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (min-width: 640px) { .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.stat .label { color: var(--muted); font-size: .8125rem; line-height: 1.125rem; font-weight: 500; }
.stat .value { font-size: 1.375rem; line-height: 1.75rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.stat .note { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.stat.primary { grid-column: 1 / -1; background: var(--brand); border-color: transparent; color: #fff; }
.stat.primary .label, .stat.primary .note { color: rgba(255,255,255,.78); }
.stat.primary .value { font-size: 2rem; line-height: 2.25rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat.primary { background: #1d4a39; } }
:root[data-theme="dark"] .stat.primary { background: #1d4a39; }

.balance { display: flex; flex-direction: column; }
.balance .item { min-height: 0; }

/* ---------- Pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--subtle); color: var(--muted);
}
.pill.enquiry { background: var(--warn-bg); color: var(--warn); }
.pill.booked { background: var(--info-bg); color: var(--info); }
.pill.completed, .pill.filled { background: var(--ok-bg); color: var(--ok); }
.pill.cancelled { background: var(--bad-bg); color: var(--bad); }
.pill.open { background: var(--tint); color: var(--action); }
.pill.star { background: var(--warn-bg); color: var(--warn); }
.pill.brand { background: var(--tint); color: var(--action); }
.pill .icon { width: 14px; height: 14px; vertical-align: 0; }

/* ---------- Buttons ---------- */

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--action); color: var(--action-ink);
  font: 600 1rem/1.25 var(--font); cursor: pointer; text-decoration: none; text-align: center;
  transition: filter .12s ease-out, background .12s ease-out, transform .12s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover, button:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active, button:active { transform: scale(.985); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.secondary, button.secondary { background: var(--tint); color: var(--action); }
.btn.ghost, button.ghost { background: transparent; color: var(--action); border-color: var(--divider); }
.btn.quiet, button.quiet { background: transparent; color: var(--muted); }
.btn.danger, button.danger { background: var(--bad-bg); color: var(--bad); }
.btn.wa, button.wa { background: var(--wa); color: var(--wa-ink); }
.btn.small, button.small { min-height: 40px; padding: 0 14px; font-size: .9375rem; border-radius: 10px; }
.btn.xs, button.xs { min-height: 34px; padding: 0 12px; font-size: .875rem; border-radius: 9px; }
.btn.huge, button.huge { min-height: 56px; font-size: 1.0625rem; }
.btn.block, button.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions.end { justify-content: flex-end; }
form.inline { display: inline; }

/* ---------- Forms ---------- */

label { display: block; font-size: .875rem; line-height: 1.25rem; font-weight: 600; margin: 16px 0 6px; }
/* A label that opens a form or a card needs no space above it. */
.field-row > div > label:first-child,
:is(form, .card, .body) > label:first-child,
:is(form, .card, .body) > input[type="hidden"] + label { margin-top: 0; }
.hint { color: var(--muted); font-size: .8125rem; font-weight: 400; margin-top: 6px; }
label .hint { margin-left: 4px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--control); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: 400 1rem/1.5 var(--font);
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { padding: 12px 14px; min-height: 104px; resize: vertical; }
input[type="date"], input[type="time"], input[type="month"] { padding-top: 0; padding-bottom: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: auto; appearance: auto; width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0;
  accent-color: var(--action); flex: none;
}
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1rem; min-height: 44px; margin: 4px 0; flex-wrap: wrap; }

/* Switches: one consistent on/off control for every yes/no setting. */
label.toggle { gap: 12px; }
label.toggle .hint { flex-basis: 100%; margin: -6px 0 0 56px; }
input[type="checkbox"][role="switch"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 44px; height: 26px; border-radius: 999px; background: var(--control); border: 0; cursor: pointer;
  transition: background .12s ease-out;
}
input[type="checkbox"][role="switch"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .12s ease-out;
}
input[type="checkbox"][role="switch"]:checked { background: var(--action); }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(18px); }
input[type="checkbox"][role="switch"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; margin-top: 16px; }
.field-row > * { min-width: 0; }
/* Two date fields side by side are too narrow on a phone to show a date. */
@media (max-width: 480px) { .field-row.stack-phone { grid-template-columns: minmax(0, 1fr); } }
:is(form, .card, .body) > .field-row:first-child,
:is(form, .card, .body) > input[type="hidden"] + .field-row { margin-top: 0; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 400px) { .field-row.three { grid-template-columns: 1fr 1fr; } .field-row.three > :first-child { grid-column: 1 / -1; } }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input, .inline-field select { flex: 1; min-width: 0; }
.unit { color: var(--muted); font-weight: 600; white-space: nowrap; }

fieldset.chips { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.chips legend { font-size: .875rem; font-weight: 600; margin-bottom: 8px; padding: 0; }
label.chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--control); border-radius: 999px; background: var(--surface); font-weight: 500; font-size: .9375rem; cursor: pointer;
}
label.chip:has(input:checked) { background: var(--tint); border-color: var(--action); color: var(--action); }
label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
label.chip::before { content: ""; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--control); flex: none; }
label.chip:has(input:checked)::before { background: var(--action); border-color: var(--action); box-shadow: inset 0 0 0 3px var(--surface); }
label.chip { position: relative; }

/* Filter chips and segmented navigation */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; margin: 12px 0; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters a, .filters span {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--divider); color: var(--ink); font-size: .9375rem; font-weight: 600;
}
.filters a:hover { text-decoration: none; background: var(--subtle); }
.filters a[aria-current="true"] { background: var(--action); border-color: var(--action); color: var(--action-ink); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.toolbar input[type="search"] { flex: 1 1 100%; }
.toolbar input[type="month"], .toolbar select { flex: 1 1 140px; }
.toolbar button { flex: none; }
@media (min-width: 640px) { .toolbar input[type="search"] { flex: 1 1 240px; } }

.jump { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 8px; scrollbar-width: none; position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 8px 0; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--subtle); color: var(--ink); font-size: .875rem; font-weight: 600; }
.jump a:hover { text-decoration: none; background: var(--tint); color: var(--action); }
.anchor { scroll-margin-top: calc(var(--top-h) + 64px); }

.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.monthnav .label { font-weight: 600; text-transform: capitalize; }
.monthnav .btn { width: 40px; padding: 0; }

/* ---------- Feedback ---------- */

.flash, .error { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 16px; font-weight: 500; font-size: .9375rem; }
.flash { background: var(--ok-bg); color: var(--ok); }
.error { background: var(--bad-bg); color: var(--bad); }
.flash .icon, .error .icon { margin-top: 1px; }

.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.empty .icon { width: 32px; height: 32px; color: var(--control); display: block; margin: 0 auto 8px; }
.empty .btn { margin-top: 12px; }

/* ---------- Content blocks ---------- */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 4px 0 0; }
.kv dt { color: var(--muted); font-size: .9375rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.message-box { white-space: pre-wrap; background: var(--subtle); border-radius: var(--r-md); padding: 12px 14px; font-size: .9375rem; overflow-wrap: anywhere; }
.link-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; overflow-wrap: anywhere; }

details.disclosure { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-lg); margin: 12px 0; }
details.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; font-weight: 600; min-height: 52px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--control); border-bottom: 2px solid var(--control); transform: rotate(45deg); margin-top: -4px; transition: transform .18s ease-out; flex: none; }
details.disclosure[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.disclosure > .body { padding: 0 16px 16px; }
details.disclosure.quiet { background: transparent; }
details.plain > summary { cursor: pointer; color: var(--muted); font-size: .875rem; font-weight: 600; padding: 6px 0; }

/* Reports: label/value rows that read well on a phone, a table on desktop */
.report { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.report th { text-align: left; color: var(--muted); font-size: .8125rem; font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.report td { padding: 10px 0; border-bottom: 1px solid var(--divider); vertical-align: top; }
.report tr:last-child td { border-bottom: 0; }
.report .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
@media (max-width: 599px) {
  .report thead { display: none; }
  .report tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--divider); }
  .report tr:last-child { border-bottom: 0; }
  .report td { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border: 0; }
  .report td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; }
  .report td:first-child { font-weight: 600; }
  .report td:first-child::before { content: none; }
  .report .num { padding-left: 0; }
}

.weather { display: flex; gap: 14px; align-items: center; }
.weather .w-icon { font-size: 1.75rem; line-height: 1; }
.weather .w-main { flex: 1; min-width: 0; }
.weather .w-title { font-weight: 600; }
.weather .w-temp { font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.weather.risky { background: var(--warn-bg); border-color: transparent; }
.weather.risky .w-warn { color: var(--warn); }

.policy h2 { font-size: 1.0625rem; margin: 20px 0 6px; }
.policy h2:first-child { margin-top: 0; }
.policy ul { padding-left: 1.2rem; margin: 6px 0; }
.policy li { margin: 6px 0; }
.policy p { margin-bottom: 8px; }
.policy-editor { min-height: 420px; font-size: .9375rem; line-height: 1.55; }

.push { display: flex; gap: 14px; align-items: flex-start; }
.push .icon.lg { color: var(--action); margin-top: 2px; }
.push-body { flex: 1; min-width: 0; }
ol.steps { padding-left: 1.2rem; margin: 8px 0 0; font-size: .9375rem; }
ol.steps li { margin: 4px 0; }

/* Sign-in */
.auth {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 40px) 24px calc(env(safe-area-inset-bottom) + 40px);
}
.auth > * { width: 100%; max-width: 380px; margin-left: auto; margin-right: auto; }
.auth-logo { display: block; width: 220px; max-width: 72%; height: auto; margin: 0 auto 40px; }
.auth h1 { font-size: 1.375rem; line-height: 1.75rem; text-align: center; margin-bottom: 8px; }
.auth .lead { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth form label:first-of-type { margin-top: 0; }
.auth .flash, .auth .error { margin-bottom: 16px; }

/* ---------- Utilities ---------- */

.muted { color: var(--muted); }
.small { font-size: .875rem; line-height: 1.25rem; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Logos that follow the active theme (light artwork on light surfaces). */
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="light"] .only-dark { display: none; }

.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stat-num { font-size: 1.75rem; line-height: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Theme picker */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--subtle); border-radius: var(--r-md); margin-top: 8px; }
.segmented button { min-height: 40px; background: transparent; color: var(--ink); font-size: .9375rem; border-radius: 9px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--action); box-shadow: var(--shadow); }

/* ---------- Desktop ---------- */

.jobs { display: grid; gap: 12px; margin: 12px 0; }
.jobs > .job, .jobs > .card { margin: 0; }

@media (min-width: 900px) {
  /* Single-column pages read best at ~760px; two-column pages use the full width. */
  main { max-width: 824px; padding-left: 32px; padding-right: 32px; }
  main:has(> .two-col), main:has(> .jobs) { max-width: 1120px; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
  .two-col > .main { grid-column: 1; grid-row: 1; min-width: 0; }
  .two-col > .side { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--top-h) + 24px); }
  .two-col.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .two-col > .side .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col > .side > .actions:first-child { margin-top: 0; }
  .two-col > .side > .card:first-child, .two-col > .side > section:first-child { margin-top: 0; }
  .two-col > .main > .section:first-child, .two-col > .main > section:first-child { margin-top: 0; }
  .two-col > .side.static { position: static; }
  .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jump { position: static; }
  h1 { font-size: 2rem; line-height: 2.5rem; }
}

/* ---------- Date and time fields ---------- */
/* Native pickers stay (they are the best on phones); this makes them match
   the other fields and swaps the browser's indicator for the app's icon. */
input[type="date"], input[type="time"], input[type="month"] {
  position: relative; text-align: left; font-variant-numeric: tabular-nums; cursor: pointer;
  padding-right: 44px; background-repeat: no-repeat; background-position: right 14px center; background-size: 20px 20px;
}
input[type="date"], input[type="month"] { background-image: url("/static/calendar.svg"); }
input[type="time"] { background-image: url("/static/clock.svg"); }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer;
}
input[type="date"]:not(:focus):invalid, input.empty-date:not(:focus) { color: var(--muted); }

/* Desktop calendar popover (app.js); phones keep the native picker. */
.datefield { position: relative; }
.datefield input { width: 100%; }
.calendar {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 304px; padding: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--divider); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar-head strong { text-transform: capitalize; }
.calendar-head button { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--ink); border-radius: 9px; }
.calendar-head button:hover { background: var(--subtle); filter: none; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-grid .dow { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.calendar-grid button {
  min-height: 38px; padding: 0; background: transparent; color: var(--ink); font-weight: 500; font-size: .9375rem; border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.calendar-grid button:hover { background: var(--subtle); filter: none; }
.calendar-grid button.other { color: var(--control); }
.calendar-grid button.today { box-shadow: inset 0 0 0 1.5px var(--action); }
.calendar-grid button[aria-selected="true"] { background: var(--action); color: var(--action-ink); }
.calendar-grid button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.calendar-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.calendar-foot button { min-height: 34px; padding: 0 10px; font-size: .875rem; background: transparent; color: var(--action); }

/* Guest message preview with a copy button beside it */
.msg-preview { display: flex; align-items: flex-start; gap: 8px; background: var(--surface-2, var(--grey-soft)); border-radius: 12px; padding: 12px; }
.msg-preview .msg-text { flex: 1; min-width: 0; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-preview .copy-btn { flex: none; }
.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; }
select.currency { width: auto; min-width: 72px; flex: none; }

/* Gear and returning guests */
.pills { display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; }
.pill.returning { background: var(--tint); color: var(--action); display: inline-flex; align-items: center; gap: 4px; }
.pill.returning .icon { width: 14px; height: 14px; }
.pill.gear-available { background: var(--ok-bg); color: var(--ok); }
.pill.gear-out { background: var(--info-bg); color: var(--info); }
.pill.gear-service { background: var(--warn-bg); color: var(--warn); }
.pill.gear-retired { background: var(--subtle); color: var(--muted); }
.returning-card .group { margin-bottom: 0; }

/* Phone-only and wide-only blocks, for reports that need a different shape on each */
.wide-only { display: none; }
@media (min-width: 900px) { .wide-only { display: block; } .phone-only { display: none; } }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report .nowrap, .report td:first-child { white-space: nowrap; }

/* Guide pages: one-line weather, guest price, month summary, next tour */
.weatherline { margin: 8px 0 0; font-size: .95rem; color: var(--muted); }
.weatherline.risky { color: var(--warn); }
.guest-pays { margin-bottom: 0; font-size: 1.05rem; }
.guest-pays strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.month-card .big-money { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.month-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); }
.month-facts strong { color: var(--ink); }
a.card.next-tour { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
a.card.next-tour .item-main { flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
