/* trail-panels.css — the trail map sheet's Conditions and Resort info tabs (2026-10-29, from the owner's mockup):
   the Resort info heading (trail-map.js renderHeader: name, region and country, favourite star, key facts, "I'm here"),
   its rows (trail-bridge.js: offline, website, reviews, plan, directions, cameras, friends, compare, the Ski Map), and
   the Conditions tab's live status, sections and "Why do the numbers differ?" (trail-bridge.js). Deep navy on white,
   hairlines between rows, line icons, rows at least 44 px tall, nothing boxed inside the sheet (no nested cards).
   The sheet and its tabs are trail-sheet.js's and trail-map.css's; conditions.js's and lift-waits.js's own contents
   keep their styles (conditions.css, freshness.css, lift-waits.css), fitted here only where they meet these rows. */

#place-card, #tm-resort, #tm-info-extra { --tp-ink: var(--navy); --tp-line: var(--separator); }

/* ---------- Titles ---------- */

.tp-h {
  display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px;
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; color: var(--tp-ink);
}
.tp-h:focus { outline: none; }
.tp-h:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

.tp-title { display: flex; align-items: flex-start; gap: 8px; }
.tp-title-text { flex: 1; min-width: 0; }
.tp-title h2 { margin: 0; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; color: var(--tp-ink); overflow-wrap: anywhere; }
.tp-place { margin: 3px 0 0; font-size: 14.5px; color: var(--muted); }
.tp-star.rp-star { width: 44px; height: 44px; margin: -6px -6px 0 0; }

/* ---------- Key facts: two (or one) figures side by side between hairlines ---------- */

.tp-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  margin: 14px 0 0; border-top: 1px solid var(--tp-line); border-bottom: 1px solid var(--tp-line);
}
.tp-stat { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-width: 0; }
.tp-stat + .tp-stat { border-left: 1px solid var(--tp-line); padding-left: 16px; }
.tp-stat svg { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--tp-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-stat p { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.tp-stat strong { font-size: 1.2rem; font-weight: 700; color: var(--tp-ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.tp-stat span { font-size: 13px; color: var(--muted); }

/* ---------- "I'm here" / "You're here" ---------- */

.tp-here { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.tp-here:empty { display: none; }
.tp-btn, .tp-here-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--stroke); border-radius: 999px; background: var(--surface, #fff); color: var(--tp-ink);
  font: 600 14.5px/1.2 var(--font); cursor: pointer; text-align: left;
}
.tp-btn svg, .tp-here-badge svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.tp-btn:hover { background: var(--fill); }
.tp-btn.primary { background: var(--tp-ink); border-color: var(--tp-ink); color: #fff; }
.tp-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.tp-btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.tp-here-badge { cursor: default; border-color: transparent; background: rgb(var(--accent-rgb) / .1); color: var(--accent); }
.tp-btn:focus-visible, .tp-here-badge:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Rows (Resort info) ---------- */

.tp-rows { display: flex; flex-direction: column; margin: 4px 0 8px; }
.tp-row, .tp-rows > .offline-row {
  display: flex; align-items: center; gap: 14px; min-height: 56px; box-sizing: border-box; width: 100%;
  margin: 0; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--tp-line); border-radius: 0;
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer;
}
.tp-rows > :last-child { border-bottom: 0; }
.tp-row:hover { background: var(--fill); }
.tp-row:active { background: var(--fill-hover); }
.tp-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 6px; }
.tp-row-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; color: var(--tp-ink); }
.tp-row-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tp-row-text strong { font-weight: 500; color: var(--text); }
.tp-row-text small { font-size: 13px; color: var(--muted); }
.tp-row-end { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.tp-row[target="_blank"] .tp-row-end { stroke: var(--accent); }

/* offline.js's save row, drawn like the others: its icon as a line icon, the size under the name, its button kept */
.tp-rows > .offline-row { cursor: default; }
.tp-rows > .offline-row .browse-icon { width: 26px; height: 26px; border-radius: 0; background: none; color: var(--tp-ink); }
.tp-rows > .offline-row .browse-icon svg { width: 24px; height: 24px; stroke-width: 1.6; }
.tp-rows > .offline-row.saved .browse-icon { background: none; color: var(--live); }
.tp-rows > .offline-row .grow { flex: 1; min-width: 0; }
.tp-rows > .offline-row .grow strong { font-size: 15px; font-weight: 500; }
.tp-rows > .offline-row .grow small { display: block; font-size: 13px; color: var(--muted); }
.tp-rows > .offline-row .grow small + small { margin-top: 3px; font-size: 12.5px; line-height: 1.35; }
.tp-rows > .offline-row .btn { min-height: 44px; height: auto; padding: 0 16px; border-radius: 999px; }

/* ---------- The live status (Conditions) ---------- */

.tp-status { padding: 2px 0 14px; border-bottom: 1px solid var(--tp-line); font-size: 14px; line-height: 1.4; }
.tp-status p { margin: 0; }
.tp-status-head { display: flex; align-items: center; gap: 10px; }
.tp-status-head strong { font-size: 1.1rem; font-weight: 700; color: var(--tp-ink); }
.tp-status-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; background: var(--muted); }
/* The state's colours, shared with the chip's dot over the map (.tm-open-dot below) */
.tp-status[data-state="open"] .tp-status-dot, .tm-open-chip[data-state="open"] .tm-open-dot { background: var(--live); }
.tp-status[data-state="closed"] .tp-status-dot { background: var(--muted); }
/* Old, missing or failed data has a hollow dot and no colour of its own: it says nothing about open or closed */
.tp-status[data-state="stale"] .tp-status-dot, .tm-open-chip[data-state="stale"] .tm-open-dot { background: none; border: 2.5px solid var(--caution-strong); }
.tp-status[data-state="unavailable"] .tp-status-dot, .tp-status[data-state="error"] .tp-status-dot,
.tp-status[data-state="none"] .tp-status-dot,
.tm-open-chip:is([data-state="unavailable"], [data-state="error"]) .tm-open-dot { background: none; border: 2px solid var(--muted); }
.tp-status[data-state="loading"] .tp-status-dot, .tm-open-chip[data-state="loading"] .tm-open-dot { background: none; border: 2px solid var(--accent); border-right-color: transparent; animation: tp-spin 1s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }
/* The same status as a chip over the map, top left above the Filters pill (trail-bridge.js updateChip; the pill's
   look is trail-filters.css's .tmf-pill): a dot in the state's colour and the status in a few words, never the colour
   alone. */
.tm-open-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 0 14px 0 12px; box-sizing: border-box;
  border-radius: 999px; border: 1px solid var(--stroke); background: #fff; color: var(--navy);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-align: left; box-shadow: var(--shadow); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast) var(--ease);
}
@media (hover: hover) { .tm-open-chip:hover { background: #f3f6fa; } }
.tm-open-chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.tm-open-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a phone a long status goes onto two lines, which fit in the 44 px */
@media (max-width: 760px) {
  .tm-open-word { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 14px; line-height: 1.15; }
}
.tm-open-chip[data-state="stale"] .tm-open-word { color: var(--caution-ink); }
.tm-open-chip:is([data-state="unavailable"], [data-state="error"], [data-state="loading"]) .tm-open-word { color: var(--muted); }
.tm-open-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box; background: var(--muted); }   /* its state colours: with .tp-status-dot above */
@media (prefers-reduced-motion: reduce) { .tp-status[data-state="loading"] .tp-status-dot, .tm-open-chip[data-state="loading"] .tm-open-dot { animation: none; border-right-color: var(--accent); } }
.tp-status-counts { margin-top: 4px !important; padding-left: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.tp-status-note { margin-top: 4px !important; padding-left: 22px; color: var(--text); }
.tp-status[data-state="stale"] .tp-status-note { color: var(--caution-ink); font-weight: 600; }
.tp-status-meta { margin-top: 4px !important; padding-left: 22px; font-size: 12.5px; color: var(--muted); }
.tp-status-meta a { color: var(--accent); }
.tp-status > .tp-btn { margin: 10px 0 0 22px; }

.tp-why { margin: 8px 0 0 22px; }
.tp-why summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px;
  color: var(--accent); font-weight: 600; cursor: pointer; list-style: none;
}
.tp-why summary::-webkit-details-marker { display: none; }
.tp-why summary::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease);
}
.tp-why[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.tp-why summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.tp-why p { margin: 0 0 8px; font-size: 13.5px; color: var(--text); }

/* ---------- Sections (Conditions): weather and avalanche, lift waiting times ---------- */

.tp-sec { padding: 14px 0 6px; border-bottom: 1px solid var(--tp-line); }
.tp-sec:last-child { border-bottom: 0; }
.tp-sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1rem; font-weight: 700; color: var(--tp-ink); }
.tp-sec-h svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-sec-h:focus { outline: none; }
.tp-sec-h:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.tp-sec .lift-waits { margin: 0; }
.tp-sec .lw-head { display: none; }   /* the section's own heading says it */
.tp-sec .lw-none, .tp-sec .lift-waits > .lw-src { margin-left: 0; }
.tp-sec .cond-more, .tp-sec .cond-retry { min-height: 44px; }
#place-card .cond-alerts { margin: 0 0 12px; }

/* conditions.js's and lift-waits.js's boxes (made for the Ski Map's card) laid flat in the tab: hairlines instead of
   tinted tiles, so nothing is a card inside the sheet */
.tp-sec .cond-now { margin-top: 4px; padding: 4px 4px 10px 0; border-radius: 0; background: none; }
.tp-sec .place-stats { gap: 0; margin-top: 0; border-top: 1px solid var(--tp-line); border-bottom: 1px solid var(--tp-line); }
.tp-sec .place-stats div { padding: 8px 10px 8px 0; border-radius: 0; background: none; }
.tp-sec .place-stats div + div { padding-left: 12px; border-left: 1px solid var(--tp-line); }
.tp-sec .cond-aval-brief { margin-top: 14px; }
.tp-sec .cond-aval-brief .cond-h { margin-top: 0; }
.tp-sec .lift-waits { padding: 0; border-radius: 0; background: none; }
.tp-sec .lw-none { margin: 0 0 8px; }

/* A resort its latest report says is closed (trail-bridge.js's updateClosed, 2026-11-01): the pistes and lifts drawn
   blurred (trail-map.js paints them so; the chairs' canvas here), the ground, names and pins sharp, and a notice above
   the credits naming the report and its time, with View as open; in the preview nothing is blurred and the notice says
   the map isn't the reported status. Never the colour alone: the words say closed, last report or preview. */
.is-closed-blur .tm-chairs { filter: blur(1.5px); }
.tm-closed-note[hidden], .tm-closed-note.is-tucked { display: none; }   /* is-tucked: under the recording panel (trail-bridge.js) */
.tm-closed-note {
  position: absolute; left: 10px; right: 72px; bottom: calc(var(--tm-sheet-h, 0px) + 48px); z-index: 2; max-width: 420px; box-sizing: border-box;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm, 12px); border: 1px solid var(--stroke); border-left: 4px solid var(--muted); background: #fff; color: var(--navy);
  box-shadow: var(--shadow); font-size: 14px; line-height: 1.3;
}
.tm-closed-note[data-state="stale"] { border-left-color: var(--caution-strong); }
.tm-closed-note[data-state="preview"] { border-left-color: var(--accent); }
.tm-closed-note p { flex: 1 1 200px; margin: 0; }
.tm-closed-meta { display: block; color: var(--muted); font-size: 13px; }
.tm-closed-btn {
  flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--accent); background: #fff; color: var(--accent);
  font: inherit; font-weight: 600; cursor: pointer;
}
.tm-closed-note[data-state="preview"] .tm-closed-btn { background: var(--accent); color: #fff; }
.tm-closed-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
/* On a phone, one slim row above the credits, the words beside the button (it goes under them only when they're long,
   as in the preview), so with the panel half open the notice stays at the foot of the map in view, off its middle
   (2026-11-04, iOS Safari check: at 107 px tall it hid part of a route) */
@media (max-width: 760px) {
  .tm-closed-note { max-width: none; gap: 4px 8px; padding: 4px 4px 4px 10px; font-size: 13px; line-height: 1.25; }
  .tm-closed-note p { flex-basis: 120px; }
  .tm-closed-meta { font-size: 12px; }
  .tm-closed-btn { padding: 0 12px; font-size: 13px; }
}

/* Pointing at a lift or piste its live report lists as closed (trail-map.js hoverTip): small grey words beside the
   pointer, a mouse's only */
.tm-hover-tip {
  position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none;
  padding: 3px 9px; border-radius: 999px; background: rgb(255 255 255 / .92); color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: 0 1px 4px rgb(var(--navy-rgb) / .18);
}
.tm-hover-tip[hidden] { display: none; }

/* "Why do the numbers differ?" opens with its words easing in, as the arrow turns */
.tp-why[open] > :not(summary) { animation: tp-open var(--dur-fast) var(--ease-out); }
@keyframes tp-open { from { opacity: 0; transform: translateY(-4px); } }
