/* The home page „Mani ceļojumi” (docs/sakumlapa/galigais/SPEC.md, docs/DESIGN.md „Mani ceļojumi”): a rail of folders,
   the trips as an aligned table, the selected one as a data sheet — v6b „Instruments”. Every rule is under .home
   (views/trips.js main), so nothing here reaches another page. The tokens are pamale's (app.css); the few the
   instrument adds are defined here for both themes. */

:root { --ink3: #7F857A; --rule: #DADDD5; --sel: #EDE4C8; --lake-ink: #23749A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink3: #7E847A; --rule: #272C25; --sel: #2E2E1F; --lake-ink: #5AA9CC; }
}
:root[data-theme="dark"] { --ink3: #7E847A; --rule: #272C25; --sel: #2E2E1F; --lake-ink: #5AA9CC; }

.home {
  --rail: 176px; --preview: 380px;
  /* the table's columns: glyph, title, dates, days, km, people, role */
  --cols: 30px minmax(0, 1fr) 84px 36px 40px 40px 82px;
  --cgap: 8px;
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--preview);
  font: 13px/1.45 var(--fb); font-feature-settings: "tnum" 1;
}
.home:focus { outline: none; }
.home h1, .home h2, .home h3 { margin: 0; text-wrap: balance; }
.home p { margin: 0; text-wrap: pretty; }
.home :is(ul, ol) { margin: 0; padding: 0; list-style: none; }
.home dl { margin: 0; }
.home svg { display: block; }
.home kbd {
  display: inline-block; min-width: 16px; padding: 0 4px; border: 1px solid var(--line2); border-bottom-width: 2px;
  border-radius: 3px; font: 500 10.5px/1.5 var(--fb); color: var(--ink2); text-align: center; vertical-align: 1px;
}
.home .btn kbd { margin-left: 2px; }
.home .btn--primary kbd { border-color: color-mix(in srgb, var(--bg) 45%, transparent); color: var(--bg); }
.home .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 3px; }
.home .btn--small { min-height: 26px; padding: 2px 8px; font-size: 12px; }

/* state words: a colour and a word, never only a colour */
.home .st-birch { color: var(--birch-ink); }
.home .st-pine { color: var(--pine); }
.home .st-gravel { color: var(--gravel); }
.home .is-none, .home .is-miss { color: var(--gravel); }

/* ---------- the three panes ---------- */

.home .hm-pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.home .pane-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.home .pane-scroll--list { position: relative; }
.home .rail { border-right: 1px solid var(--line); }
.home .list { background: var(--bg2); border-right: 1px solid var(--line); }
.home .preview { background: var(--bg2); }

/* A standing shell where the window is big enough: the bar, then the three panes filling the window's height, each
   scrolling on its own; the document does not scroll. A lower window is a plain page that does. */
@media screen and (min-width: 700px) and (min-height: 560px) {
  :root:has(#app > .home) { overflow: hidden; overscroll-behavior: none; }
  :root:has(#app > .home) body { min-height: 0; }
  #app:has(> .home) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  #app > .home { flex: 1 1 auto; min-height: 0; }
}
@media screen and (min-width: 700px) and (max-height: 559px) {
  .home .pane-scroll { overflow: visible; }
  .home .thead { top: 0; }
}

/* ---------- the rail ---------- */

.home .rail-head { padding: 14px 12px 8px 14px; }
.home .rail-title { font: 650 20px/1.1 var(--fd); font-variation-settings: "opsz" 32; }
.home .folders { padding: 4px 6px 8px; }
.home .folder {
  position: relative; display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left;
  padding: 4px 8px 4px 10px; border-radius: 3px; font-size: 12.5px; color: var(--ink); line-height: 1.4;
}
.home .folder:hover { background: var(--bg2); }
.home .folder[aria-current="true"] { background: var(--bg2); font-weight: 500; }
.home .folder[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; background: var(--birch); }
.home .folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .folder-n { flex: none; font-size: 12px; color: var(--ink2); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.home .folder--mark .folder-n { color: var(--birch-ink); font-weight: 600; }
.home .folder--mark .folder-n::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--birch); vertical-align: 1px; }
.home .folder--empty, .home .folder--empty .folder-n { color: var(--ink3); }
.home .folders-note { margin: 2px 10px 8px; font-size: 12px; color: var(--ink3); }
.home .rail-foot { margin-top: auto; padding: 10px 12px 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.home .rail-foot p { font-size: 12px; color: var(--ink2); }
.home .rail-foot a { color: var(--ink2); }
.home .rail-foot .btn { justify-content: space-between; }

/* ---------- the list ---------- */

.home .list-head {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px 4px 12px;
  border-bottom: 1px solid var(--line);
}
.home .list-head h2 { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; font: 600 13.5px/1.3 var(--fb); overflow: hidden; white-space: nowrap; }
.home .list-head h2 small { font-weight: 400; font-size: 12px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; }
.home .rows { padding: 0 0 16px; outline: none; }
.home .sh-slot { display: contents; }
.home .rows:focus-visible .row[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--birch), inset 0 0 0 2px var(--focus); }

/* every table line shares the same columns, so the headings sit over the figures */
.home :is(.thead, .row, .row-head, .row-year, .row-today) {
  display: grid; grid-template-columns: var(--cols); column-gap: var(--cgap); align-items: center; padding: 0 12px;
}
.home .thead {
  position: sticky; top: 0; z-index: 2; min-height: 26px; background: var(--bg2);
  font-size: 11px; color: var(--ink3); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.home :is(.thead, .row) > :is(.c-when, .c-days, .c-km, .c-ppl) { text-align: right; font-variant-numeric: tabular-nums; }
.home .row-head { grid-template-columns: minmax(0, 1fr) auto; padding-top: 12px; padding-bottom: 2px; font: 600 12.5px/1.4 var(--fb); }
.home .row-head-n { color: var(--ink3); font-weight: 400; font-variant-numeric: tabular-nums; }
.home .rows-more { padding: 0 12px 16px; font-size: 12.5px; color: var(--ink2); }
.home .pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 12px 2px; }
.home .pager-at { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.home .row-year { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding-top: 4px; padding-bottom: 2px; font-size: 11.5px; color: var(--ink3); }
.home .row-year::after { content: ""; display: block; border-top: 1px solid var(--line); }
.home .row-today { grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin: 6px 0 2px; font: 500 12px/1.4 var(--fb); color: var(--birch-ink); white-space: nowrap; }
.home .row-today::after { content: ""; display: block; border-top: 2px solid var(--birch); }

.home .row {
  position: relative; min-height: 40px; padding-top: 1px; padding-bottom: 1px; cursor: default; border-bottom: 1px solid var(--rule);
  line-height: 1.3; white-space: nowrap;
}
.home .row:hover { background: color-mix(in srgb, var(--bg3) 45%, var(--bg2)); }
.home .row[aria-selected="true"] { background: var(--sel); box-shadow: inset 2px 0 0 var(--birch); }
.home .c-glyph { width: 30px; height: 18px; color: var(--ink); }
.home .c-glyph svg { width: 100%; height: 100%; overflow: visible; }
.home .c-glyph .glyph-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.home .c-glyph :is(.glyph--none, .glyph--empty) .glyph-line { stroke: var(--gravel); stroke-dasharray: 1 3; }
.home .c-glyph .glyph-start { fill: currentColor; }
.home .c-glyph .glyph-end { fill: var(--bg2); stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.home .c-glyph :is(.glyph--none, .glyph--empty) :is(.glyph-start, .glyph-end) { fill: var(--bg2); stroke: var(--gravel); }
.home .row--archived :is(.c-glyph, .ttl, .c-when, .c-days, .c-km, .c-ppl, .c-role) { color: var(--gravel); }
/* the glyph's svg has its own colour (app.css .glyph--main: the plan's blue), so an archived row's is set on it */
.home .row--archived .c-glyph .glyph { color: var(--gravel); }
.home .c-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.home .ttl { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.home .st { flex: none; font-size: 12px; }
.home .c-when { color: var(--ink2); }
.home .c-when.is-now { color: var(--birch-ink); font-weight: 500; }
.home .c-role { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; }
.home .c-role--owner { color: var(--ink); }
.home .c-role--text { font-size: 12px; text-align: right; }
.home :is(.role-abbr, .role-n) { display: none; }
.home .row--invite .c-glyph .glyph-line { stroke: var(--birch-line); stroke-dasharray: 3 3; }
.home .row--next .ttl { color: var(--ink2); }
.home .row--public .c-glyph { color: var(--ink2); }
.home .row--public .ttl { font-weight: 400; }
.home .row--public :is(.c-days, .c-km) { color: var(--ink2); }

.home .status-wrap { flex: none; border-top: 1px solid var(--line); }
.home .status { display: flex; align-items: center; gap: 14px; min-height: 30px; padding: 2px 12px; font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; }
.home .status-facts { display: flex; gap: 12px; flex: 1; min-width: 0; overflow: hidden; color: var(--ink2); }
.home .status-keys { display: flex; gap: 10px; flex: none; }
.home .hm-empty { padding: 28px 14px; color: var(--ink2); max-width: 48ch; line-height: 1.6; display: grid; gap: 4px; }
.home .hm-empty b { color: var(--ink); font-weight: 600; }

/* ---------- search ---------- */

.home .search { flex: none; border-bottom: 1px solid var(--line); background: var(--bg2); }
.home .search-box { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 8px 6px 12px; }
.home .search-box:focus-within { box-shadow: inset 0 -2px 0 var(--birch); }
.home .search-toks { display: contents; }
.home .search-in { flex: 1; min-width: 12ch; border: 0; background: transparent; padding: 4px 2px; outline: none; font: inherit; font-size: 13.5px; color: var(--ink); }
.home .search-in::placeholder { color: var(--ink3); }
.home .tok {
  display: inline-flex; align-items: center; gap: 3px; padding: 0 2px 0 6px; border: 1px solid var(--line2); border-radius: 3px;
  font-size: 12.5px; line-height: 1.6; background: var(--field); white-space: nowrap; font-weight: 500;
  min-width: 0; max-width: 100%;
}
/* a long name gives way with „…”; the „×” keeps its size */
.home .tok-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home .tok button { flex: none; width: 16px; height: 16px; border-radius: 2px; color: var(--ink2); font-size: 12px; line-height: 1; }
.home .tok button:hover { background: var(--bg3); color: var(--ink); }
.home .sugg { padding: 2px 12px 6px; }
.home .sugg-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 5px; padding: 3px 0; }
.home .sugg-row > small { flex: none; width: 60px; font-size: 11px; color: var(--ink3); }
.home .sugg-chip { padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; line-height: 1.6; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.home .sugg-chip:hover { border-color: var(--ink2); background: var(--bg); }
.home .sugg-chip--typed { border-color: var(--birch-line); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.home .search-foot { padding: 4px 12px 8px; font-size: 12px; color: var(--ink2); }

/* ---------- the sheet ---------- */

.home .sh { padding: 18px 22px 36px; }
.home .sh-head { margin-bottom: 14px; }
.home .sh-title { font: 750 26px/1.08 var(--fd); font-variation-settings: "opsz" 40; letter-spacing: -.01em; overflow-wrap: anywhere; }
.home .sh-title--next { color: var(--gravel); }
.home .sh-sub { margin-top: 5px; color: var(--ink2); font-size: 13px; max-width: 60ch; overflow-wrap: anywhere; }
.home .sh-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.home .sh-head .ask-block { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); }
.home .sh-head .field-error { margin-top: 8px; overflow-wrap: anywhere; }

.home .sh-glyph { height: 190px; color: var(--plan); }
.home .sh-glyph--none { height: 110px; }
.home .sh-glyph svg { max-width: 100%; height: 100%; overflow: visible; font-family: var(--fb); }
.home .sh-glyph .plan { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.home .sh-glyph .plan--none { stroke: var(--gravel); stroke-dasharray: 1 5; }
.home .sh-glyph .node { fill: var(--bg2); stroke: currentColor; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.home .sh-glyph .node--start { fill: currentColor; }
.home .sh-glyph .node--night { fill: var(--pine); stroke: var(--pine); }
.home .sh-glyph .node--port { stroke: var(--ink2); stroke-dasharray: 2 2; }
.home .sh-glyph .lbl { font-size: 12px; fill: var(--ink); paint-order: stroke; stroke: var(--bg2); stroke-width: 4px; stroke-linejoin: round; }
.home .sh-glyph .lbl--night { fill: var(--pine); }
.home .sh-glyph .lbl--port { fill: var(--ink2); }
.home .sh-glyph .lbl--note { font-size: 16px; fill: var(--ink2); stroke: none; }
.home .sh-glyph--archived { color: var(--gravel); }
.home .sh-glyph--next .node { fill: var(--bg2); stroke: var(--gravel); }
.home .sh-glyph--next .node--start { fill: var(--gravel); }
.home .sh-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink2); margin: 6px 0 10px; }
.home .sh-legend span::before { content: ""; display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--ink); margin-right: 6px; vertical-align: 3px; }
/* the plan as the route's band, on paper in the paper's blue (map: home_map.js, schema: .sh-glyph) */
.home .sh-legend .lg-plan::before { height: 4px; border: 1px solid var(--plan-ink); border-radius: 3px; background: var(--plan); vertical-align: 2px; }
.home .sh--archived .sh-legend .lg-plan::before { border-color: var(--gravel); background: var(--gravel); }
.home .sh-legend .lg-night::before { width: 7px; height: 7px; border: 0; background: var(--pine); border-radius: 50%; vertical-align: 0; }

/* The figure: one map with the schema drawn on it. A fixed height keeps the sheet from jumping while tiles arrive;
   isolation keeps Leaflet's panes and controls inside the frame. */
.home .sh-map { position: relative; isolation: isolate; height: 260px; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; background: var(--field); }
.home .sh-map-host { position: absolute; inset: 0; font: 11.5px/1.4 var(--fb); }
.home .sh-map-host.leaflet-container { background: var(--field); }
/* The ground is Pamale's own map as it is, light in either theme (basemap.js: its colours mean things); CyclOSM, when it
   has to stand in, is muted so that the schema reads first, and inverted in the dark theme. */
.home .sh-map-host[data-base="cyclosm"] .leaflet-tile-pane > .leaflet-layer { filter: grayscale(1) contrast(.9) brightness(1.04); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home .sh-map-host[data-base="cyclosm"] .leaflet-tile-pane > .leaflet-layer { filter: invert(1) grayscale(1) brightness(.8) contrast(.9); }
}
:root[data-theme="dark"] .home .sh-map-host[data-base="cyclosm"] .leaflet-tile-pane > .leaflet-layer { filter: invert(1) grayscale(1) brightness(.8) contrast(.9); }
.home .sh-map-host .leaflet-control-attribution { background: color-mix(in srgb, var(--field) 85%, transparent); color: var(--ink3); font-size: 10px; line-height: 1.5; padding: 0 4px; }
.home .sh-map-host .leaflet-control-attribution a { color: inherit; }
.home .sh-map-host .leaflet-control-scale-line { border: 2px solid var(--ink); border-top: 0; background: color-mix(in srgb, var(--field) 85%, transparent); color: var(--ink); font: 600 11px/1.35 var(--fb); padding: 0 4px; }
.home .sh-map-host .leaflet-bar { border: 1px solid var(--line2); border-radius: 3px; box-shadow: none; }
.home .sh-map-host .leaflet-bar a { width: 24px; height: 24px; background: var(--field); color: var(--ink); border-bottom-color: var(--line); font: 500 15px/24px var(--fb); }
.home .sh-map-host .leaflet-bar a:hover { background: var(--bg2); }
.home .sh-tags { position: absolute; inset: 0; z-index: 450; pointer-events: none; }
.home .sh-tags[hidden] { display: none; }
.home .tag { position: absolute; left: 0; top: 0; white-space: nowrap; padding: 0 6px; font: 600 12px/19px var(--fb); background: var(--ink); color: var(--bg2); }
.home .tag[hidden] { display: none; }
.home .tag--night { background: var(--pine); }
.home .tag--port { background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 500; font-size: 11.5px; line-height: 18px; padding: 0 5px; }
.home .sh-tags--archived :is(.tag--start, .tag--end) { background: var(--gravel); }
/* the schema on the map, in the theme's colours (CSS over Leaflet's stroke/fill attributes): a theme chosen while the
   map is open recolours it */
.home .sh-map-host .hm-band-edge { stroke: var(--m-band-edge); }
.home .sh-map-host .hm-plan { stroke: var(--m-band); }
.home .sh-map-host .hm-dot { stroke: var(--field); fill: var(--field); }
.home .sh-map-host .hm-dot--start { fill: var(--m-band-edge); }
.home .sh-map-host .hm-dot--end { stroke: var(--m-band-edge); }
.home .sh-map-host .hm-dot--night { fill: var(--pine); }
.home .sh-map-host .hm-dot--port { stroke: var(--ink); }
.home .sh-map-host .hm-plan.hm-archived, .home .sh-map-host .hm-dot--end.hm-archived { stroke: var(--gravel); }
.home .sh-map-host .hm-band-edge.hm-archived { stroke: var(--m-poi); }
.home .sh-map-host .hm-dot--start.hm-archived { fill: var(--gravel); }
.home .sh-map-note { position: absolute; left: 8px; top: 8px; right: 44px; z-index: 460; font-size: 11.5px; color: var(--ink2); }
.home .sh-map-note[hidden] { display: none; }

.home .sh-profile { margin: 0 0 14px; }
.home .sh-profile svg { width: 100%; max-width: 100%; height: auto; font-family: var(--fb); }
.home .sh-profile .area { fill: var(--pine); fill-opacity: .16; }
.home .sh-profile .line { fill: none; stroke: var(--pine); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.home .sh-profile :is(.axis, .tick) { fill: none; stroke: var(--line2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.home .sh-profile .day { fill: none; stroke: var(--line2); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.home .sh-profile .ax { font-size: 11px; fill: var(--ink3); }
.home .sh-profile .ax--day { fill: var(--ink2); }

.home .sh-dl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 3px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home .sh-dl dt { color: var(--ink3); }
.home .sh-dl dd { margin: 0; overflow-wrap: anywhere; }
.home .sh-dl dd small { color: var(--ink3); font-size: 12px; }
.home .sh-sect { margin-top: 16px; }
.home .sh-sect h3 { font: 600 12.5px/1.4 var(--fb); color: var(--ink2); margin-bottom: 4px; }
.home .sh-table { width: 100%; border-collapse: collapse; }
.home .sh-table th { font-weight: 400; font-size: 11px; color: var(--ink3); text-align: left; padding: 2px 8px 3px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.home .sh-table td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; overflow-wrap: anywhere; }
.home .sh-table :is(th, td):last-child { padding-right: 0; }
.home .sh-table :is(th, td).num { text-align: right; white-space: nowrap; }
.home .sh-table td:first-child.num { color: var(--ink3); width: 2.2em; }
.home .sh-table .via { color: var(--ink2); font-size: 12px; }
.home .sh-table--check td:first-child { width: 1.4em; }
.home .sh-table--check .ok { color: var(--pine); }
.home .sh-table--check :is(.miss, .plain) { color: var(--ink2); }
.home .sh-table--check .wait { color: var(--pine); font-weight: 500; }
.home .sh-table--check .draft { color: var(--birch-ink); font-weight: 500; }
.home .sh-table--check .mark { font-size: 10px; }
.home .sh-table--people td:last-child { color: var(--ink2); font-size: 12px; text-align: right; }
.home .sh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.home .sh-note { margin-top: 8px; font-size: 12px; color: var(--ink3); max-width: 60ch; }
.home .sh-note .btn { margin-left: 6px; }
.home .sh-empty { padding: 40px 24px; color: var(--ink2); max-width: 44ch; }
.home .sh-empty h2 { font: 650 20px/1.2 var(--fd); color: var(--ink); margin-bottom: 6px; }

/* the way to the first trip: the three stops as the trip's own checklist */
.home .steps { margin: 2px 0 0; border-top: 1px solid var(--line); }
.home .step { display: grid; grid-template-columns: 1.4em minmax(0, 1fr); padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.home .step-body { min-width: 0; }
.home .step-mark { font-size: 10px; line-height: 21px; color: var(--ink2); }
.home .step--done .step-mark { color: var(--pine); }
.home .step h3 { font: 600 14px/1.5 var(--fb); }
.home .step p { margin-top: 2px; color: var(--ink2); max-width: 60ch; }
.home .step .sh-actions { margin-top: 8px; }
.home .step .step-alt { margin-top: 8px; font-size: 12.5px; }
.home .step .step-state { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.home .step-state .chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pine); }
.home .step .ask-block, .home .step .cmd { margin-top: 8px; }
/* the agent's request (agent.js) in the sheet's smaller voice */
.home .ask-text { font: 13.5px/1.5 var(--fb); padding: 8px 10px; }
.home .ask-row { margin-top: 6px; }
.home .ask-hint { font-size: 12px; }
.home .cmd-code { font-size: 12.5px; }
.home .sh--next .sh-dl dd { color: var(--ink2); }
.home .sh-way .btn { margin-right: 6px; }

/* ---------- the phone's heads: off on a desktop ---------- */

.home .ph-head { display: none; }

/* ---------- widths ---------- */

/* 1000–1180 px: the sheet and the rail narrow, the role abbreviates; under 1100 px the people count moves into the
   role cell ("4 dal.") and the sheet narrows once more. The title's ellipsis is the last thing to give. */
@media (max-width: 1180px) {
  .home { --preview: 352px; --rail: 160px; --cols: 30px minmax(0, 1fr) 84px 36px 40px 40px 44px; }
  .home .role-full { display: none; }
  .home .role-abbr { display: inline; }
  .home .sh { padding: 16px 18px 32px; }
}
@media (max-width: 1100px) {
  .home { --preview: 324px; --rail: 152px; --cols: 30px minmax(0, 1fr) 84px 36px 40px 62px; }
  .home .c-ppl { display: none; }
  .home .role-n { display: inline; }
  .home .c-role { text-align: right; }
}

/* two panes: the folders become a row of chips above the table */
@media (min-width: 700px) and (max-width: 1000px) {
  .home { --cols: 30px minmax(0, 1fr) 84px 36px 40px 62px; grid-template-columns: minmax(380px, 1.4fr) minmax(300px, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .home .role-full { display: none; }
  .home .role-abbr, .home .role-n { display: inline; }
  .home .c-ppl { display: none; }
  .home .c-role { text-align: right; }
  .home .rail { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 10px; }
  .home .rail-head { padding: 6px 4px; }
  .home .rail-title { font-size: 16px; white-space: nowrap; }
  .home .rail .pane-scroll { overflow: auto hidden; flex: 1; }
  .home .folders { display: flex; align-items: center; gap: 4px; padding: 6px 0; }
  .home .folders > ul { display: flex; gap: 4px; }
  .home .folders-note { display: none; }
  .home .folder { width: auto; padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; }
  .home .folder[aria-current="true"] { border-color: var(--birch-line); }
  .home .folder[aria-current="true"]::before { display: none; }
  .home .rail-foot { margin: 0; padding: 0 0 0 8px; border: 0; display: flex; align-items: center; gap: 10px; }
  .home .rail-foot p { display: none; }
  .home .sh-glyph { height: 160px; }
  .home .sh-map { height: 230px; }
  .home .sh-two { grid-template-columns: 1fr; }
}

/* phone: one pane at a time; a row is two compact lines, every fact kept */
@media (max-width: 699px) {
  .home { display: block; font-size: 14px; }
  .home .hm-pane { display: none; }
  .home[data-screen="rail"] .rail, .home[data-screen="list"] .list, .home[data-screen="preview"] .preview { display: flex; }
  .home .pane-scroll { overflow: visible; }
  .home .rail, .home .list { border: 0; }
  .home .list, .home .preview { background: var(--bg); }
  .home .rail-head { padding: 16px 14px 8px; }
  .home .folder { padding: 9px 10px 9px 14px; font-size: 15px; }
  .home .folder-n { font-size: 13.5px; }
  .home .rail-foot { margin-top: 16px; }
  .home .ph-head {
    display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: var(--bg); z-index: 5;
  }
  .home .ph-head h2 { flex: 1; min-width: 0; font: 600 14px/1.3 var(--fb); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home .ph-head .btn { min-height: 36px; }
  .home .ph-back::before { content: ""; display: inline-block; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
  .home .list-head, .home .thead { display: none; }
  .home .search { position: sticky; top: 44px; z-index: 4; background: var(--bg); }
  .home .row {
    /* the title spans the flexible column too: a long one is cut there, never widens the row */
    grid-template-columns: 30px auto auto auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 1px;
    grid-template-areas: "g t t t t w" "g d k p r r";
    padding: 7px 12px; min-height: 0; border-bottom-color: var(--line);
  }
  .home .c-glyph { grid-area: g; height: 20px; align-self: start; margin-top: 2px; }
  .home .c-title { grid-area: t; font-size: 14.5px; }
  .home .c-when { grid-area: w; font-size: 13px; text-align: right; }
  .home .c-days { grid-area: d; } .home .c-km { grid-area: k; } .home .c-ppl { grid-area: p; } .home .c-role { grid-area: r; }
  .home .row > :is(.c-days, .c-km, .c-ppl, .c-role) { text-align: left; font-size: 12.5px; color: var(--ink2); }
  .home .c-days:not(:empty)::after { content: " d."; }
  .home .c-km:not(:empty)::after { content: " km"; }
  .home .c-ppl:not(:empty)::after { content: " cilv."; }
  .home .role-full { display: inline; }
  .home :is(.role-abbr, .role-n) { display: none; }
  .home .c-ppl { display: block; }
  .home :is(.row-head, .row-year, .row-today, .status) { padding-left: 12px; padding-right: 12px; }
  .home .status-wrap { position: sticky; bottom: 0; background: var(--bg); }
  .home .status-keys { display: none; }
  .home .sh { padding: 14px 14px 40px; }
  .home .sh-glyph { height: 170px; }
  .home .sh-glyph .node { fill: var(--bg); }
  .home .sh-glyph .lbl { stroke: var(--bg); }
  .home .sh-two { grid-template-columns: 1fr; }
  .home .sh-actions .btn { flex: 1 1 auto; }
  .home .sugg-row > small { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .home :is(.folder, .row, .btn) { transition: background-color .08s linear; }
}
