/* Sandtracks booking: one small stylesheet. The whole look is set by the variables below:
   change them here and every page follows. System fonts only; nothing is loaded from elsewhere. */
:root {
  /* colour */
  --bg: #f6f3ec;
  --surface: #ffffff;
  --ink: #1f2a24;
  --ink-soft: #55615a;
  --line: #d9d3c4;
  --brand: #2f5d46;
  --brand-dark: #234837;
  --brand-ink: #ffffff;
  --brand-soft: #e3eee7;
  --warn: #8a4b08;
  --warn-soft: #fbefd9;
  --bad: #9b2226;
  --bad-soft: #f9e3e3;
  --good: #1f6b3a;
  --good-soft: #e0f1e5;
  --taken: #e7e2d6;
  --taken-ink: #5f5a50;
  --seal: #14324a;
  --seal-soft: #eef4f9;
  --shadow: 0 1px 2px rgba(31, 42, 36, 0.06), 0 4px 14px rgba(31, 42, 36, 0.05);
  /* space: every gap and padding is one of these */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --gap: var(--s4);
  --radius: 10px;
  --radius-sm: 8px;
  --tap: 48px;
  --tap-min: 44px;
  /* type: every size is one of these */
  --t-2xs: 0.75rem;
  --t-xs: 0.8rem;
  --t-sm: 0.9rem;
  --t-md: 1rem;
  --t-lg: 1.15rem;
  --t-xl: 1.5rem;
  --t-2xl: 1.75rem;
  --t-num: 2rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --width: 640px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 88px; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); accent-color: var(--brand); caret-color: var(--brand); }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
a { color: var(--brand); text-underline-offset: 0.15em; }
h1 { font-size: var(--t-xl); line-height: 1.2; margin: 0 0 var(--s2); text-wrap: balance; }
h2 { font-size: var(--t-lg); line-height: 1.3; margin: 0 0 var(--s2); text-wrap: balance; }
h3 { font-size: var(--t-md); margin: 0 0 var(--s1); }
p { margin: 0 0 var(--s3); }
ul { margin: 0 0 var(--s3); padding-left: 20px; }
main > h2 { margin-top: var(--s5); }
.wrap { width: 100%; max-width: var(--width); margin: 0 auto; padding: var(--gap); }
main.wrap { flex: 1 0 auto; }
/* the "back" link that opens most pages: a full-height target for a thumb */
main > p:first-child > a:first-child { display: inline-block; padding: 10px 0; }
main > p:first-child { margin-bottom: var(--s1); }
.top { background: var(--brand); color: var(--brand-ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: 0; padding-bottom: 0; }
.top a { display: flex; align-items: center; flex-wrap: wrap; min-height: var(--tap); color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.top .small { font-weight: 400; font-size: var(--t-sm); opacity: 0.9; white-space: pre; }
/* shared computer: who is signed in, with Sign out, on every signed-in page */
.top .who { display: flex; align-items: center; gap: var(--s2); min-width: 0; min-height: var(--tap); margin: 0; }
.top .who .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.top .who .btn { min-height: 36px; padding: 4px 10px; font-size: var(--t-sm); }
.demo { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 6px var(--s3); font-size: var(--t-sm); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); margin: 0 0 var(--gap); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--t-sm); }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--s3); }
.grow { flex: 1 1 auto; }

/* buttons and links that look like buttons: big enough for a thumb */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: var(--tap); padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 600; line-height: 1.25; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.quiet { border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.quiet:hover { background: var(--bg); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: var(--tap-min); padding: 6px var(--s3); font-size: var(--t-sm); }
form.inline { display: inline; }
.actions { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s3); margin: 0 0 var(--gap); }
.actions .btn { padding-left: var(--s3); padding-right: var(--s3); }

/* forms */
label { display: block; font-weight: 600; margin: 0 0 var(--s1); }
.field { margin: 0 0 14px; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: var(--t-sm); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=file], select, textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: var(--tap); padding: 10px var(--s3); border: 1px solid var(--ink-soft); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
/* the PIN boxes: six digits, large and spaced, so a wrong key is seen at once (the dots, that is: the type is password) */
input[type=password] { max-width: 12em; font-size: var(--t-lg); letter-spacing: 0.3em; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 110px; }
.cols input[type=date], .cols input[type=time] { padding-left: var(--s2); padding-right: var(--s1); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; min-height: var(--tap-min); }
.check input { width: 24px; height: 24px; flex: 0 0 auto; margin-top: 2px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s2); }
.cols > *, .cols3 > * { min-width: 0; }
.err { color: var(--bad); font-weight: 600; font-size: var(--t-sm); }

/* notices */
.note { border-radius: var(--radius); padding: var(--s3) 14px; margin: 0 0 var(--gap); border: 1px solid var(--line); background: var(--surface); }
.note.good { background: var(--good-soft); border-color: var(--good); }
.note.warn { background: var(--warn-soft); border-color: var(--warn); }
.note.bad { background: var(--bad-soft); border-color: var(--bad); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600; white-space: nowrap; background: var(--brand-soft); color: var(--brand); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.grey { background: var(--taken); color: var(--taken-ink); }
.empty { color: var(--ink-soft); padding: var(--s1) 0; }

/* the campsite page opens with a photo, the name and one clear button */
.hero { margin: 0 0 var(--s5); }
.hero-img { display: block; width: calc(100% + 2 * var(--gap)); max-width: none; margin: calc(-1 * var(--gap)) calc(-1 * var(--gap)) 0; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--taken); }
.hero h1 { font-size: var(--t-2xl); margin: var(--s4) 0 var(--s1); }
.hero .credit { margin-top: var(--s1); }
.hero-actions { margin: var(--s4) 0 0; }
.hero-actions .btn.primary { flex: 1 1 160px; max-width: 320px; }
.credit { display: block; font-size: var(--t-xs); color: var(--ink-soft); margin: 0 0 var(--s2); }
.units { display: grid; gap: var(--gap); margin: 0 0 var(--gap); }
.units .card { margin: 0; display: flex; flex-direction: column; }
.units .card .btn { margin-top: auto; }
.units .card:hover { border-color: var(--brand); }
:target { scroll-margin-top: var(--s3); }

/* facts about a stand */
.facts { list-style: none; padding: 0; margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: 6px; }
.facts li { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: var(--t-sm); background: var(--bg); }
.facts li.no { color: var(--taken-ink); background: transparent; border-style: dashed; }
.photo { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--taken); margin: 0 0 var(--s3); }
img.photo { aspect-ratio: 3 / 2; object-fit: cover; }
.photo + .credit, a + .credit { margin-top: calc(-1 * var(--s2)); }
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin: 0 0 var(--s3); }
.photos figure { margin: 0; }
.photos .photo { margin: 0 0 var(--s1); }
.photos .credit { margin: 0; }
.photo-row { display: flex; gap: var(--s3); align-items: center; margin: 0 0 var(--s3); }
.photo-row img { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius); background: var(--taken); }
.unit-link { display: block; color: inherit; text-decoration: none; }

/* calendar */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 var(--s2); }
.cal caption { font-weight: 700; text-align: left; padding: 0 0 6px; }
.cal th { font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); padding: var(--s1) 0; }
.cal td { padding: 2px; text-align: center; }
.cal .d { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--tap); width: 100%; border-radius: var(--radius-sm); border: 1px solid transparent;
  text-decoration: none; font: inherit; font-weight: 600; line-height: 1.1; padding: 0; }
.cal .free { background: var(--good-soft); color: var(--good); border-color: var(--good); cursor: pointer; }
.cal .taken { background: var(--taken); color: var(--taken-ink); text-decoration: line-through; }
.cal .past { color: var(--line); }
.cal .sel { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); text-decoration: none; }
.cal .block { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.cal .d small { font-size: 0.65rem; font-weight: 500; text-decoration: none; display: block; }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: var(--t-sm); margin: 0 0 var(--s3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 18px; border-radius: var(--s1); border: 1px solid var(--line); }
.legend .free { background: var(--good-soft); border-color: var(--good); }
.legend .taken { background: var(--taken); }
.legend .sel { background: var(--brand); }
.legend .block { background: var(--warn-soft); border-color: var(--warn); }

/* price */
.price { width: 100%; border-collapse: collapse; margin: 0 0 var(--s3); font-variant-numeric: tabular-nums; }
.price td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.price td:last-child { text-align: right; white-space: nowrap; }
.price tr.total td { font-weight: 700; font-size: var(--t-lg); border-bottom: 0; }
.big { font-size: var(--t-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
/* what a stand costs: one block per season, the season's name on its own line so the five amounts fit a small phone */
.ratecard { width: 100%; border-collapse: collapse; margin: 0 0 var(--s3); font-variant-numeric: tabular-nums; }
.ratecard th, .ratecard td { padding: 6px var(--s3) 6px 0; text-align: left; vertical-align: bottom; }
.ratecard th:last-child, .ratecard td:last-child { padding-right: 0; }
.ratecard thead th { font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); line-height: 1.2; border-bottom: 1px solid var(--line); }
.ratecard .season th { padding-top: var(--s3); padding-bottom: 0; font-size: var(--t-sm); }
.ratecard .season th span { font-weight: 400; color: var(--ink-soft); }
.ratecard td { font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ratecard tbody:last-child td { border-bottom: 0; }
.promise { font-weight: 600; color: var(--good); }

/* THE SEALED BANK BOX. Deliberately unlike anything a campsite can write: own colour, heavy
   border, lock mark, fixed heading and fixed warning line. Campsite-written text is drawn in
   .campsite-words, which looks nothing like it. */
.bankbox { border: 3px solid var(--seal); border-radius: var(--radius); background: var(--seal-soft); margin: 0 0 var(--gap); }
.bankbox .seal-head { display: flex; align-items: center; gap: 10px; background: var(--seal); color: #fff; padding: 10px 14px; font-weight: 700; }
.bankbox .seal-head svg { flex: 0 0 auto; }
.bankbox .seal-body { padding: 14px; }
.bankbox dl { margin: 0 0 var(--s3); display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.bankbox dt { color: var(--ink-soft); }
.bankbox dd { margin: 0; font-family: var(--mono); font-weight: 700; overflow-wrap: anywhere; }
.bankbox .only { font-weight: 700; color: var(--seal); border-top: 2px solid var(--seal); padding-top: 10px; margin: 0; }
.campsite-words { border-left: 4px solid var(--line); padding: 2px 0 2px var(--s3); margin: 0 0 var(--s3); }
.campsite-words .who { display: block; font-size: var(--t-xs); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 var(--s1); }

/* back end */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 var(--gap); padding-bottom: 2px; }
.tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; padding: var(--s2) 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; min-height: var(--tap-min); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
/* the bar stays at the bottom of the screen. It is part of the page's own height, so the last line of a page always ends above it. */
.nav { position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(31, 42, 36, 0.06); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav .wrap { display: flex; justify-content: space-around; gap: var(--s1); padding-top: 6px; padding-bottom: 6px; }
.nav a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; padding: var(--s1); min-height: var(--tap); color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--t-sm); border-radius: var(--radius-sm); }
.nav a.on { color: var(--brand); background: var(--brand-soft); }
/* today at a glance: four counts, each a link to its list further down */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 var(--gap); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stat { display: flex; flex-direction: column; justify-content: flex-start; min-height: 88px; padding: var(--s3) var(--s4); background: var(--surface); color: var(--ink); text-decoration: none; }
.stat:hover { background: var(--brand-soft); }
.stat-n { font-size: var(--t-num); font-weight: 700; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat-l { font-size: var(--t-sm); font-weight: 600; line-height: 1.25; }
.stat.zero .stat-n, .stat.zero .stat-l { color: var(--ink-soft); font-weight: 500; }
.stat.due .stat-n { color: var(--warn); }
.list { list-style: none; padding: 0; margin: 0; }
.list.card { padding: var(--s1) var(--gap); }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a.item { display: block; padding: var(--s3) 0; min-height: var(--tap); color: inherit; text-decoration: none; }
.list .line1 { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); font-weight: 600; }
.list .line1 .tag { flex: 0 0 auto; margin-top: 2px; }
.count { display: inline-block; min-width: 28px; text-align: center; padding: 0 var(--s2); border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.count.zero { background: var(--taken); color: var(--taken-ink); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 var(--s3); }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.rates { width: 100%; border-collapse: collapse; }
.rates th, .rates td { text-align: left; padding: 6px var(--s1); border-bottom: 1px solid var(--line); font-size: var(--t-sm); }

/* invoice: prints cleanly on its own */
.invoice h1 { margin-bottom: 0; }
@media print {
  body { background: #fff; display: block; }
  .top, .nav, .demo, .noprint { display: none !important; }
  .card { border: 0; padding: 0; box-shadow: none; }
}
@media (min-width: 600px) {
  .units { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .photos { grid-template-columns: repeat(3, 1fr); }
  .hero-img { width: 100%; margin: 0; border-radius: var(--radius); aspect-ratio: 2 / 1; }
  .actions { grid-template-columns: repeat(2, max-content); }
}
@media (max-width: 380px) {
  body { font-size: 16px; }
  .cols3 { grid-template-columns: 1fr 1fr; }
  .ratecard thead th { font-size: var(--t-2xs); }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
