/* Layout: phone-shaped app column, sticky header, fixed bottom tab bar; estuary palette (tide water, mudflat, buoy yellow) */
:root {
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #e3eae8;
  --ink: #14262a;
  --muted: #5b6e70;
  --line: #d3dcda;
  --tide: #1d5a62;
  --tide-soft: #d6e7e7;
  --buoy: #e9b229;
  --buoy-ink: #2a2105;
  --good: #2f7a4a;
  --shadow: 0 10px 30px -18px rgba(20, 38, 42, .45);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d181a; --surface: #152427; --surface-2: #1c2f33; --ink: #e6efee; --muted: #93a8aa;
    --line: #26393d; --tide: #6fb7bd; --tide-soft: #1c3a3e; --buoy: #f0c04a; --buoy-ink: #241b02;
    --good: #6cc48d; --shadow: 0 10px 30px -18px rgba(0,0,0,.8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d181a; --surface: #152427; --surface-2: #1c2f33; --ink: #e6efee; --muted: #93a8aa;
  --line: #26393d; --tide: #6fb7bd; --tide-soft: #1c3a3e; --buoy: #f0c04a; --buoy-ink: #241b02;
  --good: #6cc48d; --shadow: 0 10px 30px -18px rgba(0,0,0,.8); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--body); font-size: 15px; line-height: 1.5; padding-inline: 0; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--buoy); outline-offset: 2px; }

/* Header */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 14px 16px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand h1 { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: -.02em; margin: 0; line-height: 1; }
.brand h1 span { color: var(--tide); }
.proto { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--buoy); color: var(--buoy-ink); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search input { border: 0; background: transparent; padding: 11px 0; width: 100%; outline: none; }
.search svg { flex: none; color: var(--muted); }

main { padding: 14px 16px 20px; display: grid; gap: 18px; }
.screen-title { font-family: var(--display); font-weight: 700; font-size: 1.35rem; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.sub { color: var(--muted); margin: 2px 0 0; font-size: .92rem; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 999px; font-size: .86rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--tide); border-color: var(--tide); color: var(--surface); }
.chip.quick[aria-pressed="true"] { background: var(--buoy); border-color: var(--buoy); color: var(--buoy-ink); }

/* Day groups + event rows */
.day h3 { font-family: var(--display); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.list { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.ev:hover { border-color: var(--tide); }
.time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; color: var(--tide); padding-top: 1px; }
.time small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.ev h4, .place h4 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.free { background: var(--tide-soft); color: var(--tide); }
.tag.rep { background: transparent; border: 1px dashed var(--line); }

/* Places */
.place { display: grid; grid-template-columns: 64px 1fr; gap: 12px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.place:hover { border-color: var(--tide); }
.thumb { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: #ffffff; }
.open { color: var(--good); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

/* Visit */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 8px; }
.card h3 { margin: 0; font-family: var(--display); font-size: 1.05rem; }
.card p { margin: 0; }
.tidebar { background: var(--tide); color: var(--surface); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.tidebar .lbl { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.tides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-variant-numeric: tabular-nums; }
.tides div { display: grid; }
.tides b { font-size: 1.05rem; }
.tides span { font-size: .75rem; opacity: .85; }
.areas { display: grid; gap: 10px; }
.area { display: grid; gap: 2px; padding-left: 12px; border-left: 3px solid var(--buoy); }
.area b { font-size: .95rem; }
.area span { color: var(--muted); font-size: .88rem; }

/* Form */
form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field label { font-weight: 600; font-size: .88rem; }
.field input, .field select, .field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { color: var(--muted); font-size: .8rem; }
.primary { background: var(--tide); color: var(--surface); border: 0; border-radius: 12px; padding: 13px; font-weight: 700; font-size: 1rem; }
.notice { background: var(--tide-soft); color: var(--ink); border-radius: 12px; padding: 14px; }

/* Bottom tabs */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.tabs .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
nav.tabs button { background: none; border: 0; padding: 10px 4px 12px; display: grid; justify-items: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--muted); }
nav.tabs button[aria-current="page"] { color: var(--tide); }
nav.tabs svg { width: 22px; height: 22px; }

/* Detail sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(8, 16, 18, .5); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); justify-self: center; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet h2 { font-family: var(--display); font-size: 1.4rem; margin: 0; line-height: 1.2; text-wrap: balance; }
.close { background: var(--surface-2); border: 0; border-radius: 999px; width: 34px; height: 34px; flex: none; font-size: 1.1rem; }
.facts { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .92rem; }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--tide); font-weight: 600; text-decoration: underline; text-align: left; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-variant-numeric: tabular-nums; }
.hours .today { font-weight: 700; color: var(--tide); }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .22s ease-out; } @keyframes up { from { transform: translateY(24px); opacity: .6; } } }

/* ---- Live site additions ---- */
:root { --warn: #9a5b00; --warn-soft: #fbefd6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn: #f2c26b; --warn-soft: #3a2c10; } }
:root[data-theme="dark"] { --warn: #f2c26b; --warn-soft: #3a2c10; }
a { color: var(--tide); }
.facts a { font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .86rem; }
.pill-link:hover { border-color: var(--tide); }
.skeleton { height: 76px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; border: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.2s linear infinite; } @keyframes shimmer { to { background-position: -200% 0; } } }
.notice.error { background: var(--warn-soft); }
.err-text { color: var(--warn); font-size: .85rem; }
.field input:invalid:not(:placeholder-shown) { border-color: var(--warn); }
.primary:disabled { opacity: .6; cursor: progress; }
footer.site { color: var(--muted); font-size: .78rem; text-align: center; padding: 8px 16px 0; }
footer.site a { color: var(--muted); }
.thumb svg { display: block; }
.thumb.sm { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.sheet-title { display: flex; gap: 12px; align-items: center; min-width: 0; }

/* ---- Centred wordmark ---- */
header.top .wordmark { display: grid; justify-items: center; justify-content: center; gap: 2px; text-align: center; padding-top: 2px; }
.wordmark .eyebrow { font-size: .66rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.wordmark h1 { font-family: var(--display); font-weight: 800; font-size: 2.05rem; letter-spacing: -.035em; line-height: 1; margin: 0; display: flex; align-items: baseline; gap: .22em; }
.wordmark .the { font-weight: 500; font-size: .55em; letter-spacing: 0; color: var(--muted); align-self: center; font-style: italic; }
.wordmark .leigh { color: var(--tide); }
.wordmark .guide { color: var(--ink); position: relative; }
.wordmark .guide::after { content: ""; position: absolute; right: -.32em; top: .06em; width: .26em; height: .26em; border-radius: 50%; background: var(--buoy); }
.wordmark .wave { width: 128px; height: 8px; overflow: visible; }
.wordmark .wave path { fill: none; stroke: var(--buoy); stroke-width: 2.4; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .wordmark .wave path { stroke-dasharray: 140; stroke-dashoffset: 140; animation: tidein 1.4s ease-out .15s forwards; }
  @keyframes tidein { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) { .wordmark .wave path { stroke-dashoffset: 0; } }

/* ---- Computer screens: same Guide, wider layout. Phones are unchanged. ---- */
@media (min-width: 900px) {
  body { padding-top: 60px; }
  .app { max-width: 1180px; padding-bottom: 32px; }

  /* Menu moves from the bottom to a bar across the top */
  nav.tabs { top: 0; bottom: auto; padding-bottom: 0; border-top: 0; border-bottom: 1px solid var(--line); }
  nav.tabs .in { max-width: 1180px; height: 60px; display: flex; justify-content: center; gap: 6px; padding-inline: 24px; }
  nav.tabs button { display: flex; align-items: center; gap: 8px; padding: 8px 16px; margin-block: 10px; border-radius: 999px; font-size: .92rem; }
  nav.tabs button:hover { background: var(--surface-2); color: var(--ink); }
  nav.tabs button[aria-current="page"] { background: var(--tide-soft); }
  nav.tabs svg { width: 20px; height: 20px; }

  header.top { top: 60px; padding: 22px 24px 16px; gap: 14px; border-bottom: 0; }
  .wordmark h1 { font-size: 2.6rem; }
  .wordmark .wave { width: 160px; }
  .search { width: 100%; max-width: 620px; justify-self: center; }

  main { padding: 8px 24px 28px; gap: 22px; }
  .screen-title { font-size: 1.7rem; }

  /* Filters wrap instead of scrolling sideways */
  .chips { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }

  /* Places and events in columns */
  .list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
  .ev, .place { height: 100%; }

  /* Visit Leigh in two columns */
  .screen-visit { grid-template-columns: 1fr 1fr; align-items: start; }
  .screen-visit { grid-auto-flow: row dense; }
  .screen-visit > .wide { grid-column: 1 / -1; }
  .dayouts { grid-template-columns: repeat(3, 1fr); }
  .seasons { grid-template-columns: repeat(5, 1fr); }

  /* Submit form at a comfortable width */
  .screen-submit { max-width: 680px; width: 100%; margin: 0 auto; }

  /* Details open as a centred window */
  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { max-width: 620px; max-height: 86vh; border-radius: 20px; padding: 18px 24px 24px; }
  .grab { display: none; }
  .sheet .list { grid-template-columns: 1fr; }

  footer.site { padding-bottom: 16px; }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .sheet { animation: pop .18s ease-out; }
  @keyframes pop { from { transform: scale(.97); opacity: .6; } }
}

/* ---- Visit Leigh extras ---- */
.facts.compact div { grid-template-columns: minmax(120px, 40%) 1fr; }
.dayouts { display: grid; gap: 14px; }
.dayout { background: var(--bg); border-radius: 12px; padding: 14px; display: grid; gap: 6px; align-content: start; }
.dayout h4 { margin: 0; font-family: var(--display); font-size: 1rem; }
.dayout p { margin: 0; color: var(--muted); font-size: .88rem; }
.dayout ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.dayout li { font-size: .92rem; }
.dayout li span { display: block; color: var(--muted); font-size: .82rem; }
.dayout .linkbtn, .card .linkbtn { font-size: inherit; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 2px; }
.timeline b { font-family: var(--display); color: var(--tide); font-variant-numeric: tabular-nums; }
.seasons { display: grid; gap: 8px; }
.seasons div { display: grid; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--buoy); background: var(--bg); border-radius: 0 10px 10px 0; }
.seasons b { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--tide); }
.seasons span { font-size: .9rem; }
