/* The trail map as the app's main screen (trail-map.html, body.tm-app; trail-sheet.js): the page doesn't scroll, the
   map fills the window under the app bar, its controls float over it, and the panel holds everything else
   in three tabs (Explore, Conditions, Resort info): a bottom sheet on phones (collapsed to its summary row, half the
   room, or nearly all of it), a narrower sheet in the middle of a tablet, and a column on the left from 960 px.
   Colours, type, radii and motion come from design/tokens.css. Only this page: every rule is under body.tm-app or an
   element only this page has. */

/* ---------- The page: the window, with nothing but the panel scrolling ---------- */

/* resort.css gives the other pages a sky and a footer at the foot of a scrolling page; here the body is the window
   (100vh, then the space Safari leaves between its bars, then the dynamic viewport where it's known) */
html:has(> body.tm-app) { height: 100%; overflow: hidden; overscroll-behavior: none; }
html body.tm-page.tm-app {
  height: 100vh; height: -webkit-fill-available; height: 100dvh;
  min-height: 0; overflow: hidden; overscroll-behavior: none;
  display: flex; flex-direction: column;
  background: #fff;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  box-sizing: border-box;
}
body.tm-app .site-foot { display: none; }
body.tm-app .tm-main { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }

/* ---------- The app bar ---------- */
/* The shared one (resort.js, resort.css), as on every other page; here a fixed row at the top of the window's column,
   below the notch, not sticky over a scrolling page */
body.tm-app .app-bar { position: relative; flex: none; padding-top: calc(8px + env(safe-area-inset-top)); }

/* The resort being viewed: one line under the bar, the way out at its right */
body.tm-app .app-viewing { flex: none; }
body.tm-app .app-viewing-in { flex-wrap: nowrap; gap: 8px; padding: 4px 8px 4px 16px; min-height: 52px; }
body.tm-app .app-viewing .app-rs-title { flex: 1 1 auto; flex-wrap: nowrap; align-items: baseline; gap: 8px; overflow: hidden; }
body.tm-app .app-viewing .app-rs-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.tm-app .app-viewing :is(.app-rs-place, .app-rs-mine) { display: none; }
body.tm-app .app-viewing .app-rs-actions { display: flex; flex-wrap: nowrap; gap: 6px; flex: 0 1 auto; min-width: 0; }
body.tm-app .app-viewing .app-rs-btn { min-height: 44px; padding: 0 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
/* On a phone the header above names the resort: the bar says it's only being viewed */
@media (max-width: 600px) { body.tm-app .app-viewing .app-rs-name { display: none; } }

/* ---------- The map and what floats over it ---------- */

/* Beside the panel from 960 px, and on a phone on its side (600 px wide or more, 500 tall or less: 2026-11-04, iOS
   Safari left the map 174 px of height and the collapsed sheet covered the status chip and Filters; the panel is a
   narrower column there, trail-sheet.js SIDE); under it on phones and tablets, the same size whatever the panel's size,
   so the map never moves as it opens or closes (what's framed is framed above it: TrailSheet.cover).
   The column can be put away (trail-sheet.js setFolded, body.tm-folded): the map then starts at the window's edge
   (--tm-map-left), a little narrower column (2026-11-16) leaving more of it at 960 to 1280 px. */
@media (min-width: 960px), (min-width: 600px) and (max-height: 500px) {
  body.tm-app { --tm-panel-w: clamp(340px, 28vw, 400px); --tm-map-left: var(--tm-panel-w); }
  body.tm-app.tm-folded { --tm-map-left: 0px; }
  body.tm-app .tm-viewport { left: var(--tm-map-left); }
}
@media (max-width: 959px) and (min-width: 600px) and (max-height: 500px) {
  body.tm-app { --tm-panel-w: clamp(300px, 40vw, 360px); }
}
body.tm-app .tm-ui { position: absolute; z-index: 2; cursor: default; }
/* Top left: the live status chip (trail-bridge.js), under it a row with the Filters pill (trail-filters.js) and
   Directions (trail-sheet.js), and under them, while the column beside the map is put away, the dock that sums it up
   (trail-sheet.js), each its own width (owner's request 2026-11-01: the status first). The slot itself lets presses
   through to the map (it's .tm-ui, which the map takes for a control): only what's in it catches them. On a phone a
   long status goes onto two lines inside the chip (trail-panels.css). trail-sheet.js keeps the slot's height in
   --tm-tl-h, so the location and recording chips (.tm-chips) can go under it where they would meet */
.tm-map-tl { top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100% - 112px); pointer-events: none; }
.tm-map-tl:empty { display: none; }
body.tm-app :is(.tm-map-tl, .tm-map-row) > .tm-ui { position: relative; pointer-events: auto; }
.tm-map-row { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; pointer-events: none; }
.tm-map-row > .tmf-pill, .tm-map-tl > .tmf-pill { flex: none; }
/* Put away, the column leaves its tab at the map's left edge: the slot keeps clear of it */
body.tm-app.tm-folded .tm-map-tl { left: 40px; max-width: calc(100% - 142px); }
@media (pointer: coarse) { body.tm-app.tm-folded .tm-map-tl { left: 52px; max-width: calc(100% - 154px); } }

/* Directions over the map: a pill like Filters, its icon in lines */
.tm-dir-pill svg { stroke-width: 2; }
@media (max-width: 420px) { .tm-map-row > .tmf-pill { padding: 0 14px 0 12px; font-size: 14.5px; } }

/* The dock (trail-sheet.js renderDock): while the column is put away, a card a row each for a warning, the live
   status, a shown route (with Start or End) and the selected piste or lift; a press opens the column at its place */
.tm-dock { display: flex; flex-direction: column; gap: 6px; width: min(300px, 100%); pointer-events: none; }
.tm-dock-row {
  display: flex; align-items: center; gap: 4px; min-width: 0; padding-right: 6px; pointer-events: auto;
  border-radius: 14px; border: 1px solid var(--stroke); background: #fff; box-shadow: var(--shadow);
}
.tm-dock-main {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 6px 6px 8px; margin: 0;
  border: 0; border-radius: 13px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { .tm-dock-main:hover { background: var(--fill); } }
.tm-dock-main:focus-visible, .tm-dock-act:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.tm-dock-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--navy); }
.tm-dock-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-dock-main:is([data-state="warn"], [data-state="stale"], [data-state="error"]) .tm-dock-icon { background: rgb(245 163 0 / .16); color: var(--caution-strong, #8a5a00); }
.tm-dock-main[data-state="danger"] .tm-dock-icon { background: rgb(var(--sos-rgb, 215 0 21) / .12); color: var(--sos-dark, #a8001a); }
.tm-dock-main:is([data-state="ok"], [data-state="open"]) .tm-dock-icon { background: rgb(var(--accent-rgb) / .1); color: var(--accent); }
.tm-dock-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.tm-dock-main-text { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.tm-dock-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A route's warning leads its second line (trail-sheet.js): up to two lines here, so it isn't cut short */
.tm-dock-main[data-warn] .tm-dock-sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.tm-dock-main .tm-dock-sub[hidden] { display: none; }
.tm-dock-act { flex: none; height: 36px; }
@media (pointer: coarse) { .tm-dock-act { height: 44px; } }
/* Top right: SOS */
.tm-sos { top: 10px; right: 10px; }
/* Down the right side, standing on the panel: the compass, zoom, the whole area, my location and recording (map.css's
   .controls column; trail-sheet.js hides the zoom buttons and the compass, then the column, where the room is short) */
body.tm-app .tm-controls {
  top: auto; right: 10px; bottom: calc(var(--tm-sheet-h, 0px) + 12px); max-height: none;
  transition: bottom var(--dur) var(--ease-sheet), opacity var(--dur-fast) var(--ease);
}
.tm-controls.is-tight :is(.tm-zoom, .tm-compass) { display: none; }
.tm-controls.is-gone { opacity: 0; visibility: hidden; }
/* Your location, friends' sharing, the recording (map.css's .chips): across the top, under the first row */
body.tm-app .tm-chips {
  top: 62px; left: 50%; transform: translateX(-50%); align-items: center;
  width: max-content; max-width: calc(100% - 24px);
}
/* Under the top left slot where they would meet it (narrower than 1280 px, or a tall slot) */
@media (max-width: 1279px) { body.tm-app .tm-chips { top: calc(var(--tm-tl-h, 96px) + 18px); } }
/* The snow glow at the foot of the frame shows above the panel */
body.tm-app .tm-edge-bottom { bottom: var(--tm-sheet-h, 0px); }
/* The map's credits: the OpenStreetMap link in the corner, and the (i) that opens them all in Resort info */
.tm-attrib {
  left: 8px; bottom: calc(var(--tm-sheet-h, 0px) + 8px);
  display: flex; align-items: center; gap: 2px; padding: 0 10px 0 0; height: 32px;
  border-radius: 999px; background: rgb(255 255 255 / .82); font-size: 11px; line-height: 1;
  transition: bottom var(--dur) var(--ease-sheet);
}
.tm-attrib a { position: relative; color: var(--muted); text-decoration: none; padding: 8px 0; }
.tm-attrib a:hover { color: var(--text); text-decoration: underline; }
.tm-attrib a::after { content: ""; position: absolute; inset: -9px 0; }   /* 44 px tall for a finger, the pill no bigger */
.tm-attrib-info {
  position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.tm-attrib-info::after { content: ""; position: absolute; inset: -6px; }   /* a 44 px target around the small icon */
.tm-attrib-info svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tm-attrib :focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; border-radius: 999px; }
/* While the panel covers most of the map, its corner credits wait (the full credits are in Resort info) */
@media (max-width: 599px), (max-width: 959px) and (min-height: 501px) { body.tm-app:has(.tm-sheet[data-size="expanded"]) .tm-attrib { visibility: hidden; } }
/* The toast: over the map, above the panel (beside it from 960 px) */
body.tm-app .toast {
  position: fixed; z-index: 45;
  bottom: calc(var(--tm-sheet-h, 0px) + 16px);
  left: calc(50% + var(--tm-map-left, 0px) / 2);
  width: min(440px, calc(100% - 32px - var(--tm-map-left, 0px)));
}

/* ---------- The panel ---------- */

.tm-sheet {
  --tm-low: 83px;   /* the collapsed head: its top border, the grabber (26) and the summary row (56); trail-sheet.js adds the tab bar */
  position: absolute; z-index: 30; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; box-sizing: border-box;
  height: 160px;   /* until trail-sheet.js sets it */
  background: #fff; color: var(--text);
  border-radius: 16px 16px 0 0; border-top: 1px solid var(--separator);
  box-shadow: var(--shadow-sheet); overflow: hidden;
  transition: height var(--dur) var(--ease-sheet), bottom var(--dur-fast) var(--ease);
  overscroll-behavior: contain;
}
.tm-sheet.is-instant, .tm-sheet.is-dragging, html.tm-instant .tm-sheet,
html.tm-instant :is(.tm-controls, .tm-attrib) { transition: none !important; }

/* The head: the grabber (a button: a tap or ↑ ↓ change the size), then the summary row while collapsed, or the tab's
   name with the buttons that make the panel taller or smaller and close it */
.tm-sheet-head { flex: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.tm-sheet-handle {
  display: grid; place-items: center; width: 100%; height: 26px; padding: 0; margin: 0;
  border: 0; background: none; cursor: grab; touch-action: none;
}
.tm-sheet-handle span { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgb(var(--navy-rgb) / .22); }
.tm-sheet-handle:hover span { background: rgb(var(--navy-rgb) / .34); }
.tm-sheet.is-dragging .tm-sheet-handle { cursor: grabbing; }
.tm-sheet-summary {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 16px 8px; margin: 0; box-sizing: border-box;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tm-summary-icon {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill-2); color: var(--navy);
}
.tm-summary-icon svg, .tm-summary-chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-sheet-summary:is([data-state="warn"], [data-state="stale"], [data-state="error"]) .tm-summary-icon { background: rgb(245 163 0 / .16); color: var(--caution-strong, #8a5a00); }
.tm-sheet-summary[data-state="danger"] .tm-summary-icon { background: rgb(var(--sos-rgb, 215 0 21) / .12); color: var(--sos-dark, #a8001a); }
.tm-sheet-summary:is([data-state="ok"], [data-state="open"]) .tm-summary-icon { background: rgb(var(--accent-rgb) / .1); color: var(--accent); }
.tm-summary-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.tm-summary-main { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-summary-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-summary-chev { flex: none; color: var(--muted); transform: rotate(-90deg); }
.tm-sheet-bar { display: none; align-items: center; gap: 4px; padding: 0 8px 4px 16px; min-height: 48px; }
.tm-sheet-title { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.tm-sheet-btn {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.tm-sheet-btn:hover { background: var(--fill); color: var(--text); }
.tm-sheet-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-fast) var(--ease); }
.tm-sheet-btn.is-down svg { transform: rotate(180deg); }
.tm-sheet[data-size="collapsed"] .tm-sheet-bar { display: none; }
.tm-sheet:not([data-size="collapsed"]) .tm-sheet-bar { display: flex; }
.tm-sheet:not([data-size="collapsed"]) :is(.tm-sheet-summary, .tm-sum-act) { display: none; }
/* The row and, while a route followed from your location is shown, Start (or End) at its right */
.tm-sheet-sumrow { display: flex; align-items: center; }
.tm-sheet-sumrow .tm-sheet-summary { flex: 1 1 auto; min-width: 0; }
.tm-sum-act { flex: none; margin: 0 16px 8px -4px; height: 44px; padding: 0 18px; }
.tm-btn.danger { background: rgb(var(--sos-rgb, 215 0 21) / .1); color: var(--sos-dark, #a8001a); }
.tm-btn.danger:hover { background: rgb(var(--sos-rgb, 215 0 21) / .16); }

/* The contents: only they scroll */
.tm-sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 0 12px 16px; box-sizing: border-box;
}
/* Collapsed, the contents are out of sight and out of the tab order */
@media (max-width: 599px), (max-width: 959px) and (min-height: 501px) { .tm-sheet[data-size="collapsed"] .tm-sheet-body { visibility: hidden; padding-top: 0; padding-bottom: 0; } }
.tm-sheet-panel { outline: none; }

/* The tabs: a bar along the foot of the sheet, its icons in lines, the selected one in blue */
.tm-tabs {
  flex: none; display: flex; border-top: 1px solid var(--separator); background: #fff;
  padding: 0 4px env(safe-area-inset-bottom);
}
.tm-tab {
  flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 4px; margin: 0; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; position: relative;
}
.tm-tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tm-tab:hover { color: var(--text); }
.tm-tab[aria-selected="true"] { color: var(--accent); }
.tm-tab[aria-selected="true"]::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 32px; height: 3px; margin-left: -16px; border-radius: 0 0 3px 3px; background: var(--accent);
  animation: tm-tab-mark var(--dur) var(--ease-out);
}
@keyframes tm-tab-mark { from { transform: scaleX(0); opacity: 0; } }
/* A weather or avalanche warning: a dot on the Conditions tab, red when severe (trail-sheet.js setSummary's alert) */
.tm-tab-badge {
  position: absolute; top: 8px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%;
  background: var(--caution, #f5a300); box-shadow: 0 0 0 2px #fff;
}
.tm-tab-badge[data-level="danger"] { background: var(--sos, #d70015); }
.tm-sheet :is(.tm-sheet-handle, .tm-sheet-summary, .tm-sheet-btn, .tm-tab, .tm-back):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; border-radius: 10px; }

/* Explore: the lists, or the card of what's selected in their place (with the way back), or Directions */
.tm-explore-note { margin: 14px 4px 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }   /* once, at the lists' foot */
.tm-explore-detail { display: none; }
#tm-panel-explore[data-view="lists"] .tm-explore-lists { display: flex; }
#tm-panel-explore:not([data-view="lists"]) .tm-explore-lists { display: none; }
#tm-panel-explore[data-view="card"] .tm-explore-detail { display: block; }
#tm-panel-explore:not([data-view="route"]) #tm-route { display: none; }
.tm-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 4px; margin: 0 0 2px -4px;
  border: 0; border-radius: 999px; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tm-back:hover { background: rgb(var(--accent-rgb) / .08); }
.tm-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Resort info: the heading, what CONTENT adds, the credits at the foot */
#tm-panel-info .tm-resort { padding-top: 4px; }
.tm-info-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--separator); }
.tm-info-foot .tm-note { margin-top: 0; }
.tm-info-foot .tm-credit { margin-top: 10px; font-size: 12.5px; line-height: 1.5; }
.tm-info-foot .tm-credit a { color: var(--accent); }

/* A tablet: the sheet in the middle, no wider than a phone's is useful, so the map shows on both sides */
@media (min-width: 761px) and (max-width: 959px) and (min-height: 501px) {
  .tm-sheet { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); transform: translateX(-50%); border: 1px solid var(--separator); border-bottom: 0; }
}

/* From 960 px, and on a phone on its side: a column on the left, the tabs at its top, no sizes and no dragging */
@media (min-width: 960px), (min-width: 600px) and (max-height: 500px) {
  .tm-sheet {
    top: 0; bottom: 0; left: 0; right: auto; width: var(--tm-panel-w); height: auto !important;
    border-radius: 0; border-top: 0; border-right: 1px solid var(--separator); box-shadow: none; transition: none;
  }
  .tm-sheet-head { display: none; }
  /* The tab on its right edge puts it away and brings it back (trail-sheet.js setFolded): put away it slides out over
     the map, out of sight and of the tab order, and the tab stays at the map's edge. 30 px wide, 48 for a finger */
  .tm-sheet { overflow: visible; }
  .tm-sheet.is-folded { transform: translateX(-100%); visibility: hidden; }
  body.tm-app .tm-sheet.is-sliding { transition: transform var(--dur) var(--ease-sheet), visibility var(--dur) linear !important; }
  .tm-panel-fold {
    display: grid; place-items: center; position: absolute; z-index: 1; top: 50%; left: 100%; width: 30px; height: 56px; margin-top: -28px; padding: 0;
    border: 1px solid var(--separator); border-left: 0; border-radius: 0 12px 12px 0; background: #fff; color: var(--navy);
    box-shadow: 3px 0 8px rgb(var(--navy-rgb) / .1); cursor: pointer; visibility: visible;
  }
  .tm-panel-fold::before { content: ""; position: absolute; inset: -4px -18px -4px 0; }
  .tm-panel-fold svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-fast) var(--ease); }
  .tm-panel-fold[aria-expanded="false"] svg { transform: rotate(180deg); }
  @media (hover: hover) { .tm-panel-fold:hover { background: #f3f6fa; } }
  .tm-panel-fold:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
  /* A warning stays in sight beside the map: the summary row under the tabs, whatever tab is shown but Conditions */
  .tm-sheet[data-alert]:not([data-tab="conditions"]) .tm-sheet-head { display: block; border-bottom: 1px solid var(--separator); }
  .tm-sheet[data-alert] :is(.tm-sheet-handle, .tm-sheet-bar) { display: none; }
  .tm-sheet[data-alert]:not([data-tab="conditions"]) .tm-sheet-summary { display: flex; padding: 8px 16px; }
  .tm-tab-badge { top: 50%; left: auto; right: 10px; margin-top: -5px; }
  .tm-tabs { order: -1; border-top: 0; border-bottom: 1px solid var(--separator); padding: 0 8px; }
  .tm-tab { flex-direction: row; gap: 6px; min-height: 52px; padding: 6px 2px; font-size: 14px; }
  .tm-tab svg { width: 20px; height: 20px; }
  .tm-tab[aria-selected="true"]::before { top: auto; bottom: -1px; left: 12px; right: 12px; width: auto; margin: 0; border-radius: 3px 3px 0 0; }
  .tm-sheet-body { padding: 8px 14px max(20px, env(safe-area-inset-bottom)); }
  body.tm-app .tm-attrib { bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* The tab beside the column: only beside the map */
@media (max-width: 599px), (max-width: 959px) and (min-height: 501px) { .tm-panel-fold { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .tm-sheet, body.tm-app .tm-controls, .tm-attrib, .tm-sheet-btn svg, .tm-panel-fold svg { transition: none; }
}

/* The card and Directions take the focus when a summary opens them (trail-sheet.js focusIn): no ring for a press */
:is(#tm-card, #tm-route):focus:not(:focus-visible) { outline: none; }

/* The card's own × gives way to "Back to list" above it (one way back, the panel's × beside it) */
#tm-card .tm-card-head .tm-close { display: none; }

/* Pressed: buttons give a little under the finger, rows darken, as the app's other buttons do */
body.tm-app :is(.tm-tab, .tm-sheet-btn, .tm-back, .tm-btn, .tm-close, .tmf-pill, .tm-open-chip) {
  transition: transform .12s var(--ease-out), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
body.tm-app :is(.tm-tab, .tm-sheet-btn, .tm-back, .tm-btn, .tm-close, .tmf-pill, .tm-open-chip):active { transform: scale(.96); }
body.tm-app .tm-item:active { background: var(--fill-hover); }
@media (prefers-reduced-motion: reduce) {
  body.tm-app :is(.tm-tab, .tm-sheet-btn, .tm-back, .tm-btn, .tm-close, .tmf-pill, .tm-open-chip):active { transform: none; }
}
