/* Tripboard's styles. Colours are tokens, set per theme here and nowhere
   else; test/contrast.test.js checks every theme's pairs. */
:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --surface-2: #ECEBE6;
  --text: #1E1F1C;
  --text-dim: #5C5F58;
  --accent: #2F5D50;
  --accent-soft: #E3EEEA;
  --on-accent: #FFFFFF;
  --tab-on: #2F5D50;
  --on-tab: #FFFFFF;
  --line: #8A8D85;
  --must: #1D5FB0;
  --want: #2A732E;
  --maybe: #A84D08;
  --star: #A16207;
  --danger: #A3302B;
  --scrim: rgba(0, 0, 0, 0.45);
  --on-photo: #FFFFFF;
  --tint-0: #2F5D50;
  --tint-1: #5A4A7A;
  --tint-2: #8A5A2B;
  --tint-3: #2B5A8A;
  --tint-4: #7A3B4A;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --radius: 12px;
  --radius-lg: 16px;
  --fs-small: 13px;
  --fs-body: 16px;
  --fs-title: 20px;
  --fs-big: 28px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  /* A fade's curve, where a spring has nothing to move. */
  --ease-fade: ease-out;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141513;
  --surface: #1E201D;
  --surface-2: #2A2D29;
  --text: #ECEDE8;
  --text-dim: #A9ACA3;
  --accent: #8FC3B2;
  --accent-soft: #24372F;
  --on-accent: #10201B;
  --tab-on: #2F6B5B;
  --on-tab: #FFFFFF;
  --line: #74786F;
  --must: #8AB8F5;
  --want: #8FD19E;
  --maybe: #F5B068;
  --star: #F2C14E;
  --danger: #F0958C;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:root { --safe-end: env(safe-area-inset-right); }
[dir="rtl"] { --safe-end: env(safe-area-inset-left); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dim { color: var(--text-dim); }
/* hidden always hides, whatever display a class gives (.link-row was shown). */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A file picker is a label around a hidden input: the ring goes on the label. */
label.btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; }
[dir="rtl"] .icon-back { transform: scaleX(-1); }

/* The bar: back, title, edit */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--space-2);
  max-width: 1200px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--space-2)) var(--space-3) var(--space-2);
  background: var(--bg);
}
.bar-title { flex: 1; margin: 0; font-size: var(--fs-title); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:not(.on-board) .bar-title { font-size: var(--fs-big); }
/* The bar lines up with the page under it. */
body:not(.on-board) .bar { max-width: 640px; }
body.on-home .bar, body.on-home main { max-width: 960px; }
.icon-btn {
  display: inline-grid; place-items: center;
  min-width: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { min-width: 36px; min-height: 36px; margin-block: -4px; margin-inline: 0 -6px; }
.icon-btn[hidden] { display: none; }

/* flow-root keeps a first child's top margin inside, so a screen's background reaches the top bar while it slides. */
main { display: flow-root; max-width: 640px; margin: 0 auto; padding: 0 var(--space-3) calc(env(safe-area-inset-bottom) + 96px); }
main:focus { outline: none; }
body.on-board main { max-width: 1200px; }
/* The app's update offer: a small pill floating at the bottom, above the
   trip's bar, under any toast. */
.update {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  width: max-content; max-width: min(420px, calc(100vw - 2 * var(--space-3)));
  padding-block: 4px; padding-inline: var(--space-3) 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  font-size: 14px;
}
.update:not([hidden]) { display: flex; align-items: center; gap: var(--space-2); }
.update-text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.update .update-btn { flex: 0 0 auto; min-height: 32px; min-width: 4.5em; padding: 0 var(--space-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.update .update-close { flex: 0 0 auto; min-width: 32px; min-height: 32px; }
.update-close .icon { width: 18px; height: 18px; }
/* Settings › About's Check for updates. */
.channel { display: grid; gap: var(--space-1); margin-top: var(--space-2); }
.change h2 { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.change-you { padding: 2px var(--space-2); border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: var(--fs-small); font-weight: 600; }
.change[aria-current="true"] { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent-soft); }
.change-date { font-size: var(--fs-small); }
.change-part h3 { margin: var(--space-2) 0 var(--space-1); font-size: var(--fs-small); color: var(--text-dim); }
.change-part ul { margin: 0; padding-inline-start: 20px; display: grid; gap: var(--space-1); }
.update-check { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.update-status { flex: 1 1 12em; margin: 0; color: var(--text-dim); }
.update-status:empty { display: none; }
body.with-tabbar .update { bottom: calc(env(safe-area-inset-bottom) + 58px + 2 * var(--space-3)); }
body.on-map .update { bottom: auto; top: 108px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.danger { border-color: transparent; background: transparent; color: var(--danger); padding: 0 var(--space-2); }
.btn.destroy { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.btn[hidden] { display: none; }

/* Home */
.section { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 0 0 var(--space-2); }
.trips { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.trip-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.trip-card img { -webkit-user-drag: none; }
.trip-cover { height: 120px; }
.quick-menu {
  position: fixed; z-index: 40; min-width: 220px; white-space: nowrap; padding: var(--space-1);
  display: grid; border: 1px solid var(--surface-2); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); transform-origin: top left;
}
.quick-menu button {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3);
  border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.quick-menu button:hover, .quick-menu button:focus-visible { background: var(--surface-2); }
.quick-menu button.danger { color: var(--danger); }

.trip-text { display: grid; padding: var(--space-3); }
.trip-text strong { font-size: 18px; }
.badge {
  position: absolute; top: var(--space-2); inset-inline-end: var(--space-2);
  padding: 2px 10px; border-radius: 999px; font-size: var(--fs-small); font-weight: 600;
  background: var(--surface); color: var(--text);
}
.new-card-item, #newTrip .btn-label { display: none; }
/* Home on a computer: wider, trips in as many columns as fit, a labelled New trip button and a last card that starts one. */
@media (min-width: 1100px) {
  body.on-home .bar, body.on-home main { max-width: 1240px; padding-inline: 40px; }
  body.on-home .bar { padding-block-start: 20px; }
  body.on-home .bar-title { font-size: 30px; }
  body.on-home .trips { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
  body.on-home .trip-cover { height: 150px; }
  body.on-home .trips .trip-card { height: 100%; }
  body.on-home #newTrip { gap: 6px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; }
  body.on-home #newTrip:not([hidden]) { display: inline-flex; align-items: center; }
  body.on-home #newTrip .btn-label { display: inline; }
}
@media (min-width: 1100px) and (pointer: fine) {
  body.on-home .new-card-item { display: block; }
  .new-card { display: grid; place-items: center; align-content: center; gap: 8px; width: 100%; height: 100%; min-height: 230px; border: 2px dashed var(--line); border-radius: var(--radius-lg); background: none; color: var(--text-dim); font: inherit; font-weight: 600; cursor: pointer; }
  .new-card:hover { border-color: var(--accent); color: var(--accent); }
  .new-card .icon { width: 30px; height: 30px; }
}
.empty { padding: var(--space-5) 0; text-align: center; }
.empty p { margin: 0 0 var(--space-1); }
.note { margin-top: var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius); background: var(--surface-2); }
.version { margin-top: var(--space-5); font-size: var(--fs-small); text-align: center; }

/* Covers: a photo, or a tint of the trip's own */
.trip-cover, .hero, .cover-preview { position: relative; background: var(--tint-0); overflow: hidden; }
.tint-1 { background: var(--tint-1); }
.tint-2 { background: var(--tint-2); }
.tint-3 { background: var(--tint-3); }
.tint-4 { background: var(--tint-4); }
.trip-cover img, .hero img, .cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* A trip's board */
.hero {
  display: flex; align-items: flex-end; min-height: 140px;
  margin-bottom: var(--space-3); border-radius: var(--radius-lg);
}
.hero-text {
  position: relative; width: 100%; padding: var(--space-4) var(--space-3) var(--space-3);
  background: linear-gradient(to top, var(--scrim), transparent);
  color: var(--on-photo); font-weight: 600;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-2) 0 0; padding: 0; }
.chips li { padding: 0 10px; border-radius: 999px; background: var(--scrim); font-size: var(--fs-small); line-height: 26px; }

.controls { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.seg button {
  flex: 1 0 auto; min-height: 38px; padding: 0 10px; font-size: 15px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); font-weight: 600;
}
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
/* The sort switch's pill is one element that slides (slideSeg). */
.seg.sorts, .seg.looks { position: relative; }
.seg.sorts button, .seg.looks button { position: relative; z-index: 1; transition: color 0.2s; }
.seg.sorts button[aria-selected="true"], .seg.looks button[aria-selected="true"] { background: transparent; box-shadow: none; }
.seg-bubble { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
/* One row: on a phone the chips scroll sideways rather than take a second line. */
.filters { display: flex; flex-wrap: nowrap; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .pick { flex: none; white-space: nowrap; }
.filters .pick { gap: 4px; }
.filters .pick::before { content: none; }
.filters .pick[aria-pressed="false"] { color: var(--text); }
.filters .pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filters .pick .icon { width: 16px; height: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-dim); font-size: 14px; font-weight: 600;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.4; }
.chip[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.chip.imp-must[aria-pressed="true"]::before { background: var(--must); opacity: 1; }
.chip.imp-want[aria-pressed="true"]::before { background: var(--want); opacity: 1; }
.chip.imp-maybe[aria-pressed="true"]::before { background: var(--maybe); opacity: 1; }
.locate { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.locate p { margin: 0; flex: 1 1 240px; }

.groups { display: grid; gap: 10px; }
/* Expenses */
.spend-total { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.spend-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 15px; }
.spend-cats li, .xrow { display: flex; align-items: baseline; gap: var(--space-2); }
.spend-cats li span:first-child { flex: 1; color: var(--text-dim); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.xrows { display: grid; gap: 4px; margin-top: 4px; }
.xrow { width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; line-height: 1.35; background: var(--bg); text-align: start; cursor: pointer; }
.xrow { align-items: center; }
.xrow-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.xrow-ic .icon { width: 18px; height: 18px; }
#app.file-over { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: var(--radius-lg); }
.xrow-text { flex: 1; min-width: 0; display: grid; gap: 0; }
.xrow-title { font-weight: 600; font-size: 15px; }
.xrow > .attached-local { flex: none; display: grid; place-items: center; color: var(--text-dim); }
.xrow > .attached-local .icon { width: 18px; height: 18px; }
#linkOpen { display: inline-flex; align-items: center; gap: var(--space-1); text-decoration: none; }
#noteText { min-height: 40vh; }
a.attached-file { text-decoration: none; }
/* Shared into Tripboard: what came, then the trips to add it to. */
.share-what { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.share-what strong { font-size: 16px; overflow-wrap: anywhere; }
.share-what .dim { font-size: 13px; overflow-wrap: anywhere; }
.xrow.suggest { box-shadow: inset 0 0 0 2px var(--accent); }
#shareInTrips { max-height: 50vh; overflow-y: auto; margin: 0; }
.xrow-meta { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group { padding: 10px 12px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.group-head { display: flex; align-items: center; gap: var(--space-2); }
.group-head h2 { flex: 1; margin: 0; font-size: 16px; }
.count { color: var(--text-dim); font-size: 14px; }
.slot { margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.slot-empty { margin: var(--space-2) 0 0; font-size: 14px; }
.cards { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.slot + .cards { margin-top: 0; }
.slot-box { border-radius: var(--radius); }
/* Dragging a card (mouse only): empty groups and slots open up as places to drop it. */
.drop-only { display: none; }
body.dragging .drop-only { display: block; }
body.dragging .slot-empty { display: none; }
body.dragging .slot-box.drop-only .cards { min-height: 44px; border: 1px dashed var(--line); border-radius: var(--radius); }
.card[draggable="true"] { cursor: grab; }
.card.lifted { opacity: 0.4; }
.drop-over { outline: 2px dashed var(--accent); outline-offset: 4px; }
.group.drop-over { outline-offset: -2px; }
.card {
  display: flex; align-items: flex-start; gap: 0;
  border-inline-start: 3px solid var(--want); border-radius: 8px; background: var(--bg);
}
.card.imp-must { border-inline-start-color: var(--must); }
.card.imp-maybe { border-inline-start-color: var(--maybe); }
.card-body {
  flex: 1; min-width: 0; display: grid; gap: 0; text-align: start; line-height: 1.35;
  min-height: 44px; padding-block: 6px; padding-inline: 0 10px; border: 0; background: transparent;
}
.card-name { font-weight: 600; font-size: 15px; }
.card-meta { color: var(--text-dim); font-size: 13px; }
.card-meta .imp { font-weight: 600; }
.card.imp-must .imp { color: var(--must); }
.card-note { color: var(--text-dim); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.tick {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 44px; margin-block-end: -6px; padding: 0; border: 0; background: transparent; color: transparent;
}
.tick .icon { width: 12px; height: 12px; box-sizing: content-box; padding: 2px; border: 1.5px solid var(--line); border-radius: 50%; }
.tick[aria-pressed="true"] { color: var(--on-accent); }
.tick[aria-pressed="true"] .icon { background: var(--accent); border-color: var(--accent); }
.tick.pick .icon { border-radius: 6px; }
.card.picked { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Picking places: the bar takes the tabs' place at the bottom. */
body.picking .bottombar { display: none; }
.select-bar {
  position: fixed; z-index: 8; left: 0; right: 0; margin-inline: auto; bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  width: min(480px, calc(100vw - 2 * var(--space-3))); display: flex; align-items: center; gap: var(--space-1); padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}
.select-bar[hidden] { display: none; }
.select-count { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-bar .btn.danger { padding: 0 var(--space-3); }
.move-list { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; margin-bottom: var(--space-2); }
.move-slots { margin-bottom: var(--space-2); flex-wrap: wrap; border-radius: var(--radius); }
.move-to {
  display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-3);
  border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.move-to:hover, .move-to:focus-visible { background: var(--surface-2); }
.move-to.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); font-weight: 600; }
.move-hint { margin: 0 0 var(--space-2); padding-inline: var(--space-3); font-size: 14px; }

/* A trip's bar at the bottom: a floating pill with the tabs (Plan, Map,
   Today, Expenses, Files, as icons) and, beside it at its inline end, the
   + for what the tab adds, a rounded square of its own. The pill is centred
   on the screen: an empty space as wide as the + balances it at the other
   end, and gives way first when the screen is too narrow for both. The
   toast and the map's panel sit above them. */
.bottombar {
  position: fixed; z-index: 7; left: 0; right: 0; margin-inline: auto; width: fit-content; bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  display: flex; align-items: center; gap: var(--space-2); max-width: calc(100vw - 2 * var(--space-3));
}
.bottombar::before { content: ""; width: 48px; flex: 0 1 auto; min-width: 0; }
.bottombar:has(.fab[hidden])::before { display: none; }
.bottombar .tabbar { flex: none; }
.bottombar[hidden] { display: none; }
/* The selected tab sits on one circle that slides from tab to tab (views.js,
   slideBubble); it's placed by its offsetLeft, so it's pinned to the
   physical left whatever the direction. */
.tabbar {
  position: relative; display: flex; gap: 2px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}
.tab-bubble { position: absolute; top: 4px; left: 0; width: 48px; height: 48px; border-radius: 999px; background: var(--tab-on); }
.tabbar .tab { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; color: var(--text-dim); }
.tabbar .tab .icon { width: 22px; height: 22px; }
.tabbar .tab[aria-current="page"] { color: var(--on-tab); }
.tabbar .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fab {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}
.fab .icon { width: 22px; height: 22px; }
.fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fab[hidden] { display: none; }
/* Under 360 px (a small phone, or a large display size) the five tabs and
   the + don't fit at 48 px: the tabs get 44 px and closer, so the + stays on screen. */
@media (max-width: 359px) {
  body:not(.land) .bottombar { gap: 4px; }
  body:not(.land) .tabbar { gap: 0; }
  body:not(.land) .tabbar .tab { width: 44px; }
  body:not(.land) .tab-bubble { top: 6px; width: 44px; height: 44px; }
}
body.with-tabbar main { padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
body.with-tabbar .toast { bottom: calc(env(safe-area-inset-bottom) + 58px + 2 * var(--space-3)); }
body.with-tabbar .map-panel { bottom: calc(env(safe-area-inset-bottom) + 58px + 2 * var(--space-3)); inset-inline-end: var(--space-3); }
/* The no-location list keeps clear of the map's buttons, which stay put. */
body.with-tabbar .map-panel.nowhere { inset-inline-end: calc(var(--space-3) + 72px); }


/* Sheets: from the bottom on a phone, a dialog on a wide screen */
.sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
}
/* The dimming fades in as a sheet rises and out as it leaves, alongside it. */
.sheet::backdrop { background: var(--scrim); opacity: 1; transition: opacity 240ms var(--ease-fade); }
.sheet.leaving::backdrop { opacity: 0; transition-duration: 200ms; }
@starting-style { .sheet[open]::backdrop { opacity: 0; } }
.sheet-body { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-3) calc(env(safe-area-inset-bottom) + var(--space-3)); }
.sheet h2 { margin: 0; font-size: var(--fs-title); }
.field { display: grid; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; border: 0; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.field[hidden] { display: none; }
.field legend { padding: 0; margin-bottom: var(--space-1); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: var(--space-2) 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  font-size: var(--fs-body); font-weight: 400;
}
/* Chromium and Android's WebView draw their own arrow flush with the edge,
   ignoring padding, so the arrow is drawn here: two gradients make a chevron. */
.field select, .field input[type="time"], .field input[type="date"] {
  appearance: none; padding-inline-end: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
[dir="rtl"] .field select, [dir="rtl"] .field input[type="time"], [dir="rtl"] .field input[type="date"] { background-position: 16px 50%, 21px 50%; }
/* Android draws time and date fields as drop-downs with the same flush arrow.
   A computer's own clock or calendar button is kept, unseen, over the chevron. */
.field input[type="time"], .field input[type="date"] { position: relative; text-align: start; }
.field input::-webkit-calendar-picker-indicator {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: 40px; height: auto;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field input[hidden], .field select[hidden] { display: none; }
/* A key's field: how it last went beside "Key", and an eye to show it. */
.key-label { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--star); }
.key-label[data-state="ok"] .key-dot { background: var(--want); }
.key-label[data-state="refused"] .key-dot { background: var(--danger); }
.key-label[data-state="refused"] { color: var(--danger); }
.key-wrap { position: relative; display: block; }
.field .key-wrap input { padding-inline-end: 48px; }
.key-eye { position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--text-dim); cursor: pointer; border-radius: 10px; }
.key-eye .icon { width: 20px; height: 20px; }
.hint { font-weight: 400; font-size: var(--fs-small); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); }
.sheet .seg button.imp-must[aria-checked="true"] { color: var(--must); }
/* Your rating: five stars to tap in the place sheet, a star and number on a card. */
.stars-pick { display: flex; gap: 2px; }
.stars-pick .star { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; }
.stars-pick .star.on { color: var(--star); }
.stars-pick .star:disabled { cursor: default; }
.card-name .rating { display: inline-block; margin-inline-start: 8px; font-size: var(--fs-small); font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.card-name .rating .star { color: var(--star); margin-inline-end: 2px; }
/* The trip's cover: the box itself picks the photo; x takes it off. */
.cover-pick { position: relative; }
.cover-preview {
  display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 7; max-height: 200px; border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line); background: var(--surface); color: var(--text-dim); cursor: pointer;
}
.cover-preview.has-photo { border: 0; background: var(--tint-0); }
.cover-preview:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-show { display: grid; justify-items: center; gap: var(--space-1); font-weight: 600; }
.cover-show svg { width: 28px; height: 28px; }
.cover-preview .error { padding: var(--space-2); color: var(--danger); font-size: var(--fs-small); text-align: center; }
/* Ready-made covers under the box, the camera first: a row that scrolls sideways. */
.art-row { display: flex; gap: var(--space-2); margin-top: var(--space-2); padding-block-end: 2px; overflow-x: auto; scrollbar-width: none; }
.art-row > * {
  flex: none; display: grid; place-items: center; width: 72px; height: 46px; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 10px; background: var(--surface); color: var(--text-dim); cursor: pointer;
}
.art-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-row [aria-pressed="true"] { border-color: var(--accent); }
.art-row .art-photo { border: 1.5px dashed var(--line); }
.art-row .art-photo svg { width: 22px; height: 22px; }
.art-row > :focus-visible, .art-row .art-photo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-remove {
  position: absolute; inset-block-start: var(--space-2); inset-inline-end: var(--space-2);
  background: var(--scrim); color: var(--on-photo); border-radius: 999px;
}
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.grow { flex: 1; }

/* The map */
/* A desktop's scrollbar keeps its room on every screen, so a short one
   (Home, Settings) and a long one (the Plan) line up and nothing shifts
   sideways when it comes or goes. Not on the Map, which fills the window. */
:root { scrollbar-gutter: stable; }
:root:has(> body.on-map) { scrollbar-gutter: auto; }
body.on-map { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.on-map .bar { width: 100%; max-width: none; }
.map-view { position: relative; flex: 1; min-height: 0; }
.map-view[hidden] { display: none; }
.map-view .map { position: absolute; inset: 0; background: var(--surface-2); }
.map-panel {
  position: absolute; inset-inline: var(--space-3) calc(var(--space-3) + 72px); bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  display: grid; gap: var(--space-2); max-height: 45%; overflow-y: auto;
  padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
.map-panel[hidden] { display: none; }
.map-panel p { margin: 0; }
.map-panel .sel { display: grid; }
.map-panel .addr { font-size: 14px; }
.unplaced { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
/* No-location places: a one-line header that folds the list away. */
.unplaced-head {
  display: flex; align-items: center; gap: var(--space-2); min-height: 32px; margin: -4px; padding: 4px;
  border: 0; border-radius: var(--radius); background: none; color: var(--text-dim); font: inherit; text-align: start; cursor: pointer;
}
.unplaced-head span { flex: 1; min-width: 0; }
.unplaced-head .icon { flex: none; width: 18px; height: 18px; }
.unplaced-head .fold { transition: transform 0.2s; }
.unplaced-head[aria-expanded="true"] .fold { transform: rotate(180deg); }
.unplaced-head:focus-visible { outline: 2px solid var(--accent); }
.pin {
  width: 28px; height: 28px; padding: 0; border: 2px solid var(--surface); border-radius: 50%;
  background: var(--want); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); cursor: pointer;
  display: grid; place-items: center; color: var(--on-accent); line-height: 0;
}
.pin .icon { width: 15px; height: 15px; }
.pin.imp-must { background: var(--must); width: 32px; height: 32px; }
.pin.imp-must .icon { width: 17px; height: 17px; }
.pin.imp-maybe { background: var(--maybe); }
.pin.visited { opacity: 0.55; }
.pin.selected { outline: 3px solid var(--text); outline-offset: 2px; z-index: 2; }
.pin.draggable { cursor: grab; touch-action: none; }
.pin.draggable:active { cursor: grabbing; }
/* A pin's name under it: when pointed at or selected, or always (View sheet). */
.pin-label {
  display: none; position: absolute; top: calc(100% + 3px); left: 50%; translate: -50% 0; padding: 1px 6px; border-radius: 6px;
  background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; pointer-events: none;
}
.pin:hover .pin-label, .pin.hot .pin-label, .pin.selected .pin-label, .pin:focus-visible .pin-label, [data-labels="always"] .pin-label { display: block; }
[data-ratings="hide"] .card-name .rating { display: none; }
.pin:hover, .pin:focus-visible { z-index: 4; }
.view-head { margin: var(--space-3) 0 0; font-size: 15px; }
.view-part[hidden] { display: none; }
.view-part:first-of-type .view-head { margin-top: var(--space-1); }

.map-top {
  position: absolute; z-index: 3; top: var(--space-2); inset-inline: var(--space-3); display: grid; gap: var(--space-1); justify-items: start;
  pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.map-days {
  justify-self: stretch; display: flex; gap: var(--space-1);
  overflow-x: auto; scrollbar-width: none; padding: 2px;
}
.map-days[hidden] { display: none; }
.map-days .chip { flex: none; background: var(--surface); box-shadow: var(--shadow); }
.map-days .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pin.numbered { width: 28px; height: 28px; color: var(--on-accent); font-size: 13px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.toast {
  position: fixed; z-index: 30; inset-inline: var(--space-3); bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  display: flex; align-items: center; gap: var(--space-2); max-width: 420px; padding-block: 6px; padding-inline: var(--space-3) 6px;
  border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.toast[hidden] { display: none; }
.toast span { flex: 1; min-width: 0; }
.toast .btn { color: var(--bg); font-weight: 700; }
body.on-map .toast { bottom: auto; top: 108px; }
.map-days .chip::before { display: none; }
/* The map's filters: importance chips as on the board, then categories. */
/* The map's filters: a chip each, green while it hides something. */
.map-filters .chip[aria-pressed="false"] { color: var(--text); }
.map-filters .pick { gap: 4px; }
.map-filters .pick .icon { width: 16px; height: 16px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--surface); }
.dot.imp-must { background: var(--must); }
.dot.imp-want { background: var(--want); }
.dot.imp-maybe { background: var(--maybe); }
.map-note {
  justify-self: stretch; margin: 0;
  padding: var(--space-2) 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: 14px;
}
.map-note[hidden], .map-credit[hidden], .map-credits[hidden] { display: none; }
/* The map's credit: a small chip at the top (OpenStreetMap's licence and
   Google's terms want it on the map), in a 44 px tap target; tapped, the
   full credits with their links. */
.map-credit {
  display: flex; align-items: center; min-height: 44px; margin-top: -8px; padding: 0; border: 0; background: none; color: var(--text-dim); cursor: pointer;
}
.map-credit-chip {
  display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 11px; font-weight: 600; line-height: 18px;
}
.map-credit-ic { display: flex; }
.map-credit-ic .icon { width: 13px; height: 13px; }
.map-credit:focus-visible { outline: none; }
.map-credit:focus-visible .map-credit-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-credits {
  max-width: min(100%, 360px); margin: -6px 0 0; padding: var(--space-2) 12px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text-dim); font-size: 12px; line-height: 1.5;
}
.map-credits a { color: var(--accent); font-weight: 600; }
/* MapLibre's own where-am-I button: kept for its dot, worked from ours. */
.map .maplibregl-ctrl-top-right { display: none; }
/* The map's buttons: in thumb reach above the + (the start side in Hebrew,
   with it), raised over a place's card when one is open (--panel-h comes
   from views.js). Zoom only with a mouse; a phone pinches. */
.map-tools {
  position: absolute; z-index: 3; inset-inline-end: var(--space-3); display: grid; gap: var(--space-2);
  bottom: calc(env(safe-area-inset-bottom) + var(--space-3) + var(--space-2));
}
.map-tools[hidden] { display: none; }
body.with-tabbar .map-tools { bottom: calc(env(safe-area-inset-bottom) + 58px + 2 * var(--space-3) + var(--space-2)); }
.map-panel:not([hidden]):not(.nowhere) ~ .map-tools { transform: translateY(calc(-1 * var(--panel-h, 0px))); }
.map-tool, .map-zoom {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}
.map-tool { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--text); cursor: pointer; }
.map-tool .icon { width: 21px; height: 21px; }
.map-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-zoom { display: none; overflow: hidden; }
.map-zoom .map-tool { border: 0; border-radius: 0; box-shadow: none; }
.map-zoom .map-tool + .map-tool { border-top: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) {
  .map-zoom { display: grid; }
  .map-tool:hover { background: var(--surface-2); }
}
/* Map style: a picture of each map to pick from. The pictures are drawn
   in CSS with each map's own colours, not the app's. */
.mstyle-group { margin: var(--space-3) 0 var(--space-2); font-size: var(--fs-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.mstyle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.mstyle {
  display: grid; gap: 2px; align-content: start; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: center; cursor: pointer;
}
.mstyle small { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.mstyle[aria-pressed="true"] { color: var(--accent); }
.mstyle:focus-visible { outline: none; }
.mstyle:focus-visible .mthumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.mthumb {
  --l: #F2EFE9; --w: #AAD3DF; --p: #CDE8C4; --r: #FFFFFF; --r2: #F7D58A;
  position: relative; display: grid; place-items: center; height: 64px; margin-bottom: 4px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line);
  background:
    linear-gradient(transparent 72%, var(--w) 72%),
    linear-gradient(90deg, transparent 47%, var(--r2) 47% 53%, transparent 53%),
    linear-gradient(transparent 38%, var(--r2) 38% 44%, transparent 44%),
    linear-gradient(90deg, transparent 18%, var(--r) 18% 21%, transparent 21% 80%, var(--r) 80% 83%, transparent 83%),
    linear-gradient(transparent 16%, var(--r) 16% 19%, transparent 19% 58%, var(--r) 58% 61%, transparent 61%),
    linear-gradient(var(--p), var(--p)) 64% 22% / 22% 28% no-repeat,
    var(--l);
}
.mstyle[aria-pressed="true"] .mthumb { border-color: var(--accent); }
.mthumb.light { --l: #F5F5F3; --w: #D4DADC; --p: #E6EBE3; --r2: #E4E4E4; }
.mthumb.dark { --l: #1F2321; --w: #22333D; --p: #253229; --r: #3A403C; --r2: #565049; }
.mthumb.liberty { --l: #F8F4F0; --w: #9CC0F9; --p: #C6E5A8; --r2: #F9C57F; }
.mthumb.bright { --l: #F8F4F0; --w: #A0C8F0; --p: #D8E8C8; --r2: #FFEEAA; }
.mthumb.streets { --l: #F4F1EC; --w: #A8CCE8; --p: #D2E6C2; --r2: #F5C98A; }
.mthumb.satellite { --l: #4B5A3C; --w: #20384A; --p: #3D5A2F; --r: #C9C2B0; --r2: #E8D9A8; }
.mthumb.outdoor, .mthumb.terrain {
  --l: #EEF0E2; --w: #9FC6E0; --p: #BCD9A0; --r2: #E0A060;
}
.mthumb.outdoor::before, .mthumb.terrain::before {
  content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 30%, transparent 0 9px, rgba(150, 120, 70, 0.35) 9px 10px);
}
.mthumb.auto::after {
  content: ""; position: absolute; inset: 0; clip-path: polygon(62% 0, 100% 0, 100% 100%, 38% 100%);
  background:
    linear-gradient(transparent 72%, #22333D 72%),
    linear-gradient(90deg, transparent 47%, #565049 47% 53%, transparent 53%),
    linear-gradient(transparent 38%, #565049 38% 44%, transparent 44%),
    linear-gradient(90deg, transparent 18%, #3A403C 18% 21%, transparent 21% 80%, #3A403C 80% 83%, transparent 83%),
    linear-gradient(#253229, #253229) 64% 22% / 22% 28% no-repeat,
    #1F2321;
}
.mstyle.locked .mthumb { opacity: 0.5; }
.mthumb .icon { position: relative; z-index: 1; width: 20px; height: 20px; color: #FFFFFF; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.mstyle-hint { margin: var(--space-3) 0 0; font-size: 14px; color: var(--text-dim); }
.mstyle-hint a { color: var(--accent); font-weight: 600; }
/* A published trip, read only (#/p/<id>): its places open to show their description and where to open them. */
.published-by h2 { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 18px; }
.published-by h2 .icon { width: 20px; height: 20px; flex-shrink: 0; }
.published-by p { margin: 0; }
.pub-plan { margin-top: var(--space-3); }
.pub-places { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.pub-place summary { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; cursor: pointer; list-style: none; }
.pub-place summary::-webkit-details-marker { display: none; }
.pub-place summary .icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-dim); }
.pub-place summary .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pub-place details[open] { padding-bottom: var(--space-2); }
.pub-place details > :not(summary) { margin: 0 0 var(--space-1); padding-inline-start: calc(18px + var(--space-2)); font-size: 14px; }
.pub-place > a { display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: none; }
.pub-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.open-in { margin: 0; font-size: 14px; font-weight: 400; }
.panel h2 a { color: inherit; text-underline-offset: 3px; }
.open-in a { color: var(--accent); font-weight: 600; text-decoration: none; }
.open-in a:hover { text-decoration: underline; }

/* Settings */
.panel { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel h2 { margin: 0; font-size: 17px; }
.panel p { margin: 0; }
.warn { color: var(--danger); }
.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: var(--space-1); font-size: 14px; }
.steps a, .credits a { color: var(--accent); font-weight: 600; }
.credits { margin: 0; padding: var(--space-3); padding-inline-start: 32px; display: grid; gap: var(--space-1); font-size: 14px; }

.settings-search {
  display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-dim);
}
.settings-search:focus-within { border-color: var(--accent); }
.settings-search .icon { width: 18px; height: 18px; flex-shrink: 0; }
.settings-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--text); font-size: var(--fs-body); outline: none; }
.settings-results[hidden], .sgroup[hidden] { display: none; }
.sgroup { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.sgroup-label { margin: 0; padding: 0 6px; font-size: var(--fs-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.sgroup-card { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.srow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px; color: var(--text); text-decoration: none;
}
.srow + .srow { border-top: 1px solid var(--line); }
.srow:active { background: var(--surface-2); }
@media (hover: hover) { .srow:hover { background: var(--surface-2); } }
.srow-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.srow-ic .icon { width: 18px; height: 18px; }
.srow-text { display: grid; gap: 1px; min-width: 0; }
.srow-title { font-weight: 600; }
.srow-status { font-size: var(--fs-small); color: var(--text-dim); }
/* Settings on a computer: its list beside the open page (views.js, renderSettings). */
@media (min-width: 1100px) {
  body.on-settings .bar, body.on-settings main { max-width: 1100px; padding-inline: 32px; }
  body.on-settings main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
  .settings-nav { position: sticky; top: var(--space-3); }
  .settings-pane { min-width: 0; }
  .settings-pane > :first-child { margin-top: var(--space-2); }
  .srow[aria-current="page"] { background: var(--accent-soft); }
  .srow[aria-current="page"] .srow-ic { background: var(--accent); color: var(--on-accent); }
}
.srow-status[data-tone="warn"] { color: var(--danger); }
p[data-tone="warn"] { color: var(--danger); }
.srow-chev { color: var(--text-dim); font-size: 22px; line-height: 1; }
.page-hint { margin: var(--space-2) 6px var(--space-3); }
.srow-empty { margin: 0; padding: var(--space-3); font-size: 14px; color: var(--text-dim); }

/* A place's location in its sheet */
.where { margin: 0; color: var(--text); font-weight: 400; }
.where.dim { color: var(--text-dim); }
.loc-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.results { list-style: none; display: grid; gap: var(--space-1); margin: 0; padding: 0; }
.results button {
  display: grid; width: 100%; min-height: 44px; padding: var(--space-2) 12px; text-align: start;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 400;
}
.results .dim { font-size: 14px; }
.results .plain button { border-style: dashed; background: transparent; }
/* A new place's search answers, straight under its name. */
/* Paste a list: the text, then what it understood, a place a row. */
.paste-text { display: block; width: auto; min-height: 9em; margin: 0 var(--space-3) var(--space-2); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
.paste-list { list-style: none; margin: 0; padding: 0 var(--space-3) var(--space-2); display: grid; }
.paste-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.paste-list li:last-child { border-bottom: 0; }
.paste-list strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.paste-list .dim { flex: none; font-size: 13px; }
.paste-ic { display: inline-grid; flex: none; color: var(--text-dim); }
.paste-ic.on { color: var(--accent); }
.paste-ic .icon { width: 18px; height: 18px; }
#pasteForm .paste-go { flex: 1; }
.place-check { display: grid; gap: var(--space-2); justify-items: start; margin-block-end: var(--space-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.place-check .hint { margin: 0; }
.place-found { display: grid; gap: var(--space-2); }
.place-found:empty { display: none; }
.place-found .hint { margin: 0; color: var(--text-dim); }
.place-paste { flex: none; min-height: 44px; padding: 0 12px; gap: 6px; font-size: 14px; }
.place-paste .icon { width: 18px; height: 18px; }
#placeForm .place-done, #placeForm .place-another { flex: 1 1 0; justify-content: center; }
.hint:empty { display: none; }

@media (min-width: 720px) {
  .sheet { width: 520px; margin: auto; border-radius: 20px; }
  .sheet-body { padding: var(--space-4); }
  .trips { grid-template-columns: repeat(2, 1fr); }
  /* Beside the buttons, never under them, so they don't move. */
  .map-panel, body.with-tabbar .map-panel, body.with-tabbar .map-panel.nowhere { inset-inline-end: auto; width: min(380px, 100% - 2 * var(--space-3) - 72px); }
  .map-panel:not([hidden]):not(.nowhere) ~ .map-tools { transform: none; }
}
/* On a wide screen the board is a board: its groups side by side, in as
   many rows as it takes, so the whole trip is there by scrolling down. One
   long row that scrolled sideways hid all but its first days from a mouse
   wheel. A destination's name starts a row of its own. */
@media (min-width: 960px) {
  .groups { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
  .groups > .dest-band { grid-column: 1 / -1; }
  .controls { grid-template-columns: auto 1fr; align-items: center; }
  .sorts { justify-self: start; }
  .trips { grid-template-columns: repeat(3, 1fr); }
  .hero { min-height: 180px; }
}

/* The screen that leaves while the next one moves in (views.js, tabAfter):
   on top when it goes Back, under the new one on a push. */
.tab-leaving { position: fixed; z-index: 4; pointer-events: none; }
main.tab-leaving { margin: 0; }
/* Solid, so the screen coming in under it on Back doesn't show through. */
main.tab-leaving:not(.tab-under) { background: var(--bg); min-height: 100dvh; }
.tab-leaving.tab-under { z-index: 0; }
.tab-over { position: relative; z-index: 1; background: var(--bg); min-height: 100dvh; }
/* With a mouse, the buttons at the top and the trips on Home grow a little
   under the pointer; pressing them bounces (views.js, pressBounce). */
@media (hover: hover) and (pointer: fine) {
  .bar .icon-btn, .trip-card { transition: scale 260ms var(--spring-control, var(--ease-fade)), box-shadow 260ms var(--ease-fade); }
  .bar .icon-btn:hover { scale: 1.12; }
  .trip-card:hover { scale: 1.025; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14); }
}
.tab-moving, .tab-moving body { overflow-x: clip; }

:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after, :root[data-motion="off"] ::backdrop { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Files: the choice when adding, and files attached to a place */
.choice {
  display: grid; gap: 2px; width: 100%; margin-bottom: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-align: start; cursor: pointer;
}
.choice:hover, .choice:focus-visible { border-color: var(--accent); }
.choice-title { font-weight: 700; color: var(--text); }
.choice-text { font-size: 14px; color: var(--text-dim); }
.attached { list-style: none; display: grid; gap: var(--space-1); margin: 0; padding: 0; }
.attached:empty { display: none; }
.attached-file {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 44px; padding: 6px 12px;
  border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-weight: 600; text-align: start; cursor: pointer;
}
.attached-file > span:not(.attached-local) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attached-file:has(.attached-url) > span:first-of-type { flex: 0 1 auto; }
.attached-file > span.attached-url { flex: 1 1 0; color: var(--text-dim); font-weight: 400; font-size: 13px; text-align: start; }
[dir="rtl"] .attached-file > span.attached-url { text-align: right; }
.attached-file .icon { width: 18px; height: 18px; flex: none; color: var(--accent); }
.attached-local .icon { color: var(--text-dim); }
.clip { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: 6px; color: var(--accent); font-weight: 600; }
.clip .icon { width: 14px; height: 14px; }

/* A trip's sharing page: everyone's defaults, then each person. */
.chips-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips-row .chip::before { content: none; }
.chips-row .chip .icon { width: 16px; height: 16px; }
.chips-row .chip[aria-pressed="false"] { text-decoration: line-through; }
.chip:disabled, .seg button:disabled { opacity: 0.6; }
.people { list-style: none; margin: 0; padding: 0; }
.person + .person { border-top: 1px solid var(--line); }
.person-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; list-style: none; cursor: default; }
summary.person-head { cursor: pointer; }
summary.person-head::-webkit-details-marker { display: none; }
details[open] > summary .srow-chev { transform: rotate(90deg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.person-body { display: grid; gap: var(--space-3); padding: 0 0 var(--space-3); }
.share-note { background: var(--surface-2); box-shadow: none; }
.share-note h2 { font-size: 15px; }
.share-note p { font-size: 14px; color: var(--text-dim); }
.tick:disabled { opacity: 0.5; }
.share-page .seg { max-width: 420px; }
[dir="rtl"] details[open] > summary .srow-chev { transform: rotate(-90deg); }
.sheet button:disabled:not(.attached-file) { opacity: 0.5; }
.link-field { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.btn.danger-text { color: var(--danger); }

/* Google Drive's backups */
.drive-list { list-style: none; margin: 0; padding: 0; }
.drive-list li { display: flex; align-items: center; gap: var(--space-2); padding-block: var(--space-2); border-block-end: 1px solid var(--line); }
.drive-list li:last-child { border-block-end: 0; }
.drive-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.drive-text .dim { font-size: var(--fs-small); }
.drive-btns { display: flex; gap: var(--space-1); flex-shrink: 0; }
/* A sheet opened to edit holds the focus itself (openSheet). */
dialog[tabindex="-1"]:focus { outline: none; }

/* Settings → Categories */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; align-items: center; gap: var(--space-2); padding-block: var(--space-2); border-block-end: 1px solid var(--line); }
.cat-list li:last-child { border-block-end: 0; }
.cat-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cat-name input { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; }
.cat-name .dim { font-size: var(--fs-small); }
.cat-btns { display: flex; align-items: center; gap: var(--space-1); flex-shrink: 0; }
.cat-btns .icon-btn:disabled { opacity: 0.35; }
.cat-keep { display: inline-block; min-width: 72px; }

/* The trip sheet: importing a Google Maps list by its link */
/* The trip sheet: Import from file and Add from link, side by side */
.import-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.import-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: 84px; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-align: center; cursor: pointer;
}
.import-btn svg { width: 24px; height: 24px; color: var(--accent); }
.import-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.import-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-row { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.link-row input { flex: 1; min-width: 0; }

/* Adding or editing a trip or a place: a full-screen page like Sharing,
   with its own bar, rather than a sheet over the board. */
.sheet.page {
  width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0;
  border-radius: 0; background: var(--bg);
}
.sheet.page .sheet-body {
  max-width: 640px; margin: 0 auto;
  padding: 0 var(--space-3) calc(env(safe-area-inset-bottom) + var(--space-3));
}
.page-bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: var(--space-2);
  padding: calc(env(safe-area-inset-top) + var(--space-2)) 0 var(--space-2);
  background: var(--bg);
}
.page-bar .page-back { margin-inline-start: calc(-1 * var(--space-2)); }
.page-back .icon-x { display: none; }
/* The trip form's two halves: one column on a phone, side by side on a computer. */
.trip-col { display: contents; }
.sheet.page .page-bar h2 { flex: 1; font-size: var(--fs-big); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet.page .field input, .sheet.page .field select, .sheet.page .field textarea { background-color: var(--surface); }
.sheet.page .sheet-actions {
  position: sticky; bottom: 0;
  padding: var(--space-2) 0 calc(env(safe-area-inset-bottom) + var(--space-2));
  margin-bottom: calc(-1 * (env(safe-area-inset-bottom) + var(--space-3)));
  background: var(--bg);
}

/* On a computer a new or edited trip is a wide dialog over the page, its
   details on the left and its cover, places to start with and file on the right. */
@media (min-width: 1100px) {
  #tripSheet.page { width: 960px; max-width: calc(100vw - 64px); height: fit-content; max-height: 88dvh; margin: auto; border-radius: 20px; }
  #tripSheet::backdrop { background: rgba(0, 0, 0, 0.35); }
  #tripForm { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; align-items: start; align-content: start; max-width: none; padding: 0 28px var(--space-3); }
  #tripForm > .page-bar { grid-column: 1 / -1; padding-block-start: var(--space-3); }
  /* A dialog closes with x at its end rather than a back arrow at its start. */
  #tripForm .page-back { order: 1; margin-inline: 0 calc(-1 * var(--space-2)); }
  #tripForm .page-back .icon-back { display: none; }
  #tripForm .page-back .icon-x { display: block; }
  #tripForm > .sheet-actions { grid-column: 1 / -1; }
  #tripForm .trip-col { display: grid; gap: var(--space-3); min-width: 0; }
  #tripForm .art-row { flex-wrap: wrap; overflow: visible; }
}

/* Adding a place: a sheet from below over the trip, its title and its
   button staying in view while the form scrolls. */
#placeSheet:not(.page) { max-height: 80dvh; }
#placeSheet:not(.page) .page-back { display: none; }
#placeSheet:not(.page) .page-bar { position: sticky; top: 0; z-index: 1; padding: 0 0 var(--space-2); background: var(--surface); }
#placeSheet:not(.page) .sheet-actions {
  position: sticky; bottom: 0; z-index: 1;
  padding: var(--space-2) 0 calc(env(safe-area-inset-bottom) + var(--space-2));
  margin-bottom: calc(-1 * (env(safe-area-inset-bottom) + var(--space-3)));
  background: var(--surface);
}

/* On a computer, adding or editing a place opens a panel down the map's
   side, so the plan stays in view. A click outside it closes it. */
body.desk #placeSheet {
  position: fixed; inset: 0 0 0 auto; width: 500px; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
  border-radius: 0; border-inline-start: 1px solid var(--surface-2); background: var(--bg); box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}
[dir="rtl"] body.desk #placeSheet { inset: 0 auto 0 0; box-shadow: 8px 0 30px rgba(0, 0, 0, 0.12); }
body.desk #placeSheet::backdrop { background: transparent; }
body.desk #placeSheet .sheet-body { max-width: none; padding-inline: 24px; }
body.desk #placeSheet .page-bar, body.desk #placeSheet .sheet-actions { background: var(--bg); }
body.desk #placeSheet .page-bar h2 { flex: 1; }
body.desk #placeSheet .page-back { display: inline-grid; order: 1; margin-inline: 0 calc(-1 * var(--space-2)); }
body.desk #placeSheet .page-back .icon-back { display: none; }
body.desk #placeSheet .page-back .icon-x { display: block; }
body.desk #placeSheet .field input, body.desk #placeSheet .field select, body.desk #placeSheet .field textarea { background-color: var(--surface); }

/* Sync in the bar: turning arrows while trips sync, a crossed cloud when
   the last sync didn't finish (tapped, Settings › Data says why). Hidden
   the rest of the time. */
.sync-badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px var(--space-2); border-radius: 999px;
  color: var(--text-dim); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; text-decoration: none;
}
.sync-badge[hidden] { display: none; }
.sync-badge svg { width: 16px; height: 16px; }
.sync-badge[data-state="syncing"] svg { animation: sync-turn 1s linear infinite; }
.sync-badge[data-state="error"] { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
@keyframes sync-turn { to { rotate: 360deg; } }
@media (max-width: 420px) {
  .sync-badge { padding: 4px; }
  .sync-badge-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Offline: the trip's badge in the bar, and its card in Edit trip */
.offline-badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px var(--space-2); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: var(--fs-small); font-weight: 600; white-space: nowrap;
}
.offline-badge svg { width: 16px; height: 16px; }
/* On a phone the bar also holds Sharing, Edit trip and Settings, so the badge keeps only its tick. */
@media (max-width: 420px) {
  .offline-badge { padding: 4px; }
  .offline-badge-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.offline-card {
  font-size: var(--fs-body);
  display: grid; gap: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font-weight: 400; color: var(--text);
}
.offline-card p { margin: 0; }
.offline-title { font-weight: 600; }
.offline-card progress { width: 100%; height: 8px; accent-color: var(--accent); }
.offline-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; cursor: pointer; }
.check input, .field .check input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
/* Duplicate trip: what comes along, one choice a row with its hint under it */
.dup-what { gap: 0; }
.dup-what legend { margin-block-end: var(--space-1); }
.dup-check { display: flex; align-items: flex-start; padding-block: var(--space-2); color: var(--text); }
.dup-check input { margin-block-start: 2px; flex: none; }
.dup-check strong { display: block; font-weight: 600; }
.dup-check .hint { display: block; }
/* Today: today's places in order, the way between them, Next and Navigate */
body.on-board main.today-page { max-width: 640px; }
.today-head { margin: var(--space-3) 0; }
.today-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-block: -8px -4px; }
.today-kicker { margin: 0; color: var(--accent); font-weight: 600; }
.today-date { margin: 0; font-size: 26px; line-height: 1.2; }
.today-done { margin: 2px 0 0; font-size: 14px; }
/* Stepping through the trip's days: before, back to today, after */
.day-steps { flex: none; display: flex; align-items: center; gap: 2px; margin-inline-end: -10px; }
.day-steps .icon-btn { color: var(--text); }
.day-steps .day-step.off { opacity: 0.3; pointer-events: none; }
.day-back { min-height: 36px; padding: 0 12px; text-decoration: none; }
/* A day's heading on the Plan opens that day */
.day-open { display: inline-flex; align-items: center; gap: 2px; color: inherit; text-decoration: none; }
.day-open-ic { width: 16px; height: 16px; color: var(--text-dim); }
.day-open:hover > span { text-decoration: underline; }
.slot .day-open-ic { width: 13px; height: 13px; }
[dir="rtl"] .day-step .icon, [dir="rtl"] .day-open-ic { transform: scaleX(-1); }
.today { list-style: none; margin: 0; padding: 0; }
.today .card { flex-direction: column; align-items: stretch; gap: 0; }
.today .card-row { display: flex; align-items: flex-start; gap: var(--space-1); }
.today .card.next { border: 2px solid var(--accent); border-inline-start-width: 4px; background: var(--surface); }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-block: 0 var(--space-2); padding-inline: var(--space-3) var(--space-2); }
.next-label { color: var(--accent); font-weight: 700; }
.next-row .btn { border-radius: 999px; text-decoration: none; }
.leg { margin-inline-start: 8px; padding-block: var(--space-1); padding-inline: var(--space-3) 0; border-inline-start: 2px dotted var(--line); color: var(--text-dim); font-size: var(--fs-small); }
.leg:empty { min-height: var(--space-2); padding-block: 0; }
.today + .hint { margin: var(--space-2) 0 0; }
/* A stay booked for tonight somewhere else, apart from the day's own places */
.also-booked { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-3) 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.also-booked-ic .icon { width: 20px; height: 20px; color: var(--text-dim); margin-top: 2px; }
.also-booked-label { margin: 0; font-size: var(--fs-small); }
.also-booked-name { display: block; padding: 2px 0; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.tomorrow { margin-top: var(--space-4); color: inherit; text-decoration: none; }
.tomorrow-head { display: flex; justify-content: space-between; align-items: baseline; }

/* GitHub sync: the setup code for another device, and the question a setup link asks */
.sync-qr { justify-self: center; padding: var(--space-2); border-radius: var(--radius-lg); background: #fff; line-height: 0; }
.sync-qr svg { width: 200px; height: 200px; }
.setup-ask { border: 2px solid var(--accent); }

/* Weather (views.js, src/weather.js): a small chip on a day, a panel on Today. */
.wx { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.wx .icon { width: 18px; height: 18px; color: var(--text-dim); }
.wx-max { font-weight: 600; }
.wx-min { color: var(--text-dim); }
.wx-today { grid-template-columns: auto 1fr; align-items: center; gap: var(--space-3); }
.wx-today-ic .icon { width: 40px; height: 40px; color: var(--accent); }
.wx-today-text { display: grid; gap: 2px; }
.wx-today-kind { font-weight: 600; }
.wx-today-temps { display: flex; align-items: baseline; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.wx-today-temps .wx-max { font-size: var(--fs-big); line-height: 1.1; }
.wx-today-temps .wx-min { font-size: var(--fs-title); }
.wx-today-more { font-size: 14px; }
.wx-ask { grid-template-columns: auto 1fr; align-items: start; gap: var(--space-3); }
.wx-ask-ic .icon { width: 28px; height: 28px; color: var(--accent); }
.wx-ask-text { display: grid; gap: var(--space-2); }
.tomorrow-head .wx { margin-inline-start: auto; margin-inline-end: var(--space-3); }
.wx-today-src { font-size: var(--fs-small); }
.group-head .wx { margin-inline-end: var(--space-1); }
/* A place category's icon: before a place's name, and before a group's title by category. */
.card-name .icon.cat { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 5px; color: var(--text-dim); }
.group-head h2 .icon.cat { width: 20px; height: 20px; vertical-align: -3px; margin-inline-end: 8px; color: var(--accent); }
.data-label { margin: var(--space-3) 0 var(--space-2); }
.data-label:first-child { margin-top: var(--space-1); }
.sync-qr[hidden] { display: none; }
.sync-steps summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.sync-steps .steps { margin-top: var(--space-2); }

/* A filter's drop-down: All, then a box for each choice. */
.filter-menu { min-width: 240px; max-height: min(70vh, 480px); overflow-y: auto; }
.filter-menu hr { margin: 2px var(--space-2); border: 0; border-top: 1px solid var(--surface-2); }
.filter-menu .box {
  flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px;
  border: 2px solid var(--text-dim); border-radius: 5px; color: var(--on-accent);
}
.filter-menu [aria-checked="true"] .box, .filter-menu [aria-checked="mixed"] .box { background: var(--accent); border-color: var(--accent); }
.filter-menu .box .icon { width: 14px; height: 14px; stroke-width: 3; }
.filter-menu .box.radio { border-radius: 50%; }
.filter-menu .star { width: 18px; text-align: center; color: var(--star); }
.filter-menu button > .icon { width: 18px; height: 18px; }
.filter-menu .dot { width: 12px; height: 12px; margin-inline: 3px; }
.filter-menu .grow { flex: 1; }

/* The View sheet: category icons off, or the importance colour off. */
[data-cat="label"] .card-name .icon.cat, [data-cat="label"] .group-head h2 .icon.cat { display: none; }
[data-imp="label"] .card { border-inline-start-color: transparent; }

/* Destinations with dates. On the Plan, each run of a destination's days
   starts with its name, then its places that have no day yet, folded. */
.dest-band { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px var(--space-2); margin-top: 4px; padding: 6px var(--space-1) 0; border-top: 2px solid var(--accent); }
.groups > .dest-band:first-child { margin-top: 0; }
.dest-band .icon { width: 17px; height: 17px; color: var(--accent); align-self: center; flex: none; }
.dest-band h2 { margin: 0; font-size: 18px; }
.dest-band .dim { font-size: 14px; }
.group.dest-any { background: var(--accent-soft); box-shadow: none; }
.dest-any .group-head h2 { font-size: 16px; }
.dest-any .fold-title { flex: 1; min-width: 0; }
.dest-any .fold .count { font-weight: 400; }
.dest-any .fold { display: flex; width: 100%; align-items: center; gap: var(--space-2); min-width: 0; min-height: 44px; margin: -6px 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.dest-any .fold .icon { width: 20px; height: 20px; flex: none; color: var(--text-dim); }
.dest-any.open .fold .icon { transform: rotate(180deg); }
.dest-any .fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.dest-any .peek { margin: var(--space-1) 0 0; font-size: 14px; }
.dest-any .cards { margin-top: var(--space-2); }
.also-head { display: flex; align-items: baseline; gap: var(--space-2); }
.also-head h2 { flex: 1; }
.also .cards { margin: 0; }
.also .btn { justify-self: start; }

/* Edit trip: a row per destination, its dates under it when opened. */
.dest-rows { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.dest-row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dest-line { display: flex; align-items: center; gap: var(--space-1); min-height: 48px; padding-inline: 4px; }
.field .dest-name { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 600; }
/* 44 px to tap, a 36 px pill to see. */
.dest-when { flex: none; min-height: 44px; padding: 0 12px; border: 4px solid transparent; border-radius: 999px; background: var(--accent-soft); background-clip: padding-box; color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.dest-when.none { background: transparent; color: var(--text-dim); outline: 1px dashed var(--text-dim); outline-offset: -5px; }
.dest-when:focus-visible { outline: 2px solid var(--accent); }
.dest-dates { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
.dest-dates[hidden] { display: none; }
.dest-dates .field { flex: 1 1 130px; }
.dest-acts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 2px; }
.dest-acts .btn[hidden] { display: none; }

/* Journeys: a flight or a train between two places. The card's edge is the
   accent instead of an importance; the times sit on a dotted line. */
.card.journey { border-inline-start-color: var(--accent); }
[data-imp="label"] .card.journey { border-inline-start-color: var(--accent); }
.jline { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.jline .rail { flex: 1; max-width: 96px; height: 0; border-top: 2px dotted var(--line); position: relative; }
.jline .rail::before, .jline .rail::after { content: ""; position: absolute; top: -4px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.jline .rail::before { inset-inline-start: -3px; }
.jline .rail::after { inset-inline-end: -3px; }
.jline sup { margin-inline-start: 1px; font-size: 11px; font-weight: 700; color: var(--accent); }
[dir="rtl"] .card.journey .card-name .icon.cat, [dir="rtl"] .jland .icon { transform: scaleX(-1); }
.jchange { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; padding-inline-start: 40px; color: var(--text-dim); font-size: 12px; }
.jchange .icon { width: 14px; height: 14px; flex: none; }
.jland button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding-inline: 14px 12px;
  border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--text-dim); font-size: 14px; text-align: start;
}
.jland .icon { width: 18px; height: 18px; flex: none; color: var(--accent); }
.jland b { color: var(--text); font-variant-numeric: tabular-nums; }
.jsoon { color: var(--accent); font-weight: 600; font-size: 14px; }
/* The place sheet as a journey: the fields only one of them has. */
#placeForm:not(.is-journey) .j-only, #placeForm.is-journey .p-only { display: none; }
#modeSeg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
#modeSeg .icon { width: 16px; height: 16px; flex: none; }
.cards .jchange { margin: -2px 0 2px; }

/* A computer's wide screen (views.js, desk): a trip's tabs in a side bar
   at the start, the page beside it, and the map beside the page (folded
   away with the handle on its edge) or alone from the side bar's Map. */
.side, .desk-fold, .group-dest, .card-time { display: none; }
body.desk {
  --side: 248px; --panel: clamp(560px, 42vw, 820px);
  --edge: color-mix(in srgb, var(--line) 35%, transparent);
}
body.desk .bottombar { display: none; }
body.desk .side:not([hidden]) {
  position: fixed; z-index: 6; inset-block: 0; inset-inline-start: 0; width: var(--side); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) 14px 68px; overflow-y: auto;
  background: var(--surface); border-inline-end: 1px solid var(--edge);
}
.side-back { display: flex; align-items: center; gap: var(--space-2); align-self: start; padding: 6px 8px; margin-bottom: var(--space-2); border-radius: 8px; color: var(--text-dim); font-size: 14px; text-decoration: none; }
.side-back:hover { background: var(--surface-2); color: var(--text); }
.side-back .icon { width: 18px; height: 18px; }
.side-cover { position: relative; flex: none; height: 96px; border-radius: var(--radius); overflow: hidden; background: var(--tint-0); }
.side-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side-name { margin: 12px 8px 2px; font-size: var(--fs-title); line-height: 1.25; overflow-wrap: anywhere; }
.side-when { margin: 0 8px 14px; color: var(--text-dim); font-size: var(--fs-small); }
.side-nav { display: grid; gap: 2px; }
.side-tab { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.side-tab:hover { background: var(--surface-2); }
.side-tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-tab .count { margin-inline-start: auto; font-weight: 400; }
.side-add { margin: 14px 4px 4px; border-radius: 999px; }
.side-add[hidden] { display: none; }
.side-dests { margin: 14px 8px 0; padding-top: 14px; border-top: 1px solid var(--edge); color: var(--text-dim); font-size: var(--fs-small); line-height: 1.8; }
.side-dests[hidden] { display: none; }
/* The top bar's buttons sit at the foot of the side bar; the side bar has the back and the name. */
body.desk .bar, body.desk.on-map .bar {
  position: fixed; z-index: 7; top: auto; bottom: 0; inset-inline-start: 0; width: var(--side); max-width: none; margin: 0;
  box-sizing: border-box; padding: var(--space-2) 10px; background: var(--surface); border-inline-end: 1px solid var(--edge);
}
body.desk #back, body.desk .bar-title, body.desk #settingsBtn { display: none; }
/* The side bar's foot has room for the words, so the sync state reads at a glance. */
body.desk .sync-badge, body.desk .offline-badge { padding: 4px 8px; }
body.desk main, body.desk.on-board main {
  max-width: none; margin-inline: var(--side) 0; padding: var(--space-3) var(--space-4) 48px;
}
body.desk.side-map main { width: var(--panel); box-sizing: border-box; }
body.desk main.tab-leaving { margin: 0; }
/* The page scrolls by itself, so its scroll bar sits by it, not at the window's edge past the map. */
:root:has(> body.desk) { scrollbar-gutter: auto; overflow: hidden; }
body.desk main { height: 100dvh; box-sizing: border-box; overflow-y: auto; }
body.desk:not(.side-map) main { padding-inline-end: 56px; }
body.desk main.today-page { max-width: none; }
body.desk .hero { display: none; }
body.desk .controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
body.desk .groups { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-items: start; }
body.desk .groups > .dest-band { display: none; }
body.desk .group-dest { display: block; margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
/* The map: beside the page, or alone. */
body.desk .map-view:not([hidden]) { position: fixed; z-index: 3; inset-block: 0; inset-inline-end: 0; inset-inline-start: var(--side); }
body.desk.side-map .map-view:not([hidden]) { inset-inline-start: calc(var(--side) + var(--panel)); border-inline-start: 1px solid var(--edge); }
/* The credit at the bottom start corner, under the place's card. */
body.desk .map-top { bottom: var(--space-3); display: flex; flex-direction: column; align-items: flex-start; }
body.desk .map-days, body.desk .map-note { align-self: stretch; }
body.desk .map-credits { order: 1; margin: auto 0 0; }
body.desk .map-credit { order: 2; min-height: 28px; margin: auto 0 0; }
body.desk .map-top:has(.map-credits:not([hidden])) .map-credit { margin-top: 0; }
body.desk.with-tabbar .map-panel { bottom: calc(var(--space-3) + 28px + var(--space-2)); }
body.desk.with-tabbar .map-view:has(.map-credit[hidden]) .map-panel { bottom: var(--space-3); }
body.desk.with-tabbar .map-tools { bottom: var(--space-3); }
/* Grown by size, not scale: MapLibre places a pin with its own transform,
   and scale would multiply that too, pushing the pin away from its spot. */
.pin.hot { width: 36px; height: 36px; z-index: 3; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.pin.hot.imp-must { width: 40px; height: 40px; }
/* The line between the page and the map: drag it (or arrow keys on it) to share the width. */
.desk-split { display: none; }
body.desk.side-map .desk-split:not([hidden]) {
  display: block; position: fixed; z-index: 7; inset-block: 0; inset-inline-start: calc(var(--side) + var(--panel) - 5px); width: 10px;
  cursor: col-resize; touch-action: none;
}
body.desk .desk-split::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 4px; width: 2px; background: transparent; transition: background-color 120ms; }
body.desk .desk-split:hover::after, body.desk .desk-split:focus-visible::after, body.splitting .desk-split::after { background: var(--accent); }
body.desk .desk-split:focus-visible { outline: none; }
body.splitting, body.splitting * { cursor: col-resize !important; user-select: none; }
body.splitting .map-view { pointer-events: none; }
/* The handle that folds the map away, on its edge, and brings it back from the window's. */
/* It sits on the map's side of the line, never over the page's scroll bar. */
body.desk .desk-fold:not([hidden]) {
  position: fixed; z-index: 8; top: 50%; translate: 0 -50%; inset-inline-start: calc(var(--side) + var(--panel) + 1px);
  display: grid; place-items: center; width: 24px; height: 56px; padding: 0;
  border: 1px solid var(--edge); border-inline-start: 0; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--text-dim); box-shadow: var(--shadow); cursor: pointer;
}
[dir="rtl"] body.desk .desk-fold:not([hidden]) { border-radius: 10px 0 0 10px; }
body.desk .desk-fold:hover { color: var(--text); }
body.desk:not(.side-map) .desk-fold:not([hidden]) { inset-inline-start: auto; inset-inline-end: var(--bar-w, 0px); width: 32px; height: 64px; border-inline-start: 1px solid var(--edge); border-inline-end: 0; border-radius: 10px 0 0 10px; }
[dir="rtl"] body.desk:not(.side-map) .desk-fold:not([hidden]) { border-radius: 0 10px 10px 0; }
/* The map on its way out when folded: held where it was while it slides off. */
body.desk .map-view.map-leaving { position: fixed; z-index: 3; inset-block: 0; pointer-events: none; }
.desk-fold .icon { width: 18px; height: 18px; rotate: -90deg; }
body.desk:not(.side-map) .desk-fold .icon { rotate: 90deg; }
[dir="rtl"] .desk-fold .icon { scale: -1 1; }

/* With a mouse the Plan's cards are compact, so more of the trip shows. */
@media (pointer: fine) {
  body.desk .group { padding: 10px 12px 12px; border-radius: 14px; }
  body.desk .group-head h2 { font-size: 15px; }
  body.desk .group-head .icon-btn.small { min-width: 30px; min-height: 30px; }
  body.desk .slot { margin: 8px 0 3px; font-size: 11px; }
  body.desk .cards { gap: 4px; margin-top: 4px; }
  body.desk .slot + .cards { margin-top: 0; }
  body.desk .card { border-inline-start-width: 3px; border-radius: 8px; }
  body.desk .card-body { min-height: 0; padding-block: 5px; gap: 0; padding-inline-end: 8px; line-height: 1.35; }
  body.desk .card-name { font-size: 14px; }
  body.desk .card-meta, body.desk .card-note { font-size: 12.5px; }
  body.desk .card-note { -webkit-line-clamp: 1; }
  body.desk .tick { width: 30px; height: 30px; margin-top: 2px; }
  body.desk .tick .icon { width: 11px; height: 11px; padding: 2px; border-width: 1.5px; }
  body.desk .jline { font-size: 13px; gap: 6px; }
  body.desk .jchange { padding-inline-start: 34px; font-size: 11.5px; margin: 0 0 2px; }
  body.desk .dest-any .fold { min-height: 30px; margin: 0; }
  body.desk .dest-any .group-head h2 { font-size: 15px; }
  body.desk .dest-any .peek { font-size: 12.5px; margin-top: 2px; }
  body.desk .xrow { min-height: 0; padding: 5px 8px; gap: 8px; }
  body.desk .xrow-ic { width: 26px; height: 26px; border-radius: 7px; }
  body.desk .xrow-ic .icon { width: 15px; height: 15px; }
  body.desk .xrow-title, body.desk .xrow .amount { font-size: 14px; }
  body.desk .xrow-meta { font-size: 12.5px; }
  body.desk .spend-total { font-size: 22px; }
  body.desk .spend-cats { font-size: 14px; }
}
/* A phone on its side (views.js, land): the trip's tabs and + in a rail
   at the start, the cover gone, the Plan's switch and filters in the top
   bar, and the Plan in columns as on a computer. Cards and ticks keep
   their phone size, for fingers. The rail takes the notch's side. */
body.land { --rail: 72px; --rail-in: env(safe-area-inset-left); --far-in: env(safe-area-inset-right); }
[dir="rtl"] body.land { --rail-in: env(safe-area-inset-right); --far-in: env(safe-area-inset-left); }
body.land .bottombar {
  inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; left: auto; right: auto; bottom: 0; margin: 0;
  width: calc(var(--rail) + var(--rail-in)); max-width: none; box-sizing: border-box; padding-inline-start: var(--rail-in);
  flex-direction: column; justify-content: center; gap: var(--space-3);
  background: var(--surface); border-inline-end: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
}
body.land .bottombar::before { display: none; }
body.land .tabbar { flex-direction: column; border: 0; background: none; box-shadow: none; }
body.land .tab-bubble { top: 0; left: 4px; }
body.land .bar, body.land.on-map .bar {
  max-width: none; width: auto; margin: 0; margin-inline-start: calc(var(--rail) + var(--rail-in));
  padding: var(--space-1) max(var(--space-3), var(--far-in)) var(--space-1) var(--space-3); gap: var(--space-1);
}
[dir="rtl"] body.land .bar { padding: var(--space-1) var(--space-3) var(--space-1) max(var(--space-3), var(--far-in)); }
body.land .bar-title { font-size: 18px; }
body.land .bar:has(> .controls) .bar-title { flex: none; max-width: 30%; }
body.land .bar > .controls { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--space-2); margin: 0; margin-inline-start: var(--space-2); }
body.land .bar > .controls .sorts { flex: none; }
body.land .bar > .controls .filters { min-width: 0; }
body.land main, body.land.with-tabbar main {
  max-width: none; margin: 0; margin-inline-start: calc(var(--rail) + var(--rail-in));
  padding: var(--space-2) max(var(--space-3), var(--far-in)) calc(env(safe-area-inset-bottom) + var(--space-4)) var(--space-3);
}
[dir="rtl"] body.land main { padding: var(--space-2) var(--space-3) calc(env(safe-area-inset-bottom) + var(--space-4)) max(var(--space-3), var(--far-in)); }
body.land .map-view { margin-inline-start: calc(var(--rail) + var(--rail-in)); }
body.land .hero { display: none; }
body.land .groups { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
body.land .groups > .dest-band { grid-column: 1 / -1; }
body.land .groups.areas { display: flex; flex-wrap: wrap; align-items: flex-start; }
body.land .area { flex: var(--cols, 1) 0 min(100%, calc(var(--cols, 1) * 260px)); min-width: 0; }
body.land .area-cols { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; }
body.land .area-col.wide { grid-column: span 2; }
body.land .area-col.wide > .cards:last-child { display: block; columns: 2; column-gap: 8px; }
body.land .area-col.wide > .cards:last-child > li { break-inside: avoid; margin-bottom: 4px; }
body.land.with-tabbar .toast, body.land.with-tabbar .update { bottom: calc(env(safe-area-inset-bottom) + var(--space-3)); }
body.land .toast { inset-inline-start: calc(var(--rail) + var(--rail-in) + var(--space-3)); }
body.land.with-tabbar .map-panel { bottom: calc(env(safe-area-inset-bottom) + var(--space-3)); }
body.land.with-tabbar .map-tools { bottom: calc(env(safe-area-inset-bottom) + var(--space-3) + var(--space-2)); }

/* Files has few, long groups: each takes the page's width, its rows in columns. */
body.desk .files-groups { grid-template-columns: 1fr; }
body.desk .files-groups .xrows { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* The List look: a line a place: done, rating, category, name (coloured by importance) and time. */
:root[data-look="list"] body.on-board .card { background: none; border: 0; border-radius: 6px; align-items: center; gap: 0; min-width: 0; }
:root[data-look="list"] body.on-board .card:hover { background: var(--bg); }
:root[data-look="list"] body.on-board .group, :root[data-look="list"] body.on-board .cards { min-width: 0; }
:root[data-look="list"] body.on-board .card-body { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 0; padding: 1px 4px 1px 0; }
:root[data-look="list"] body.on-board .card-meta, :root[data-look="list"] body.on-board .card-note, :root[data-look="list"] body.on-board .jline,
:root[data-look="list"] body.on-board .jchange, :root[data-look="list"] body.on-board .dest-any .peek { display: none; }
:root[data-look="list"] body.on-board .card-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; color: var(--want); text-decoration: none; }
:root[data-look="list"] body.on-board .card.imp-must .card-name { color: var(--must); font-weight: 650; }
:root[data-look="list"] body.on-board .card.imp-maybe .card-name { color: var(--maybe); }
:root[data-look="list"] body.on-board .card.journey .card-name { color: var(--text); }
:root[data-look="list"] body.on-board .card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
:root[data-look="list"] body.on-board .card-name .icon.cat { width: 15px; height: 15px; margin: 0; color: var(--text-dim); }
:root[data-look="list"] body.on-board .card-name .rating { position: relative; order: -1; width: 14px; margin: 0; flex: none; text-align: end; color: var(--text-dim); font-size: 12.5px; font-weight: 600; }
:root[data-look="list"] body.on-board .card-name .rating .star { position: absolute; inset-inline-end: 4px; bottom: -7px; margin: 0; font-size: 0; color: inherit; pointer-events: none; }
:root[data-look="list"] body.on-board .card-name .rating .star::before { content: "\2605"; font-size: 9px; font-weight: 400;
  text-shadow: 1px 0 var(--halo), -1px 0 var(--halo), 0 1px var(--halo), 0 -1px var(--halo), 1px 1px var(--halo), -1px -1px var(--halo), 1px -1px var(--halo), -1px 1px var(--halo); }
/* --halo is the colour behind the row, so the star keeps a thin gap where it overlaps the number */
:root[data-look="list"] body.on-board .group { --halo: var(--surface); }
:root[data-look="list"] body.on-board .group.dest-any { --halo: var(--accent-soft); }
:root[data-look="list"] body.on-board .card:hover { --halo: var(--bg); }
/* Centre the digits, not their line boxes, so the rating and time sit level with the tick and icon */
:root[data-look="list"] body.on-board :is(.card-name .rating, .card-time) { text-box: trim-both cap alphabetic; }
:root[data-look="list"]:not([data-ratings="hide"]) body.on-board .card-name:not(:has(.rating))::before { content: ""; order: -1; width: 14px; flex: none; }
:root[data-look="list"] body.on-board .card-time { display: block; flex: none; color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
:root[data-look="list"] body.on-board .tick { width: 24px; height: 24px; margin: 0; }
:root[data-look="list"] body.on-board .tick .icon { width: 9px; height: 9px; padding: 1px; }
:root[data-look="list"] body.on-board .cards { gap: 0; }
:root[data-look="list"] body.on-board .slot { margin: 6px 0 1px; font-size: 10.5px; }
:root[data-look="list"] body.on-board .jland { font-size: 12.5px; }
:root[data-look="list"] body.on-board .jland button { min-height: 0; padding-block: 1px; padding-inline: 24px 0; border: 0; background: none; }
/* Expanded: the List's line, then the place's details and its note under the name. */
:root[data-rows="expanded"] { --lead: 39px; }
:root[data-rows="expanded"][data-ratings="hide"] { --lead: 20px; }
:root[data-rows="expanded"] body.on-board .card { align-items: flex-start; }
:root[data-rows="expanded"] body.on-board .cards { gap: 2px; }
:root[data-rows="expanded"] body.on-board .card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 6px; padding-block: 3px; }
:root[data-rows="expanded"] body.on-board .card-name { grid-area: 1 / 1; }
:root[data-rows="expanded"] body.on-board .card-time { grid-area: 1 / 2; }
:root[data-rows="expanded"] body.on-board :is(.card-meta, .card-note) { display: block; grid-column: 1 / -1; padding-inline-start: var(--lead); color: var(--text-dim); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-rows="expanded"] body.on-board .card-meta:empty { display: none; }
:root[data-rows="expanded"] body.on-board .card-note { justify-self: start; max-width: 100%; box-sizing: border-box; font-style: italic; unicode-bidi: plaintext; }
:root[data-rows="expanded"] body.on-board .tick { margin-top: 1px; }
/* On a phone the List keeps finger-sized rows and type. */
:root[data-look="list"] body.on-board:not(.desk) .card { min-height: 44px; }
:root[data-look="list"] body.on-board:not(.desk) .card-body { min-height: 44px; padding-block: 0; }
:root[data-look="list"] body.on-board:not(.desk) .card-name { font-size: 15px; gap: 6px; }
:root[data-look="list"] body.on-board:not(.desk) .card-name .icon.cat { width: 17px; height: 17px; }
:root[data-look="list"] body.on-board:not(.desk) .card-name .rating { width: 15px; font-size: 13.5px; }
:root[data-look="list"]:not([data-ratings="hide"]) body.on-board:not(.desk) .card-name:not(:has(.rating))::before { width: 15px; }
:root[data-look="list"] body.on-board:not(.desk) .card-time { font-size: 13px; }
:root[data-look="list"] body.on-board:not(.desk) .tick { width: 38px; height: 44px; }
:root[data-look="list"] body.on-board:not(.desk) .tick .icon { width: 11px; height: 11px; padding: 2px; }
:root[data-rows="expanded"] body.on-board:not(.desk) { --lead: 44px; }
:root[data-rows="expanded"][data-ratings="hide"] body.on-board:not(.desk) { --lead: 23px; }
:root[data-rows="expanded"] body.on-board:not(.desk) .card-body { padding-block: 8px; }
:root[data-rows="expanded"] body.on-board:not(.desk) :is(.card-meta, .card-note) { font-size: 13px; }
:root[data-rows="expanded"] body.on-board:not(.desk) .tick { height: 36px; }
/* Importance as words only: the name keeps the usual text colour. */
:root[data-look="list"][data-imp="label"] body.on-board .card:not(.journey) .card-name { color: var(--text); font-weight: 500; }

/* By destination: a block a destination, its trips out beside it. */
.groups.areas { grid-template-columns: 1fr; gap: 12px; }
.area { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.area-head { display: flex; align-items: center; gap: var(--space-1); padding-inline: 12px 8px; border-block-start: 3px solid var(--accent); }
.area-head .fold { display: flex; flex: 1; align-items: center; gap: var(--space-2); min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.area-head .fold > .icon { width: 18px; height: 18px; flex: none; color: var(--accent); }
.area-head .fold > .icon:last-child:not(:first-child) { width: 20px; height: 20px; color: var(--text-dim); }
.area.open .area-head .fold > .icon:last-child:not(:first-child) { transform: rotate(180deg); }
.area-head .fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.area-name { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); min-width: 0; }
.area-name h2 { margin: 0; font-size: 18px; }
.area-name .dim { font-size: 13.5px; }
.area-count { flex: none; font-size: 12.5px; color: var(--text-dim); }
.area.travel .area-head { border-block-start-color: var(--line); }
.area.travel .area-head .fold > .icon:first-child { color: var(--text-dim); }
.area-cols { display: grid; gap: 10px; padding: 0 10px 10px; }
.area-col { min-width: 0; }
.area-col .slot { margin: 10px 2px 4px; }
.area-col > .slot:first-child { margin-top: 2px; }
.area-col.trip-out { padding: 8px 10px 10px; border-radius: 12px; background: var(--accent-soft); }
.area-col-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); margin-bottom: 2px; }
.area-col-head h3 { margin: 0; font-size: 15.5px; }
.area-col-head .dim { font-size: 12.5px; }
@media (min-width: 960px) {
  .groups.areas, body.desk .groups.areas { display: flex; flex-wrap: wrap; align-items: flex-start; }
  .area { flex: var(--cols, 1) 0 min(100%, calc(var(--cols, 1) * 260px)); min-width: 0; }
  .area-cols { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; }
  .area-col.wide { grid-column: span 2; }
  .area-col.wide > .cards:last-child { display: block; columns: 2; column-gap: 8px; }
  .area-col.wide > .cards:last-child > li { break-inside: avoid; margin-bottom: 4px; }
}
.area-peek { margin: -4px 0 0; padding: 0 12px 10px; padding-inline-start: 38px; font-size: 13.5px; }

/* The place panel (2026-11): the name as its header, then cards for Where
   (Route for a journey), When, Details and Attachments, each row a label
   and its value. The same on a phone and in the computer's side panel. */
#placeSheet { background: var(--bg); }
#placeSheet:not(.page) .page-bar, #placeSheet:not(.page) .sheet-actions { background: var(--bg); }
#placeSheet .sheet-body { gap: var(--space-3); }
#placeSheet .page-bar h2 { flex: 1; font-size: var(--fs-small); font-weight: 600; color: var(--text-dim); line-height: 1.3; }
#placeSheet .kind-seg[hidden] { display: none; }
.ptitle { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cat-badge { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.cat-badge .icon { width: 22px; height: 22px; }
.ptitle-name { flex: 1; min-width: 0; }
.ptitle-name input, .pstop-name, #placeFromSlot input {
  width: 100%; min-height: 44px; padding: 2px 0; border: 0; border-bottom: 1px dashed transparent; border-radius: 0;
  background: transparent; color: var(--text); font-size: 26px; font-weight: 700; line-height: 1.2;
}
.ptitle-name input:placeholder-shown, .ptitle-name input:focus { border-bottom-color: var(--line); }
.ptitle-name input:focus, .pstop-name:focus, #placeFromSlot input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--accent); }
.ptitle-name input::placeholder, .pstop-name::placeholder, #placeFromSlot input::placeholder { color: var(--text-dim); font-weight: 600; }
.ptitle-name input[aria-invalid="true"] { border-bottom: 2px solid var(--danger); }
.ptitle-route { flex: 1; min-width: 0; margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
#placeForm.is-journey .ptitle-name { display: none; }
#placeForm .modes { margin: 0; }
#placeForm .modes button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#placeForm .modes .icon { width: 16px; height: 16px; }

.pcard { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; border-radius: var(--radius-lg); background: var(--surface); }
.pcard[hidden] { display: none; }
.pcard-head {
  display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 12px var(--space-3) 4px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
}
[lang="he"] .pcard-head { letter-spacing: 0; font-size: 13px; }
.pcard-head .icon { width: 15px; height: 15px; }
.pcard-hint { margin: 0; padding: 0 var(--space-3) 12px; font-size: var(--fs-small); color: var(--text-dim); }

/* Where, or a journey's route: each end a stop with its address and buttons. */
.pstop { display: flex; gap: 12px; padding: 4px var(--space-3) 14px; }
.pstop + .pstop { padding-top: 0; }
.pstop-body { flex: 1; min-width: 0; display: grid; gap: var(--space-2); }
.pstop-dots { display: flex; flex-direction: column; align-items: center; width: 14px; padding-top: 8px; }
.pdot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--accent); }
.pdot.fill { background: var(--accent); }
.pline { flex: 1; width: 2px; margin-top: 4px; background: var(--line); }
.pstop-k { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
[lang="he"] .pstop-k { letter-spacing: 0; font-size: 13px; }
.pstop-name, #placeFromSlot input { font-size: 18px; min-height: 36px; }
#placeFromSlot input[aria-invalid="true"] { border-bottom: 2px solid var(--danger); }
.paddr { display: flex; align-items: flex-start; gap: 10px; }
.paddr > .icon { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
#placeForm.is-journey .paddr > .icon { display: none; }
.paddr .where { flex: 1; min-width: 0; font-size: 15px; }
.paddr .icon-btn.small { flex: none; width: 36px; height: 36px; margin: -6px 0; color: var(--text-dim); }
.paddr .icon-btn.small .icon { width: 16px; height: 16px; }
.paddr .icon-btn[hidden] { display: none; }
.pcard .loc-actions .btn, .open-menu > summary { min-height: 40px; padding: 0 12px; gap: 6px; font-size: 14px; border-color: transparent; background: var(--surface-2); }
.pcard .loc-actions .icon { width: 16px; height: 16px; }
.open-menu { position: relative; }
.open-menu[hidden] { display: none; }
.open-menu > summary { list-style: none; cursor: pointer; }
.open-menu > summary::-webkit-details-marker { display: none; }
.open-menu .chev { width: 14px; height: 14px; color: var(--text-dim); }
.open-menu-list {
  position: absolute; z-index: 3; inset-block-start: calc(100% + 4px); inset-inline-start: 0; min-width: 180px;
  display: grid; padding: 4px; border: 1px solid var(--surface-2); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.open-menu.to-end .open-menu-list { inset-inline: auto 0; }
.open-menu-list a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.open-menu-list a:hover, .open-menu-list a:focus-visible { background: var(--surface-2); }
.pcard .results button { background: var(--bg); }

/* A row: its label at the start, its value (a drop-down, times, stars) at the end. */
.prow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px var(--space-3); border-top: 1px solid var(--surface-2); }
.prow[hidden] { display: none; }
.pcard-head + .prow { border-top: 0; }
.prow-lab { flex: none; max-width: 45%; color: var(--text-dim); font-size: 15px; }
.prow-val { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.prow-val > [hidden] { display: none; }
.prow select {
  min-width: 0; max-width: 100%; min-height: 44px; padding-block: 0; padding-inline: 4px 26px;
  appearance: none; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 16px;
  text-align: end; text-align-last: end; text-overflow: ellipsis; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 6px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.prow-val > select:first-child { flex: 1; }
[dir="rtl"] .prow select { background-position: 6px 50%, 11px 50%; }
.prow input[type="time"], .prow input[type="date"] {
  position: relative; flex: none; min-height: 40px; padding-block: 0; padding-inline: 12px 30px;
  appearance: none; border: 0; border-radius: 10px; background-color: var(--surface-2); color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
[dir="rtl"] .prow input[type="time"], [dir="rtl"] .prow input[type="date"] { background-position: 10px 50%, 15px 50%; }
.prow input::-webkit-calendar-picker-indicator {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: 30px; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.prow select:disabled, .prow input:disabled { background-image: none; opacity: 1; cursor: default; }
.prow-text { min-width: 0; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 16px; text-align: end; }
.prow-text:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.prow .stars-pick .star { min-width: 36px; font-size: 24px; }
.prow #ratingClear { min-height: 36px; padding: 0 6px; color: var(--text-dim); }
.prow #ratingClear .icon { width: 16px; height: 16px; }
.prow #ratingClear[hidden] { display: none; }
#placeSheet .imp-seg { margin: 4px var(--space-3) 12px; }
.prow-add {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 48px; padding: 0 var(--space-3);
  border: 0; border-top: 1px solid var(--surface-2); background: transparent; color: var(--accent); font-weight: 600; font-size: 15px; text-align: start; cursor: pointer;
}
.prow-add[hidden] { display: none; }
.prow-add .icon { width: 18px; height: 18px; }
.pdesc { display: grid; gap: 6px; padding: 12px var(--space-3) 14px; border-top: 1px solid var(--surface-2); color: var(--text-dim); font-size: 15px; }
.pdesc textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 16px; resize: vertical;
}
.pdesc textarea:focus { outline: none; border-color: var(--accent); }
#placeSheet .pcard .attached { padding: 0 var(--space-3) 8px; }
#placeSheet .sheet-actions { justify-content: center; flex-wrap: wrap; }
#placeSheet .sheet-actions .btn .icon { width: 18px; height: 18px; }
#placeSheet #nextLeg { color: var(--accent); }
/* A journey's day and time share a row; on a phone the label goes above them. */
@media (max-width: 480px) {
  #placeForm.is-journey #dayRow, #arriveRow { flex-wrap: wrap; row-gap: 0; padding-block: 8px; }
  #placeForm.is-journey #dayRow .prow-val, #arriveRow .prow-val { flex-basis: 100%; justify-content: space-between; }
  #placeForm.is-journey #dayRow select, #arriveRow select { flex: 0 1 auto; padding-inline-start: 0; text-align: start; text-align-last: start; }
}
.dest-dates .dest-part { flex-basis: 100%; }
/* Kept at the top of the view while a destination is dragged, wherever the board is scrolled to. */
/* Empty space between the blocks, under a dragged destination: a block of its own. */
.groups.areas.drop-over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 14px; }
.area.drop-over, .area-col.drop-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
[data-dest][draggable="true"] { cursor: grab; }
div.fold { cursor: inherit; }
