/* Wanderlog – map-centric layout (step 7b) */
/* Wanderlog – map-centric layout. Colours: a royal-blue header and royal blue as the main
   colour; the sidebar is bright white (light) or pitch black (dark). The theme follows the
   computer unless the person picks one with the switch in the header (data-theme on <html>). */
:root {
  --bar: #2449c9;          /* royal blue header, the same in both themes */
  --bar-ink: #ffffff;
  /* Microsoft's logo (Sign In with Microsoft), the same in both themes */
  --ms-red: #f25022;
  --ms-green: #7fba00;
  --ms-blue: #00a4ef;
  --ms-yellow: #ffb900;
  --sidebar: 400px;
  --tile-plain: linear-gradient(135deg, #2449c9, #0b1640 75%);
  --highlight: #8fb0ff;    /* route under the pointer */
  --ink: #0d1324;
  --muted: #5b6478;
  --line: #e2e6ef;
  --paper: #ffffff;
  --card: #ffffff;
  --field: #f4f6fb;
  --soft: #eef2ff;
  --accent: #2449c9;
  --link: #2449c9;
  --accent-ink: #ffffff;
  --danger: #c62828;
  --ok: #1b7f3b;
  --shadow: 0 1px 3px rgb(13 19 36 / 12%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink: #f3f5f9;
  --muted: #9ba3b4;
  --line: #24272e;
  --paper: #000000;
  --card: #0c0d10;
  --field: #15171c;
  --soft: #121a3a;
  --accent: #3a5fe0;
  --link: #91a8ff;
  --accent-ink: #ffffff;
  --danger: #ff8a8a;
  --ok: #7ddc9a;
  --shadow: 0 1px 3px rgb(0 0 0 / 60%);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f3f5f9;
  --muted: #9ba3b4;
  --line: #24272e;
  --paper: #000000;
  --card: #0c0d10;
  --field: #15171c;
  --soft: #121a3a;
  --accent: #3a5fe0;
  --link: #91a8ff;
  --accent-ink: #ffffff;
  --danger: #ff8a8a;
  --ok: #7ddc9a;
  --shadow: 0 1px 3px rgb(0 0 0 / 60%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header */
.topbar { flex: none; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--bar); color: var(--bar-ink); z-index: 3; box-shadow: 0 1px 0 rgb(0 0 0 / 12%); }
.topbar button, .topbar a.button { color: var(--bar-ink); background: transparent; border: 1px solid rgb(255 255 255 / 45%); }
.topbar button.primary { background: #ffffff; color: #2449c9; border-color: #ffffff; }
.topbar button:hover { background: rgb(255 255 255 / 14%); }
.topbar button.primary:hover { background: #e8edff; }
.topbar :focus-visible { outline-color: #ffffff; }
.theme-toggle { min-width: 36px; justify-content: center; font-size: 1.05rem; padding: 4px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bar-ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.status { font-size: 0.8rem; color: #ffd6d6; }
.account { position: relative; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgb(0 0 0 / 25%); padding: 6px; display: grid; z-index: 10; }
.dropdown a, .dropdown button { display: block; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--ink); text-decoration: none; border-radius: 6px; font: inherit; cursor: pointer; min-height: 0; }
.dropdown a:hover, .dropdown button:hover { background: var(--soft); }
.dropdown a, .dropdown button { color: var(--ink) !important; border: 0 !important; background: none; }

/* Layout: sidebar + map */
.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { width: var(--sidebar); flex: none; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.map-area { position: relative; flex: 1; min-width: 0; background: #03060f; }
.map { position: absolute; inset: 0; }
#panel { display: grid; gap: 14px; min-width: 0; }
#panel > *, .card, .fields, .fields label, .two > * { min-width: 0; }
.sidebar { overflow-x: hidden; }
/* Screen-reader-only labels (position: absolute) stay inside the scrolling sidebar; otherwise one far down the
   list (e.g. the Action column of the backups table) makes the whole page taller, so it scrolls past the map. */
.sidebar { position: relative; }
@media (max-width: 760px) {
  .layout { flex-direction: column-reverse; }
  .map-area { flex: none; height: 42vh; }
  .sidebar { width: auto; flex: 1; border-right: 0; border-top: 1px solid var(--line); }
}

/* Controls */
button, a.button, label.button {
  font: inherit; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.small, a.button.small, label.button.small { min-height: 30px; padding: 2px 10px; font-size: 0.85rem; }
button.link { border: 0; background: none; padding: 0; min-height: 24px; color: var(--link); }
button:hover, a.button:hover, label.button:hover { border-color: var(--accent); }
button.primary:hover, a.button.primary:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }
label.button { position: relative; }
label.button input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.button:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
input, select, textarea { min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); width: 100%; }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; min-height: 140px; }
.fields { display: grid; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { padding: 0 6px; font-size: 0.9rem; }
.fields label { display: grid; gap: 4px; font-size: 0.9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.footer { display: flex; justify-content: flex-end; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
h2 { margin: 0; font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
h3 { margin: 0; font-size: 1rem; }
.back { text-decoration: none; font-size: 0.95rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.notice { margin: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--ok); color: var(--ok); background: var(--card); }
.notice.error { border-color: var(--danger); color: var(--danger); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tiles: trips and steps as landscape photos */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tile { display: block; position: relative; border-radius: 14px; overflow: hidden; background: #0b1640; color: #fff; text-decoration: none; box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }
.tiles.trips { gap: 12px; }
.tile:hover, .tile:focus-visible { box-shadow: 0 0 0 3px var(--accent); outline: none; }
.tile-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b1640; }
.tile-plain { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0 20px; text-align: center; font-size: 1rem; color: rgb(255 255 255 / 80%); background: var(--tile-plain); }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 78%), rgb(0 0 0 / 0%) 58%); }
.tile-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; display: grid; gap: 6px; }
.tile-title { font-size: 1.3rem; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 3px rgb(0 0 0 / 50%); overflow-wrap: anywhere; }
.tile-stats { display: flex; gap: 18px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.95; }
.tile-stats b { display: block; font-size: 1rem; text-transform: none; letter-spacing: 0; }
.tile-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tile-badge.business { background: #0d1324; color: #ffffff; }
.tile-flags { font-size: 1rem; letter-spacing: 2px; }
.tile-badge { background: #ffffff; color: #2449c9; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.tile-credit { position: absolute; top: 8px; right: 10px; font-size: 0.7rem; color: rgb(255 255 255 / 88%); text-shadow: 0 1px 2px #000; }
.tile.step .tile-title { font-size: 1.1rem; }
.tile-number { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 50%; background: #2449c9; color: #ffffff; border: 2px solid #ffffff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.journey { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; margin: 0 0 0 26px; padding: 6px 0 6px 16px; border-left: 2px dashed var(--accent); min-height: 30px; }

/* Trip and step headers */
.hero { position: relative; border-radius: 14px; overflow: hidden; }
.hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.stats div { display: grid; }
.stats dt { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo { position: relative; border-radius: 8px; overflow: hidden; background: #0b1640; aspect-ratio: 1; }
.photo > button.open { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; min-height: 0; background: #0b1640; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; gap: 4px; justify-content: space-between; opacity: 0; transition: opacity 0.15s; }
.photo:hover .photo-tools, .photo:focus-within .photo-tools { opacity: 1; }
.photo-tools button { min-height: 26px; min-width: 26px; padding: 0 6px; font-size: 0.8rem; background: rgb(255 255 255 / 94%); color: #2449c9; border: 0; justify-content: center; }
.photo .select { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; }
.photo .badge { position: absolute; top: 6px; right: 6px; background: #2449c9; color: #ffffff; font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.photo .missing { display: grid; place-items: center; height: 100%; color: #cfe; font-size: 0.75rem; padding: 6px; text-align: center; }

/* Places */
.places { display: grid; gap: 12px; }
.place-group h4 { margin: 0 0 2px; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.place { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.place:last-child { border-bottom: 0; }
.place-name { font-weight: 600; overflow-wrap: anywhere; }
.place-tools { grid-row: span 3; display: flex; gap: 4px; align-items: start; }
.place-tools button { min-height: 28px; min-width: 28px; padding: 0 6px; justify-content: center; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.results li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: var(--field); border-radius: 8px; }
.results li.stacked { display: block; }
.search-row { flex-wrap: nowrap; }
.search-row input { flex: 1; }
.search-row button { flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choice-grid button { padding: 0; border-radius: 8px; overflow: hidden; min-height: 0; aspect-ratio: 16 / 10; border: 3px solid transparent; }
.choice-grid button[aria-pressed="true"] { border-color: var(--accent); }
.choice-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font-size: 0.85rem; min-height: 30px; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.chip-button { border: 0; background: none; min-height: 22px; min-width: 22px; padding: 0 4px; color: var(--muted); }
.kind-switch { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.kind-switch p { flex-basis: 100%; margin: 0; }
.inline-choice { display: inline-flex !important; align-items: center; gap: 6px; }
.flags-line { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: 0.9rem; }
.warning { color: var(--danger); font-weight: 600; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; }
.plan-day { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.plan-day:last-child { border-bottom: 0; }
.plan-date { font-weight: 700; display: grid; line-height: 1.2; }
.plan-date small { font-weight: 400; color: var(--muted); }
.plan-body { display: grid; gap: 2px; min-width: 0; }
.plan-item { overflow-wrap: anywhere; }
a.plan-item { text-decoration: none; font-weight: 600; }
.plan-item.gap { color: var(--danger); }
.plan-day.gap { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.suggestion { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.suggestion:last-child { border-bottom: 0; }

/* Map overlays */
.map-styles { position: absolute; top: 12px; right: 12px; display: flex; background: rgb(255 255 255 / 92%); border-radius: 10px; padding: 3px; gap: 2px; box-shadow: 0 2px 8px rgb(0 0 0 / 25%); }
.map-styles:empty { display: none; }
.map-styles button { border: 0; background: transparent; color: #0d1324; min-height: 30px; padding: 2px 10px; font-size: 0.85rem; }
.map-styles button[aria-pressed="true"] { background: #2449c9; color: #fff; }
.pick-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; background: #2449c9; color: #ffffff; padding: 8px 14px; border-radius: 10px; font-weight: 600; box-shadow: 0 2px 8px rgb(0 0 0 / 30%); }
/* No 'position' here: MapLibre places markers itself (position: absolute + transform). */
.map-marker { padding: 0; border: 3px solid #fff; border-radius: 50%; background: #2449c9; box-shadow: 0 2px 6px rgb(0 0 0 / 45%); cursor: pointer; min-height: 0; display: block; }
.map-marker img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.map-marker-trip { width: 54px; height: 54px; }
.map-marker-step { width: 40px; height: 40px; }
.map-marker-cluster { width: 48px; height: 48px; }
.map-marker:hover { box-shadow: 0 0 0 3px #8fb0ff, 0 2px 6px rgb(0 0 0 / 45%); }
.map-marker-badge, .map-marker-number { position: absolute; top: -7px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: #0d1324; color: #fff; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.map-marker-number { left: -9px; right: auto; background: #2449c9; color: #ffffff; }
.maplibregl-ctrl-attrib a { color: #0d1324; }
.maplibregl-ctrl-attrib a + a, .maplibregl-ctrl-attrib a + span { margin-left: 4px; }
.map-logo { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: block; line-height: 0; }
.map-logo img { display: block; width: 88px; height: 23px; }
/* MapLibre's zoom buttons in the dark theme */
:root[data-theme="dark"] .maplibregl-ctrl-group { background: #0c0d10; }
:root[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: #24272e; }
:root[data-theme="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .maplibregl-ctrl-group { background: #0c0d10; }
  :root:not([data-theme="light"]) .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
}

/* Photo viewer */
.viewer { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 94%); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.viewer figure { margin: 0; display: grid; gap: 8px; justify-items: center; max-height: 100vh; padding: 20px 0; }
.viewer img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 6px; }
.viewer figcaption { color: #e8eef1; text-align: center; padding: 0 8px; }
.viewer-nav, .viewer-close { background: rgb(255 255 255 / 12%); color: #fff; border: 0; font-size: 2rem; min-height: 48px; justify-content: center; margin: 0 8px; }
.viewer-close { position: absolute; top: 12px; right: 12px; font-size: 1.6rem; width: 44px; margin: 0; }
.viewer-delete { position: absolute; top: 12px; right: 68px; z-index: 2; min-height: 44px; margin: 0; background: rgb(20 20 20 / 82%); color: #ff8a80; border: 1px solid rgb(255 255 255 / 18%); }
.viewer-close { z-index: 2; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--card); color: var(--ink); max-width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
dialog h2 { margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Flights (step 9) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 2px; }
.tabs a { padding: 6px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.flight-list { list-style: none; margin: 0; padding: 0; display: grid; }
.flight-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; align-items: center; }
.flight-list li:last-child .flight-row { border-bottom: 0; }
.flight-row:hover { background: var(--soft); }
.flight-date { display: grid; font-weight: 700; line-height: 1.15; }
.flight-date small { font-weight: 400; color: var(--muted); }
.flight-main { display: grid; min-width: 0; }
.flight-side { display: grid; justify-items: end; gap: 2px; }
.status-badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.status-badge.delayed, .status-badge.cancelled, .status-badge.diverted { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.status-badge.arrived { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-badge.enroute, .status-badge.departed, .status-badge.boarding { background: var(--accent); color: #ffffff; }
.delay { color: var(--danger); font-weight: 700; margin: 0; }
.filters { gap: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 1px; box-shadow: var(--shadow); min-width: 0; }
.stat b { font-size: 1.15rem; overflow-wrap: anywhere; }
.stat span { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.stat small { color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.top-list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.top-list h4, .card h4 { margin: 0 0 6px; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.top-list ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 0.85rem; }
.top-list li { display: flex; justify-content: space-between; gap: 6px; }
.top-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.year-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.year-bar { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; min-width: 0; }
.year-bar .bar { align-self: end; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.year-bar small { color: var(--muted); font-size: 0.7rem; }
.airport-box { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: var(--field); min-width: 0; }
.airport-box > b { font-size: 1.4rem; }
.time-row { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 4px 0 0; font-size: 0.9rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.events { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.events li { display: grid; gap: 1px; padding-left: 10px; border-left: 3px solid var(--accent); }
.journey-flight { font-weight: 600; text-decoration: none; display: block; }
.lookup { background: var(--soft); box-shadow: none; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: 1fr 1fr; } }

/* Notifications (step 10) */
.bell { position: relative; text-decoration: none; font-size: 1.05rem; padding: 4px 6px; border-radius: 8px; line-height: 1; }
.bell:hover, .bell:focus-visible { background: rgb(255 255 255 / 0.16); }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #ffffff; font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; }
.bell-count[hidden] { display: none; }
.events li.unread { border-left-color: var(--danger); }

/* Flight statistics layout fix (2026-11-29): grids in the sidebar may never grow wider than it;
   long names are shortened, big numbers stay on one line, the years scroll sideways. */
#panel, .card { grid-template-columns: minmax(0, 1fr); }
.stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { align-content: start; }
.stat b { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.stat small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.top-list li span { flex: 1; min-width: 0; }
.top-list li b { flex: none; font-variant-numeric: tabular-nums; }
.year-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.year-bars { min-width: 100%; width: max-content; }
.year-bar { flex: 1 0 22px; }
.year-bar small { white-space: nowrap; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.top-list ol { grid-template-columns: minmax(0, 1fr); }
/* A scroll bar that stays visible (macOS hides scroll bars until you scroll). */
.year-scroll::-webkit-scrollbar { height: 8px; }
.year-scroll::-webkit-scrollbar-track { background: var(--field); border-radius: 4px; }
.year-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
/* Narrow phones: the header must fit with the bell, the theme switch and the name. */
@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .header-tools { gap: 6px; min-width: 0; }
  .account, .user-menu { min-width: 0; }
  #user-button { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Radio buttons and checkboxes are not text fields (the trip kind could not be chosen). */
input[type="radio"], input[type="checkbox"] { width: auto; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.kind-switch .inline-choice { min-height: 32px; cursor: pointer; }
/* Country suggestions under the country field. */
.country-suggestions:empty { display: none; }
.country-suggestions .suggestion { width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; color: var(--ink); }
.country-suggestions .suggestion:hover, .country-suggestions .suggestion:focus-visible { background: var(--soft); }

/* Plan: actions on nights without a stay or without a hotel. */
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.plan-action { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--link); text-decoration: none; white-space: nowrap; }
.plan-action:hover, .plan-action:focus-visible { border-color: var(--accent); }
.plan-item.stay .plan-action { margin-left: 6px; }
.plan-item.gap { display: block; }

/* Hotel reservations */
.lodging-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lodging-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lodging-row:last-child { border-bottom: 0; }
.lodging-row > a { display: grid; gap: 1px; color: var(--ink); text-decoration: none; min-width: 0; }
.lodging-row > a:hover b { text-decoration: underline; }
.lodging-row > button, .lodging-row > span { flex: none; }
a.plan-item { color: inherit; text-decoration: none; }
a.plan-item:hover { text-decoration: underline; }

.plan-add { justify-self: start; font-size: 0.75rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 1px 6px; border-radius: 6px; }
.plan-add:hover, .plan-add:focus-visible { color: var(--link); background: var(--soft); }

/* Photos dragged onto a trip or step page */
body.dropping main { outline: 3px dashed var(--accent, #2449c9); outline-offset: -10px; }
body.dropping main::after { content: "Drop photos to add them"; position: fixed; inset: auto 0 24px; margin: auto; width: max-content; padding: 10px 16px; border-radius: 999px; background: var(--accent, #2449c9); color: #fff; font-weight: 600; pointer-events: none; }

/* Step 14 – route editor and countries visited */
.range-row { display: grid; grid-template-columns: 3.5em 1fr 9.5em; align-items: center; gap: 8px; margin: 6px 0; }
.range-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-row output { text-align: right; font-variant-numeric: tabular-nums; }
.visited-line { margin: 4px 0 0; }
.visited-list { list-style: none; margin: 0; padding: 0; columns: 2 14em; }
.visited-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; break-inside: avoid; }
.suggestion-card { margin: 8px 0; }

/* Step 15 – administration */
.error-text { color: var(--danger); }
.microsoft { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.microsoft-logo { display: inline-grid; grid-template-columns: 8px 8px; gap: 2px; }
.microsoft-logo i { width: 8px; height: 8px; display: block; }
.microsoft-logo i:nth-child(1) { background: var(--ms-red); }
.microsoft-logo i:nth-child(2) { background: var(--ms-green); }
.microsoft-logo i:nth-child(3) { background: var(--ms-blue); }
.microsoft-logo i:nth-child(4) { background: var(--ms-yellow); }
.or-line { text-align: center; margin: 4px 0; }
.card.highlight { background: var(--soft); }
.secret { font-size: 1.1rem; letter-spacing: 0.04em; user-select: all; }
.danger-zone { border: 1px solid var(--danger); }
.account-list { list-style: none; margin: 12px 0 0; padding: 0; }
.account-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.account-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.account-list select { flex: 0 0 7.5em; width: 7.5em; }
.account-list li.switched-off .account-text b { color: var(--muted); }

/* Step 16a – journeys */
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Step 16c – documents */
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.document-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

/* Step 17a – email import (Inbox) */
.import-lines { display: grid; gap: 8px; }
.import-line { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: start; }
.import-line input { margin-top: 4px; }
.import-text { white-space: pre-wrap; max-height: 260px; overflow: auto; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* Step 17a – changed and cancelled bookings in the Inbox */
.import-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--line); }
.import-tag.update { background: var(--accent-soft, rgb(37 99 235 / 0.16)); }
.import-tag.cancel { background: rgb(220 38 38 / 0.16); }
.import-changes { margin-top: 4px; gap: 2px; }

/* Step 17b – AI reading */
.import-ai { padding: 6px 10px; border-radius: 8px; background: rgb(217 119 6 / 0.14); }

/* Day plan: "+ Add" menu (activities, hotel, journey, car; a step only for today and the past) */
details.plan-add { justify-self: start; padding: 0; }
details.plan-add > summary { list-style: none; cursor: pointer; font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 1px 6px; border-radius: 6px; }
details.plan-add > summary::-webkit-details-marker { display: none; }
details.plan-add > summary:hover, details.plan-add > summary:focus-visible, details.plan-add[open] > summary { color: var(--link); background: var(--soft); }
.plan-add-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.plan-add-list a { font-size: 0.8rem; text-decoration: none; color: var(--ink); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.plan-add-list a:hover, .plan-add-list a:focus-visible { border-color: var(--link); color: var(--link); }

/* Step 18a – security log */
.security-log { gap: 8px; }
.security-item { display: grid; gap: 1px; padding-left: 8px; border-left: 3px solid var(--line); }
.security-item.warn { border-left-color: var(--danger); }

/* Notifications: remove and mute */
.events li.notification { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.notification-text { display: grid; gap: 2px; min-width: 0; }
.notification-actions { display: flex; gap: 4px; align-items: center; flex: none; }
button.icon-button { min-width: 30px; padding: 2px 8px; }
button.link-button { background: none; border: none; color: var(--link); padding: 2px 4px; }
