/* Ceļojumu plānotājs. Vizuālā identitāte: docs/DESIGN.md (meža migla, bērzs, priede, ogle).
   Kartes krāsas (--m-*) ir vienādas abās tēmās, jo flīzes vienmēr ir gaišas. */

:root {
  --bg: #E4E7E1; --bg2: #F3F4F0; --bg3: #D8DCD4;
  --ink: #24281F; --ink2: #5C6156; --line: #C6CBC0; --line2: #A9AFA2;
  --birch: #D9A621; --birch-ink: #7F5D0C; --birch-line: #A57A0B;
  --ember: #B03D18; --pine: #2E5A3C; --pine-soft: #DCE7DD; --gravel: #8B8A80;
  --s0: #4F534B; --s1: #D9A621; --s2: #2E5A3C; --s3: #B8401A; --s4: #B9BDB3;
  --field: #FBFBF8;
  --focus: #A57A0B;
  /* ezera zilais: izvēlētā diena un posms Lineālā (saskarnē „šo tu tagad skaties”, ne līnijām); slāneklis: posms bez maršruta */
  --lake: #2E88B0; --lake-deep: #23749A; --on-lake: #fff; --slate: #5B6472;
  /* plāns uz papīra (glifi, shēma): tā pati debess zilā kā maršruta josla kartē; --plan-ink — joslas mala leģendā */
  --plan: #1E90FF; --plan-ink: #0B4FA8;
  --hatch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='6' height='6' fill='%23F3F4F0'/%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%23B9BDB3' stroke-width='2.2'/%3E%3C/svg%3E");

  /* karte: nemainās ar tēmu */
  /* Maršruts kā telefona navigācijā (pamale-ios Shared/Style.swift RouteBand, Fizzy #100): debess zila josla ar
     tumšāku malu, caurspīdīga kā viens gabals (route_lines.js: mala un vidus savās rūtīs, opacity vecākajai rūtij);
     nobrauktais: priede ar baltu malu (RiddenBand). Ezera zilā (--m-lake) ir tikai saskarnei, ne līnijām. */
  --m-band: #1E90FF; --m-band-edge: #0B4FA8; --m-ridden: #2E5A3C; --m-lake: #2E88B0;
  --m-ink: #24281F; --m-pine: #2E5A3C; --m-birch: #D9A621; --m-birch-deep: #B98A0E;
  --m-ember: #B8401A; --m-gravel: #8B8A80; --m-slate: #5B6472; --m-shop: #3D5A80; --m-water: #2B7A9E; --m-poi: #6F6E66;
  --ms0: #4F534B; --ms1: #D9A621; --ms2: #2E5A3C; --ms3: #B8401A; --ms4: #B9BDB3;

  --fd: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --fb: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gut: 20px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171A15; --bg2: #20241E; --bg3: #2B3029;
    --ink: #E6E8E1; --ink2: #A9AEA2; --line: #363B33; --line2: #4D5449;
    --birch: #E7B531; --birch-ink: #E7B531; --birch-line: #E7B531;
    --ember: #E0663A; --pine: #6FAE85; --pine-soft: #22352A; --gravel: #8B8A80;
    --s0: #9A9E95; --s1: #E7B531; --s2: #6FAE85; --s3: #E0663A; --s4: #4A4F47;
    --field: #1B1F19;
    --focus: #E7B531;
    --lake: #5AA9CC; --lake-deep: #5AA9CC; --on-lake: #171A15; --slate: #8B95A3;
    --plan: #4AA8FF; --plan-ink: #7DBEFF;
    --hatch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='6' height='6' fill='%2320241E'/%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%235A6056' stroke-width='2.2'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171A15; --bg2: #20241E; --bg3: #2B3029;
  --ink: #E6E8E1; --ink2: #A9AEA2; --line: #363B33; --line2: #4D5449;
  --birch: #E7B531; --birch-ink: #E7B531; --birch-line: #E7B531;
  --ember: #E0663A; --pine: #6FAE85; --pine-soft: #22352A; --gravel: #8B8A80;
  --s0: #9A9E95; --s1: #E7B531; --s2: #6FAE85; --s3: #E0663A; --s4: #4A4F47;
  --field: #1B1F19;
  --focus: #E7B531;
  --lake: #5AA9CC; --lake-deep: #5AA9CC; --on-lake: #171A15; --slate: #8B95A3;
  --plan: #4AA8FF; --plan-ink: #7DBEFF;
  --hatch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='6' height='6' fill='%2320241E'/%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%235A6056' stroke-width='2.2'/%3E%3C/svg%3E");
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- pamats ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.5 var(--fb);
  font-feature-settings: "tnum" 1;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--birch); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 12px; }
.loading { padding: 48px var(--gut); color: var(--ink2); margin: 0; }
.noscript { padding: 48px var(--gut); max-width: 60ch; }
.strong { font-weight: 600; color: var(--ink); }
.warn { color: var(--ember); font-weight: 500; }
.ph { color: var(--ink2); margin: 0; padding: 24px 0; }
.tag {
  display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid var(--line2); border-radius: 10px;
  font: 500 11.5px/1.6 var(--fb); color: var(--ink2); vertical-align: 1px;
}
/* Nozīmīte sarakstā: stāvoklis ir krāsa + vārds (docs/DESIGN.md). */
.badge {
  display: inline-block; padding: 0 7px; border: 1px solid var(--line2); border-radius: 10px;
  font: 500 11.5px/1.65 var(--fb); color: var(--ink2); white-space: nowrap; vertical-align: 1px;
}
.badge + .badge { margin-left: 6px; }
/* Pirmā atzīme aiz nosaukuma tabulas šūnā (piem. „savienotājs”, „Beidzies”) nepielīp tekstam. */
td.strong > .badge:first-of-type { margin-left: 8px; }
.badge--me { margin-left: 8px; }
.badge--pine { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 45%, var(--line)); }
/* „Titullapā” in /admin/trips: on the title page, which anyone on the internet sees. */
.badge--birch { color: var(--birch-ink); border-color: color-mix(in srgb, var(--birch-line) 55%, var(--line)); }
.check .badge { margin-left: 8px; }

/* ---------- pogas un lauki ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--line2); border-radius: 4px; background: transparent;
  color: var(--ink); font: 500 14px/1.2 var(--fb); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg2); border-color: var(--ink2); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--ink2); border-color: var(--ink2); color: var(--bg); }
.btn--danger { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 45%, var(--line)); }
.btn--danger:hover { border-color: var(--ember); background: color-mix(in srgb, var(--ember) 8%, transparent); }
.btn--small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn--icon { min-width: 32px; min-height: 32px; padding: 0 6px; font-size: 16px; }
.btn--wide { width: 100%; min-height: 44px; font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: transparent; border-color: var(--line2); }
.btn--primary:disabled:hover, .btn--primary[aria-disabled="true"]:hover { background: var(--ink); border-color: var(--ink); }
.btn[aria-disabled="true"] { cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; min-width: 0; }
.field-label { font: 500 13px/1.3 var(--fb); color: var(--ink2); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-hint { margin: 2px 0 0; font-size: 12px; color: var(--ink2); display: flex; justify-content: space-between; gap: 12px; }
.field-error { margin: 2px 0 8px; font-size: 13px; color: var(--ember); font-weight: 500; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.counter { white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"],
input[type="time"], input[type="search"], select, textarea {
  width: 100%; min-height: 36px; padding: 6px 9px;
  background: var(--field); border: 1px solid var(--line2); border-radius: 4px;
  font-size: 15px; line-height: 1.35;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--ink2); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; border-color: var(--line2); }
/* A text field turns read-only while its write is on its way (it keeps the focus and the caret, so it is not
   disabled): the muted ground says it takes nothing now. The copy field (.tok-value) is read-only for good and
   stays as it is. Forced colours replace the ground, so there the border turns dashed instead. */
:is(input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"],
input[type="time"], input[type="search"], textarea):read-only:not(:disabled, .tok-value) { background: var(--bg3); }
@media (forced-colors: active) {
  :is(input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"],
  input[type="time"], input[type="search"], textarea):read-only:not(:disabled, .tok-value) { border-style: dashed; }
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--ember) !important; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; accent-color: var(--pine); flex: none; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }

/* ---------- augšējā josla ---------- */

.bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px;
  padding: 10px var(--gut); font-size: 13.5px; border-bottom: 1px solid var(--line);
}

/* logo joslas kreisajā pusē: emblēma un vārds ir viena saite uz „/”. Emblēmai ir savas plakanās
   krāsas (docs/DESIGN.md „Logo”), tāpēc tēma maina tikai vārdu; izmēru dod CSS, ne JS. */
.logo { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.logo-mark { display: block; flex: none; width: 24px; height: 24px; }
.logo-word { font: 700 21px/1 var(--fd); font-variation-settings: "opsz" 24; letter-spacing: -.012em; }
/* josla ir klusa: pasvītrojums parādās tikai uz hover un tikai vārdam */
.logo:hover .logo-word {
  text-decoration: underline; text-decoration-color: var(--birch);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.logo:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.bar-user { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; }
.bar-name { color: var(--ink2); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* bez sesijas vārda vietā „Ieiet” (ui.js siteBar(null)): saite ar bērza svītru, kā titullapā */
.bar-login {
  padding: 4px 0; font-weight: 500; font-size: 14px; white-space: nowrap;
  text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 4px;
}
.bar-login:hover { text-decoration-color: currentColor; }
/* aģenta zīme pirms vārda (ui.js agentChip): priedes punkts — pieslēgts, tukšs grants aplis — nav */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px;
  border: 1px solid var(--line2); border-radius: 12px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink2); white-space: nowrap; text-decoration: none;
}
a.chip:hover { color: var(--ink); border-color: var(--ink2); }
.chip--unknown { padding-left: 9px; }
.chip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pine); }
.chip--off .chip-dot { background: transparent; border: 2px solid var(--gravel); }
/* galvenā navigācija aiz logo: Mani ceļojumi, Publiskie ceļojumi. Pašreizējā bērza tintē ar bērza
   svītru apakšā, tāpat kā pārvaldības cilnes un zobrata punkts. */
.bar-nav { display: flex; align-items: center; gap: 0 18px; }
.bar-nav-link {
  padding: 4px 0; font-weight: 500; font-size: 14px; color: var(--ink2); text-decoration: none; white-space: nowrap;
}
.bar-nav-link:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--birch); }
.bar-nav-link[aria-current] { color: var(--birch-ink); box-shadow: inset 0 -2px 0 var(--birch); }
.bar-nav-link[aria-current]:hover { text-decoration: none; }

/* zobrats: izvēlne ar saitēm, tēmu un „Iziet” (docs/DESIGN.md „Josla un zobrata izvēlne”) */
.bar-menu { position: relative; display: flex; }
.gear {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 4px; color: var(--ink2);
}
.gear:hover, .gear[aria-expanded="true"] { background: var(--bg2); color: var(--ink); }
.gear[aria-current] { color: var(--birch-ink); }
.gear-ic { display: block; width: 20px; height: 20px; fill: currentColor; }
.menu {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 900; min-width: 172px; padding: 4px;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px; font-size: 14px;
}
.menu-item { display: block; padding: 8px 12px; border-radius: 4px; text-decoration: none; font-weight: 500; white-space: nowrap; }
button.menu-item { width: 100%; text-align: left; }
.menu-item:hover { background: var(--bg3); }
.menu-item[aria-current] { color: var(--birch-ink); box-shadow: inset 3px 0 0 var(--birch); }
/* fokuss iekšpusē: ārpusē tas uzkāptu kaimiņu punktiem un izvēlnes malai */
.menu-item:focus-visible { outline-offset: -3px; }
.menu-sep { margin: 4px -4px; border-top: 1px solid var(--line); }
.menu-label { padding: 6px 12px 2px; font: 500 12px/1.3 var(--fb); color: var(--ink2); }
/* tēmas izvēle: aplītis kā radio pogai; izvēlētajam bērza tintes punkts (krāsa + forma, ne tikai krāsa) */
.menu-radio { display: flex; align-items: center; gap: 10px; }
.menu-radio::before {
  content: ""; flex: none; width: 14px; height: 14px; padding: 2px; border-radius: 50%;
  border: 1.5px solid var(--line2); background-clip: content-box;
}
.menu-radio[aria-checked="true"]::before { border-color: var(--birch-ink); background-color: var(--birch-ink); }
.menu-form { margin: 0; }
.page-title {
  font: 800 clamp(34px, 5vw, 48px)/.95 var(--fd); font-variation-settings: "opsz" 96;
  letter-spacing: -.02em; margin: 0;
}

/* ---------- maršruta glifs ---------- */

.glyph { display: block; overflow: visible; flex: none; --glyph-bg: var(--bg); }
.glyph-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.glyph-start { fill: currentColor; }
.glyph-end { fill: var(--glyph-bg); stroke: currentColor; stroke-width: 1.6; }
.glyph--main { color: var(--plan); }
.glyph--published { color: var(--pine); }
.glyph--draft { color: var(--birch-line); }
.glyph--draft .glyph-line { stroke-dasharray: 4 3.4; }
.glyph--withdrawn { color: var(--gravel); }
.glyph--none, .glyph--empty { color: var(--gravel); }
.glyph--empty .glyph-line { stroke-dasharray: 1 5; }

/* ---------- the page frame of /publiskie (the home page's own is home.css) ---------- */

.trips-page { padding: 20px var(--gut) 72px; max-width: 1180px; }

/* ---------- publiskie ceļojumi /publiskie ---------- */

.pub-page .page-title { margin-top: 12px; }
.pub-lede { margin: 10px 0 0; max-width: 62ch; color: var(--ink2); }
.pub-search {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px;
  margin: 24px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.pub-search .pub-q { margin: 0; flex: 1 1 260px; max-width: 420px; }
.pub-kind { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
/* veidi vienā rindā; ja neietilpst (telefonā), rinda ritinās pati, ne lapa */
.pub-kind .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pub-kind .seg-btn { white-space: nowrap; }
.pub-status { margin: 14px 0 0; font-size: 14px; color: var(--ink2); }
.pub-list { margin-top: 12px; }
.pub-list[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
.pub-more { margin: 20px 0 0; }
.pub-retry { margin: 10px 0 0; }
.archive { margin-top: 40px; }
.archive summary { cursor: pointer; font: 600 18px/1.3 var(--fd); padding: 6px 0; }
.empty { padding: 36px 0; max-width: 60ch; }
.empty h2 { font: 700 26px/1.15 var(--fd); margin: 0 0 8px; }
.empty p { margin: 0 0 14px; }
.empty-slug { overflow-wrap: anywhere; }

/* ---------- ceļojuma josla ---------- */

/* One narrow row at the top of the trip page, on every tab (trip_bar.js, docs/DESIGN.md „Ceļojums”): the mark, the
   trip's name, the variant shown, the menu of its parts, „Labot karti”, a quiet status and the site's menu. 36 px. It
   sticks to the window's top while a page scrolls under it; in the route's shell nothing scrolls under it. */
:root { --bar-h: 36px; }
.trip-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 0 14px;
  height: var(--bar-h); padding: 0 var(--gut); background: var(--bg); border-bottom: 1px solid var(--line2);
  font-size: 14px;
}
.tb-home { display: inline-flex; flex: none; color: inherit; }
.tb-home .logo-mark { width: 20px; height: 20px; }
.tb-titles { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.tb-title {
  min-width: 6ch; margin: 0; font: 600 15px/1.2 var(--fd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  outline: none;
}
/* the variant the map shows, when it is not the main plan: a muted chip, to Detaļas */
.tb-variant-slot { display: contents; }
.tb-variant {
  flex: 0 2 auto; min-width: 7ch; max-width: 22ch; padding: 1px 8px; border: 1px solid var(--line2); border-radius: 10px;
  font-size: 12.5px; line-height: 18px; color: var(--ink2); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-variant:hover { color: var(--ink); border-color: var(--ink2); }
.tb-nav { position: relative; flex: none; display: flex; align-items: center; }
.tb-menu-btn { display: none; }
.tb-list { display: flex; align-items: center; gap: 0 2px; margin: 0; padding: 0; list-style: none; }
.tb-list a, .tb-gpx {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border-radius: 4px;
  font-weight: 500; color: var(--ink2); text-decoration: none; white-space: nowrap;
}
.tb-list a:hover, .tb-gpx:hover { background: var(--bg2); color: var(--ink); }
.tb-list a[aria-current] { color: var(--birch-ink); box-shadow: inset 0 -3px 0 var(--birch); border-radius: 4px 4px 0 0; }
.tb-gpx .dl-ic { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-edit-slot { display: contents; }
.trip-bar .btn--edit-map { flex: none; min-height: 28px; padding: 2px 10px; }
.tb-status { flex: none; display: inline-flex; color: var(--ink2); }
.tb-status:empty { display: none; }
.tb-status-ic {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  animation: tb-turn 1.6s linear infinite;
}
@keyframes tb-turn { to { transform: rotate(360deg); } }
.trip-bar > .bar-user { flex: none; margin-left: auto; gap: 0 12px; }
@media (forced-colors: active) {
  .tb-list a[aria-current] { outline: 2px solid Highlight; outline-offset: -3px; }
}
/* Where the parts do not fit, one button names the part on screen and opens the list under it (trip_bar.js
   MENU_MEDIA: the same query). „Labot karti” keeps its icon, its words the screen reader's. */
@media (max-width: 820px) {
  .trip-bar { gap: 0 10px; }
  .tb-menu-btn {
    display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 1px solid var(--line2);
    border-radius: 4px; background: var(--bg2); font-weight: 600; color: var(--birch-ink); white-space: nowrap;
  }
  .tb-menu-btn[aria-expanded="true"] { background: var(--bg3); }
  .tb-caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tb-list {
    display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 900; min-width: 180px; padding: 4px;
    flex-direction: column; align-items: stretch; background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px;
    box-shadow: 0 4px 14px rgb(0 0 0 / .16);
  }
  .tb-nav.is-open .tb-list { display: flex; }
  .tb-list a, .tb-gpx { display: flex; width: 100%; height: 38px; padding: 0 12px; color: var(--ink); }
  .tb-list a[aria-current] { box-shadow: inset 3px 0 0 var(--birch); border-radius: 4px; }
  .tb-list :focus-visible { outline-offset: -3px; }
  .trip-bar .btn--edit-map { width: 32px; padding: 0; justify-content: center; }
  .trip-bar .btn--edit-map .btn-word {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
}
/* the narrowest phones have no room for the variant's chip beside the trip's name: Detaļas say which it is */
@media (max-width: 340px) {
  .tb-variant { display: none; }
}

/* ---------- Detaļas (?tab=details, trip_details.js, docs/celojuma-detalas/SPEC.md) ---------- */

.lede { margin: 8px 0 0; max-width: 72ch; color: var(--ink2); }
.line-ic { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--small .line-ic { width: 14px; height: 14px; }
.archived-note {
  margin: 10px 0 0; padding: 6px 12px; max-width: 72ch; font-weight: 500;
  border-left: 4px solid var(--gravel); background: var(--bg2);
}
/* publisks ceļojums no malas: tikai skatīt; priede — „redz arī citi”, kā publicētam ieteikumam */
.public-note {
  margin: 10px 0 0; padding: 8px 12px; max-width: 72ch;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  border-left: 4px solid var(--pine); background: var(--bg2);
}
.public-note p { margin: 0; flex: 1 1 32ch; }

.dt { max-width: 1280px; padding: 20px var(--gut) 72px; }
/* galva: nosaukums, apraksts, fakti, ceļojuma darbības */
.dt-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dt-title {
  margin: 0; font: 800 clamp(30px, 4.2vw, 46px)/.98 var(--fd); font-variation-settings: "opsz" 96; letter-spacing: -.02em;
  overflow-wrap: break-word; hyphens: auto; max-width: 24ch; outline: none;
}
.dt-facts { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 13.5px; color: var(--ink2); }
.dt-kind { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.dt-kind .line-ic { color: var(--ink2); }
.dt-actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
/* divas kolonnas darbvirsmā: varianti pa kreisi, cilvēki un iestatījumi pa labi */
.dt-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 56px; }
@media (min-width: 1024px) {
  .dt-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
}
.dt-sect { margin-top: 26px; }
.dt-sect-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 10px; }
.dt-h { margin: 0; font: 700 22px/1.15 var(--fd); font-variation-settings: "opsz" 40; letter-spacing: -.01em; }
.dt-sect-head .btn { align-self: center; }
.dt-lead { margin: -4px 0 10px; max-width: 72ch; font-size: 13.5px; line-height: 1.45; color: var(--ink2); }
.dt-lead strong { color: var(--ink); font-weight: 600; }
.dt-variants > .errbox { margin: 0 0 12px; }
/* varianti: saraksts ar līnijām, ne kartītes; rādītajam papīrs un svītra tajā krāsā, kāda tam ir kartē: rādītais
   plāns, galvenais vai cits, kartē ir debess josla */
.dt-plans { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dt-plan { border-bottom: 1px solid var(--line); }
.dt-plan.is-shown { background: var(--bg2); box-shadow: inset 4px 0 0 var(--plan); }
.dt-plan.is-shown .glyph, .dt-plan-link:hover .glyph { --glyph-bg: var(--bg2); }
.dt-plan-link {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px 16px; align-items: center;
  padding: 12px 16px 12px 18px; text-decoration: none; color: inherit;
}
.dt-plan-link:hover { background: var(--bg2); }
.dt-plan-link:hover .dt-plan-title { text-decoration: underline; text-decoration-color: var(--birch); }
.dt-plan-link:focus-visible { outline-offset: -3px; }
.dt-plan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dt-plan-title { font: 600 16.5px/1.2 var(--fd); overflow-wrap: anywhere; }
.dt-plan-state, .dt-plan-meta { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 12.5px; color: var(--ink2); }
.state { font-weight: 600; }
.state--main { color: var(--ink); }
.state--published { color: var(--pine); }
.state--draft { color: var(--birch-ink); }
/* grants krāsa tekstam gaišajā tēmā ir par gaišu (2,8:1), tāpēc tumšāks tonis */
.state--withdrawn { color: color-mix(in srgb, var(--gravel) 55%, var(--ink)); }
.diff { font-weight: 500; color: var(--ink); }
/* rādītā varianta saturs: tas, kas bija plāna rindā un tās piezīmēs */
.dt-plan-open { padding: 0 18px 16px 122px; }
.dt-plan-facts { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 13.5px; color: var(--ink2); }
.dt-plan-facts .who { font-weight: 500; color: var(--ink); }
.dt-plan-note { margin: 10px 0 0; font-size: 14px; line-height: 1.5; max-width: 72ch; }
.dt-plan-note-body > :first-child { margin-top: 0; }
.dt-plan-note-body > :last-child { margin-bottom: 0; }
.dt-plan-note-body p, .dt-plan-note-body ul { margin: 0 0 .6em; }
.dt-plan-note-body h3 { margin: .9em 0 .3em; font: 600 15px/1.3 var(--fb); }
.dt-plan-note.is-clamped .dt-plan-note-body {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
}
.dt-plan-note-toggle { margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--ink); }
.dt-plan-notes { margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink2); max-width: 72ch; }
.dt-plan-notes p { margin: 0 0 4px; }
.dt-plan-notes strong { color: var(--ink); font-weight: 600; }
/* the notice about the route (trip_details.js): its sentences one under another */
.route-notice { color: var(--ink); }
.route-notice > * { display: block; margin: 0 0 4px; }
.dt-plan-actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dt-plan-actions .btn--danger { margin-left: auto; }
.dt-plan-actions .btn--danger + .btn--danger { margin-left: 0; }
.action-with-hint { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.action-hint { font-size: 12.5px; color: var(--ink2); }
/* „Jauns variants”: pēdējā rinda, bērza raustītais aplis */
.dt-plan--new .dt-plan-link { width: 100%; color: var(--ink2); text-align: left; }
.dt-plan--new .dt-plan-title { color: var(--ink); }
.dt-plan--new .dt-plan-link[aria-busy="true"] { cursor: progress; }
.v-plus {
  display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto; border: 2px dashed var(--birch-line);
  border-radius: 50%; font: 500 22px/1 var(--fd); color: var(--birch-ink);
}
@media (max-width: 560px) {
  .dt-plan-link { grid-template-columns: 66px minmax(0, 1fr); gap: 0 12px; padding: 10px 14px 10px 16px; }
  .dt-plan-link .glyph { width: 66px; height: 36px; }
  .dt-plan-open { padding: 0 14px 14px 16px; }
  .dt-plan-actions .btn--danger { margin-left: 0; }
}
/* cilvēki: vārds un loma, pārvaldītājam arī e-pasts */
.dt-people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dt-person {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.dt-person-name { font-weight: 600; overflow-wrap: anywhere; }
.dt-person-name .badge { margin-left: 6px; }
.dt-person-mail { grid-column: 1; font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
.dt-role { grid-column: 2; grid-row: 1; color: var(--ink2); white-space: nowrap; font-size: 13px; }
.dt-role--owner { color: var(--ink); font-weight: 500; }
@media (forced-colors: active) {
  .dt-plan.is-shown > .dt-plan-link { outline: 2px solid Highlight; outline-offset: -4px; }
}
/* iestatījumi kā fakti: nosaukums klusāks, vērtība tintē */
.dt-kv {
  margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 18px;
  border-top: 1px solid var(--line); font-size: 14px;
}
.dt-kv > div { display: contents; }
.dt-kv dt, .dt-kv dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dt-kv dt { color: var(--ink2); font-size: 13px; padding-top: 8px; }
.dt-kv dd .hint { display: block; font-size: 12.5px; color: var(--ink2); }
@media (max-width: 360px) {
  .dt-kv { grid-template-columns: minmax(0, 1fr); }
  .dt-kv dt { padding: 8px 0 0; border-bottom: 0; }
  .dt-kv dd { padding-top: 0; }
}

/* ---------- maršruta čaula ---------- */

/* The route's shell (docs/DESIGN.md „Ceļojums”): where the window is tall enough (min-height 640 px; route.js
   SHELL_MEDIA, the same query) the page is the window's height and stands still — the bar, the Lineāls, the map with the
   rows under it, and the pane (the days, the chosen day's or leg's detail, the footnote), the one part that scrolls. A
   choice brings what it shows into view in the pane; the document never moves. Lower, the route is a plain page: the
   bar sticks, everything else scrolls with the document. Printed, it is a plain page whatever the window (screen
   only): a long day runs on across the pages.
   640 px lets the usual phone have the shell (390 × 664: Safari's toolbar on a regular iPhone). The heights it has to
   hold are the bar (36 px), the Lineāls (188 px on a phone; wider, 161 px where the sentence fits beside the bubbles
   and 202 px where it goes under them: one row of bubbles scrolling sideways over a sentence's box of three lines, the
   same whatever is chosen), the map at its least (260 px), the attribution's row under it (19 px) and a pane of
   160 px — 663 px on a phone, 677 px at the worst. Lower than that, nothing is guessed either: the pane keeps its
   160 px and the stage scrolls (the document never does), so at 640 px the worst case shows about 120 px of the pane
   before the stage is scrolled.
   No height in the shell is guessed: the stage is a column, and the real heights of the Lineāls and of the rows under
   the map (the edit bar, „Tu esi pie …”) decide. The map gives way first, from what the width asks (--map-want) down to
   260 px; the pane keeps 160 px and takes whatever is left; only when even that does not fit does the stage scroll.
   On the plain page the map is what the width asks — never under 260 px either. dvh: in the shell the document does not
   scroll, so the browser's bars stay as they are; in a page that scrolls, svh (the map is not resized as they come and
   go). */
:root { --svh: 1vh; --dvh: 1vh; --map-want: clamp(300px, calc(50 * var(--svh)), 560px); }
@supports (height: 1svh) { :root { --svh: 1svh; --dvh: 1dvh; } }
@media (max-width: 820px) { :root { --map-want: clamp(260px, calc(42 * var(--svh)), 460px); } }
@media (max-width: 520px) { :root { --map-want: clamp(260px, calc(40 * var(--svh)), 400px); } }
@media screen and (min-height: 640px) {
  :root:has(> body > .trip-page.on-route) { overflow: hidden; overscroll-behavior: none; }
  :root:has(> body > .trip-page.on-route) body { min-height: 0; }
  .trip-page.on-route { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .trip-page.on-route > :not(.stage) { flex: none; }
  .trip-page.on-route > .stage {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  }
  .trip-page.on-route > .stage > * { flex: none; }
  /* the map and its rows are the stage's own items (the slot keeps the map's place only on the plain page) */
  .trip-page.on-route > .stage > .map-slot { display: contents; }
  .trip-page.on-route > .stage > .map-slot > .map { flex: 0 1 var(--map-want); height: auto; min-height: 260px; }
  .trip-page.on-route > .stage > .map-slot > .map-under,
  .trip-page.on-route > .stage > .map-slot > .map-hold { flex: none; }
  /* The pane's scroll, and on a desktop its columns', goes on into the stage at their ends (no overscroll-behavior of
     their own): where the stage scrolls (the least of each part does not fit), a hand scrolls it back to the map's top.
     The stage keeps its scroll to itself and the root has none, so the document never moves. */
  .trip-page.on-route > .stage > .pane { flex: 1 0 160px; min-height: 160px; overflow-y: auto; }
  .trip-page.on-route > .stage > .pane:focus-visible { outline-offset: -3px; }
  /* the pane is its own scroller, under nothing: what it brings into view stops at its top */
  .trip-page.on-route > .stage > .pane * { scroll-margin-top: 0; }
  .trip-page.on-route .lower { min-height: 0; }
  /* Two columns (a desktop): the pane is a grid of one row as high as it is, and the day list and the detail column
     (the footnote at its end) each scroll on their own — choosing a day low in the list leaves the list where it is
     while the detail comes to its column's top. One column (a phone) keeps the pane as its one scroller. */
  @media (min-width: 821px) {
    .trip-page.on-route > .stage > .pane { display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
    .trip-page.on-route .lower { grid-template-rows: minmax(0, 1fr); }
    .trip-page.on-route .days, .trip-page.on-route .detail-col { min-height: 0; overflow-y: auto; }
  }
}
/* What focus, a link or scrollIntoView brings to the top of a page that scrolls stops under the bar. */
.trip-page > .stage, .trip-page > .stage * { scroll-margin-top: calc(var(--bar-h) + 8px); }
/* a list that scrolls by itself (Mantas' suggestions) brings its option to its own top */
.stage [role="listbox"] > * { scroll-margin-top: 0; }

/* ---------- Lineāls ---------- */

/* Zem ceļojuma joslas, tikai maršrutā (ruler.js, docs/DESIGN.md „Lineāls”): bumbiņas un teikums, zem tiem dienu kartītes
   blakus ar kopīgām malām un viena čipu strīpa cauri visām. Fiksēts mērogs: ritinās tikai lineāls savā rāmī, lapa
   nekad nekļūst platāka. Kolonnas, čipu malas un vietu čipu platumus abos mērogos (darbvirsma; telefons ≤ 480 px)
   dod ruler_model.js caur mainīgajiem: --cols-d/-p, --ml-d/-p, --mr-d/-p, --w-d/-p, --sm-d/-p. */
.rl { position: relative; z-index: 5; padding: 10px var(--gut); border-bottom: 1px solid var(--line); background: var(--bg); }
.rl:empty { display: none; }
.rl[aria-busy="true"] .rl-scroll { opacity: .7; }
.rl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-bottom: 8px; }
/* bumbiņa: klikšķis izvēlas dienu; josla zem tām — dienas, kas redzamas. Ātri pieskaroties telefons nedrīkst tuvināt
   lapu, un teksts neiezīmējas. Viena rinda, cik dienu arī būtu: garam ceļojumam tā ritinās sāniski savā rāmī (izvēlēto
   tajā ieritina ruler.js), un Lineāls nekļūst augstāks — čaulā tas atņemtu vietu rūtij. Rāmja malas atstāj vietu
   šodienas lokam, novecojušās dienas punktam un fokusam. */
.rl-bubbles {
  position: relative; display: flex; flex-wrap: nowrap; gap: 5px; padding: 4px 4px 8px; margin: -1px -4px 0;
  flex: 0 1 auto; min-width: 0; max-width: calc(100% + 8px); overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
}
.rl-bubbles > * { flex: none; }
.rl-band { position: absolute; left: 0; top: 0; height: 2px; width: 0; border-radius: 1px; background: var(--line2); transition: left .25s ease, width .25s ease; }
.rl-bubble, .rl-whole {
  position: relative; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--line2); background: var(--bg2); font: 800 13px/1 var(--fd); color: var(--birch-ink);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.rl-bubble:hover, .rl-whole:hover { border-color: var(--ink2); background: var(--field); }
.rl-bubble.is-selected, .rl-whole.is-selected { background: var(--lake-deep); border-color: var(--lake-deep); color: var(--on-lake); }
/* „Viss maršruts”: the first bubble, the frame icon of the map's own button; pressed on the whole route */
.rl-whole { color: var(--ink2); text-decoration: none; }
.rl-whole .fit-ic { width: 16px; height: 16px; }
.rl-bubble.is-today { box-shadow: 0 0 0 2.5px var(--birch); }
.rl-bubble.has-stale::after {
  content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ember); border: 1.5px solid var(--bg);
}
/* teikums: ceļojums, izvēlētā diena vai posms; vārds, kas garāks par rindu (vieta var būt viens 160 zīmju vārds), lūst.
   The Lineāls is as tall whatever is chosen: its bubbles keep to one row (below), and its sentence's box is always three
   lines high — a shorter sentence leaves room under it, a longer one scrolls in its own box — so a
   choice never moves the map under it by a line (in the shell the map gives way first) and the pane keeps its room.
   The box and every item in it have one line height, centred in their row (a baseline shared by two fonts would make the
   row taller), and the box is three of them and the two gaps between: a sentence of three lines fits it whole (nothing
   scrolls, no descender is cut). Its scroll is the page's at its ends (no
   overscroll-behavior): a swipe that starts on it moves the page on. */
.rl-line {
  --rl-lh: 20px; --rl-gap: 1px;
  flex: 1 1 360px; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: var(--rl-gap) 14px;
  margin: 0; min-width: 0; height: calc(3 * var(--rl-lh) + 2 * var(--rl-gap)); overflow-y: auto;
  font-size: 14px; line-height: var(--rl-lh); color: var(--ink2); overflow-wrap: anywhere;
}
.rl-line > b { font: 800 17px/var(--rl-lh) var(--fd); color: var(--ink); }
/* the focus ring inside the link: the box clips what stands out of it */
.rl-line a:focus-visible { outline-offset: -3px; }
@media print { .rl-line { height: auto; overflow: visible; } }
.rl-line .ink { color: var(--ink); font-weight: 500; }
.rl-line .warn { color: var(--ember); font-weight: 600; }
.rl-line .all { margin-left: auto; font-size: 13px; color: var(--ink2); text-decoration: none; }
.rl-line .all + .all { margin-left: 0; }
.rl-line .all:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--birch); }
.rl-line-leg { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 10px; min-width: 0; max-width: 100%; }
.rl-line-leg .rl-pop-route { font-weight: 500; }
.rl-line-leg .rl-pop-facts { display: inline-flex; gap: 10px; }
/* rāmis, kurā lineāls ritinās; tur, kur ir vēl, mala izgaist — pārgriezts čips ir turpinājums */
.rl-scroll {
  position: relative; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent; padding: 0 0 6px;
}
.rl-scroll.can-left { mask-image: linear-gradient(90deg, transparent 0, #000 24px); }
.rl-scroll.can-right { mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent 100%); }
.rl-scroll.can-left.can-right { mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }
/* While the bar is wider than its box, an arrow on each side scrolls it (ruler.js): beside the box, which narrows for
   them — no card is covered —, the box's full height, a triangle to its side; disabled at its end. */
.rl-frame { display: flex; align-items: stretch; gap: 4px; }
.rl-frame > .rl-scroll { flex: 1 1 auto; min-width: 0; }
.rl-arrow {
  flex: none; display: grid; place-items: center; width: 28px; margin-bottom: 6px; padding: 0;
  border: 1px solid var(--line2); border-radius: 6px; background: var(--bg2); color: var(--ink);
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.rl-arrow:hover:not(:disabled) { background: var(--bg3); border-color: var(--ink2); }
.rl-arrow:disabled { background: transparent; border-color: var(--line); color: var(--line2); cursor: default; }
.rl-arrow-ic { width: 10px; height: 20px; fill: currentColor; }
/* režģis: kolonna katram posma gabalam, starta un finiša kolonna galos; rindas — galva, strīpa. Dienas kartīte
   aizņem savas kolonnas un abas rindas; čipi, sliede un naktis ir strīpas rindas elementi, tāpēc nakts var stāvēt
   pāri kartītes malai. Ritms: 8 · galva 20 · 6 · čipi 28 · 10 = 72 px. */
.rl-bar {
  display: grid; grid-template-columns: var(--cols-d); grid-template-rows: auto auto; row-gap: 6px; width: max-content;
  border: 1px solid var(--line2); border-radius: 6px; background: var(--bg2);
}
.rl-day {
  grid-row: 1 / 3; z-index: 0; display: grid; grid-template-rows: subgrid; row-gap: 6px; min-width: 0;
  padding: 8px 10px 10px; border-left: 1px solid var(--line2); color: inherit; text-decoration: none;
  scroll-margin-left: var(--sm-d, 0px);
}
.rl-day.is-first { border-left: 0; border-radius: 5px 0 0 5px; }
.rl-day.is-last { border-radius: 0 5px 5px 0; }
.rl-day.is-first.is-last { border-radius: 5px; }
.rl-day:hover { background: var(--bg3); }
/* the frame would clip a ring outside the card */
.rl-day:focus-visible { outline-offset: -3px; }
.rl-day.is-selected { background: color-mix(in srgb, var(--lake) 14%, var(--bg2)); box-shadow: inset 0 -3px 0 var(--lake); }
.rl-day.is-selected:hover { background: color-mix(in srgb, var(--lake) 20%, var(--bg2)); }
.rl-day.is-selected .rl-head b { color: var(--lake); }
/* galva: numurs, datums un dienas mīšanās km treknrakstā labajā malā */
.rl-head {
  grid-row: 1; display: flex; align-items: baseline; gap: 7px; min-width: 0; height: 20px;
  font-size: 12.5px; line-height: 20px; color: var(--ink2); white-space: nowrap; overflow: hidden;
}
.rl-head b { font: 800 17px/20px var(--fd); color: var(--birch-ink); }
.rl-head .rl-date { overflow: hidden; text-overflow: ellipsis; }
.rl-head .rl-km { margin-left: auto; padding-left: 4px; font-weight: 700; color: var(--ink); flex: none; }
.rl-head .rl-km.is-stale { color: var(--ember); }
.rl-today {
  flex: none; align-self: center; padding: 0 6px; border: 1px solid var(--birch-line); border-radius: 9px;
  font: 600 10.5px/16px var(--fb); color: var(--birch-ink);
}
/* the strip: chips on one rail from the start to the finish */
.rl-rail { grid-row: 2; grid-column: 2 / -2; align-self: start; margin-top: 13px; z-index: 1; height: 2px; background: var(--line2); pointer-events: none; }
.rl-leg, .rl-stay, .rl-end {
  grid-row: 2; align-self: start; height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 0 8px; border: 1px solid var(--line2); border-radius: 4px;
  font-size: 12.5px; line-height: 1; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.rl-leg .line-ic, .rl-stay .line-ic, .rl-end .line-ic { width: 15px; height: 15px; }
.rl-leg { z-index: 2; min-width: 0; padding: 0 6px; margin: 0 var(--mr-d, 3px) 0 var(--ml-d, 3px); background: var(--field); overflow: hidden; }
.rl-leg .line-ic { color: var(--ink2); }
.rl-leg:hover { border-color: var(--ink2); }
/* the text on solid paper: on a hatched chip the hatch shows only at its ends */
.rl-body { display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 3px; border-radius: 3px; }
.rl-body > span { overflow: hidden; text-overflow: ellipsis; }
.rl-leg.is-unrouted { border-style: dashed; border-color: var(--slate); color: var(--slate); background: var(--hatch); }
.rl-leg.is-unrouted .line-ic { color: var(--slate); }
.rl-leg.is-stale {
  border-style: dashed; border-color: var(--ember); color: var(--ember); font-weight: 600;
  background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--ember) 22%, transparent) 5px 6px) var(--bg2);
}
.rl-leg.is-stale .line-ic { color: var(--ember); }
.rl-leg.is-unrouted .rl-body, .rl-leg.is-stale .rl-body { background: var(--bg2); }
.rl-leg.is-selected { border-color: var(--lake); box-shadow: 0 0 0 1.5px var(--lake); }
/* a night across the border of its two days, the start and the finish: as wide as their names */
.rl-stay, .rl-end { z-index: 3; width: var(--w-d); border-width: 1.5px; font-weight: 600; background: var(--bg2); }
.rl-stay > span, .rl-end > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rl-stay { justify-self: start; transform: translateX(-50%); }
.rl-stay--tent { border-color: var(--pine); background: var(--pine-soft); }
.rl-stay--tent .line-ic { color: var(--pine); }
.rl-stay--hotel { border-color: var(--birch-line); background: color-mix(in srgb, var(--birch) 28%, var(--bg2)); }
.rl-stay--hotel .line-ic { color: var(--birch-ink); }
/* nobody has said where: a bed, neither a tent nor a hotel */
.rl-stay--bed { border-color: var(--ink2); }
.rl-stay--bed .line-ic { color: var(--ink2); }
.rl-end { border-color: var(--ink); }
/* a node no track reaches (the notice says how far) */
.rl-stay.is-far, .rl-end.is-far { border-color: var(--ember); }
/* a place's chip opens its card in the day's panel (ruler.js placeChip) */
.rl-stay:hover > span, .rl-end:hover > span { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 2px; }
.rl-end--start { justify-self: end; margin-right: 3px; }
.rl-end--finish { justify-self: start; margin-left: 3px; }
/* a leg's facts while the pointer or the focus is on its chip: one for the whole ruler, outside the scrolling box */
.rl-pop {
  position: absolute; z-index: 30; display: flex; flex-direction: column; gap: 3px; min-width: 190px; max-width: 280px;
  padding: 8px 11px 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--bg2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10); font-size: 12.5px; line-height: 1.4; color: var(--ink2); pointer-events: none;
  overflow-wrap: anywhere;
}
.rl-pop b, .rl-line-leg b { font: 600 13.5px/1.3 var(--fd); color: var(--ink); }
.rl-line .rl-line-leg b { line-height: var(--rl-lh); }
.rl-pop-route { color: var(--ink); }
.rl-pop-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.rl-pop-mix { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.rl-pop-mix .mixbar { width: 70px; flex: none; margin-top: 0; }
@media (forced-colors: active) {
  .rl-day.is-selected, .rl-leg.is-selected, .rl-bubble.is-selected, .rl-whole.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
}
/* telefons: 2 px/km, ritms 6 · 18 · 5 · 26 · 8 = 63 px; bumbiņas 27 px ar 3 px atstarpi („Viss maršruts” un 10 dienas —
   327 px, vienā rindā arī 360 px ekrānā); posma fakti teikumā, ne logā */
@media (max-width: 480px) {
  .rl { padding-top: 8px; padding-bottom: 8px; }
  .rl-top { gap: 2px 10px; margin-bottom: 6px; }
  .rl-bubbles { gap: 3px; padding: 3px 0 9px; }
  .rl-bubble, .rl-whole { width: 27px; height: 27px; }
  .rl-line { flex-basis: 100%; font-size: 13.5px; column-gap: 10px; }
  .rl-line .all { margin-left: 0; }
  .rl-bar { grid-template-columns: var(--cols-p); row-gap: 5px; }
  .rl-day { padding: 6px 8px 8px; row-gap: 5px; scroll-margin-left: var(--sm-p, 0px); }
  .rl-head { height: 18px; gap: 6px; font-size: 12px; line-height: 18px; }
  .rl-head b { font-size: 16px; line-height: 18px; }
  .rl-head .rl-wd, .rl-day.is-today .rl-date { display: none; }
  .rl-today { padding: 0; border: 0; font-size: 12px; line-height: 18px; }
  .rl-rail { margin-top: 12px; }
  .rl-leg, .rl-stay, .rl-end { height: 26px; gap: 4px; font-size: 12px; }
  .rl-leg { padding: 0 4px; margin: 0 var(--mr-p, 3px) 0 var(--ml-p, 3px); }
  .rl-stay, .rl-end { width: var(--w-p); padding: 0 7px; }
  .rl-leg .line-ic, .rl-stay .line-ic, .rl-end .line-ic { width: 14px; height: 14px; }
  .rl-lt, .rl-pop { display: none; }
}

/* ---------- karte ---------- */

.stage { display: block; outline: none; }
.stage[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
/* the map's height: „maršruta čaula” above */
.map-slot {
  min-height: var(--map-want); background: var(--bg3);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.map { height: var(--map-want); background: var(--bg3); }
/* Rows under the map (route.js): the edit mode's bar, „Tu esi pie …”, the map's attribution. Over the map are only its
   controls, in its corners, so nothing ever covers them; over the whole window the rows go under the map there. */
/* The rows are the page's, not the map's: they take no part in its stacking order (Leaflet gives its controls z 800,
   which out of the map's own isolated box would paint over the sticky bar and take its taps). */
.map-under { position: relative; z-index: 0; isolation: isolate; background: var(--bg2); }
.map-under > .leaflet-control-attribution {
  position: static; z-index: auto; float: none; clear: none; margin: 0; padding: 2px 8px; text-align: right;
  background: none !important;
}
/* Karte pa visu ekrānu (route_full.js): tā pati karte modālā dialogā, kas aizpilda logu; vieta lapā paliek
   (.map-slot), zem tās — rinda „Tu esi pie …”. Bez kustības: tā ir atbilde uz pogu, ne pāreja. */
/* padding: viewport-fit=cover — the map's controls and the line under it stay off the notch and the home bar */
.map-full {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0; background: var(--bg3); color: var(--ink); overflow: hidden auto; overscroll-behavior: contain;
}
/* the page behind the dialog does not scroll (a touch or a wheel the map does not take) */
:root:has(.map-full[open]) { overflow: hidden; }
.map-full[open] { display: flex; flex-direction: column; }
.map-full::backdrop { background: var(--bg3); }
/* As the shell's stage (min-height 640 px above): the map takes the window and gives way first, down to 260 px; the rows
   under it (the edit bar, „Tu esi pie …”, the attribution) keep their height. In a window lower than that (a phone held
   sideways, the edit mode on) the dialog's own column scrolls — by a hand on the rows, the map keeping its gestures —,
   and keeps its scroll to itself: the document never moves. */
.map-full .map { flex: 1 1 auto; min-height: 260px; height: auto; }
.map-full .map-under { flex: none; border-top: 1px solid var(--line); }
/* isolation: Leaflet rūtis (z 400–700) un vadīklas (z 1000) paliek kartes iekšā, nevis sacenšas ar lapas
   slāņiem — citādi „Slāņi” un +/− uzkāpj atvērtai zobrata izvēlnei (z 900). Tāpēc nav jākāpina z-index. */
.leaflet-container { font: 13px/1.35 var(--fb); background: var(--bg3); isolation: isolate; }
/* maršruta skatā: kā tuvināt karti, ja rullītis vai viens pirksts ritina lapu (mapkit.js cooperativeGestures).
   Virs vadīklām (z 1000), klikšķus laiž cauri; tumšs aizsegs ar baltu tekstu der abām tēmām. */
.map-hint {
  position: absolute; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 16px;
  background: rgb(20 22 18 / .62); color: #fff; font: 500 17px/1.35 var(--fb); text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.map-hint.is-on { opacity: 1; }
/* savām rūtīm (dayHl, surf) Leaflet neatceļ augšējo „svg { max-width: 100% }” */
.leaflet-container .leaflet-pane > svg { max-width: none !important; max-height: none !important; }
.leaflet-container a { color: inherit; }
.leaflet-bar { border: 1px solid var(--line2) !important; border-radius: 6px; overflow: hidden; }
.leaflet-bar a { background: var(--bg2); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--bg3); color: var(--ink); }
.leaflet-bar a.leaflet-disabled { background: var(--bg2); color: var(--line2); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--bg2) 82%, transparent) !important; color: var(--ink2); font-size: 10.5px; }
.leaflet-control-attribution a { color: var(--ink); }
.leaflet-control-scale-line { background: color-mix(in srgb, var(--bg2) 80%, transparent); border-color: var(--ink2); color: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.leaflet-popup-content-wrapper { border-radius: 6px; }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; line-height: 1.4; }
/* a window taller than the map lets it be scrolls inside, and its wheel or finger stops there (mapkit.js OWN_SCROLLERS) */
.leaflet-popup-scrolled { overscroll-behavior: contain; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink2); }
.leaflet-tooltip { background: var(--bg2); color: var(--ink); border-color: var(--line2); font: 500 12.5px var(--fb); box-shadow: none; }
.leaflet-tooltip-top::before { border-top-color: var(--line2); }
/* Other grounds are dimmed in the dark theme; Pamale's own map stays as it is, as on the phone (basemap.js) */
:root[data-theme="dark"] .leaflet-tile-pane > .leaflet-layer:not(.pm-base) { filter: brightness(.82) contrast(1.06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane > .leaflet-layer:not(.pm-base) { filter: brightness(.82) contrast(1.06); }
}
/* A tile of Pamale's map: greyed CyclOSM where no country's map covers it whole, the same in either theme, and our
   map over it, clipped to the countries' outlines (basemap.js) */
.pm-base .leaflet-tile { overflow: hidden; }
.pm-base .leaflet-tile > img, .pm-base .leaflet-tile > canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.pm-base .leaflet-tile > .pm-fallback { filter: grayscale(1) contrast(.9) brightness(1.04); }
/* the quarter of a CyclOSM image one level farther out that is this tile's */
.pm-base .leaflet-tile > :is(.pm-q00, .pm-q01, .pm-q10, .pm-q11) { width: 200%; height: 200%; }
.pm-base .leaflet-tile > :is(.pm-q10, .pm-q11) { left: -100%; }
.pm-base .leaflet-tile > :is(.pm-q01, .pm-q11) { top: -100%; }

.pop { display: flex; flex-direction: column; gap: 2px; max-width: 260px; }
.pop strong { font: 600 15px/1.25 var(--fd); margin-bottom: 2px; }
.pop-meta { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--ink2); }
.pop-desc { color: var(--ink2); margin-top: 2px; }
.pop a { margin-top: 4px; font-weight: 500; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* atrašanās vieta, „viss maršruts” un „karte pa visu ekrānu” */
.loc-btn, .full-btn { display: grid; place-items: center; width: 30px; height: 30px; background: var(--bg2); color: var(--ink); }
.loc-btn:hover, .full-btn:hover { background: var(--bg3); }
.full-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* pilnajā kartē izeja ir redzama vārdā, arī telefonā */
.full-btn.is-on { display: flex; gap: 6px; width: auto; height: 34px; padding: 0 12px 0 9px; font: 600 14px/1 var(--fb); }
.loc-btn svg { width: 17px; height: 17px; fill: currentColor; }
.fit-ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.fit-ic .fit-frame { stroke-width: 2; }
.fit-ic .fit-route { stroke-width: 1.7; opacity: .8; }

/* leģenda: kura līnija ir kurš plāns */
.mlegend {
  max-width: min(62vw, 300px); padding: 5px 9px 6px;
  background: color-mix(in srgb, var(--bg2) 90%, transparent); color: var(--ink);
  border: 1px solid var(--line2); border-radius: 6px; font: 12.5px/1.3 var(--fb);
}
.mlg {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1px 7px; margin: 0; padding: 2px 0 2px 6px;
  border-left: 3px solid transparent; color: var(--ink2);
}
.mlg.is-active { border-left-color: var(--birch); color: var(--ink); font-weight: 600; }
.mlg-name { flex: 1 1 auto; min-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlg-who, .mlg-on { color: var(--ink2); font-weight: 400; white-space: nowrap; }
.mlg-on { color: var(--birch-ink); }
.mlg-warn { color: var(--ember); font-weight: 500; white-space: nowrap; }
.loc-btn[aria-busy="true"] svg { animation: loc-pulse 1s ease-in-out infinite alternate; }
@keyframes loc-pulse { to { opacity: .35; } }
.me-acc { stroke: #2B7A9E; stroke-width: 1; fill: #2B7A9E; fill-opacity: .12; }
.me-dot { stroke: #fff; stroke-width: 2.5; fill: #2B7A9E; fill-opacity: 1; }
.locinfo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px var(--gut);
  background: var(--bg2); border-bottom: 1px solid var(--line); border-left: 4px solid var(--m-water);
}
.locinfo p { margin: 0; flex: 1 1 320px; }
.loc-acc { color: var(--ink2); font-size: 12.5px; }
.linkish { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 3px; font-weight: 600; }
.linkish:hover { text-decoration-color: currentColor; }

/* slāņu panelis */
.lp { background: var(--bg2); color: var(--ink); border: 1px solid var(--line2); border-radius: 6px; font: 13px/1.35 var(--fb); }
.lp-toggle { display: flex; align-items: center; gap: 6px; padding: 7px 11px; font-weight: 500; min-height: 34px; }
.lp-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.lp-toggle[aria-expanded="true"] { color: var(--birch-ink); }
/* The list scrolls within the map, however small (260 px) it is: --lp-room is what the map has below the list's top
   (mapkit.js LayerPanel, measured as it opens and as the map changes size). */
.lp-panel {
  border-top: 1px solid var(--line); padding: 2px 12px 10px;
  max-height: min(60vh, 440px, var(--lp-room, 440px)); overflow: auto; width: min(290px, calc(100vw - 80px));
  /* its scroll stays its own, at its ends too (as a scrolled map window's): the full window's dialog and the shell's
     stage are scrolled only by a hand on the rows or the pane */
  overscroll-behavior: contain;
}
.lp-group { border: 0; margin: 10px 0 0; padding: 0; min-width: 0; }
.lp-group legend { padding: 0; margin: 0 0 2px; font-weight: 600; font-size: 12.5px; color: var(--ink2); }
.lp-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; min-height: 28px; }
.sw { flex: none; overflow: visible; }
.sw path { fill: none; stroke-width: 3; stroke-linecap: round; }
.sw .rt-surf-sw { stroke: var(--m-birch); stroke-dasharray: 5 2; stroke-linecap: butt; stroke-width: 4; }
.sw .avoid-sw { stroke: var(--m-ember); stroke-dasharray: 3 2; stroke-linecap: butt; }
.sw .poi-sw { stroke: var(--m-pine); stroke-dasharray: 0 7; stroke-width: 6; }
/* maršruta josla paraugā kā kartē: mala, vidus, caurspīdīgums visam kopā (mapkit.js swatch) */
.sw .sw-band { opacity: .6; }
.sw .sw-band--ref { opacity: .28; }
.sw .sw-band .rt-band-sw-edge { stroke: var(--m-band-edge); stroke-width: 8; stroke-linecap: round; }
.sw .sw-band .rt-band-sw { stroke: var(--m-band); stroke-width: 5.5; }
.sw .sw-band--ref .rt-band-sw-edge { stroke-width: 10; }
.sw .sw-band--ref .rt-band-sw { stroke-width: 7.5; }
.sw .rt-unrouted-sw { stroke: var(--m-slate); stroke-dasharray: 5 4; stroke-width: 3; }

/* līnijas kartē (Leaflet path className), kā telefona navigācijā (docs/DESIGN.md „Maršruta līnijas kartē”).
   Maršruts ir debess josla: mala (.rt-band-edge) un vidus (.rt-line) savās rūtīs, caurspīdīgums rūtij, tāpēc josla
   ir caurspīdīga kā viens gabals. Izvēlētais (viss maršruts, diena, posms) ir pilna josla, pārējais blāva un šaura;
   galvenais plāns zem cita varianta ir plata blāva josla (.rt-plan-ref). Galveno un variantu šķir forma, ne krāsa.
   Raustīta līnija nozīmē posmu bez aktuāla maršruta: oglsarkana — novecojis, slāneklis — nemaršrutēts (prāmis). */
.rt-band-edge, .rt-plan-ref-edge { stroke: var(--m-band-edge); }
.rt-line, .rt-band-faint, .rt-plan-ref { stroke: var(--m-band); }
/* a leg under the pointer: its band's middle in the edge's colour, the faint one as wide as the full one */
.rt-line:not(.is-stale).leaflet-interactive:hover { stroke: var(--m-band-edge); }
.rt-band-faint.leaflet-interactive:hover { stroke: var(--m-band-edge); stroke-width: 6.5px; }
/* the hidden one of a leg's two bands takes no pointer (route_lines.js): what is in view is what a click takes */
.leaflet-pane > svg path.leaflet-interactive.is-off { pointer-events: none; }
.rt-line.is-stale { stroke: var(--m-ember); stroke-dasharray: 6 5; }
.rt-unrouted { stroke: var(--m-slate); stroke-dasharray: 6 5; }
.rt-drag { stroke: var(--m-ember); stroke-dasharray: 6 5; }
.rt-ref { stroke: var(--m-slate); stroke-dasharray: 6 6; stroke-opacity: .85; }
.avoid { stroke: var(--m-ember); fill: var(--m-ember); fill-opacity: .12; stroke-dasharray: 4 4; }
.rt-surf.sf--0 { stroke: var(--ms0); }
.rt-surf.sf--1 { stroke: var(--ms1); }
.rt-surf.sf--2 { stroke: var(--ms2); }
.rt-surf.sf--3 { stroke: var(--ms3); }
.rt-surf.sf--4 { stroke: var(--ms4); stroke-dasharray: 3 3; }

/* pini */
.pin-wrap { background: none; border: 0; }
.pin {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #fff; background: var(--m-ink); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.pin svg { width: 14px; height: 14px; fill: currentColor; }
.pin--lvm { background: var(--m-pine); }
/* skeleta mezgli: karogs startam un finišam (tinte), gulta naktij (bērzs), enkurs pārcelšanās punktam */
.pin .line-ic, .ic .line-ic { width: 15px; height: 15px; fill: none; }
.pin--camp { background: var(--m-birch); color: var(--m-ink); }
.pin--port { background: #fff; color: var(--m-ink); border-color: var(--m-ink); }
.pin--shop { background: var(--m-shop); }
.pin--water { background: var(--m-water); }
.pin--hazard { background: var(--m-ember); }
.pin--poi { background: var(--m-poi); }
.pin--tip { background: #fff; color: var(--m-ink); border-color: var(--m-birch); }
.pin--lvm { border-width: 1.5px; }
.pin--lvm svg { width: 10px; height: 10px; }
.pin.is-active { outline: 3px solid var(--m-birch); outline-offset: 1px; }
/* mezgla vārds kartē: bez kastes, ar baltu oreolu, lai lasās uz jebkurām flīzēm (flīzes ir gaišas abās tēmās) */
.leaflet-tooltip.node-label {
  padding: 0; border: 0; background: none; box-shadow: none; color: var(--m-ink); font: 600 12.5px/1.2 var(--fb);
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 8px #fff;
}
.leaflet-tooltip.node-label::before { display: none; }
.cursor-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--m-birch); border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(217, 166, 33, .35);
}

/* plāna punkti kartē tam, kas tos drīkst mainīt (docs/punkti-karte/SPEC.md): numurs dienā, balts aplis ar ogles
   malu — mazāks par pieturu pini, lai tie paliek redzami zem tā; dienas starts un finišs — pilns ogles aplis */
.wp {
  width: 100%; height: 100%; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--m-ink); color: var(--m-ink); font: 700 10px/1 var(--fb);
}
/* virziena bultiņas uz maršruta (SPEC 6.4): ogles ševrons ar baltu apmali — lasāms uz līnijas un blakus tai */
.rt-arrow { pointer-events: none; background: none; border: 0; }
.rt-arrow-ic { display: block; overflow: visible; }
.rt-arrow-casing, .rt-arrow-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rt-arrow-casing { stroke: #fff; stroke-width: 3.8; }
.rt-arrow-line { stroke: var(--m-ink); stroke-width: 1.9; }
.pop-note { margin-top: 6px; color: var(--ink2); }
/* kartes labošana (SPEC 6.1): josla kartes augšā vidū, starp vadīklām (pa kreisi +/−, pa labi „Slāņi”), virs tām;
   kamēr karte gaida klikšķi, krustiņš visur, arī virs līnijām, un joslā rinda, ko darīt */
.map.is-placing, .map.is-placing.leaflet-grab, .map.is-placing .leaflet-interactive { cursor: crosshair; }
/* režīmā mezgli, punkti, pieturas un līnijas velkami: pirksta ilgais piespiediens nedrīkst atvērt pārlūka izvēlni vai iezīmēt tekstu */
.map.is-editing:not(.is-placing) .leaflet-marker-icon:has(.wp, .pin:not(.pin--lvm)) { cursor: grab; }
.map.is-editing:not(.is-placing) :is(.rt-line, .rt-band-faint) { cursor: grab; }
.map.is-editing .leaflet-marker-icon { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.map.is-dragging, .map.is-dragging .leaflet-marker-icon, .map.is-dragging .leaflet-interactive { cursor: grabbing; }
.edit-bar {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px var(--gut);
  background: var(--bg2); color: var(--ink); border-bottom: 1px solid var(--line); border-left: 4px solid var(--birch);
  font: 500 13.5px/1.3 var(--fb);
}
.edit-bar[hidden], .edit-bar [hidden] { display: none; }
.edit-bar-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.edit-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 0; }
.edit-tip { margin: 0; font-size: 12.5px; color: var(--ink2); }
/* „Pievienot punktu” un „Labot karti” nospiesti — iespiesta poga, ne galvenā darbība (tā ir pilna tinte) */
.btn--place[aria-pressed="true"], .btn--edit-map[aria-pressed="true"] {
  background: var(--bg3); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink);
}
.dlg-note { margin: 0 0 10px; }
.pop-check { flex-basis: 100%; }
/* posma veids, profils un ilgums kartes labošanas režīmā */
.leg-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 10px 0; }
.leg-form .field { margin: 0; }
.leg-form .field-hint { flex-basis: 100%; margin: 0; }
.leg-form [hidden] { display: none; }
.leg-form-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- dienas un detaļas ---------- */

.lower { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); min-height: 420px; }
.days { border-right: 1px solid var(--line); padding: 8px 0; }
.day {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); width: 100%;
  text-align: left; padding: 14px var(--gut); border-bottom: 1px solid var(--line);
}
.days > div:last-child .day { border-bottom: 0; }
.day:hover, .day.is-active { background: var(--bg2); }
.day.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--birch); }
.day:focus-visible { outline-offset: -3px; }
.day > span { grid-column: 2; display: block; }
.day .day-n {
  grid-column: 1; grid-row: 1 / span 2; font: 800 26px/1 var(--fd); font-variation-settings: "opsz" 48; color: var(--birch-ink);
}
.day-t { font: 600 16px/1.25 var(--fd); overflow-wrap: anywhere; }
.day-m { display: flex !important; flex-wrap: wrap; gap: 0 12px; margin-top: 3px; font-size: 13px; color: var(--ink2); }
.day-legs { margin-top: 2px; font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.leg-goes-on { margin: 0 0 12px; color: var(--ink2); }
.mixbar { display: flex !important; height: 5px; margin-top: 8px; border-radius: 3px; overflow: hidden; background: var(--bg3); }
.mixbar i { display: block; height: 100%; }
.mixbar .sf--0 { background: var(--s0); }
.mixbar .sf--1 { background: var(--s1); }
.mixbar .sf--2 { background: var(--s2); }
.mixbar .sf--3 { background: var(--s3); }
.mixbar .sf--4 { background: var(--hatch); }
.light { position: relative; height: 6px; margin-top: 9px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.light i, .light b { position: absolute; top: 0; bottom: 0; }
.light-sun { background: var(--birch); opacity: .9; }
.light-ride { background: var(--ink); opacity: .55; }
.light-ride.is-late { background: var(--ember); opacity: .85; }
.lt { display: flex !important; justify-content: space-between; flex-wrap: wrap; gap: 0 10px; margin-top: 4px; font-size: 11.5px; color: var(--ink2); }
.lt .late { color: var(--ember); font-weight: 500; }

.detail { padding: 18px 24px 44px; max-width: 80ch; min-width: 0; outline: none; }
.detail > h2 { font: 700 26px/1.15 var(--fd); font-variation-settings: "opsz" 48; letter-spacing: -.01em; margin: 0 0 6px; overflow-wrap: anywhere; }
.meta { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--ink2); font-size: 13.5px; }
.day-note { margin: 0 0 18px; }
.stop {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px;
  padding: 14px 0; border-top: 1px solid var(--line); outline: none;
}
.stops > .stop:first-child { border-top: 0; }
.stop.is-hi { background: var(--bg2); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
/* a click anywhere on a stop's card is a press of its name (route_days.js) */
.detail .stop { cursor: pointer; }
.detail .stop:hover { background: var(--bg2); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.ic {
  width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center;
  /* ārpus kartes: tēmas tinte, lai starta un finiša aplis redzams arī tumšajā tēmā */
  background: var(--ink); color: var(--bg); flex: none;
}
.ic svg { width: 14px; height: 14px; fill: currentColor; }
:is(.k-shop, .k-water, .k-hazard, .k-poi) > .ic, .ic:is(.k-shop, .k-water, .k-hazard, .k-poi) { color: #fff; }
.k-camp > .ic, .ic.k-camp { background: var(--m-birch); color: var(--m-ink); }
.k-port > .ic, .ic.k-port { background: var(--bg2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.k-shop > .ic, .ic.k-shop { background: var(--m-shop); }
.k-water > .ic, .ic.k-water { background: var(--m-water); }
.k-hazard > .ic, .ic.k-hazard { background: var(--m-ember); }
.k-poi > .ic, .ic.k-poi { background: var(--m-poi); }
.k-tip > .ic, .ic.k-tip { background: var(--bg2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--birch); }
.stop h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.stop-name { font: 600 16.5px/1.25 var(--fd); text-align: left; overflow-wrap: anywhere; }
.stop-name:hover { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 3px; }
.stop-meta { display: inline-flex; flex-wrap: wrap; gap: 0 10px; font: 500 12.5px var(--fb); color: var(--ink2); }
.stop p { margin: 4px 0 0; }
.stop .night .lbl { color: var(--ink2); }
.stop .md { margin-top: 4px; }
.links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.links .coords { color: var(--ink2); }
.pois { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.pois-h { font: 600 15.5px/1.3 var(--fd); margin: 0; color: var(--pine); }
.pois-src { margin: 2px 0 8px; font-size: 12.5px; color: var(--ink2); }
.poilist { list-style: none; padding: 0; margin: 0; }
.poilist button {
  position: relative; display: block; width: 100%; text-align: left; padding: 6px 0 6px 18px; font-size: 13.5px; line-height: 1.35;
}
.poilist button::before { content: ""; position: absolute; left: 2px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--pine); }
.poi-name { font-weight: 600; margin-right: 8px; }
.poilist button:hover .poi-name { color: var(--birch-ink); text-decoration: underline; text-decoration-color: var(--birch); }
.poi-meta { display: inline-flex; flex-wrap: wrap; gap: 0 10px; color: var(--ink2); }
.foot {
  display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 18px var(--gut) 28px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink2);
}
.foot span { max-width: 60ch; }

/* ---------- Markdown ---------- */

.md { overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md blockquote { max-width: 72ch; }
.md p { margin: 8px 0; }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--fd); line-height: 1.2; margin: 22px 0 6px; }
.md h2 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.md h3 { font-size: 19px; font-weight: 650; }
.md h4, .md h5, .md h6 { font-size: 16px; font-weight: 600; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--ink2); }
.md blockquote { margin: 12px 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--birch); color: var(--ink2); }
.md blockquote p { margin: 4px 0; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--bg3); padding: 1px 5px; border-radius: 3px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; max-width: 72ch; }
.md a { overflow-wrap: anywhere; }
.md-table { overflow-x: auto; margin: 12px 0; max-width: 100%; -webkit-overflow-scrolling: touch; }
.md-table:focus-visible { outline-offset: 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { font: 600 13px var(--fb); color: var(--ink2); border-bottom: 2px solid var(--line); white-space: nowrap; }
.md .al-right { text-align: right; white-space: nowrap; }
.md .al-center { text-align: center; }
.md-check-note { margin: 12px 0 2px !important; font-size: 12.5px; color: var(--ink2); }
.md .md-check { list-style: none; padding-left: 0; }
.md-check li { margin: 0; }
.md-check label { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; cursor: pointer; }
.md-check input { margin-top: 2px; }
.md-check input:disabled { cursor: default; }
.md-check li.done span { color: var(--ink2); text-decoration: line-through; text-decoration-color: var(--line2); }

/* ---------- piezīmes (?tab=notes, views/trip_notes.js) ---------- */

/* the list on the left, the open note on the right; one column on a phone (below) */
.notes {
  display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 0 40px; align-items: start;
  padding: 22px var(--gut) 72px; border-top: 1px solid var(--line);
}
.notes--empty { display: block; }
/* a long note scrolls, the list stays in view below the trip's bar */
.notes-list { position: sticky; top: calc(var(--bar-h) + 12px); min-width: 0; }
.notes-items { list-style: none; margin: 0 0 12px; padding: 0; }
.notes-items a {
  display: block; padding: 7px 10px 7px 12px; border-left: 3px solid var(--line);
  text-decoration: none; font-weight: 500; overflow-wrap: anywhere;
}
.notes-items a:hover { border-left-color: var(--line2); background: var(--bg2); }
/* the open one: the birch of the active tab */
.notes-items a[aria-current] { border-left-color: var(--birch); color: var(--birch-ink); background: var(--bg2); }
.notes-full { margin: 0; font-size: 12.5px; color: var(--ink2); }
.notes-pane { min-width: 0; max-width: 72ch; }
.note-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; margin-bottom: 18px; }
.note-head h2 {
  flex: 1 1 18ch; min-width: 0; margin: 0; overflow-wrap: anywhere;
  font: 700 30px/1.1 var(--fd); font-variation-settings: "opsz" 60; letter-spacing: -.01em;
}
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.note-actions .btn--icon { min-width: 30px; min-height: 30px; }
.note-meta { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--ink2); }
.note-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.note-form .field-error { margin-top: 10px; }
/* after a 409: the newest text under the person's own, as source to merge from */
.note-newest { margin-top: 12px; padding: 10px 14px 12px; border-left: 4px solid var(--birch); background: var(--bg2); }
.note-newest h3 { margin: 0 0 4px; font: 600 15px/1.3 var(--fb); }
.note-newest-title { margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.note-src {
  margin: 0 0 8px; padding: 8px 10px; max-height: 420px; overflow: auto;
  background: var(--field); border: 1px solid var(--line2); border-radius: 4px;
  font: 13.5px/1.5 var(--fm); white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (max-width: 820px) {
  .notes { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 16px; }
  .notes-list { position: static; }
}
@media (max-width: 520px) {
  .note-head h2 { font-size: 24px; }
}
@media print {
  .notes { display: block; }
  .notes-list, .note-actions { display: none !important; }
}

/* ---------- vēsture (?tab=history, views/trip_log.js) ---------- */

/* A thread of days: the time, a face, what happened, the part of the trip. The face is the person's
   initials in one of five calm tones (log_model.js toneOf), mixed from the theme's own colours so that
   both themes keep the text readable on its fill; the thread runs behind the faces. */
.hist { padding: 22px var(--gut) 72px; border-top: 1px solid var(--line); max-width: 1000px; }
.hist-h { margin: 0; font: 700 30px/1.1 var(--fd); font-variation-settings: "opsz" 60; letter-spacing: -.01em; }
.hist-intro { margin: 6px 0 0; max-width: 62ch; font-size: 14px; color: var(--ink2); }
.hist-tools { margin: 16px 0 0; }
.hist-tools .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hist-tools .seg-btn { white-space: nowrap; }
.hist-empty { margin: 22px 0 0; max-width: 62ch; color: var(--ink2); }
.hist-days:focus { outline: none; }
.hist-days:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.hist-day { margin-top: 22px; }
.hist-date {
  position: sticky; top: var(--bar-h, 0px); z-index: 1;
  margin: 0; padding: 8px 0 6px; background: var(--bg); border-bottom: 1px solid var(--line);
  font: 600 12.5px/1.3 var(--fb); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2);
}
.hist-list { position: relative; list-style: none; margin: 0; padding: 4px 0 0; }
.hist-list::before {
  content: ""; position: absolute; top: 18px; bottom: 18px; left: calc(46px + 12px + 13px); width: 2px;
  background: var(--line);
}
.hist-row {
  position: relative; display: grid; grid-template-columns: 46px 28px minmax(0, 1fr) auto; gap: 0 12px;
  align-items: start; padding: 7px 0;
}
.hist-time { padding-top: 4px; text-align: right; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.hist-ava {
  --tone: var(--gravel);
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 24%, var(--bg2));
  color: color-mix(in srgb, var(--tone) 72%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--tone) 45%, var(--bg2));
  box-shadow: 0 0 0 3px var(--bg);
  font: 700 11px/1 var(--fb); letter-spacing: .02em;
}
.hist-ava--0 { --tone: var(--pine); }
.hist-ava--1 { --tone: var(--ember); }
.hist-ava--2 { --tone: var(--birch-line); }
.hist-ava--3 { --tone: var(--m-water); }
.hist-ava--4 { --tone: var(--m-slate); }
.hist-ava--admin { background: var(--pine); color: var(--bg2); border-color: var(--pine); }
.hist-ava--system { background: var(--bg); border-color: var(--pine); color: var(--pine); }
.hist-ava--gone { background: var(--bg); border-style: dashed; border-color: var(--line2); color: var(--ink2); }
.hist-text { margin: 0; padding-top: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.hist-who, .hist-name { font-weight: 600; }
.hist-who--quiet { color: var(--ink2); }
.hist-subject { font-weight: 400; }
.hist-plan { font-weight: 500; }
.hist-times { color: var(--ink2); }
.hist-rest {
  margin-left: .35em; color: var(--birch-ink); font-size: inherit;
  text-decoration: underline dotted; text-decoration-color: var(--birch-line); text-underline-offset: 3px;
}
.hist-rest:hover { text-decoration-style: solid; }
.hist-badge {
  display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 999px;
  font-size: 12px; line-height: 19px; color: var(--ink2); white-space: nowrap; vertical-align: 1px;
}
/* a row of the skeleton: its mark before the name, „Atgriezt” after the words */
.hist-mark {
  display: inline-block; margin-right: 8px; padding: 0 6px; border: 1px solid var(--pine); border-radius: 4px;
  font-size: 12px; line-height: 19px; color: var(--pine); white-space: nowrap; vertical-align: 1px;
}
.hist-revert { margin-left: 10px; vertical-align: 1px; }
.hist-topic { padding-top: 4px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.hist-topic::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px;
  background: var(--line2); vertical-align: 1px;
}
.hist-topic--route::before { background: var(--m-lake); }
.hist-topic--schedule::before { background: var(--birch); }
.hist-topic--packing::before { background: var(--pine); }
.hist-topic--notes::before { background: var(--s0); }
.hist-topic--trip::before { background: var(--ember); }
.hist-more { margin: 18px 0 0 calc(46px + 12px + 28px + 12px); }
/* a phone: the face, the words, the time on the right; the filter says the part of the trip */
@media (max-width: 560px) {
  .hist-h { font-size: 24px; }
  .hist-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 10px; }
  .hist-time { order: 3; padding-left: 4px; }
  .hist-topic { display: none; }
  .hist-list::before { left: 13px; }
  .hist-more { margin-left: 38px; }
}
@media print {
  .hist-tools, .hist-more { display: none !important; }
  .hist-date { position: static; }
}
.md-page { font-size: 15.5px; line-height: 1.58; }
.md-page h2 { padding-top: 16px; border-top: 1px solid var(--line); margin-top: 30px; }
.md-page h2:first-child { border-top: 0; padding-top: 0; }
.toc { margin: 0 0 22px; padding: 10px 0 12px 14px; border-left: 3px solid var(--line); }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.toc .toc-sub { color: var(--ink2); }

/* ---------- segmentēta izvēle un Markdown lauks ---------- */

.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; }
.seg-btn { padding: 6px 12px; min-height: 34px; font-weight: 500; font-size: 14px; border-right: 1px solid var(--line2); }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--bg3); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg-btn:focus-visible { outline-offset: -3px; }
/* views/fields.js mdField */
.md-preview { margin: 8px 0 4px; padding: 10px 12px; background: var(--bg); border: 1px dashed var(--line2); border-radius: 4px; max-height: 420px; overflow: auto; }
.field--md textarea { font-size: 14.5px; }

/* ---------- Mantas (docs/DESIGN.md „Mantas”) ---------- */

/* One table: rows are items, columns are the people who ride. The row tint says what the viewer has
   to do, from tokens so both themes have it: --pk-none — nobody takes it, --pk-ok — nothing for me
   to do here; a row I still have to pack keeps the page's own background. The name pill's two greens
   (.pk-pill): --pk-take-ink on --pk-take — takes, --bg2 on --pk-packed — packed; each text keeps at
   least 4.5:1 on its fill in both themes. */
.pk {
  --pk-ok: color-mix(in srgb, var(--pine-soft) 75%, var(--bg2));
  --pk-none: color-mix(in srgb, var(--ember) 11%, var(--field));
  --pk-take: color-mix(in srgb, var(--pine) 30%, var(--bg2));
  --pk-take-ink: color-mix(in srgb, var(--pine) 80%, var(--ink));
  --pk-packed: color-mix(in srgb, var(--pine) 85%, var(--ink));
  padding: 22px var(--gut) 56px; border-top: 1px solid var(--line);
}
/* The dark theme's pine is light: the light theme's mix would leave the take text at 4.1:1 on its
   fill, so the fill is a little darker and the text lighter (5.2:1). Both dark blocks, as at the top. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pk {
    --pk-take: color-mix(in srgb, var(--pine) 28%, var(--bg2));
    --pk-take-ink: color-mix(in srgb, var(--pine) 55%, var(--ink));
  }
}
:root[data-theme="dark"] .pk {
  --pk-take: color-mix(in srgb, var(--pine) 28%, var(--bg2));
  --pk-take-ink: color-mix(in srgb, var(--pine) 55%, var(--ink));
}
.pk-h { margin: 0; font: 700 30px/1.1 var(--fd); font-variation-settings: "opsz" 60; letter-spacing: -.01em; }
.pk-meta { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; color: var(--ink2); }
.pk-quiet { margin: 8px 0 0; font-size: 13.5px; color: var(--ink2); }
.pk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0 0; }
.pk-toolbar > .btn { margin-left: auto; }
.pk-toolbar .seg-btn { white-space: nowrap; }
.pk-notes, .pk-fx { font-size: 14px; white-space: nowrap; }
.pk-body { margin-top: 18px; }
.pk-empty { margin: 0; padding: 8px 0; max-width: 62ch; color: var(--ink2); }

/* The table is as wide as its content, not the page, so the people sit right after the names: the
   item column is the longest name up to --pk-t-max (a longer one wraps), each person's column is
   --pk-col. More columns than fit: the people scroll sideways under the item column, which stays
   (sticky). The item column holds its width by itself (.pk-tbox), so min-width only has to keep
   the fixed columns — the tick and the people. */
/* a size container, so a group band can be as wide as the visible part (.pk-grp th > span) */
.pk-scroll { overflow-x: auto; margin: 0 -8px; overscroll-behavior-x: contain; container-type: inline-size; }
.pk-table {
  --pk-c: 34px; --pk-t-max: 300px; --pk-col: 84px;
  width: auto; min-width: calc(var(--pk-c) + var(--pk-n, 0) * var(--pk-col));
  table-layout: auto; border-collapse: separate; border-spacing: 0; font-size: 14.5px;
}
.pk-table--noticks { --pk-c: 0px; }
/* a visitor's list has no people to sit next to: it wraps in the page's width, as text does */
.pk-table--plain { width: 100%; min-width: 0; max-width: 760px; }
.pk-col-c { width: var(--pk-c); }
.pk-col-p { width: var(--pk-col); }
.pk-table td, .pk-table th {
  padding: 3px 2px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle;
  font-weight: inherit; background: var(--pk-row, var(--bg));
}
.pk-row { --pk-row: var(--bg); }
.pk-row[data-row="ok"] { --pk-row: var(--pk-ok); }
.pk-row[data-row="none"] { --pk-row: var(--pk-none); }
.pk-table .pk-c { position: sticky; left: 0; z-index: 1; padding-left: 8px; }
.pk-table .pk-t { position: sticky; left: var(--pk-c); z-index: 1; padding: 4px 10px 4px 2px; }
.pk-table--noticks .pk-t { left: 0; padding-left: 8px; }
/* Its own width under a min-content squeeze too (not only the longest word), so a narrow screen
   scrolls the people rather than crushing the names. */
.pk-tbox { width: max-content; max-width: var(--pk-t-max); }
.pk-table--plain .pk-tbox { width: auto; max-width: none; }
/* never narrower or wider than --pk-col: the pill is the column less its gaps (.pk-pill) */
.pk-table .pk-p { width: var(--pk-col); min-width: var(--pk-col); }
/* a group is a band across the table, its items right under it; items before the first group have none.
   Green with a tick when nothing in it needs me (groupState in trip_packing.js). The band is a
   button that closes and opens its group; the vertical padding is the button's, so all of the
   band's height is the target. */
.pk-grp th { padding: 0; border-bottom-color: var(--line2); background: var(--bg3); }
/* The band's text takes no part in the table's width: in an auto-sized table a colspan cell's
   content widens the columns it spans, so a long group name (up to 40 characters) on a trip with one
   or two people would widen the item column and part the names from the people again. Inline-size
   containment counts the span as empty when the table is sized; its width then comes from the band
   once laid out — all of it, but no wider than the scroller's visible part (100cqi of .pk-scroll,
   less the band's padding) — so a long name is cut where it can be read (.pk-grp-btn), and the
   sticky `left` still has room to hold the button in view while the people scroll sideways. The button fills the span,
   so a click anywhere on the band's visible part opens and closes it, not only on the name. */
.pk-grp th > span {
  position: sticky; left: 0; display: inline-block; vertical-align: top; width: min(100%, 100cqi); contain: inline-size;
  font: 700 15px/1.2 var(--fd);
}
.pk-grp th .pk-grp-btn { width: 100%; padding: 6px 8px; }
/* inside: the band's left edge is the scroller's, and the sticky cells of the rows around it would
   paint over a ring drawn outside; inside it sits on the band, where --focus is under 3:1 in the
   light theme (--birch-ink: 4.35:1 on --bg3, 4.93:1 on --pk-ok; the dark theme's is --focus itself) */
.pk-grp th .pk-grp-btn:focus-visible { outline-offset: -3px; outline-color: var(--birch-ink); }
.pk-grp th[data-grp="ok"] { background: var(--pk-ok); }
.pk-grp th[data-grp="ok"] > span { color: var(--pine); }
/* One line, always: what comes and goes on the band (the red count, the „✓”, a closed band's count)
   must never wrap it to a second line and move the rows under it. So the name is cut with „…” (the
   whole of it in its tooltip and to a screen reader), and a closed band's count gives way first. */
.pk-grp-btn { display: flex; align-items: center; padding: 6px 0; text-align: left; white-space: nowrap; }
.pk-grp-btn > * { flex: none; }
.pk-grp-btn > .pk-grp-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pk-grp-btn > .pk-grp-sum { flex: 0 100 auto; min-width: 0; margin-left: .3em; overflow: hidden; text-overflow: ellipsis; }
.pk-grp-btn:hover .pk-grp-name { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 3px; }
/* the chevron points down while open, right while closed */
.pk-chev {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.pk-grp-btn[aria-expanded="false"] .pk-chev { transform: rotate(-90deg); }
.pk-grp-ok { margin-right: 6px; }
/* a closed band's count: quieter than the name */
.pk-grp-sum { font: 500 13.5px/1.2 var(--fb); color: var(--ink2); }
/* the band's red count of rows nobody takes: --bg on --ember is over 4.5:1 in both themes. It is a
   flex item of the one-line band; the negative block margins keep its margin box (12px) under the
   name's 18px line, so the band is as high with the count as without it and nothing under it moves
   when it comes. */
.pk-grp-n {
  display: inline-block; min-width: 18px; height: 18px; margin: -3px 0 -3px 8px; padding: 0 5px; border-radius: 9px;
  background: var(--ember); color: var(--bg); font: 700 12px/18px var(--fb); text-align: center;
}
/* A row the table does not show (a closed group's, one the filter leaves out) is still there, with no
   height and invisible, so the item column keeps the whole list's width and nothing jumps
   (trip_packing.js ghost()). Its sides keep their padding: that is part of the width. */
.pk-ghost { visibility: hidden; }
.pk-table .pk-ghost > td { height: 0; padding-top: 0; padding-bottom: 0; border-bottom: 0; }
.pk-ghost .pk-tbox { height: 0; overflow: hidden; }
.pk-tline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.pk-name { min-width: 0; font-weight: 500; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
button.pk-name:hover { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 3px; }
/* the red „!” in the tick cell of a row nobody takes (its words are for a screen reader in the name
   cell); --bg on --ember is over 4.5:1 in both themes */
.pk-nb {
  display: inline-block; width: 17px; height: 17px; border-radius: 50%; vertical-align: middle;
  background: var(--ember); color: var(--bg); font: 700 12px/17px var(--fb); text-align: center; cursor: default;
}
.pk-nobody {
  padding: 0 8px; border: 1px solid var(--ember); border-radius: 12px;
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  /* --ember towards --ink (darker in the light theme, lighter in the dark): ≥ 4.5:1 on the pink row in both */
  color: color-mix(in srgb, var(--ember) 80%, var(--ink)); border-color: color-mix(in srgb, var(--ember) 80%, var(--ink));
}
.pk-note { display: block; font-size: 13px; line-height: 1.35; color: var(--ink2); overflow-wrap: anywhere; }
.pk-table input[type="checkbox"] { width: 17px; height: 17px; }

/* The name pill: grey outline — does not take; green fill with a pine border — takes; solid deep
   green with „✓” — packed. Three steps you can tell apart at a glance (owner, 2026-10-08), the same
   for every person's pill. A length, not a percentage: in an auto-sized table a long name would
   otherwise widen its column. */
.pk-pill {
  display: flex; align-items: center; justify-content: center; gap: 3px; width: calc(var(--pk-col) - 8px); margin: 0 2px;
  min-height: 26px; padding: 0 5px; border: 1.5px solid var(--line2); border-radius: 13px;
  color: var(--ink2); font: 500 12px/1.1 var(--fb); white-space: nowrap; overflow: hidden;
}
.pk-pill-l { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; max-width: 100%; }
.pk-pill-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
button.pk-pill:hover { border-color: var(--ink2); color: var(--ink); }
.pk-pill.is-take { background: var(--pk-take); border-color: var(--pine); color: var(--pk-take-ink); font-weight: 600; }
/* hover: a step deeper; the text goes to --ink as on a grey pill, which keeps ≥ 6:1 on the deeper fill */
button.pk-pill.is-take:hover { background: color-mix(in srgb, var(--pk-take) 85%, var(--pine)); border-color: var(--pine); color: var(--ink); }
.pk-pill.is-take.is-packed { background: var(--pk-packed); color: var(--bg2); }
button.pk-pill.is-take.is-packed:hover {
  background: color-mix(in srgb, var(--pk-packed) 88%, var(--ink)); border-color: color-mix(in srgb, var(--pk-packed) 88%, var(--ink)); color: var(--bg2);
}
.pk-pill:focus-visible { outline-offset: 1px; }
/* What the others just changed, marked for a few seconds (FLASH_MS, the list read again by itself;
   owner's pick 2026-10-16, docs/mantas-efekti/VARIANTI.html „Nozibsnī”): the pill blinks birch three
   times and keeps a soft birch halo, its row washes birch and fades back; a new or changed item has a
   birch bar at the start of its name (a phone row: at its start). At the end the halo and the bar
   fade out. A shadow, never an outline (the focus ring is one). --fresh-age (packing_model.js
   freshAge) is how long ago the mark began: a list drawn anew mid-flash goes on from there. Under
   reduced motion all of that is still: the row stays birch-tinted, and the mark goes at once —
   unless this browser was told „Atļaut efektus” (.pk-fx-on, trip_packing.js), which wins over the
   page-wide stilling below by its weight (both !important). */
.pk-pill, .pk-row > .pk-t, .pk-pl-row { transition: box-shadow .8s ease-out; }
.pk-pill.is-fresh {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--birch) 60%, transparent);
  animation: pk-flash .7s ease-in-out 3 calc(-1 * var(--fresh-age, 0ms));
}
.pk-row.is-fresh > .pk-t, .pk-pl-row.is-fresh { box-shadow: inset 4px 0 0 var(--birch); }
.pk-row:has(.pk-pill.is-fresh) > *, .pk-row.is-fresh > *, .pk-pl-row.is-fresh {
  animation: pk-wash 2.4s ease-out calc(-1 * var(--fresh-age, 0ms));
}
/* the dark ink of the light theme in both: birch is light in both */
@keyframes pk-flash { 45% { background-color: var(--birch); border-color: var(--birch-line); color: #24281F; } }
@keyframes pk-wash { 0% { background-color: color-mix(in srgb, var(--birch) 38%, var(--pk-row, var(--bg))); } }
@media (prefers-reduced-motion: reduce) {
  .pk:not(.pk-fx-on) .pk-row:has(.pk-pill.is-fresh) > *, .pk:not(.pk-fx-on) .pk-row.is-fresh > * {
    background-color: color-mix(in srgb, var(--birch) 26%, var(--pk-row, var(--bg)));
  }
  .pk:not(.pk-fx-on) .pk-pl-row.is-fresh { background-color: color-mix(in srgb, var(--birch) 26%, var(--bg)); }
  .pk.pk-fx-on .pk-pill, .pk.pk-fx-on .pk-row > .pk-t, .pk.pk-fx-on .pk-pl-row { transition: box-shadow .8s ease-out !important; }
  .pk.pk-fx-on .pk-pill.is-fresh { animation: pk-flash .7s ease-in-out 3 calc(-1 * var(--fresh-age, 0ms)) !important; }
  .pk.pk-fx-on .pk-row:has(.pk-pill.is-fresh) > *, .pk.pk-fx-on .pk-row.is-fresh > *, .pk.pk-fx-on .pk-pl-row.is-fresh {
    animation: pk-wash 2.4s ease-out calc(-1 * var(--fresh-age, 0ms)) !important;
  }
}
/* forced colours drop shadows: a dashed inner outline instead, never on the focused pill, whose solid
   focus ring it would replace */
@media (forced-colors: active) {
  .pk-pill.is-fresh:not(:focus-visible), .pk-row.is-fresh > .pk-t, .pk-pl-row.is-fresh { outline: 2px dashed Highlight; outline-offset: -2px; }
}
.pk-ok { flex: none; font-size: 11.5px; }

/* adding: the field with its suggestions and the button */
.pk-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; align-items: start; gap: 10px 12px; margin-top: 20px; max-width: 760px; }
/* a group field: the input with „▾” inside its right end, the offer under it as under the title */
.pk-grp-field { position: relative; min-width: 0; }
.pk-grp-field input { width: 100%; padding-right: 34px; }
.pk-grp-all {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 32px;
  display: flex; align-items: center; justify-content: center; color: var(--ink2);
}
.pk-grp-all:hover { color: var(--ink); }
.pk-grp-all .pk-chev { margin: 0; }
.pk-grp-field .pk-sugg { max-height: 260px; overflow-y: auto; }
.pk-add-field { position: relative; min-width: 0; }
.pk-sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px 0;
  background: var(--field); border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 6px 18px rgba(23, 26, 21, .16);
}
.pk-sugg li { padding: 7px 10px; font-size: 14.5px; cursor: pointer; overflow-wrap: anywhere; }
.pk-sugg li:hover, .pk-sugg li.is-active { background: var(--bg3); }
.pk-sugg mark { background: color-mix(in srgb, var(--birch) 32%, transparent); color: inherit; font-weight: 600; }
.pk-sugg small { font-size: 13px; color: var(--ink2); }
.pk-foot { margin-top: 16px; }
.pk-hint { margin: 4px 0 0; max-width: 90ch; font-size: 13.5px; color: var(--ink2); }
.pk-sw {
  display: inline-block; width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px;
  border: 1px solid var(--line2); border-radius: 3px; background: var(--bg);
}
.pk-sw--none { background: var(--pk-none); }
.pk-sw--ok { background: var(--pk-ok); }

/* „Man jāieliek” on a phone: big rows, packed ones struck through on green, in their place */
.pk-prog { max-width: 520px; height: 8px; margin-top: 8px; border-radius: 4px; background: var(--bg3); overflow: hidden; }
.pk-prog i { display: block; height: 100%; background: var(--pine); }
/* a group heading is the table's band: grey, or green with a tick when nothing in it needs me; the
   button is the whole band, a thumb's height */
.pk-ph-grp {
  margin: 18px -8px 0; border-bottom: 1px solid var(--line2); background: var(--bg3);
  font: 700 15px/1.2 var(--fd); overflow-wrap: anywhere;
}
.pk-ph-grp[data-grp="ok"] { background: var(--pk-ok); color: var(--pine); }
.pk-ph-grp .pk-grp-btn { width: 100%; min-height: 40px; padding: 10px 8px; }
.pk-pl { list-style: none; margin: 0 -8px; padding: 0; border-top: 1px solid var(--line); }
.pk-ph-grp + .pk-pl { border-top: 0; }
.pk-pl-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pk-pl-row.is-done { background: var(--pk-ok); }
.pk-pl input[type="checkbox"] { width: 22px; height: 22px; }
.pk-pl-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pk-pl-row.is-done .pk-pl-name { text-decoration: line-through; text-decoration-color: var(--ink2); }
.pk-also { flex: none; padding: 1px 9px; border: 1px solid var(--line2); border-radius: 12px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.pk-back-p { margin: 16px 0 0; }

/* the row editor and the copy dialog */
.pk-move-btns { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.dlg .pk-move-status:empty { display: none; }
.pk-del { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.pk-src { list-style: none; margin: 6px 0 0; padding: 0; max-height: 44vh; overflow-y: auto; border-top: 1px solid var(--line); }
.pk-src-row {
  display: grid; grid-template-columns: 17px 48px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.pk-src-row .glyph { width: 48px; height: 28px; }
.pk-src-n { display: block; font-weight: 600; overflow-wrap: anywhere; }
.pk-src-t small { font-size: 13px; color: var(--ink2); }
.pk-src-none { padding: 12px 0; color: var(--ink2); }
.pk-keep { margin-top: 12px; }
.dlg .pk-copy-note { display: block; margin: 8px 0 0; font-size: 13px; }

@media (max-width: 600px) {
  .pk { padding-top: 16px; padding-bottom: 40px; }
  .pk-h { font-size: 24px; }
  .pk-table { --pk-t-max: 140px; --pk-col: 80px; }
  .pk-toolbar { gap: 10px; }
  .pk-toolbar > .btn { margin-left: 0; }
  .pk-toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pk-toolbar .seg-btn { padding: 6px 10px; font-size: 13.5px; }
  /* the add row in two lines: the title alone, then the group and the button — three in a row would
     leave the title a few pixels */
  .pk-add { grid-template-columns: minmax(0, 1fr) auto; }
  .pk-add-field { grid-column: 1 / -1; }
}

/* ---------- dialogi un paziņojumi ---------- */

.dlg {
  width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto;
  padding: 22px 24px 20px; border: 1px solid var(--line2); border-radius: 6px;
  background: var(--bg2); color: var(--ink);
}
.dlg[open] { animation: dlg-in .16s ease-out; }
.dlg::backdrop { background: rgba(23, 26, 21, .5); }
.dlg h2 { font: 700 23px/1.2 var(--fd); margin: 0 0 10px; }
.dlg p { margin: 0 0 8px; max-width: 60ch; }
.dlg form { margin: 0; }
.dlg .field { margin-top: 12px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dlg--wide { width: min(720px, calc(100vw - 28px)); }
.dlg-intro { color: var(--ink2); }
/* lejupielāžu saraksts (downloadDialog, piem. GPX pa dienām): katrs fails sava rinda, visa rinda ir saite */
.dl-group { margin: 14px 0 0; font: 600 13px/1.3 var(--fb); color: var(--ink2); }
.dl-files { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line); }
.dl-files li { border-bottom: 1px solid var(--line); }
.dl-file { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; color: var(--ink); text-decoration: none; }
.dl-file:hover { background: var(--bg3); }
.dl-file:focus-visible { outline-offset: -3px; }
.dl-file-title { font-weight: 600; }
.dl-file-detail { color: var(--ink2); font-size: 14px; overflow-wrap: anywhere; }
.dlg-fields { margin-top: 4px; }
/* „Iestatījumi → Dienas”: a day under another, its nodes and legs under its texts */
.dd-body { max-height: min(62vh, 640px); overflow-y: auto; padding-right: 6px; }
.dd-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 16px; }
.dd-dates .field { margin: 0; }
.dlg .dd-length { margin: 0 0 8px; color: var(--ink2); font-size: 14px; }
.dd-day { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.dd-head { margin: 0; font: 600 14px/1.3 var(--fb); }
.dd-head b { font: 800 16px/1 var(--fd); color: var(--birch-ink); }
.dd-texts { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 0 12px; }
.dd-items { list-style: none; margin: 10px 0 0; padding: 0; }
.dd-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 8px; padding: 6px 0; }
.dd-ic { padding-top: 22px; color: var(--ink2); }
.dd-node, .dd-leg { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; align-items: start; }
.dd-node { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.dd-node .check, .dd-node .field-hint, .dd-leg > .field-hint { grid-column: 1 / -1; }
.dd .field { margin: 0 0 6px; }
.dd textarea { min-height: 0; }
.dd-on { color: var(--ink2); font-size: 14px; }
.dd-on .dd-ic { padding-top: 0; }
.dlg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 18px; }
.dlg-grid .field { margin: 0 0 14px; }
.dlg-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin-top: 8px; }
.dlg-grid .dlg-checks { grid-column: 1 / -1; }
.dlg-checks .field-hint { flex: 1 1 100%; margin: 0; }
/* A box the dialog switched off (e.g. „Ieteikt titullapā” for a private trip) reads as off, its hint says why. */
.dlg-checks .check:has(> input:disabled) { color: var(--ink2); cursor: not-allowed; }
.dlg .field-error { margin: 12px 0 0; }
.dlg[aria-busy="true"] { cursor: progress; }
.dlg .dlg-wait { margin: 12px 0 0; font-size: 13px; color: var(--ink2); }
.dlg-span { grid-column: 1 / -1; }
.dlg .copy-dates { margin: -8px 0 14px; }
/* izvēle ar paskaidrojumu (redzamība, kopijas pamats): radio, virsraksts, zem tā klusāks teksts */
.choice-set { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.dlg-grid .choice-set { margin: 0 0 14px; }
.choice-set legend { padding: 0; margin: 0 0 2px; }
.choice {
  display: grid; grid-template-columns: 17px minmax(0, 1fr); column-gap: 10px; align-items: baseline;
  padding: 6px 0; cursor: pointer;
}
.choice input { align-self: start; margin-top: 3px; }
.choice-title { font-weight: 600; overflow-wrap: anywhere; }
.choice-hint { grid-column: 2; font-size: 13px; line-height: 1.45; color: var(--ink2); }
.dlg p.choice-one { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } }

.toast {
  position: fixed; left: 16px; bottom: 16px; z-index: 3000; max-width: min(460px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 4px; background: var(--ink); color: var(--bg); font-weight: 500;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s, transform .16s;
}
.toast.is-on { opacity: 1; transform: none; }
.toast--error { background: #B03D18; color: #fff; }
.toast:empty { display: none; }
/* A toast with one action (the packing list's „Atcelt”): the button can be clicked while it shows. */
.toast--action { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 14px; }
.toast--action.is-on { pointer-events: auto; }
.toast-btn {
  flex: none; min-height: 32px; padding: 4px 12px; border-radius: 4px; font-weight: 600; color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
}
.toast-btn:hover { border-color: currentColor; }

.errpage { padding: 24px var(--gut); }
.errbox { padding: 32px 0; max-width: 62ch; }
.errbox h1, .errbox h2 { font: 700 28px/1.15 var(--fd); margin: 0 0 8px; }
.errbox p { margin: 0 0 12px; }
.errbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.stage > .errbox { padding: 32px var(--gut); }
.stage > .empty { padding: 36px var(--gut); }

/* ---------- pārvaldība ---------- */

.admin { padding: 22px var(--gut) 72px; max-width: 1280px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.admin-head .page-title { margin: 0; }
.subnav { display: flex; gap: 0 22px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.subnav-link {
  padding: 8px 0 9px; text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.subnav-link:hover { border-bottom-color: var(--line2); }
.subnav-link[aria-current] { color: var(--birch-ink); border-bottom-color: var(--birch); }
.admin-sec { padding-top: 14px; }
.admin-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.admin-tools input[type="search"] { width: min(280px, 100%); min-height: 32px; }
.admin-count { margin: 0 0 0 auto; color: var(--ink2); font-size: 13px; }

/* Blīva tabula: viena rinda = viens ieraksts, bez ievadlaukiem. */
.atable { overflow-x: auto; max-width: 100%; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.atable:focus-visible { outline-offset: -3px; }
.atable table { border-collapse: collapse; width: 100%; min-width: 820px; font-size: 13.5px; }
.atable th, .atable td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.atable th {
  font: 600 12.5px var(--fb); color: var(--ink2); white-space: nowrap;
  padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--line2);
}
.atable tr:hover td { background: var(--bg2); }
.atable .nm { min-width: 170px; padding-right: 20px; }
.atable .sub { display: block; font-size: 12px; color: var(--ink2); }
.atable .num { text-align: right; width: 1%; white-space: nowrap; }
.atable .when { white-space: nowrap; color: var(--ink2); }
.atable .tags { white-space: nowrap; }
.atable .acts { text-align: right; white-space: nowrap; padding-right: 0; width: 1%; }
.atable .acts .btn + .btn { margin-left: 6px; }
.atable tr.is-off td, .atable tr.is-off .strong { color: var(--ink2); }

/* Žurnāls /admin/audit: atlase virs tabulas, rindā klikšķināmi vārdi, „Sīkāk” atver rindu zem tās. */
.aud-lede { flex-basis: 100%; margin: 0; max-width: 80ch; color: var(--ink2); font-size: 13.5px; }
/* One grid row of equal fields: every label on one line, every control 36px. Safari draws a native select and a
   date field to its own height, so here the select is a plain one with a drawn caret (gradients, so it follows the
   theme) and the date field has no inner padding. A minimum height, not a height: a larger minimum font grows them. */
.aud-filter {
  display: grid; flex: 1 1 100%; align-items: end; gap: 10px 12px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}
.aud-filter .field { gap: 4px; margin: 0; }
.admin-tools .aud-filter :is(input, select) { width: 100%; min-height: 36px; margin: 0; }
.aud-filter select {
  appearance: none; padding-right: 28px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%),
    linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.aud-filter input[type="date"] { padding-block: 5px; }
.aud-filter input[type="date"]::-webkit-datetime-edit { padding: 0; }
.aud-filter input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
@media (forced-colors: active) { .aud-filter select { appearance: auto; padding-right: 9px; } }
/* Five in a row only while a date field's track holds a whole date with the picker's icon (Firefox needs
   about 146px); narrower, two rows. */
@media (max-width: 1080px) {
  .aud-filter { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .aud-filter > .field { grid-column: span 2; }
  .aud-filter > .aud-q { grid-column: span 4; }
}
.aud-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.aud-chips[hidden] { display: none; }
/* a trip's title can be 120 characters: the chip wraps, so its ✕ stays on a phone's screen */
.aud-chip { gap: 2px; max-width: 100%; padding-right: 2px; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.aud-chip-x { flex: none; }
.aud-chip-x {
  min-width: 24px; min-height: 24px; padding: 0 5px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink2); font: inherit; cursor: pointer;
}
.aud-chip-x:hover { background: var(--bg3); color: var(--ink); }
.aud-pick {
  padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px;
}
.aud-pick:hover { text-decoration-color: var(--birch); }
.aud-table td { vertical-align: top; }
.aud-table .aud-detail { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.atable tr.is-open td, .atable tr.aud-more-row td { background: var(--bg2); }
/* The row clicked or reached with ↑ ↓ (or its details, clicked): a band above and below it (an outline's
   sides would sit on the first cell's text, which has no left padding, or be cut off by the scrolling box). */
.aud-table :is(tr.aud-line, tr.aud-more-row):focus { outline: none; }
/* --birch-ink, not --focus: on these grounds the light theme's --focus is under 3:1 (as .pk-grp's ring); --bg2,
   not --bg3, under it, which would take the „Uzmanību” badge's small text below 4.5:1. Separate
   borders: collapsed, WebKit paints the row above's line over the top band's upper half (each cell has
   only a bottom border, so nothing doubles). */
.atable table.aud-table { border-collapse: separate; border-spacing: 0; }
.aud-table :is(tr.aud-line, tr.aud-more-row):focus td {
  background: var(--bg2); box-shadow: inset 0 2px 0 var(--birch-ink), inset 0 -2px 0 var(--birch-ink);
}
/* Forced colours drop the shadows: every row keeps a top border in the page's colour, so the focused row's
   turning CanvasText (above its 1px line below) moves nothing as the arrows walk. */
@media (forced-colors: active) {
  .aud-table :is(tr.aud-line, tr.aud-more-row) td { border-top: 2px solid Canvas; }
  .aud-table :is(tr.aud-line, tr.aud-more-row):focus td { border-top-color: CanvasText; }
}
.atable tr.aud-more-row td { padding: 8px 14px 14px; }
.aud-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.aud-dl dt { color: var(--ink2); font-weight: 500; }
.aud-dl dd { margin: 0; overflow-wrap: anywhere; }
.atable .aud-dl .sub { display: inline; margin-left: 8px; }
.aud-detail-full { white-space: pre-wrap; }
.aud-more { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 14px; }
.aud-more .warn { margin: 0; }
.badge--alarm { margin-left: 6px; color: var(--ember); border-color: color-mix(in srgb, var(--ember) 45%, var(--line)); }

/* Tabs in a dialog („Ceļojuma iestatījumi”: Ceļojums, Cilvēki): the same look as the admin subnav,
   as buttons with aria-selected. */
.dlg .subnav { margin: 0 0 6px; }
.subnav-link[aria-selected="true"] { color: var(--birch-ink); border-bottom-color: var(--birch); }
.dlg [role="tabpanel"] { padding-top: 6px; }

/* „Iestatījumi → Cilvēki”: one person per row, the role chosen in the row. */
.ppl { width: 100%; border-collapse: collapse; font-size: 14px; }
.ppl th, .ppl td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ppl th { font: 600 12.5px var(--fb); color: var(--ink2); white-space: nowrap; padding-block: 8px; border-bottom-color: var(--line2); }
.ppl .nm { font-weight: 600; overflow-wrap: anywhere; }
.ppl .em { color: var(--ink2); overflow-wrap: anywhere; }
.ppl select { width: auto; min-width: 140px; min-height: 32px; padding: 4px 8px; font-size: 14px; }
.ppl .own { padding-left: 9px; color: var(--ink2); font-weight: 500; }
.ppl .nm .badge { margin-left: 6px; font-weight: 500; }
.ppl .acts { width: 1%; padding-right: 0; text-align: right; white-space: nowrap; }
/* „ieaicināts” (people panel) and „arhivēts” (home invitations): quieter than the outlined badge */
.badge--quiet { background: var(--bg3); border-color: var(--bg3); }
.ppl-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 18px; }
.ppl-add .field { flex: 1 1 260px; margin: 0; }
.ppl-panel[aria-busy="true"] { cursor: progress; }
.ppl-panel .field-error { margin: 12px 0 0; }
/* On a phone each person is a small block: name and button, e-mail, role. */
@media (max-width: 600px) {
  .ppl, .ppl tbody { display: block; }
  .ppl thead { display: none; }
  .ppl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .ppl td { display: block; padding: 0; border: 0; }
  .ppl .em { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .ppl .role { grid-column: 1; grid-row: 3; margin-top: 4px; }
  .ppl .acts { grid-column: 2; grid-row: 1; width: auto; }
  .ppl .own { padding-left: 0; }
}
.wd-list { list-style: none; margin: 14px 0 0; padding: 0; }
.wd-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wd-list li:first-child { border-top: 0; }
.wd-title { font-weight: 500; flex: 1 1 100%; overflow-wrap: anywhere; }
.wd-list .sub { margin-right: auto; font-size: 12.5px; color: var(--ink2); }

/* ---------- aģentu žetoni ---------- */

.tok-intro { margin: 0 0 16px; max-width: 74ch; color: var(--ink2); font-size: 14px; }
.tok-intro p { margin: 0 0 6px; }
.tok-help { font-weight: 500; color: var(--ink); }
.tok-secret { margin-top: 4px; }
.tok-field + .tok-field { margin-top: 14px; }
.tok-row { display: flex; align-items: center; gap: 8px; }
.tok-value { flex: 1 1 auto; min-width: 0; font: 13px/1.4 var(--fm); }
.tok-hint { margin: 3px 0 0; font-size: 12px; color: var(--ink2); }
/* žetona logs: brīdinājums, ka žetonu rāda vienu reizi, ir pirmais un redzamākais */
.tok-secret .tok-warn { margin: 0 0 16px; padding: 8px 12px; border-left: 4px solid var(--birch); background: var(--bg); font-weight: 500; }
.tok-steps { margin: 0; padding-left: 22px; }
.tok-steps > li { margin: 0 0 14px; padding-left: 2px; }
.tok-steps > li::marker { font: 700 15px var(--fd); color: var(--birch-ink); }
.tok-secret .tok-step { margin: 0 0 6px; }
/* soļa teksts jau saka, kas laukā ir; lauka vārds paliek ekrāna lasītājam (aria-label) */
.tok-steps .tok-field { margin: 0; }
.tok-steps .tok-field > .field-label { display: none; }
.tok-secret :not(pre) > code { font: .9em var(--fm); background: var(--bg3); padding: 1px 5px; border-radius: 3px; }
.tok-more { margin-top: 12px; font-size: 13.5px; }
.tok-more > summary { cursor: pointer; color: var(--ink2); }
.tok-more .tok-field { margin-top: 10px; }

/* ---------- palīdzība ---------- */

/* lasīšanas kolonna kā piezīmēs: ≤ 72 zīmes, tā pati burtu skala */
.help { padding: 22px var(--gut) 72px; max-width: calc(72ch + 2 * var(--gut)); }
.help-body { font-size: 15.5px; line-height: 1.58; }
.help-lede { margin: 12px 0 0; max-width: 62ch; font-size: 17px; line-height: 1.5; color: var(--ink2); }
.help .toc { margin: 22px 0 0; }
.help-sec { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.help-sec h2 { font: 700 26px/1.15 var(--fd); font-variation-settings: "opsz" 60; letter-spacing: -.01em; margin: 0 0 10px; }
.help-sec h3 { font: 600 18px/1.3 var(--fb); margin: 20px 0 4px; }
.help-sec p { margin: 8px 0; }
.help-list { margin: 8px 0; padding-left: 22px; }
.help-list li { margin: 4px 0; }
.help-list li::marker { color: var(--ink2); }
/* soļi: numurs aplī kreisajā malā, teksts un komandas pa labi no tā */
.help-steps { margin: 16px 0 8px; padding: 0; list-style: none; counter-reset: step; }
.help-steps > li { position: relative; counter-increment: step; padding-left: 42px; margin: 0 0 24px; }
.help-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border: 1.5px solid var(--birch-line); border-radius: 50%;
  font: 700 14px/25px var(--fd); text-align: center; color: var(--birch-ink);
}
.help-steps > li > :first-child { margin-top: 2px; }
.help-sec .help-step { margin-bottom: 6px; }
.help-body :not(pre) > code { font: .9em var(--fm); background: var(--bg3); padding: 1px 5px; border-radius: 3px; }
.help-prompt { margin: 10px 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--birch); }
.help-sec .help-prompt p { margin: 4px 0; }

/* komanda ar pogu „Kopēt” (views/agent.js copyBlock): gara rinda aplūst, lapa horizontāli neritinās */
.cmd { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.cmd-code {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 7px 10px;
  background: var(--field); border: 1px solid var(--line2); border-radius: 4px;
  font: 13.5px/1.5 var(--fm); white-space: pre-wrap; overflow-wrap: anywhere;
}
.cmd .btn { flex: none; margin-top: 2px; }
.cmd-flag { white-space: nowrap; }

/* gatavs lūgums aģentam ar pogu „Kopēt” (views/agent.js askBlock): papīra lapiņa uz kartītes */
.ask-block { min-width: 0; }
.ask-head { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ask { margin: 0; }
.ask-text {
  margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font: 500 15px/1.45 var(--fd); font-variation-settings: "opsz" 24; overflow-wrap: anywhere;
}
.ask-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px;
  font-size: 12.5px; color: var(--ink2);
}
.ask-row .btn { flex: none; }
.ask-hint { margin: 0; font-size: 12.5px; color: var(--ink2); }
.ask-connect { margin-top: 14px; }
.ask-connect .cmd { margin: 6px 0; }

/* ---------- grafiks (views/trip_schedule.js, docs/DESIGN.md „Grafiks”) ---------- */

.sch { padding: 18px var(--gut) 56px; border-top: 1px solid var(--line); max-width: 1180px; }
.sch-quiet { margin: 0 0 12px; color: var(--ink2); font-size: 14px; }
.sch-who { margin-bottom: 16px; }
/* „Tiekamies”: the one big line of the page, on the lake's colour (the schedule's in the docs) */
.sch-meet {
  max-width: 760px; padding: 12px 18px 14px; border-left: 5px solid var(--m-lake); border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--m-lake) 13%, var(--bg2));
}
.sch-meet-h { margin: 0; font: 600 13px/1.3 var(--fb); color: var(--ink2); }
.sch-when {
  margin: 2px 0 0; font: 800 clamp(24px, 3.4vw, 32px)/1.1 var(--fd); font-variation-settings: "opsz" 48;
  letter-spacing: -.01em; overflow-wrap: anywhere;
}
.sch-where { margin: 4px 0 0; font-size: 16px; overflow-wrap: anywhere; }
.sch-none { margin: 4px 0 10px; color: var(--ember); font-weight: 600; }
.sch-leg { margin-top: 28px; }
.sch-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 8px; font: 700 20px/1.2 var(--fd); }
/* „no plāna „…”” carries a variant's title: it wraps on a phone instead of widening the page */
.sch-h .badge { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.sch-ents { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.sch-group { border-bottom: 1px solid var(--line); }
/* a row: time · kind · what and where · price · timetable [· order or „Šo”] */
.sch-ent {
  display: grid; grid-template-columns: 96px 26px minmax(0, 1fr) minmax(0, 150px) minmax(0, 220px);
  gap: 4px 14px; align-items: start; padding: 10px 0;
}
.sch--write .sch-ent {
  grid-template-columns: 96px 26px minmax(0, 1fr) minmax(0, 150px) minmax(0, 220px) 66px; cursor: pointer;
}
.sch--write .sch-ent:hover { background: var(--bg2); }
.sch-tm { grid-column: 1; font: 600 15px/26px var(--fb); font-variant-numeric: tabular-nums; }
.sch-date { display: block; font: 500 12.5px/1.3 var(--fb); color: var(--ink2); }
.sch-ic {
  grid-column: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
}
.sch-ic svg { width: 14px; height: 14px; fill: currentColor; }
/* the kinds in the map's colours, which do not change with the theme */
.sch-ic:not(.sk-meet) { color: #fff; }
.sk-car { background: var(--m-slate); }
.sk-train { background: var(--m-shop); }
.sk-bus { background: var(--m-water); }
.sk-ferry { background: var(--m-lake); }
.sk-plane { background: var(--m-pine); }
.sk-other { background: var(--m-poi); }
.sch-main { grid-column: 3; min-width: 0; }
.sch-ti { display: inline; font-weight: 600; line-height: 26px; text-align: left; overflow-wrap: anywhere; }
button.sch-ti:hover { text-decoration: underline; text-decoration-color: var(--birch); text-underline-offset: 3px; }
.sch-pl { font-size: 13.5px; color: var(--ink2); overflow-wrap: anywhere; }
.sch-nt { margin-top: 2px; font-size: 13px; color: var(--ink2); white-space: pre-line; overflow-wrap: anywhere; }
.sch-pr { grid-column: 4; font-size: 14px; line-height: 26px; overflow-wrap: anywhere; }
.sch-src { grid-column: 5; display: flex; flex-wrap: wrap; column-gap: 10px; font-size: 13.5px; line-height: 26px; }
.sch-link { overflow-wrap: anywhere; }
.sch-checked { color: var(--ink2); }
/* a timetable not checked lately: the word and the colour, never the colour alone */
.sch-stale { color: var(--ember); font-weight: 600; }
.sch-act { grid-column: 6; grid-row: 1; display: flex; justify-content: flex-end; gap: 4px; }
.sch-moves { display: inline-flex; gap: 4px; }
.sch-move { min-width: 30px; min-height: 30px; padding: 0; font-size: 15px; }
.sch-move:disabled { opacity: .3; }
/* the chosen entry in full, its alternatives right under it in the quieter ink (not transparency:
   faded text must still read 4.5:1); the „alternatīva” chip and „izvēlēties šo” keep full strength */
.sch-ent--alt { padding-top: 6px; border-top: 1px dashed var(--line); color: var(--ink2); }
.sch-ent--alt .sch-ti { font-weight: 500; }
.sch-ent--alt .sch-ic { opacity: .5; }
.sch-ent--alt .sch-alt-act { color: var(--ink); }
.sch-alt-act { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13.5px; }
.sch-alt-act .badge { vertical-align: 0; }
/* an undecided choice (D2): equal rows, one „Šo” each, under the question */
/* the box reaches into the page's margin, so its rows keep the columns of the rows around it */
.sch-pick {
  --pick-in: min(18px, var(--gut));
  margin: 8px calc(-1 * var(--pick-in)); padding: 8px var(--pick-in) 0 calc(var(--pick-in) - 4px);
  border-bottom: 0; border-left: 4px solid var(--m-lake); border-radius: 0 8px 8px 0; background: var(--bg2);
}
.sch-pick-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sch-pick-h { margin: 0; font: 700 17px/1.25 var(--fd); }
.sch-pick .sch-ent + .sch-ent { border-top: 1px solid var(--line); }
.sch--write .sch-pick .sch-ent:hover { background: var(--bg3); }
.sch-add { margin-top: 2px; }
/* „Galvenais plāns ir mainīts”: ember bar above the leg it is about */
.sch-review {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; max-width: 860px; margin: 0 0 10px;
  padding: 10px 14px; border-left: 4px solid var(--ember); background: color-mix(in srgb, var(--ember) 10%, var(--bg2));
}
.sch-review p { margin: 0; flex: 1 1 36ch; font-weight: 500; }
.sch-review strong { color: var(--ember); }
/* „Dienas”: from the main plan, read-only */
.sch-days { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 15px; }
.sch-days th, .sch-days td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.sch-days thead th { font: 600 13px var(--fb); color: var(--ink2); border-bottom: 2px solid var(--line); white-space: nowrap; }
.sch-days .num { text-align: right; padding-right: 24px; font-weight: 600; white-space: nowrap; }
.sch-days thead .num { font-weight: 600; }
.sch-dn { width: 4.5em; font: 800 22px/1 var(--fd); font-variation-settings: "opsz" 48; color: var(--birch-ink); }
.sch-sleep { overflow-wrap: anywhere; }
.sch-days-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; max-width: 760px;
  margin: 8px 0 0; font-size: 13.5px; color: var(--ink2);
}
.sch-days-foot strong { color: var(--ink); }
/* the entry form (mockup E) */
.sch-inline { display: flex; align-items: center; gap: 8px; }
.sch-inline input { flex: 1 1 0; min-width: 0; }
.sch-inline .btn { flex: none; }
.sch-form textarea { resize: vertical; }
.sch-dlg-more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  /* price and timetable move under the text */
  .sch-ent { grid-template-columns: 76px 26px minmax(0, 1fr); }
  .sch--write .sch-ent { grid-template-columns: 76px 26px minmax(0, 1fr) auto; }
  .sch-pr, .sch-src { grid-column: 3; line-height: 1.45; }
  /* a time that wraps must not push the price and the timetable down */
  .sch-tm { grid-row: span 3; }
  .sch-act { grid-column: 4; }
}
@media (max-width: 600px) {
  /* phone (mockup F): time on the left, the rest on the right; the kind is in the text for a
     screen reader and usually in the title, the mark gives way */
  .sch-ent { grid-template-columns: 58px minmax(0, 1fr); gap: 2px 10px; }
  .sch--write .sch-ent { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .sch-ic { display: none; }
  .sch-main, .sch-pr, .sch-src { grid-column: 2; }
  .sch-act { grid-column: 3; }
  .sch-tm { font-size: 14px; line-height: 24px; }
  .sch-ti { line-height: 24px; }
  .sch-meet { padding: 10px 14px 12px; }
  .sch-when { font-size: 24px; }
  .sch-days { font-size: 14px; }
  .sch-days th, .sch-days td { padding: 8px 8px 8px 0; }
  .sch-days .num { padding-right: 10px; }
  .sch-dn { width: 2em; font-size: 20px; }
}

/* ---------- šaurs ekrāns ---------- */

@media (max-width: 820px) {
  :root { --gut: 14px; }
  /* iOS nepietuvina lauku, ja burti ir vismaz 16 px */
  input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"],
  input[type="time"], input[type="search"], select, textarea { font-size: 16px; }
  .lower { grid-template-columns: 1fr; }
  .days { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail { padding: 16px var(--gut) 40px; }
}
/* josla ar navigāciju: šaurākā ekrānā vārds atkāpjas (zobrats paliek), tad arī logo vārds */
@media (max-width: 680px) {
  .bar-name { display: none; }
  /* aģenta zīme: tikai punkts (vārds paliek title un ekrāna lasītājam); nezināms stāvoklis neko
     nesaka, tāpēc telefonā tam vietas netērē. Punkts-saite ir vismaz 24 × 24 px. */
  .chip { min-width: 24px; min-height: 24px; justify-content: center; padding: 0 6px; }
  .chip .chip-label { display: none; }
  .chip--unknown { display: none; }
}
@media (max-width: 440px) {
  .bar .logo-word { display: none; }
  .bar-nav { gap: 0 14px; }
  .bar-nav-link { font-size: 13.5px; }
}
@media (max-width: 520px) {
  /* telefons: galva kompakta, lai karte sākas pirmajā ekrānā */
  .bar { padding-top: 6px; padding-bottom: 6px; gap: 2px 12px; font-size: 13px; }
  .bar-user { gap: 2px 12px; }
  /* joslas logo telefonā mazāks; CSS pārraksta SVG width/height, jo tās ir arī CSS īpašības.
     Noteikumi ir piesieti joslai. */
  .bar .logo { gap: 7px; }
  .bar .logo-mark { width: 20px; height: 20px; }
  .bar .logo-word { font-size: 18px; font-variation-settings: "opsz" 20; }
  .trips-page { padding-top: 14px; }
  .archived-note { margin-top: 6px; padding: 4px 10px; font-size: 13px; }
  .public-note { margin-top: 6px; padding: 6px 10px; gap: 6px 12px; font-size: 13px; }
  .pub-search { margin-top: 18px; gap: 12px; }
  .pub-search .pub-q { flex-basis: 100%; max-width: none; }
  .pub-kind .seg-btn { padding: 6px 10px; font-size: 13.5px; }
  /* leģenda telefonā: divas šauras rindas kartes kreisajā apakšā, virs mēroga */
  .mlegend { max-width: min(70vw, 230px); padding: 4px 7px 5px; font-size: 11.5px; }
  .mlg { gap: 6px; padding-left: 5px; }
  .mlg-who { display: none; }
  .bar-name { max-width: 14ch; }
  .field-pair { grid-template-columns: 1fr; }
  .dlg { padding: 18px 16px; }
  .dd-texts, .dd-node { grid-template-columns: minmax(0, 1fr); }
  .dlg-actions .btn { flex: 1 1 auto; }
  /* pārvaldība telefonā: kompakta galva, tabula ritinās savā konteinerā */
  .admin { padding-top: 14px; }
  .admin-head { align-items: flex-start; }
  .subnav { margin-top: 14px; gap: 0 18px; }
  .admin-tools input[type="search"] { width: 100%; }
  .admin-count { margin-left: 0; flex-basis: 100%; }
  .aud-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aud-filter > .field { grid-column: auto; }
  .aud-filter > .aud-q { grid-column: 1 / -1; }
  .help { padding-top: 14px; }
  .help-sec h2 { font-size: 23px; }
  .help-steps > li { padding-left: 36px; }
  .cmd-code { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .bar, .trip-bar, .rl-arrow, .dt-actions, .dt-plan-actions, .dt-sect-head .btn, .leaflet-control-container, .toast, .skip,
  .rl-bubbles, .map-hint { display: none !important; }
  .edit-bar { display: none !important; }
  body { background: #fff; color: #000; }
}
