/* Everywhen — subpages (world clock, meeting planner, credits, privacy).
   Colours, fonts, radii and glows come from the main map's theme tokens in /css/ui.css (CYBER / MONO / 8-BIT),
   mapped here to the short names the subpages use. */
body {
  --bg: var(--bg-color);
  --card: var(--card-bg);
  --border: var(--card-border);
  --accent-2: var(--accent-secondary);
  --amber: var(--amber-gold);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --font: var(--font-mono);
  --radius: var(--border-radius);
  --line: rgba(255, 255, 255, 0.08);
}
body[data-theme="mono"] { --font: var(--font-sans); }
body[data-theme="retro"] { --line: rgba(255, 255, 255, 0.18); }

* { box-sizing: border-box; }

/* Always reserve the scrollbar track, so pages with and without a scrollbar line up exactly */
html { background-color: #03070d; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* One content width for every subpage, so the header and body line up from page to page */
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(40px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Shared header: same parts as the main map (brand pill, action buttons, settings panel) ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  position: relative;
  z-index: 300; /* settings panel and search lists open above every card below */
}
.site-header .brand-section { color: var(--text); text-decoration: none; }
.site-header .brand-section:hover { border-color: var(--accent); text-decoration: none; }
.site-search { position: relative; flex: 1 1 260px; max-width: 360px; margin: 0 auto; }
.site-nav { display: flex; gap: 8px; }
.site-header .top-action-btn { text-decoration: none; }
.site-settings-wrap { position: relative; }
/* Phone and tablet: one row, ☰ · brand · search (the sections and settings are in the ☰ drawer, /css/ui.css) */
@media (max-width: 900px) {
  .site-header { margin-bottom: 18px; }
  .site-nav { display: none; }
  .site-settings-wrap { order: -1; position: static; }
  .site-search { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; }
}
@media (max-width: 480px) {
  .site-header .brand-section { padding: 0 12px; }
  .site-header .brand-title { display: none; }
}
body[data-theme="retro"] .site-header .brand-title,
body[data-theme="retro"] .site-header .top-action-btn { font-family: var(--font-pixel); }
/* the settings panel takes its fonts from /css/ui.css, same as on the map */
body[data-theme="retro"] .site-header .settings-dropdown { font-family: var(--hud-font); }

.breadcrumb { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.breadcrumb a { color: var(--muted); }

h1 {
  font-size: var(--fs-h1);
  margin: 0 0 18px;
  line-height: 1.25;
}
h2 { font-size: var(--fs-h2); margin: var(--space-section) 0 12px; }
body[data-theme="retro"] :is(h1, h2, .clock) { font-family: var(--font-pixel); }
body[data-theme="retro"] h1 { font-size: 18px; line-height: 1.6; }
body[data-theme="retro"] h2 { font-size: 12px; line-height: 1.7; }

/* ---------- Clock card (same surface as the map's city panel) ---------- */
.clock-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), var(--card-border-glow);
}
.clock {
  font-size: clamp(46px, 14vw, 84px);
  font-weight: 900;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px var(--accent-glow);
  line-height: 1.05;
}
body[data-theme="mono"] .clock { text-shadow: none; }
body[data-theme="retro"] .clock { font-size: clamp(28px, 8vw, 48px); text-shadow: none; }
.date { color: var(--muted); margin: 6px 0 14px; font-size: 15px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 4px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.badge.dst { border-color: var(--amber); color: var(--amber); }
.badge.diff { border-color: var(--accent-2); color: var(--accent-2); }

.sun {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.sun div {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  padding: 10px 12px;
}
.sun span { display: block; font-size: 12px; color: var(--muted); }
.sun strong { font-size: 20px; }

/* ---------- Actions: primary = accent fill (like the active theme button), secondary = outline ---------- */
.cta {
  display: block;
  margin: 22px 0 8px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--bg-color);
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}
.cta:hover { text-decoration: none; filter: brightness(1.08); }
.cta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 28px; }
.cta-row .cta { margin: 0; display: flex; align-items: center; justify-content: center; }
.cta-alt { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.cta-alt:hover { background: rgba(255, 255, 255, 0.05); }
@media (max-width: 560px) { .cta-row { grid-template-columns: 1fr; } }
.cta-sub { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 28px; }
body[data-theme="retro"] .cta { font-family: var(--font-pixel); font-size: 11px; line-height: 1.7; box-shadow: 4px 4px 0 var(--accent-secondary); }
body[data-theme="retro"] .cta-alt { box-shadow: none; }

.about { color: var(--text); opacity: 0.86; }

table.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.diff-table th, .diff-table td {
  text-align: start;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.diff-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.diff-table td:last-child { text-align: end; color: var(--accent-2); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 6px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Page heading: title + one muted line (same on every subpage) ---------- */
.page-head { margin: 4px 0 var(--space-head); }
.page-head h1 { margin: 0 0 6px; }
.page-sub { margin: 0; color: var(--muted); font-size: var(--fs-sub); }

/* ---------- World clock index ---------- */
/* "Your time zone": small label over a large "City  time" line; date, offset and source beside it; location button on the right */
.your-zone {
  display: flex; align-items: center; gap: 28px;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 14px 16px 14px 20px; margin: 0 0 22px; box-shadow: 0 0 18px var(--accent-glow);
}
.your-zone[hidden] { display: none; }
.yz-main { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.yz-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.yz-line { display: flex; align-items: baseline; gap: 14px; }
.yz-city { font-size: 26px; font-weight: 800; line-height: 1.2; }
.your-zone .yz-time, .diff-base .yz-time { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--accent); }
.yz-info { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-inline-start: 24px; border-inline-start: 1px solid var(--line); }
.yz-date { font-size: 16px; font-weight: 600; color: var(--text); }
.yz-source { font-size: 12.5px; color: var(--muted); }
.locate-btn { flex: none; }
.locate-btn[disabled] { opacity: .6; cursor: progress; }
.locate-btn[hidden] { display: none; }
body[data-theme="retro"] .yz-time, body[data-theme="retro"] .yz-city { font-family: var(--font-pixel); font-size: 16px; }

/* Continent sections: a clear heading band between them */
.zone-tools { margin: 0 0 30px; }
.region { margin: 0 0 44px; }
.region[hidden] { display: none; }
.region h2 {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; padding: 0 0 10px;
  font-size: 26px; font-weight: 800; letter-spacing: .01em; border-bottom: 2px solid var(--accent);
}
.region-count { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
body[data-theme="retro"] .region h2 { font-size: 15px; }
/* Masonry columns: countries with many cities do not leave holes in the row */
.country-grid { columns: 4 210px; column-gap: 12px; }
.country-group {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  break-inside: avoid; margin: 0 0 12px;
}
.country-group h3 { font-size: 13px; font-weight: 800; color: var(--text); margin: 0 0 8px; }
.country-group .cc { color: var(--muted); font-weight: 600; }
.city-times { list-style: none; margin: 0; padding: 0; }
.city-times a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 5px 0; color: var(--accent-2); font-size: 14px;
}
.city-times li + li a { border-top: 1px solid var(--line); }
.city-times a:hover { color: var(--accent); text-decoration: none; }
.ct-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
body[data-theme="retro"] .yz-time, body[data-theme="retro"] .yz-city { font-family: var(--font-pixel); font-size: 14px; }

footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
footer a { color: var(--muted); }

/* ---------- Favorites: star on every city (list rows, city page) and summary cards on the world clock page ---------- */
.fav-btn {
  flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--muted); border-radius: calc(var(--radius) - 2px);
}
.fav-btn:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }
.fav-btn.on { color: var(--amber); }
.city-times li { display: flex; align-items: center; gap: 4px; }
.city-times li a { flex: 1; min-width: 0; }
.ct-name { min-width: 0; overflow-wrap: anywhere; } /* a long single-word name ("Marquesaseilanden") wraps instead of pushing the time out */
.city-times li + li { border-top: 1px solid var(--line); }
.city-times li + li a { border-top: 0; }
.city-times .fav-btn { width: 24px; height: 24px; font-size: 15px; opacity: .45; }
.city-times li:hover .fav-btn, .city-times .fav-btn.on { opacity: 1; }
.city-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.city-title h1 { margin: 0; }
.city-title .fav-btn { width: 36px; height: 36px; font-size: 24px; }

.favorites { margin: 0 0 30px; }
.favorites[hidden] { display: none; }
.favorites h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fav-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.fav-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-name { font-size: 17px; font-weight: 800; color: var(--text); }
.fav-name:hover { color: var(--accent); text-decoration: none; }
.fav-country { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.fav-time { display: flex; align-items: flex-end; gap: 8px; color: var(--accent); }
.fav-time .badge { font-size: 10.5px; padding: 2px 7px; margin-bottom: 5px; }
.fav-time .badge[hidden] { display: none; }
.fav-time:hover { text-decoration: none; }
.fav-card .fav-clock { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.fav-date { font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.fav-card .badges { gap: 6px; }
.fav-card .badges .badge { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
.fav-sun { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fav-sun div { border: 1px solid var(--line); border-radius: calc(var(--radius) - 2px); padding: 6px 9px; }
.fav-sun span { display: block; font-size: 11px; color: var(--muted); }
.fav-sun strong { font-size: 14px; }
body[data-theme="retro"] .fav-card .fav-clock { font-family: var(--font-pixel); font-size: 20px; }
.fav-empty { margin: 0; padding: 16px 18px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 13.5px; }
.fav-empty[hidden] { display: none; }

/* ---------- City page ---------- */
.city-head .city-title { margin: 0 0 6px; }
.city-clock { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.cc-side { display: flex; flex-direction: column; gap: 14px; padding-inline-start: 28px; border-inline-start: 1px solid var(--line); }
.cc-side .sun { grid-template-columns: 1fr 1fr 1fr; margin-top: 0; }
.city-clock .date { margin-bottom: 0; }
.cc { color: var(--muted); }
.fact-list { list-style: none; margin: 0; padding: 0; }
.fact-list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact-list li[hidden] { display: none; }
.fact-list strong { display: inline-block; min-width: 230px; margin-inline-end: 12px; font-variant-numeric: tabular-nums; }
.local-name { color: var(--muted); margin-inline-start: 6px; }
.note { font-size: var(--fs-note); color: var(--muted); margin: 8px 0 0; }
.sun-table td:not(:first-child), .sun-table th:not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; }
.sun-table td:last-child { color: var(--text); }

/* Toast: a short message in the middle of the screen */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96); z-index: 200;
  padding: 14px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--accent);
  color: var(--text); font-size: 14px; font-weight: 700; box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 18px var(--accent-glow);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast { width: max-content; max-width: min(440px, calc(100vw - 32px)); text-align: center; line-height: 1.5; } /* a long notice wraps in a readable width */
.fact-none { color: var(--muted); }

/* "vs all cities": one row per time difference, west to east */
.all-diff { border-top: 1px solid var(--line); }
.ad-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ad-label { font-size: 13px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.ad-row[data-d="0"] .ad-label { color: var(--accent); }
.ad-cities { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.ad-cities a { color: var(--text); }
.ad-cities a:hover { color: var(--accent); text-decoration: none; }

/* World clock tabs: "By continent" / "Time difference" (one page, two views) */
.clock-tabs { display: flex; gap: 6px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.clock-tab {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 10px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent;
}
.clock-tab:hover { color: var(--text); }
.clock-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
/* Base city: same card language as "Your time zone" */
.diff-base {
  display: flex; align-items: center; gap: 28px; margin: 0 0 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 14px 20px;
}
.diff-base .yz-info { flex: 1; }
.diff-pick { position: relative; width: 260px; flex: none; }
body[data-theme="retro"] .clock-tab { font-family: var(--font-pixel); font-size: 11px; }

/* Time difference tab: sub-headings, major cities table, planner link */
.sub-title { font-size: var(--fs-label); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.major-table td:nth-child(3), .major-table th:nth-child(3), .major-table th:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.major-table .ct-time { color: var(--text); font-size: 14px; }
.fav-mark { color: var(--amber); font-size: 12px; }
.ad-row[hidden], .ad-cities a[hidden] { display: none; }

/* Clock card: one line about the next daylight saving change */
.cc-note { margin: 0; font-size: 13px; color: var(--text); }
.cc-note[hidden] { display: none; }
.cc-note span { color: var(--muted); margin-inline-end: 4px; }

/* ---------- One view: base card actions, filter + sort on one line, row differences ---------- */
.list-tools { display: flex; align-items: center; gap: 16px; margin: 0 0 30px; }
.clock-tabs + .list-tools { margin-top: -8px; }
.list-tools .region-filter { flex: 1; }
.list-view[hidden] { display: none; }

/* Major cities heading with the "Show favorites" switch */
.sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sub-head .sub-title { margin-bottom: 10px; }
.switch-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.switch-label input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }

/* ---------- Base card: city name opens the city picker; small links; 24-hour day bar ---------- */
.your-zone { flex-direction: column; align-items: stretch; gap: 12px; }
body { --db-night: #0d1b2e; --db-twilight: color-mix(in srgb, var(--amber) 55%, var(--db-night)); --db-day: color-mix(in srgb, var(--accent) 55%, transparent); }
body[data-theme="mono"] { --db-night: #1b2230; --db-day: rgba(255, 255, 255, 0.55); }
body[data-theme="retro"] { --db-night: #2a2152; --db-day: var(--accent); }
.yz-top { display: flex; align-items: center; gap: 28px; }
.yz-top .yz-info { flex: 1; }
.link-btn { font: inherit; font-size: 12.5px; color: var(--accent-2); background: none; border: 0; padding: 0; margin-inline-start: 12px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }
.link-btn[disabled] { opacity: .6; cursor: progress; }
.day-bar { padding: 2px 0 0; }
.db-track { position: relative; height: 10px; border-radius: 999px; background: var(--db-night); }
body[data-theme="retro"] .db-track { border-radius: 0; }
.db-now { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--text); box-shadow: 0 0 0 3px var(--card), 0 0 10px var(--accent-glow); }
.db-scale { position: relative; display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.db-mark { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; color: var(--text); }
.db-mark[hidden] { display: none; }

/* ---------- All cities: local time on each row, find box and its answer ---------- */
.ad-label { display: flex; flex-direction: column; gap: 1px; }
.ad-time { font-size: 12px; font-weight: 600; color: var(--muted); }
.ad-row { grid-template-columns: 170px 1fr; }
.find-pick { position: relative; width: 260px; }
.find-result {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
}
.find-result[hidden] { display: none; }
.fr-name { font-size: 18px; font-weight: 800; color: var(--text); }
.fr-country, .fr-time { font-size: 13px; color: var(--muted); }
.fr-time .ct-time { color: var(--text); font-weight: 700; font-size: 14px; }
.fr-diff { margin-inline-start: auto; font-size: 15px; font-weight: 800; color: var(--accent); }
.ad-cities a.hit { color: var(--bg-color); background: var(--accent); border-radius: 4px; padding: 0 5px; }

/* Base card actions: city search + location (button until allowed, then a quiet status) */
.yz-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.yz-actions .diff-pick { position: relative; width: 240px; }
.locate-btn.is-status { cursor: help; opacity: .45; }
.locate-btn.active { cursor: default; }
.locate-btn.is-status:hover { color: var(--muted); border-color: var(--line); box-shadow: none; }
.ad-cities a:focus { outline: none; }

/* base city name is a link to its page */
a.yz-city { color: var(--text); }
a.yz-city:hover { color: var(--accent); text-decoration: none; }

/* Base card: label on its own line, then everything else on one centred line */
.your-zone { gap: 8px; }
.your-zone > .yz-label { display: block; }
.yz-top { align-items: center; }
.yz-top .yz-line { align-items: center; }
.yz-top .yz-info { justify-content: center; }
.day-bar { margin-top: 6px; }

/* Base card line, read left to right by importance: time (largest) · city · date and UTC — no divider, one baseline */
.yz-top { align-items: baseline; gap: 16px; }
.yz-top .yz-line { align-items: baseline; gap: 12px; }
.yz-top .yz-city { font-size: 22px; }
.your-zone .yz-top .yz-time { font-size: 30px; }
.yz-top .yz-info { padding-inline-start: 0; border-inline-start: 0; justify-content: flex-start; }
.yz-top .yz-date { font-size: 15px; font-weight: 500; color: var(--muted); }
.yz-top .yz-actions { align-self: center; margin-inline-start: auto; }

/* City clock: same size in 12H and 24H — two-digit hours, AM/PM as a small tag that always keeps its slot */
.city-clock .clock { white-space: nowrap; font-size: clamp(46px, 7.2vw, 76px); }
.clock .ampm { display: inline-block; min-width: 2.2em; margin-inline-start: .25em; font-size: .3em; font-weight: 800; letter-spacing: .04em; color: var(--muted); text-shadow: none; vertical-align: .2em; }
body[data-theme="retro"] .clock .ampm { font-size: .35em; }

/* ---------- Phone (≤600px): everything stacks inside the screen; nothing pushes the page sideways ---------- */
@media (max-width: 600px) {
  .yz-top { flex-wrap: wrap; gap: 10px; }
  .yz-top .yz-line { flex-wrap: wrap; gap: 4px 12px; }
  .yz-top .yz-actions, .yz-actions { width: 100%; margin-inline-start: 0; }
  .yz-actions .diff-pick, .diff-pick, .find-pick { flex: 1 1 auto; width: auto; min-width: 0; }
  .diff-base { flex-wrap: wrap; gap: 12px; }
  .list-tools { flex-wrap: wrap; gap: 10px; }
  .list-tools .region-filter, .region-filter { flex: 1 1 100%; min-width: 0; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .region-filter::-webkit-scrollbar { display: none; }
  .region-filter .theme-btn { flex: none; }
  .city-clock { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cc-side { padding-inline-start: 0; border-inline-start: 0; padding-top: 14px; border-top: 1px solid var(--line); }
  .fact-list strong { display: block; min-width: 0; margin: 0 0 2px; }
  .ad-row { grid-template-columns: minmax(0, 1fr); }
  .major-table td:nth-child(2), .major-table th:nth-child(2) { display: none; } /* the country: the city links to its page */
  .diff-table td, .diff-table th { white-space: normal !important; overflow-wrap: anywhere; }
  .sun, .cc-side .sun { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sun span { overflow-wrap: anywhere; }
}

/* phones and tablets: a fixed page background and blur behind the header buttons repaint the whole screen on every scroll and drag */
@media (max-width: 900px) {
  body { background-attachment: scroll; }
  .site-header :is(.brand-section, .top-action-btn, .search-input-box) { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* phone: the base card is one line (city, time); the search and My location sit under it */
@media (max-width: 600px) {
  .yz-top { flex-wrap: wrap; align-items: center; gap: 10px; }
  .yz-top .yz-main { flex: 1 1 auto; min-width: 0; }
  .yz-top .yz-line { flex-wrap: nowrap; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
  .yz-top .yz-city { font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
  .your-zone .yz-top .yz-time { font-size: 22px; }
  .yz-top .yz-info { display: none; }
  /* favorites: one card at a time, swiped sideways */
  .fav-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; scrollbar-width: none; }
  .fav-grid::-webkit-scrollbar { display: none; }
  .fav-card { flex: 0 0 82%; scroll-snap-align: start; }
  .fav-card:only-child { flex-basis: 100%; }
}
/* phone: in Difference each time difference is one box, like the country boxes */
@media (max-width: 600px) {
  #diff-list .ad-row { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; }
  #diff-list .ad-row[hidden] { display: none; }
  .sub-head { align-items: center; margin: 22px 0 12px; }
  .sub-head .sub-title { margin: 0; }
  .all-diff { border-top: 0; } /* the boxes have their own borders */
  #diff-list .ad-cities { gap: 6px; } /* each city a small chip, so names never run together */
  #diff-list .ad-cities a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; line-height: 1.3; }
  #diff-list .ad-cities a[hidden] { display: none; }
  #diff-list .ad-cities a.hit { padding: 4px 9px; border-color: var(--accent); }
  body[data-theme="retro"] #diff-list .ad-cities a { border-radius: 0; }
  #diff-list .ad-label { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
  body[data-theme="retro"] #diff-list .ad-row { border-radius: 0; }
}

/* city page: hotels card (affiliate links) */
.stay-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 20px; margin: 0 0 28px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.stay-card h2 { margin: 0 0 4px; font-size: 17px; }
.stay-card p { margin: 0; }
.stay-text p { font-size: 13.5px; color: var(--muted); }
.stay-links { display: flex; gap: 10px; }
.stay-links .cta { margin: 0; min-width: 120px; display: flex; align-items: center; justify-content: center; }
.stay-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); opacity: .8; }
body[data-theme="retro"] .stay-card { border-radius: 0; }
@media (max-width: 600px) {
  .stay-card { grid-template-columns: 1fr; }
  .stay-links .cta { flex: 1 1 0; min-width: 0; }
}

/* W3 (after Europe) only with All: with a continent picked it would sit right under the filter */
body.region-picked .ad-w3 { display: none; }
