:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2422;
  --quiet: #5b6662;
  --line: #e2ded5;
  --brand: #1f4e46;
  --brand-ink: #ffffff;
  --open: #2f7a4d;
  --taken: #8a8f8d;
  --error: #b3261e;
  --input: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917;
    --card: #1e2523;
    --ink: #eef2f0;
    --quiet: #a8b3ae;
    --line: #2f3936;
    --brand: #5fb3a1;
    --brand-ink: #0d1412;
    --open: #6fcf97;
    --taken: #7c8582;
    --error: #f2b8b5;
    --input: #141917;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.page { max-width: 640px; margin: 0 auto; padding: 24px 16px 8px; }

.hero { padding: 16px 0 8px; }
.eyebrow { margin: 0 0 4px; color: var(--quiet); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
h1 { margin: 0 0 12px; font-size: 32px; line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 20px; }
.lead { margin: 0 0 16px; color: var(--quiet); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.card.muted { background: transparent; }

.button {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.button:disabled { opacity: .55; }

.phone {
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid var(--brand);
  border-radius: 10px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

ul.checks, ul.plain, ul.spaces { list-style: none; margin: 0; padding: 0; }
ul.checks li { padding: 6px 0 6px 28px; position: relative; }
ul.checks li::before { content: "\2713"; position: absolute; left: 4px; color: var(--open); font-weight: 700; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

.space {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.space:last-child { border-bottom: 0; }
.space .detail { display: block; color: var(--quiet); font-size: 15px; }
.space .right { text-align: right; white-space: nowrap; }
.badge { display: block; font-size: 14px; font-weight: 600; }
.space.open .badge { color: var(--open); }
.space.taken { color: var(--taken); }
.space.taken .badge { color: var(--taken); }

.footer { max-width: 640px; margin: 0 auto; padding: 16px; color: var(--quiet); font-size: 14px; text-align: center; }
.footer a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar form { margin: 0; }
.brand { color: var(--brand); font-weight: 700; text-decoration: none; }
.link {
  background: none; border: 0; padding: 8px 0; color: var(--brand);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}

/* ---------- messages ---------- */
.flash {
  margin: 8px 0 0; padding: 12px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--open); color: var(--ink);
}
.error { margin: 6px 0 0; color: var(--error); font-size: 16px; font-weight: 600; }
.hint { margin: 6px 0 0; color: var(--quiet); font-size: 15px; }
.back { color: var(--brand); text-decoration: none; font-weight: 600; }

/* ---------- buttons ---------- */
.button + .button { margin-top: 12px; }
.button.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.button.danger { background: transparent; color: var(--error); border: 2px solid var(--error); }
.card > .button { margin-top: 16px; }
.small {
  display: inline-block; padding: 10px 14px; border-radius: 8px; border: 0;
  background: var(--brand); color: var(--brand-ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; text-align: center;
}
.small.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); padding: 8px 14px; }

/* ---------- forms ---------- */
.form label { display: block; margin: 18px 0 6px; font-weight: 600; }
.form label:first-of-type { margin-top: 0; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--input); color: var(--ink); font: inherit;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form .button { margin-top: 24px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .row label { margin-top: 18px; }
.form label.check { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.form label.check input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--brand); }
.form fieldset.choices { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.form fieldset.choices[hidden] { display: none; }
.form fieldset.choices legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.form fieldset.choices label.check { margin: 10px 0 0; min-height: 44px; }
.address { display: flex; align-items: center; gap: 6px; }
.address input { flex: 1; min-width: 0; }
.address span { color: var(--quiet); white-space: nowrap; font-size: 16px; }
.address-line {
  padding: 12px 14px; border-radius: 10px; background: var(--bg);
  font-weight: 700; word-break: break-all;
}
.danger-zone { margin: 8px 0 24px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 0; }
.stats div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 8px; text-align: center;
}
.stats strong { display: block; font-size: 28px; line-height: 1.1; }
.stats span { color: var(--quiet); font-size: 15px; }
.spaces.manage .space { flex-direction: column; align-items: stretch; gap: 10px; }
.spaces.manage .badge { margin-top: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------- renter requests ---------- */
.space { flex-wrap: wrap; }
.space .rent-link { flex-basis: 100%; margin-top: 4px; padding: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form h2 { margin: 0 0 8px; }
.form h2.section, h2.section { margin-top: 28px; }
.optional { color: var(--quiet); font-weight: 400; }
.center { text-align: center; }
.error.box {
  padding: 12px 16px; border: 2px solid var(--error); border-radius: 10px; background: var(--card);
}
.requests { border: 2px solid var(--brand); }
.request { padding: 14px 0; }
.request a { color: var(--ink); text-decoration: none; }
.request .detail { display: block; color: var(--quiet); font-size: 15px; }
.request .actions { margin-top: 10px; }
.badge a { color: inherit; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--quiet); }
.facts dd { margin: 0; font-weight: 600; }
.notes { white-space: pre-wrap; margin: 0; }
.decide { display: grid; gap: 12px; }
.decide form { margin: 0; }

/* ---------- agreements and signing ---------- */
:root { --wait: #9a5b00; }
@media (prefers-color-scheme: dark) { :root { --wait: #f2c46d; } }
.agreement { white-space: pre-wrap; font-size: 16px; line-height: 1.55; max-height: 60vh; overflow-y: auto; }
.agreement-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em;
       background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.blanks li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.blanks span { color: var(--quiet); font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0 10px; }
.tab { padding: 12px; border-radius: 10px; border: 2px solid var(--brand); background: transparent;
       color: var(--brand); font: inherit; font-weight: 600; }
.tab.active { background: var(--brand); color: var(--brand-ink); }
.sig-box { display: block; width: 100%; border: 2px dashed var(--line); border-radius: 10px; background: #fff; }
canvas.sig-box { aspect-ratio: 3 / 1; height: auto; touch-action: none; cursor: crosshair; }
.typed-preview { font-family: 'Dancing Script', 'Snell Roundhand', 'Segoe Script', 'Brush Script MT', cursive; font-weight: 600; font-size: 40px; color: #111;
                 min-height: 90px; padding: 14px 16px; line-height: 1.4; overflow-wrap: anywhere; }
.sig-image { max-width: 100%; background: #fff; border-radius: 8px; }
.status-good { color: var(--open); font-weight: 600; }
.status-wait, .badge.wait, .badge.wait a { color: var(--wait); font-weight: 600; }
.send-buttons { display: grid; gap: 10px; margin: 12px 0 16px; }
.send-buttons .button + .button { margin-top: 0; }
.inline-form { margin: 14px 0 0; }
.inline-form .link { text-align: left; font-size: 15px; }
.blank .context { margin: 0 0 12px; color: var(--quiet); font-size: 15px; overflow-wrap: anywhere; }
.blank mark { background: #ffe58a; color: #111; padding: 0 3px; border-radius: 3px; font-weight: 700; }
.form > .card + .button { margin-top: 8px; }

/* ---------- payments ---------- */
.payment-list li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.payment-list li span { color: var(--quiet); font-size: 15px; }
.payment-list li .detail { flex-basis: 100%; }
.payment-list li.failed strong { color: var(--error); text-decoration: line-through; }
details.record { margin-top: 16px; }
details.record summary { color: var(--brand); font-weight: 600; cursor: pointer; padding: 8px 0; }
details.record .form { margin-top: 12px; }
.hero form { margin: 12px 0; }
.hero .button.secondary { margin-top: 12px; }
details.stripe-help { margin: 4px 0 16px; }
details.stripe-help summary { color: var(--brand); font-weight: 600; cursor: pointer; padding: 8px 0; }
details.stripe-help .facts { grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
details.stripe-help .facts dt { margin-top: 12px; font-weight: 600; color: var(--ink); }
details.stripe-help .facts dd { font-weight: 400; color: var(--quiet); }
details.stripe-help .facts dd strong { color: var(--ink); overflow-wrap: anywhere; }
.needs { margin: 0 0 12px; padding: 12px 14px; border: 2px solid var(--wait); border-radius: 10px; }
.needs p { margin: 0 0 6px; }
.needs ul { margin: 0; padding-left: 20px; }
.back-to-lot { margin: 24px 0 8px; }
.stats.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.four div { padding: 12px 4px; }
.stats.four span { font-size: 14px; }
.stats div.wait strong { color: var(--wait); }
.pay-choices { display: grid; gap: 4px; margin: 12px 0 4px; }
.pay-choice { margin: 0 !important; }
.pay-choice .hint { margin: 6px 0 10px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.refund-tag { color: var(--wait); font-weight: 600; font-size: 15px; }
.payment-list li.refunded strong { text-decoration: line-through; color: var(--quiet); }
.payment-list li .refund-form { flex-basis: 100%; margin-top: 4px; }
.needs .small { margin-top: 6px; }
.nav-links { gap: 16px; }

/* ---------- reports ---------- */
.stats div.bad strong { color: var(--error); }
.needs.late { border-color: var(--error); }
.report-buttons { display: grid; gap: 10px; }
.report-buttons .button + .button { margin-top: 0; }
.rent-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rent-list li:last-child { border-bottom: 0; }
.rent-list li > a { color: var(--ink); text-decoration: none; display: block; }
.rent-list .state { display: block; font-weight: 600; }
.rent-list .detail { display: block; color: var(--quiet); font-size: 15px; }
.rent-list .rent-late .state, .rent-list .rent-failed .state { color: var(--error); }
.rent-list .rent-due .state { color: var(--wait); }
.rent-list .rent-ok .state { color: var(--open); }
.rent-list .rent-start .state { color: var(--quiet); }
.rent-list .actions { margin-top: 8px; }
.year-pick { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 8px; }
.year-pick a { color: var(--brand); font-weight: 600; }
.year-total { margin: 0 0 8px; font-size: 24px; }
.year-total .detail { display: block; color: var(--quiet); font-size: 15px; }
.contact-card { margin-top: 16px; }
.contact-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list span { display: block; }
.contact-list .detail { color: var(--quiet); font-size: 15px; }
.contact-list a { color: var(--brand); font-weight: 600; }

@media print {
  .topbar, .footer, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; font-size: 13px; }
  .page { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .stats div { border: 1px solid #ccc; background: #fff; }
  .contact-list li, .rent-list li, .payment-list li { break-inside: avoid; padding: 6px 0; }
  .contact-list a, .rent-list li > a { color: #000; }
  .hint, .lead, .detail, .contact-list .detail { color: #333 !important; }
  .contact-list strong, .rent-list strong { font-size: 15px; }
  .contact-list span, .contact-list .detail, .rent-list .state, .rent-list .detail,
  .payment-list li span { font-size: 13px; }
  .contact-list a { text-decoration: none; }
}

/* ---------- waitlist choices ---------- */
.form fieldset.wants label.want { align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.form fieldset.wants label.want input { margin-top: 2px; }
.form fieldset.wants label.want > span { display: block; }
.form fieldset.wants .detail { display: block; color: var(--quiet); font-size: 15px; font-weight: 400; }
.form fieldset.wants .detail.open-now { color: var(--open); font-weight: 600; }
.form fieldset.wants label.want:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.form fieldset.wants > .hint { margin: 4px 0 0; }
.form fieldset.wants .hint a { color: var(--brand); font-weight: 600; }

/* ---------- month prices and month picking ---------- */
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.form .month-grid label.month-price { margin: 0; font-size: 15px; font-weight: 600; }
.form .month-grid label.month-price input { margin-top: 4px; padding: 10px 8px; text-align: center; }
.month-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.month-pick { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center;
              cursor: pointer; background: var(--input); }
.form .month-picks label.month-pick { margin: 0; font-weight: 600; }
.month-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.month-pick .price { display: block; font-weight: 400; color: var(--quiet); font-size: 14px; }
.month-pick:has(input:checked) { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.month-pick:has(input:checked) .price { color: var(--brand-ink); }
.month-pick:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.year-sum { font-size: 20px; font-weight: 700; margin: 8px 0 0; }
.pick-buttons { display: flex; gap: 10px; margin-top: 4px; }
.pick-buttons button { font: inherit; font-size: 15px; background: none; border: 0; color: var(--brand); font-weight: 600;
                       padding: 6px 0; cursor: pointer; }
.month-pick:has(input:checked)::before { content: "\2713"; display: block; font-size: 14px; line-height: 1; margin-bottom: 2px; }
.month-pick:not(:has(input:checked))::before { content: ""; display: block; height: 16px; }
.form label.check.risk { align-items: flex-start; padding: 12px; border: 2px solid var(--wait); border-radius: 10px; margin-top: 16px; }
.form label.check.risk input { margin-top: 2px; }

/* ---------- printable lot sign with QR code ---------- */
.sign-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.lot-sign { background: #fff; border: 3px solid var(--ink, #1d2422); border-radius: 16px; padding: 28px 20px;
  text-align: center; margin: 20px 0; color: #000; }
.lot-sign p { margin: 0; }
.sign-name { font-size: 28px; font-weight: 800; line-height: 1.15; }
.sign-call { font-size: 18px; margin-top: 4px !important; }
.sign-qr { width: min(78vw, 340px); margin: 18px auto; }
.sign-qr svg { width: 100%; height: auto; display: block; }
.sign-scan { font-size: 18px; line-height: 1.35; }
.sign-url { font-size: 22px; font-weight: 700; margin-top: 12px !important; word-break: break-all; }
.sign-phone { font-size: 18px; margin-top: 8px !important; }
@media print {
  .lot-sign { border: 4px solid #000; margin: 0; padding: 0.5in 0.4in; page-break-inside: avoid; }
  .sign-name { font-size: 44px; }
  .sign-call { font-size: 26px; }
  .sign-qr { width: 5in; margin: 0.35in auto; }
  .sign-scan { font-size: 24px; }
  .sign-url { font-size: 30px; }
  .sign-phone { font-size: 24px; }
}

/* ---------- pricing tip on the space form ---------- */
.price-tip { background: #f3f7f5; border: 1px solid #d5e2dc; border-radius: 10px; padding: 12px 14px; margin: 8px 0 14px;
  font-size: 15px; line-height: 1.45; }
.price-tip p { margin: 0; }
.price-tip .tip-math { margin-top: 8px; }

/* ---------- insurance: take a photo or choose a file ---------- */
.field-label { font-weight: 600; margin: 14px 0 6px; }
.ins-picker { display: grid; gap: 10px; margin-bottom: 8px; }
.ins-picker label.button { margin: 0; text-align: center; cursor: pointer; }
.ins-chosen { margin: 0; }
.ins-preview { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid #ddd; justify-self: start; }

/* ---------- lot map ---------- */
.lotmap { width: 100%; height: 62vh; min-height: 320px; border-radius: 12px; overflow: hidden; background: #dfe5e2;
  margin: 10px 0; }
.lotmap.renter { height: 52vh; }
.map-find { display: flex; gap: 8px; margin-bottom: 8px; }
.map-find input { flex: 1; margin: 0; }
.map-status { min-height: 1.4em; }
.map-selected { border: 2px solid #ff8a00; border-radius: 12px; padding: 12px; margin: 10px 0; background: #fff8ef; }
.map-selected p { margin: 0 0 6px; }
.map-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.map-spaces { display: flex; flex-wrap: wrap; gap: 8px; }
.map-spaces li { border: 0; padding: 0; }
.map-spaces .chosen { outline: 3px solid #ff8a00; }
.sg-map-label { position: absolute; transform: translate(-50%, -50%); color: #fff; font: 700 13px/1 system-ui, sans-serif;
  text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; white-space: nowrap; }
.sg-map-info { font-size: 15px; line-height: 1.4; min-width: 170px; }
.sg-map-info .button { margin-top: 8px; display: inline-block; }
.map-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; }
.map-key.open { background: #1fa65a; }
.map-key.taken { background: #8a9196; }

.tagline { font-size: 20px; font-weight: 600; color: var(--accent, #1f4e46); margin: 4px 0 10px; line-height: 1.3; }
.spaces.manage .add-renter { display: block; margin-top: 8px; text-align: center; }
.problems { color: #a3271c; padding-left: 20px; }
.problems li { margin: 6px 0; }

/* ---------- landing page lot picture ---------- */
.lot-picture { margin: 8px auto 20px; text-align: center; }
.lot-picture img { width: min(78vw, 300px); height: auto; display: block; margin: 0 auto 10px; }
.lot-picture figcaption { font-size: 15px; color: #5b6662; line-height: 1.5; }
.lot-picture .map-key { margin-left: 4px; }

/* ---------- landing page feature groups ---------- */
.features { display: grid; gap: 14px; }
.feature h2 { margin-top: 0; }
.feature-icon { font-size: 28px; margin: 0 0 4px; line-height: 1; }
.device-note { margin: 4px 0 18px; }
@media (min-width: 900px) { .features { grid-template-columns: repeat(3, 1fr); } }
