/* Eryrys — Clwydian Range field-guide palette.
   Ground: cool limestone. Ink: slate-green. Accent: slate-teal.
   Semantic hues are earned, not decorative:
     gorse  = free / costs nothing
     heather= paid admission
     bracken= closed, hazard, tide, warning              */

:root {
  --paper:      #F1F2EC;
  --surface:    #FAFBF6;
  --surface-2:  #E7E9E1;
  --ink:        #1B2422;
  --ink-2:      #4A5652;
  --ink-3:      #78847F;
  --accent:     #24605B;
  --accent-soft:#D6E4E0;
  --gorse:      #9A6B05;
  --gorse-soft: #F5E7C4;
  --heather:    #7A4E7E;
  --heather-soft:#EBDDEC;
  --bracken:    #A64B28;
  --bracken-soft:#F6DFD5;
  --line:       rgba(27, 36, 34, .13);
  --line-firm:  rgba(27, 36, 34, .26);
  --shadow:     0 1px 2px rgba(27, 36, 34, .06), 0 6px 18px -10px rgba(27, 36, 34, .22);

  --f-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --f-body: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --f-data: "Fira Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1100px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #121718;
    --surface:    #1A2123;
    --surface-2:  #232C2E;
    --ink:        #E6EAE3;
    --ink-2:      #A2AEA9;
    --ink-3:      #7C8984;
    --accent:     #63B5AA;
    --accent-soft:#1E3B39;
    --gorse:      #E4B854;
    --gorse-soft: #3B3218;
    --heather:    #C295C6;
    --heather-soft:#33253A;
    --bracken:    #E08055;
    --bracken-soft:#3D2018;
    --line:       rgba(230, 234, 227, .14);
    --line-firm:  rgba(230, 234, 227, .3);
    --shadow:     0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:      #121718;
  --surface:    #1A2123;
  --surface-2:  #232C2E;
  --ink:        #E6EAE3;
  --ink-2:      #A2AEA9;
  --ink-3:      #7C8984;
  --accent:     #63B5AA;
  --accent-soft:#1E3B39;
  --gorse:      #E4B854;
  --gorse-soft: #3B3218;
  --heather:    #C295C6;
  --heather-soft:#33253A;
  --bracken:    #E08055;
  --bracken-soft:#3D2018;
  --line:       rgba(230, 234, 227, .14);
  --line-firm:  rgba(230, 234, 227, .3);
  --shadow:     0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -.005em;
}

p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.eyebrow {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cy { font-style: italic; color: var(--ink-3); font-weight: 400; letter-spacing: .04em; text-transform: none; }

/* ---------- masthead: contour ground ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-firm);
  background: var(--surface);
}
.masthead canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
  pointer-events: none;
}
:root[data-theme="dark"] .masthead canvas { opacity: .38; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .masthead canvas { opacity: .38; }
}
.masthead .wrap { position: relative; padding-block: 34px 26px; }

.mast-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
  justify-content: space-between;
}
.masthead h1 {
  font-size: clamp(2.1rem, 6.2vw, 3.4rem);
  letter-spacing: -.02em;
}
.masthead h1 .sub {
  display: block;
  font-family: var(--f-body);
  font-size: clamp(.82rem, 2.4vw, 1rem);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-2);
  margin-top: 8px;
  line-height: 1.4;
}

.stamp {
  font-family: var(--f-data);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-2);
  border: 1px solid var(--line-firm);
  border-radius: 2px;
  padding: 9px 12px;
  background: var(--paper);
  white-space: nowrap;
}
.stamp b { color: var(--ink); font-weight: 500; }

/* ---------- key facts row ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}
.fact {
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--line);
}
.fact:last-child { border-right: 0; }
.fact dt {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 3px;
}
.fact dd {
  margin: 0;
  font-family: var(--f-data);
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fact dd small { display: block; font-family: var(--f-body); font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* ---------- sticky nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 7px;
}
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 3px;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav .spacer { flex: 1 1 auto; min-width: 8px; }

/* rain toggle */
.rain-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line-firm);
  background: var(--surface);
  padding: 5px 11px;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--f-body);
  white-space: nowrap;
}
.rain-toggle .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3);
  transition: background .18s;
}
.rain-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.rain-toggle[aria-pressed="true"] .dot { background: var(--accent); }

/* ---------- sections ---------- */

section { padding-block: 44px; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
.sec-head { margin-bottom: 22px; }
.sec-head h2 {
  font-size: clamp(1.45rem, 3.6vw, 2rem);
  margin-top: 4px;
}
.sec-head .lede {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 64ch;
  margin-top: 8px;
}

/* ---------- weather strip ---------- */

.wx {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}
.wx-day {
  border: 1px solid var(--line);
  border-top: 3px solid var(--wx-accent, var(--ink-3));
  border-radius: 3px;
  background: var(--surface);
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wx-day .d {
  font-family: var(--f-data);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wx-day .t {
  font-family: var(--f-display);
  font-size: 1.55rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wx-day .t sup { font-size: .55em; font-weight: 500; top: -.5em; }
.wx-day .t .lo { font-size: .58em; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.wx-day .cond { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.wx-day .rain {
  font-family: var(--f-data);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
  padding-top: 6px;
}
.wx-day .bar {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 4px;
}
.wx-day .bar i { display: block; height: 100%; background: var(--wx-accent, var(--ink-3)); }

/* ---------- day cards ---------- */

.day {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, var(--surface-2), transparent);
}
.day-head h3 { font-size: 1.3rem; }
.day-head .theme {
  font-size: 13.5px;
  color: var(--ink-2);
  flex: 1 1 200px;
}
.day-head .cost {
  font-family: var(--f-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line-firm);
  border-radius: 100px;
  padding: 2px 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.slots { display: flex; flex-direction: column; }
.slot {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 0 16px;
  padding: 16px 18px;
  border-bottom: 1px dashed var(--line);
}
.slot:last-child { border-bottom: 0; }
.slot .when {
  font-family: var(--f-data);
  font-size: 12px;
  color: var(--ink-3);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}
.slot .when b { display: block; color: var(--ink-2); font-weight: 500; }
.slot h4 { font-size: 1.04rem; margin-bottom: 3px; }
.slot h4 .pin { font-size: 12px; color: var(--ink-3); font-family: var(--f-body); font-weight: 400; margin-left: 7px; }
.slot p { font-size: 14.2px; color: var(--ink-2); }
.slot .detail { margin-top: 7px; }

.slot.nap { background: color-mix(in srgb, var(--heather-soft) 42%, transparent); }
.slot.nap h4 { color: var(--heather); }

/* plan B row, revealed by rain mode */
.planb {
  margin-top: 9px;
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 12px;
  font-size: 13.6px;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
  border-radius: 0 3px 3px 0;
}
.planb b { color: var(--accent); font-weight: 600; }
body:not(.rain) .planb { display: none; }
body.rain .slot:not(.nap) > div > h4,
body.rain .slot:not(.nap) > div > .detail { opacity: .55; }
body.rain .slot .planb { opacity: 1; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip {
  font-family: var(--f-data);
  font-size: 11.5px;
  line-height: 1.5;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--line-firm);
  color: var(--ink-2);
  background: var(--paper);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip.free    { color: var(--gorse);   border-color: var(--gorse);   background: var(--gorse-soft); font-weight: 500; }
.chip.paid    { color: var(--heather); border-color: var(--heather); background: var(--heather-soft); }
.chip.warn    { color: var(--bracken); border-color: var(--bracken); background: var(--bracken-soft); }
.chip.drive   { color: var(--accent);  border-color: var(--accent);  background: var(--accent-soft); }
.chip.indoor  { border-style: dashed; }

/* ---------- places table / directory ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}
.filters .lab {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-right: 4px;
}
.fbtn {
  font-family: var(--f-body);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--line-firm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.fbtn:hover { border-color: var(--ink-3); color: var(--ink); }
.fbtn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.place {
  border: 1px solid var(--line);
  border-left: 3px solid var(--p-accent, var(--ink-3));
  border-radius: 3px;
  background: var(--surface);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.place h4 { font-size: 1.02rem; }
.place .meta {
  font-family: var(--f-data);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.place p { font-size: 13.6px; color: var(--ink-2); margin: 0; }
.place .chips { margin-top: auto; padding-top: 4px; }
.place[hidden] { display: none; }
.empty { color: var(--ink-3); font-size: 14px; padding: 20px 0; }

/* ---------- money table ---------- */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; background: var(--surface-2);
  position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--f-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-firm); }
.rowlab { font-weight: 500; color: var(--ink); }
.rowlab small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.3px; }

/* ---------- generic panels ---------- */

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 16px 18px;
}
.panel h3 { font-size: 1.08rem; margin-bottom: 9px; }
.panel ul { margin: 0; padding-left: 17px; }
.panel li { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.panel li:last-child { margin-bottom: 0; }
.panel li b, .panel li strong { color: var(--ink); font-weight: 600; }
.panel .k { font-family: var(--f-data); font-size: 12.5px; color: var(--ink); }

.callout {
  border: 1px solid var(--bracken);
  background: var(--bracken-soft);
  border-radius: 4px;
  padding: 14px 16px;
}
.callout h3 { color: var(--bracken); font-size: 1.05rem; margin-bottom: 7px; }
.callout li, .callout p { color: var(--ink); }

.callout.good { border-color: var(--gorse); background: var(--gorse-soft); }
.callout.good h3 { color: var(--gorse); }

/* ---------- shared checklist ---------- */

.list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
}
.tick:last-child { border-bottom: 0; }
.tick input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; cursor: pointer; }
.tick.done span { text-decoration: line-through; color: var(--ink-3); }
.tick .who { font-family: var(--f-data); font-size: 10.5px; color: var(--ink-3); margin-left: auto; padding-left: 8px; white-space: nowrap; }
.sync {
  font-family: var(--f-data);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.sync.live .dot { background: var(--gorse); }

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

footer {
  border-top: 1px solid var(--line-firm);
  padding-block: 26px 40px;
  font-size: 12.5px;
  color: var(--ink-3);
}
footer p { max-width: 70ch; }
footer a { color: var(--ink-2); }



@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===================================================================
   Iconography, quick links, tide chart — added in the polish pass
   =================================================================== */

.ico {
  width: 1em; height: 1em; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.sec-head .eyebrow { display: flex; align-items: center; gap: 8px; }
.sec-head .eyebrow .ico { width: 15px; height: 15px; color: var(--accent); stroke-width: 1.75; }
.panel h3, .callout h3 { display: flex; align-items: center; gap: 8px; }
.panel h3 .ico, .callout h3 .ico { width: 15px; height: 15px; }
.panel h3 .ico { color: var(--accent); }
.callout h3 .ico { color: var(--bracken); }
.callout.good h3 .ico { color: var(--gorse); }

/* ---------- quick links ---------- */

.qgroup + .qgroup { margin-top: 20px; }
.qgroup h3 {
  font-family: var(--f-body);
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.qgroup h3 .ico { width: 14px; height: 14px; color: var(--ink-3); }

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 9px; }
.q {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.q:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.q .ico { width: 19px; height: 19px; color: var(--accent); margin-top: 2px; }
.q b { display: block; font-size: 13.6px; font-weight: 600; line-height: 1.32; }
.q em {
  display: block; font-style: normal;
  font-family: var(--f-data); font-size: 11px;
  color: var(--ink-3); margin-top: 3px; letter-spacing: .01em;
}
.q.call .ico { color: var(--bracken); }
.q.call:hover { border-color: var(--bracken); }
.q.nav-to .ico { color: var(--gorse); }
.q.nav-to:hover { border-color: var(--gorse); }

/* ---------- animated weather glyphs ---------- */

.wx-day { position: relative; }
.wx-ic {
  width: 36px; height: 36px;
  stroke: var(--wx-accent, var(--ink-3));
  fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 2px;
}
.wx-ic .sun-core { fill: var(--wx-accent, var(--ink-3)); fill-opacity: .16; }
.wx-ic .cloud-fill { fill: var(--wx-accent, var(--ink-3)); fill-opacity: .10; }

@keyframes fall { 0% { transform: translateY(-2.5px); opacity: 0 } 22% { opacity: .95 } 100% { transform: translateY(8px); opacity: 0 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes drift { 0%,100% { transform: translateX(0) } 50% { transform: translateX(2.2px) } }
@keyframes gust { 0% { stroke-dashoffset: 26; opacity: 0 } 30% { opacity: 1 } 100% { stroke-dashoffset: -26; opacity: 0 } }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-1.6px) } }

.wx-ic .drop { animation: fall 1.6s linear infinite; }
.wx-ic .drop:nth-of-type(2) { animation-delay: .45s }
.wx-ic .drop:nth-of-type(3) { animation-delay: .9s }
.wx-ic .rays { transform-origin: 50% 50%; animation: spin 26s linear infinite; }
.wx-ic .cloud { animation: drift 7s ease-in-out infinite; }
.wx-ic .gust { stroke-dasharray: 26; animation: gust 3.1s ease-in-out infinite; }
.wx-ic .gust:nth-of-type(2) { animation-delay: .55s }
.wx-ic .wave { animation: bob 3.6s ease-in-out infinite; }
.wx-ic .wave:nth-of-type(2) { animation-delay: .5s }

/* day cards carry the day's weather colour as a rail */
.day { border-left: 3px solid var(--d-accent, var(--line-firm)); }
.day-head h3 { display: flex; align-items: center; gap: 9px; }
.day-head h3 .ico { width: 17px; height: 17px; color: var(--d-accent, var(--ink-3)); stroke-width: 1.8; }

.place { transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.place:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.slot h4 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.slot h4 .ico { width: 15px; height: 15px; color: var(--ink-3); align-self: center; }

/* ---------- Friday tide chart ---------- */

.tide {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 16px 18px 12px;
  margin-top: 16px;
}
.tide h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.tide h3 .ico { width: 16px; height: 16px; color: var(--gorse); }
.tide .sub { font-size: 13.5px; color: var(--ink-2); margin: 6px 0 10px; max-width: 74ch; }
.tide-wrap { overflow-x: auto; }
.tide-wrap svg { display: block; width: 100%; min-width: 560px; height: auto; }
.tide .plan-br { stroke: var(--ink-2); stroke-width: 1.2; }
.tide .grid-l { stroke: var(--line); stroke-width: 1; }
.tide .curve { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tide .sea { fill: var(--accent); fill-opacity: .13; }
.tide .band { fill: var(--gorse); fill-opacity: .16; }
.tide .band-edge { stroke: var(--gorse); stroke-width: 1; stroke-dasharray: 3 3; }
.tide .lab { font-family: var(--f-data); font-size: 10.5px; fill: var(--ink-3); }
.tide .lab-key { font-family: var(--f-data); font-size: 11px; fill: var(--ink); font-weight: 500; }
.tide .lab-gorse { font-family: var(--f-data); font-size: 11px; fill: var(--gorse); font-weight: 500; }
.tide .mark { fill: var(--accent); }
.tide .now { fill: var(--gorse); stroke: var(--surface); stroke-width: 2; }
@keyframes pulse { 0%,100% { r: 5; opacity: 1 } 50% { r: 7.5; opacity: .55 } }
.tide .halo { fill: var(--gorse); animation: pulse 2.6s ease-in-out infinite; }
.tide-key { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .wx-ic .drop, .wx-ic .rays, .wx-ic .cloud, .wx-ic .gust, .wx-ic .wave, .tide .halo { animation: none !important; }
  .wx-ic .drop { opacity: .9 }
  .tide .halo { opacity: .45 }
  .q:hover, .place:hover { transform: none; }
}

/* ---------- directions origin control ---------- */

.origin {
  border: 1px solid var(--line-firm);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.origin-lab {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3);
}
.origin-lab .ico { width: 14px; height: 14px; color: var(--accent); }
.origin-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.obtn {
  font-family: var(--f-body);
  font-size: 13px; font-weight: 500;
  padding: 6px 13px;
  border-radius: 100px;
  border: 1px solid var(--line-firm);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.obtn:hover { border-color: var(--accent); color: var(--ink); }
.obtn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--paper); font-weight: 600;
}
:root[data-theme="dark"] .obtn[aria-pressed="true"] { color: #0F1516; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .obtn[aria-pressed="true"] { color: #0F1516; }
}
.origin-note {
  flex: 1 1 100%;
  font-size: 13.2px; color: var(--ink-2); margin: 0;
  max-width: 80ch;
}
.origin-note .k { font-family: var(--f-data); font-size: 11.5px; color: var(--ink-3); }

/* postcode line + directions link on a place card */
.place .meta.pc {
  display: flex; align-items: flex-start; gap: 6px;
  color: var(--ink-2); line-height: 1.45;
}
.place .meta.pc .ico { width: 12px; height: 12px; margin-top: 2px; color: var(--ink-3); }
.place .dir {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  margin-top: 9px;
  font-family: var(--f-body);
  font-size: 12.5px; font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--line-firm);
  border-radius: 100px;
  padding: 4px 11px;
}
.place .dir .ico { width: 13px; height: 13px; }
.place .dir:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- tap-to-copy codes ---------- */

.copy {
  font-family: var(--f-data);
  font-size: .92em;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  margin: 0 1px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.copy::after {
  content: "";
  display: inline-block;
  width: .72em; height: .72em;
  margin-left: .42em;
  vertical-align: -.02em;
  border: 1px solid currentColor;
  border-radius: 1.5px;
  box-shadow: 1.5px -1.5px 0 -.5px var(--surface-2), 2.5px -2.5px 0 -1px currentColor;
  opacity: .5;
}
.copy:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.copy:hover::after { opacity: .85; box-shadow: 1.5px -1.5px 0 -.5px var(--accent-soft), 2.5px -2.5px 0 -1px currentColor; }

.copy.ok, .copy.fail {
  background: var(--gorse-soft);
  border-color: var(--gorse);
  color: var(--gorse);
}
.copy.fail { background: var(--bracken-soft); border-color: var(--bracken); color: var(--bracken); }
.copy.ok::after, .copy.fail::after { display: none; }
.copy.ok::before, .copy.fail::before {
  content: "Copied";
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
.copy.fail::before { content: "Press ⌘C"; }

/* inside the dark masthead stamp the code chips need their own ground */
.stamp .copy { background: var(--surface); }
.chip .copy, .chips .copy { border: 0; background: none; padding: 1px 2px; margin: 0; }

/* ---------- progressive disclosure ---------- */

details.more {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}
details.more > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0 1px;
  font-family: var(--f-body);
  font-size: 12.4px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--accent);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: "";
  width: 6px; height: 6px; flex: none;
  margin: -2px 1px 0;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
}
details.more[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
details.more > summary:hover { color: var(--ink); }
details.more > summary:hover::before { border-color: currentColor; }

.more-body {
  padding: 9px 0 3px;
  font-size: 13.6px;
  line-height: 1.6;
  color: var(--ink-2);
}
.more-body p { margin: 0 0 .65em; }
.more-body p:last-child { margin-bottom: 0; }
.more-body ul { margin: .45em 0 .7em; padding-left: 18px; }
.more-body li { margin-bottom: 5px; }
.more-body li:last-child { margin-bottom: 0; }
.more-body b, .more-body strong { color: var(--ink); font-weight: 600; }
.more-body .chips { margin-top: 9px; }

/* section-level expander sits under the lede */
.sec-head details.more { max-width: 78ch; border-top-color: var(--line-firm); }
.panel details.more, .callout details.more { margin-top: 12px; }
.callout details.more > summary { color: var(--bracken); }
.callout.good details.more > summary { color: var(--gorse); }

/* ===================================================================
   Mobile. Written for a phone held one-handed in a car park, not for
   a shrunk desktop: bigger tap targets, no sideways scroll, and the
   numbers you need still lined up.
   =================================================================== */

/* nothing may push the page sideways */
html, body { max-width: 100%; overflow-x: hidden; }
body { overflow-wrap: break-word; }

@media (max-width: 900px) {
  .wx { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 720px) {
  .wrap { padding-inline: 16px; }
  section { padding-block: 32px; }
  .masthead .wrap { padding-block: 24px 20px; }

  .mast-top { gap: 14px; }
  .masthead h1 { font-size: clamp(1.95rem, 8.5vw, 2.6rem); }
  .stamp {
    white-space: normal;       /* nowrap overflowed at phone width */
    width: 100%;
    line-height: 1.75;
  }

  .facts { margin-top: 18px; grid-template-columns: repeat(2, 1fr); }
  .fact { border-right: 0; border-bottom: 1px solid var(--line); padding: 11px 12px 11px 0; }
  .fact:nth-last-child(-n+1) { border-bottom: 0; }

  /* the rain toggle must stay reachable in the scrolling nav */
  .nav .wrap { gap: 2px; }
  .nav .spacer { flex: 0 0 10px; min-width: 10px; }
  .nav a { padding: 8px 10px; }

  .sec-head h2 { font-size: clamp(1.35rem, 5.6vw, 1.7rem); }
  .sec-head .lede { font-size: 14.5px; }

  .wx { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .wx-day { padding: 11px 12px 12px; }
  .wx-ic { width: 30px; height: 30px; }
  .wx-day .t { font-size: 1.4rem; }

  .day-head { padding: 13px 14px; gap: 5px 10px; }
  .day-head h3 { font-size: 1.18rem; }
  .day-head .theme { flex-basis: 100%; font-size: 13px; }

  .slot { grid-template-columns: 1fr; gap: 5px; padding: 14px; }
  .slot .when {
    display: inline-flex; gap: 7px; align-items: baseline;
    padding-top: 0; font-size: 11.5px;
    letter-spacing: .04em; text-transform: uppercase;
  }
  .slot .when b { display: inline; font-size: 13px; letter-spacing: 0; text-transform: none; }
  .slot h4 { font-size: 1rem; }
  .slot h4 .pin { margin-left: 0; flex-basis: 100%; }

  .panel, .callout { padding: 14px 15px; }
  .cols, .list-grid, .places, .qgrid { gap: 10px; }

  .tablewrap { border-radius: 3px; }
  th, td { padding: 9px 11px; font-size: 13.5px; }

  .tide { padding: 14px 14px 10px; }
  .tide .sub { font-size: 13px; }

  footer { padding-block: 22px 32px; }
}

@media (max-width: 460px) {
  /* one column reads better than two cramped ones */
  .wx { grid-template-columns: 1fr; }
  /* facts stay two-up: five stacked rows pushed the page off the first screen */
  .facts { grid-template-columns: repeat(2, 1fr); column-gap: 12px; }
  .fact { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .fact dt { font-size: 10px; letter-spacing: .1em; }
  .fact dd { font-size: 13px; }
  .fact dd small { font-size: 11.5px; }
  .fact:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .origin { padding: 12px 13px; }
  .origin-btns { width: 100%; }
  .obtn { flex: 1 1 auto; text-align: center; }
  .day-head .cost { order: -1; }
}

/* Touch: fingers are not cursors. Applies to any coarse pointer at any width. */
@media (pointer: coarse) {
  .nav a { padding: 9px 12px; }
  .fbtn, .obtn { padding: 9px 15px; font-size: 13.5px; }
  .rain-toggle { padding: 8px 13px; }
  .q { padding: 14px 14px; }
  .place .dir { padding: 8px 14px; font-size: 13px; }
  .tick { padding: 11px 2px; }
  .tick input { width: 20px; height: 20px; margin-top: 1px; }

  /* an inline code chip still has to be hittable without wrecking the line */
  .copy { padding: 5px 9px; }
  .chip .copy, .chips .copy { padding: 4px 3px; }

  /* the disclosure arrow is the most-tapped control on the page */
  details.more > summary { padding: 13px 0 7px; font-size: 13px; }
  details.more > summary::before { width: 7px; height: 7px; }
}

/* wide, data-dense things scroll inside their own box — never the page */
.tide-wrap, .tablewrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tide-wrap svg { min-width: 520px; }

/* ---------- shared expense ledger ---------- */

.ledger-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  border: 1px solid var(--line);
  border-top: 3px solid var(--s-accent, var(--ink-3));
  border-radius: 3px;
  background: var(--surface);
  padding: 12px 14px;
}
.stat dt {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 4px;
}
.stat dd {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.5rem; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--s-accent, var(--ink));
}
.stat dd small {
  display: block; margin-top: 3px;
  font-family: var(--f-body); font-size: 12px; font-weight: 400; color: var(--ink-2);
}
.budget-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.budget-bar i { display: block; height: 100%; background: var(--s-accent, var(--accent)); transition: width .3s ease; }

.xform {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  border: 1px solid var(--line-firm);
  border-left: 3px solid var(--gorse);
  border-radius: 4px;
  background: var(--surface);
  padding: 14px 15px;
  margin-bottom: 16px;
}
.xform .row2 { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.xform label { display: block; }
.xform .flab {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 4px;
}
.xform input, .xform select {
  width: 100%;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-firm);
  border-radius: 3px;
  padding: 9px 10px;
  -webkit-appearance: none; appearance: none;
}
.xform input#x-amount { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.xform select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.xform input:focus, .xform select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.xadd {
  grid-column: 1 / -1;
  font-family: var(--f-body); font-size: 14.5px; font-weight: 600;
  padding: 11px 18px;
  border: 0; border-radius: 3px;
  background: var(--accent); color: var(--paper);
  cursor: pointer;
}
:root[data-theme="dark"] .xadd { color: #0F1516; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xadd { color: #0F1516; } }
.xadd:hover { filter: brightness(1.08); }
.xadd:disabled { opacity: .5; cursor: default; }

.xlist { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow: hidden; }
.xday {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3);
}
.xday span { font-family: var(--f-data); letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--ink); }
.xrow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.xrow:last-child { border-bottom: 0; }
.xrow .xwhat { font-size: 14.5px; color: var(--ink); }
.xrow .xmeta { grid-column: 1; font-family: var(--f-data); font-size: 11px; color: var(--ink-3); }
.xrow .xamt {
  grid-row: 1 / 3; grid-column: 2;
  font-family: var(--f-data); font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.xdel {
  grid-row: 1 / 3; grid-column: 3;
  border: 1px solid var(--line); border-radius: 3px; background: none;
  color: var(--ink-3); cursor: pointer;
  width: 30px; height: 30px; line-height: 1; font-size: 15px;
}
.xdel:hover { border-color: var(--bracken); color: var(--bracken); background: var(--bracken-soft); }

.settle { margin-top: 16px; }
.settle li { margin-bottom: 7px; }
.settle .owe { font-family: var(--f-data); font-size: 13px; }
.xstatus {
  font-family: var(--f-data); font-size: 11.5px; color: var(--ink-3);
  margin-top: 10px; display: flex; align-items: center; gap: 6px;
}
.xstatus .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.xstatus.live .dot { background: var(--gorse); }
.xstatus.err .dot { background: var(--bracken); }
.xempty { padding: 18px 14px; color: var(--ink-3); font-size: 14px; }

@media (max-width: 720px) {
  .xform { grid-template-columns: 1fr 1fr; padding: 13px; }
  .ledger-top { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat dd { font-size: 1.3rem; }
}
@media (pointer: coarse) {
  .xform input, .xform select { padding: 12px 10px; font-size: 16px; }  /* 16px stops iOS zooming on focus */
  .xadd { padding: 14px 18px; }
  .xdel { width: 38px; height: 38px; }
}

/* ---------- floating dock ---------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 100px;
  border: 1px solid var(--line-firm);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 6px rgba(27, 36, 34, .1), 0 12px 32px -12px rgba(27, 36, 34, .4);
  max-width: calc(100vw - 24px);
}
:root[data-theme="dark"] .dock { box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 14px 34px -12px rgba(0,0,0,.8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dock { box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 14px 34px -12px rgba(0,0,0,.8); }
}

.dock a, .dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 60px;
  padding: 8px 10px 7px;
  border: 0;
  border-radius: 100px;
  background: none;
  font-family: var(--f-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dock .ico { width: 18px; height: 18px; stroke-width: 1.7; }
.dock a:hover, .dock button:hover { color: var(--ink); background: var(--surface-2); }
.dock a.on { color: var(--accent); background: var(--accent-soft); }
.dock button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* the dock floats over the page, so give the page room to end above it */
body { padding-bottom: 86px; }

@media (max-width: 420px) {
  .dock { gap: 0; padding: 4px; }
  .dock a, .dock button { min-width: 0; flex: 1 1 0; padding: 8px 6px 7px; font-size: 10px; }
}

/* on a wide screen the sticky top nav already does this job */
@media (min-width: 860px) {
  .dock { display: none; }
  body { padding-bottom: 0; }
}

/* ledger actions: status, undo, export */
.xactions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 10px;
}
.xactions .xstatus { margin-top: 0; flex: 1 1 auto; cursor: pointer; }
.xbtn {
  font-family: var(--f-body); font-size: 12.5px; font-weight: 500;
  padding: 6px 13px; border-radius: 100px;
  border: 1px solid var(--line-firm); background: var(--surface);
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.xbtn:hover { border-color: var(--accent); color: var(--accent); }
#xundo { border-color: var(--bracken); color: var(--bracken); background: var(--bracken-soft); font-weight: 600; }
.more-body code {
  font-family: var(--f-data); font-size: .9em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 5px;
}
@media (pointer: coarse) { .xbtn { padding: 9px 15px; font-size: 13.5px; } }
.budget-edit { margin-top: 9px; font-size: 11.5px; padding: 4px 10px; }
@media (pointer: coarse) { .budget-edit { padding: 7px 12px; font-size: 12.5px; } }

/* ---------- receipts ---------- */

.xreceipt { align-items: center; }
.xfile {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px;
  border: 1px dashed var(--line-firm);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  text-align: center;
}
.xfile:hover { border-color: var(--accent); color: var(--accent); border-style: solid; }
.xfile .ico { width: 16px; height: 16px; flex: none; }

.xthumb { position: relative; justify-self: start; }
.xthumb img {
  width: 76px; height: 76px; object-fit: cover;
  border-radius: 3px; border: 1px solid var(--line-firm); display: block;
}
.xthumb button {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; line-height: 1; font-size: 15px;
  border-radius: 50%; border: 1px solid var(--line-firm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.xthumb button:hover { border-color: var(--bracken); color: var(--bracken); }

.xshot {
  grid-row: 1 / 3; grid-column: 2;
  padding: 0; border: 1px solid var(--line-firm); border-radius: 3px;
  background: none; cursor: pointer; line-height: 0;
}
.xshot img { width: 42px; height: 42px; object-fit: cover; border-radius: 2px; display: block; }
.xshot:hover { border-color: var(--accent); }
.xrow.has-shot { grid-template-columns: 1fr auto auto auto; }
.xrow.has-shot .xamt { grid-column: 3; }
.xrow.has-shot .xdel { grid-column: 4; }

.rview {
  border: 1px solid var(--line-firm);
  border-radius: 5px;
  background: var(--surface);
  padding: 12px;
  max-width: min(94vw, 720px);
  max-height: 92vh;
  color: var(--ink);
}
.rview::backdrop { background: rgba(10, 14, 13, .72); backdrop-filter: blur(3px); }
.rview img { display: block; max-width: 100%; max-height: 78vh; border-radius: 3px; margin-bottom: 10px; }
.rview form { text-align: right; }

@media (max-width: 720px) {
  .xshot img { width: 38px; height: 38px; }
}
