@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3eee4;
  --ink: #1c1712;
  --muted: #4e463d;
  --card: #fffaf3;
  --line: #e3d6c4;
  --accent: #8e2f24;
  --accent-ink: #fffaf3;
  --water: #1d4c57;
  --ok: #1d5c40;
  --warn: #7a3e12;
  --shadow: 0 10px 30px rgba(48, 28, 16, 0.06);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tab: 4.6rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #101417;
  --ink: #f6f1e7;
  --muted: #d2c8bb;
  --card: #1a2128;
  --line: #33404a;
  --accent: #f0b089;
  --accent-ink: #1a120c;
  --water: #9fd0d6;
  --ok: #8ddebe;
  --warn: #f0c08a;
  --shadow: none;
  color-scheme: dark;
}

html[data-city="london"] {
  --accent: #1c2c4a;
  --accent-ink: #f7f4ee;
  --water: #2d5a48;
}
html[data-theme="dark"][data-city="london"] {
  --accent: #d5deee;
  --accent-ink: #121820;
  --water: #b7d7c8;
}
html[data-city="brussels"],
html[data-city="bruges"] {
  --accent: #6a4324;
  --accent-ink: #fffaf3;
  --water: #3e5344;
}
html[data-theme="dark"][data-city="brussels"],
html[data-theme="dark"][data-city="bruges"] {
  --accent: #e6c7a2;
  --accent-ink: #1c140c;
  --water: #c5d7c4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  max-width: 100%;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--water); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 8px; }

.shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 12px 16px calc(var(--tab) + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.brand strong {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.icon-btn, .hit, .chip, .tabs a, select.field, .textlink {
  min-height: 44px;
  min-width: 44px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
}

.mast {
  margin: 8px 0 16px;
  border-top: 1px solid var(--ink);
}
html[data-city="london"] .mast { border-top: 4px double var(--ink); }
html[data-city="brussels"] .mast,
html[data-city="bruges"] .mast { border-top: 6px solid var(--accent); }
.hero {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #c8b8a4;
}
.caption, .fine {
  margin: 0;
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: 2rem; margin: 14px 0 6px; }
h2 { font-size: 1.15rem; }
.lede { margin: 0 0 12px; color: var(--muted); }

.clocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.clocks span, .pill {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.92rem;
}
.banner {
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.banner strong { font-family: var(--serif); }
.banner.warn { border-left-color: var(--warn); }
.banner p { margin: 6px 0 0; }

.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 0 10px;
  scroll-snap-type: x proximity;
}
.days button {
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 44px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}
.days button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.days small { display: block; color: inherit; opacity: 0.8; font-size: 0.75rem; }

.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
}
.plan .when {
  font-family: var(--serif);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  margin: 4px 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.hit, .textlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.hit.solid, button.solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.hit.preferred { box-shadow: inset 0 0 0 2px var(--water); }
button.hit { min-height: 44px; }

.notes { margin: 8px 0 0; padding-left: 1.1rem; }
.notes li { margin: 4px 0; }

.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.field {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 12px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}
.card-main {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}
.card .thumb, .fallback {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  background: #d9cbb8;
}
.fallback {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  color: var(--muted);
  border: 1px dashed var(--line);
}
.card h2 { font-size: 1.05rem; }
.card .meta, .meta { color: var(--muted); margin: 2px 0; font-size: 0.95rem; }
.card-actions, .actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-copy { min-width: 0; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.photo-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.photo-frame img { width: 100%; max-height: 420px; object-fit: cover; }
.opinion {
  border: 1px dashed var(--warn);
  border-radius: 12px;
  padding: 10px 12px;
}
.opinion strong { color: var(--warn); }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  border-radius: 12px;
  font-weight: 600;
}
.tabs a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.dialog-back {
  position: fixed;
  inset: 0;
  background: rgba(16, 12, 8, 0.46);
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.dialog {
  width: min(720px, 100%);
  max-height: min(92dvh, 920px);
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.dialog header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding-bottom: 8px;
}
.progress {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}
details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.pair { display: grid; gap: 10px; }
@media (min-width: 860px) {
  .pair { grid-template-columns: 1fr 1fr; }
  .results.grid { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-back { align-items: center; }
  .dialog { border-radius: 20px; max-height: 86dvh; }
  h1 { font-size: 2.4rem; }
}
.loading { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
