/* Shreddy web app. Mobile first; light and dark follow the phone's setting. */

:root {
  --c-page: #f4f6f8;
  --c-surface: #ffffff;
  --c-surface-2: #eef1f4;
  --c-text: #0f1720;
  --c-muted: #5b6675;
  --c-border: #e2e6eb;
  --c-accent: #1d5fd8;
  --c-accent-text: #ffffff;

  --c-open: #13803d;
  --c-open-bg: #dcf5e5;
  --c-hold: #9a5a00;
  --c-hold-bg: #fdefd3;
  --c-scheduled: #1d5fd8;
  --c-scheduled-bg: #e0eaff;
  --c-closed: #5b6675;
  --c-danger: #e5484d;
  --c-closed-bg: #eceff2;

  --c-green-run: #1a9e4b;
  --c-blue-run: #1d5fd8;
  --c-black-run: #111111;
  --c-park-run: #e0701a;

  --radius: 14px;
  --radius-sm: 9px;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --tap: 44px;
  /* Motion: strong ease-out for responses, iOS-like curve for sheets */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-page: #0b0f14;
    --c-surface: #151b22;
    --c-surface-2: #1d252e;
    --c-text: #e8edf2;
    --c-muted: #93a0ae;
    --c-border: #26303b;
    --c-accent: #6b9bff;
    --c-accent-text: #0b0f14;

    --c-open: #4ade80;
    --c-open-bg: #12321f;
    --c-hold: #fbbf24;
    --c-hold-bg: #3a2c0c;
    --c-scheduled: #8fb3ff;
    --c-scheduled-bg: #18264a;
    --c-closed: #a3adb8;
    --c-danger: #ff6369;
    --c-closed-bg: #232b34;

    --c-green-run: #34c56a;
    --c-blue-run: #6b9bff;
    --c-black-run: #e8edf2;
    --c-park-run: #f59a4a;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  /* No overscroll-behavior here: the page keeps iPhone's rubber-band bounce at the top and bottom.
     (Shreddy has no pull-to-refresh to protect, and data updates live.) The sheet contains its own. */
  background: var(--c-page);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-page);
  color: var(--c-text);
  font: var(--fs-md)/1.4 var(--font);
}

button { font: inherit; color: inherit; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
a { color: var(--c-accent); touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }

/* ---------- Header ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--c-page);
  border-bottom: 1px solid var(--c-border);
}
.bar h1 { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.bar p { font-size: var(--fs-sm); color: var(--c-muted); }
.bar.compact h1 { font-size: var(--fs-lg); }
.bar-text { min-width: 0; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin-left: -10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { background: var(--c-surface-2); }
/* Reload (top right): gets the newest version in one tap. Spins while it fetches. */
.reload-btn { margin: 0 -10px 0 auto; color: var(--c-muted); }
.reload-btn.spinning svg { animation: reload-spin 700ms linear infinite; }
@keyframes reload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .reload-btn.spinning svg { animation: none; opacity: 0.5; } }

/* ---------- Layout ---------- */

main {
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: 720px;
  margin: 0 auto;
}

.section-title {
  margin: 20px 4px 8px;
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-title:first-child { margin-top: 4px; }
/* A section title with an action on the right ("Your lifts" · Edit). */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 4px 8px; }
.section-head:first-child { margin-top: 4px; }
.section-head .section-title { margin: 0; }
.section-action {
  margin: -12px -4px; /* a 44px tap area without moving the title */
  padding: 12px 4px;
  border: 0;
  background: transparent;
  color: var(--c-accent);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.section-action:active { opacity: 0.6; }

.empty { padding: 32px 8px; text-align: center; color: var(--c-muted); }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--c-scheduled-bg);
  color: var(--c-text);
  font-size: var(--fs-sm);
}
.banner strong { display: block; margin-bottom: 2px; }
button.banner {
  width: 100%;
  align-items: center;
  border: 0;
  text-align: left;
  font-size: var(--fs-sm);
  cursor: pointer;
}
button.banner:active { transform: scale(0.99); }
.banner-opened { background: var(--c-open-bg); }
.banner-opened strong { color: var(--c-open); font-size: var(--fs-md); }
.banner-upcoming { background: var(--c-scheduled-bg); }
.banner-upcoming strong { color: var(--c-scheduled); }
.banner-hold { background: var(--c-hold-bg); }
.banner-hold strong { color: var(--c-hold); }
.banner-trails { background: var(--c-surface); border: 1px solid var(--c-border); }

/* Your alerts today: the most important banner, so it gets the accent edge. */
.banner-alerts {
  display: block;
  padding: 10px 14px 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: inset 4px 0 0 var(--c-accent);
}
.alerts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alerts-head strong { margin: 0; font-size: var(--fs-md); }
.alerts-dismiss {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-accent-text);
  font: inherit;
  font-weight: 650;
  font-size: var(--fs-sm);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 160ms var(--ease-out);
}
.alerts-dismiss:active { transform: scale(0.97); }
.banner-alerts .news-list { gap: 0; margin-top: 4px; }
.alert-time { min-width: 5.5ch; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.alerts-more { margin: 0 0 6px; font-size: var(--fs-sm); }

.news-card { padding: 4px 16px; }
.news-section { padding: 12px 0; border-top: 1px solid var(--c-border); }
.news-section:first-child { border-top: 0; }
.news-title { font-weight: 650; margin-bottom: 6px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.news-list li { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--c-muted); }

/* ---------- Today card ---------- */
.today-card { margin-bottom: 16px; }
.today-title { margin: 12px 0 2px; font-size: var(--fs-lg); font-weight: 750; }
.news-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.news-item:active { opacity: 0.6; }
.news-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.today-card .news-list { gap: 0; }

/* Lift name area is a button that opens the lift's history */
.row-button {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.row-button:active { opacity: 0.6; }

/* A trail scrolled to from the Today card */
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--c-scheduled-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; background: var(--c-scheduled-bg); } }

/* Freshness and offline */
#subtitle.stale { color: var(--c-hold); font-weight: 600; }
.banner-offline { background: var(--c-hold-bg); }
.banner-offline strong { color: var(--c-hold); }

/* Lift history sheet */
.lift-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--c-muted); }
.facts { margin: 0 0 12px; padding-left: 18px; color: var(--c-muted); }
.timeline-title { margin: 8px 0 6px; font-size: var(--fs-md); }
.timeline { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.timeline li { display: flex; gap: 12px; }
.timeline-time { min-width: 72px; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* ---------- Resort list ---------- */

.resort {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid var(--c-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.resort:first-child { border-top: 0; }
.resort:active { background: var(--c-surface-2); }
.resort-name { font-size: var(--fs-lg); font-weight: 650; }
.resort-stats { margin-top: 2px; font-size: var(--fs-sm); color: var(--c-muted); }
.resort-stats b { color: var(--c-text); font-weight: 650; }
.chevron { margin-left: auto; color: var(--c-muted); flex: none; }

/* ---------- Tabs and filters ---------- */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--c-surface-2);
}
.tab {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--c-surface); color: var(--c-text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--c-text); border-color: var(--c-text); color: var(--c-page); }
.chip[aria-pressed="true"] .run-icon { --c-black-run: var(--c-page); }
.chip:active { transform: scale(0.97); }

.firsts-card { margin-bottom: 12px; }

.summary { margin: 0 4px 12px; font-size: var(--fs-sm); color: var(--c-muted); }

/* ---------- Rows (lifts, trails) ---------- */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 8px 10px 16px;
  border-top: 1px solid var(--c-border);
}
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { margin-top: 1px; font-size: var(--fs-sm); color: var(--c-muted); }
.trail-row { padding-right: 16px; }

.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.open { color: var(--c-open); background: var(--c-open-bg); }
.status.hold { color: var(--c-hold); background: var(--c-hold-bg); }
.status.scheduled { color: var(--c-scheduled); background: var(--c-scheduled-bg); }
.status.closed, .status.unknown { color: var(--c-closed); background: var(--c-closed-bg); }

.tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 650;
  white-space: nowrap;
}
.tag.groomed { color: var(--c-scheduled); background: var(--c-scheduled-bg); }
.tag.open { color: var(--c-open); background: var(--c-open-bg); }
.tag.closed { color: var(--c-closed); background: var(--c-closed-bg); }

.follow {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
}
.follow svg { width: 22px; height: 22px; }
.follow[aria-pressed="true"] { color: var(--c-accent); }
.follow:active { background: var(--c-surface-2); }
.follow:disabled { opacity: 0.4; }

/* Reordering "Your lifts" (as Field Changer's batting order). The handle's tap area is the icon plus
   1px, ending at the icon's right edge, so a thumb resting on the screen edge doesn't start a drag. */
.grip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 25px;
  height: var(--tap);
  margin-right: 10px;
  color: var(--c-muted);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.grip svg { flex: none; width: 24px; height: 24px; }
#your-lifts.editing .row-button { pointer-events: none; }
/* Remove (Edit): the iOS red minus, on the left. */
.remove-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: 0 -10px 0 -12px; /* the circle lines up with the names' left edge; the tap area stays 44px */
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-danger);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.remove-btn svg { width: 22px; height: 22px; }
.remove-btn:active { transform: scale(0.9); }
#your-lifts .row.removing {
  overflow: hidden;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transition: height 220ms var(--ease-out), padding 220ms var(--ease-out), opacity 160ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { #your-lifts .row.removing { transition: none; } }
#your-lifts .row.dragging { opacity: 0; } /* its place is the gap */
body.reordering { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.reordering #your-lifts .row { transition: transform 160ms ease; }
.row-ghost {
  position: fixed;
  z-index: 30;
  margin: 0;
  border-top: 0;
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.18), 0 2px 6px rgb(0 0 0 / 0.08);
  pointer-events: none;
  transform: scale(1.02);
  transition: transform 160ms var(--ease-out);
}
@starting-style { .row-ghost { transform: scale(1); } } /* lifts off the list */
.row-ghost.settling { transform: scale(1); transition: top 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  body.reordering #your-lifts .row, .row-ghost, .row-ghost.settling { transition: none; }
}

.run-icon { flex: none; width: 20px; height: 20px; }

/* ---------- Sheet and toast ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / 0.45);
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  width: 100%;
  max-width: 520px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: var(--c-surface);
  overscroll-behavior: contain;
}
.sheet h2 { font-size: var(--fs-lg); }
/* Title and the round ✕ (close), kept at the top while a tall sheet scrolls. */
.sheet-head {
  position: sticky;
  top: -20px; /* the sheet's top padding: the header sticks at the sheet's edge */
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 8px;
  padding: 20px 20px 0;
  background: var(--c-surface);
}
.sheet-head h2 { min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
.sheet-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -1px -2px 0 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-muted);
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  transition: transform 160ms var(--ease-out);
}
.sheet-x::after { content: ""; position: absolute; inset: -7px; } /* a 44px tap area around the 30px circle */
.sheet-x svg { width: 14px; height: 14px; }
.sheet-x:active { transform: scale(0.92); }
.sheet p, .sheet ol { margin: 0 0 12px; color: var(--c-muted); }
.sheet ol { padding-left: 20px; }
.sheet li { margin-bottom: 4px; }

.btn {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--c-accent);
  color: var(--c-accent-text);
  font-weight: 650;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--c-text);
  color: var(--c-page);
  font-size: var(--fs-sm);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}
.toast[hidden] { display: none; }

@media (hover: hover) and (pointer: fine) {
  .resort:hover, .icon-btn:hover, .follow:hover { background: var(--c-surface-2); }
  .chip:hover { border-color: var(--c-muted); }
}


/* =================== Resort page redesign =================== */

/* Freshness dot in the header: green fresh, amber late, gray offline */
#subtitle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c-closed); }
.fresh-dot.fresh { background: var(--c-open); box-shadow: 0 0 0 3px var(--c-open-bg); }
.fresh-dot.late { background: var(--c-hold); box-shadow: 0 0 0 3px var(--c-hold-bg); }
.sub-extra { color: var(--c-muted); font-weight: 400; }

/* Stats strip: three tappable numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 76px;
  padding: 10px 12px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.stat:active { transform: scale(0.97); }
.stat-current { border-color: var(--c-text); }
.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
.stat-value { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-of { font-size: var(--fs-sm); font-weight: 600; color: var(--c-muted); letter-spacing: 0; }
.stat-bar { width: 100%; height: 4px; margin-top: auto; border-radius: 2px; background: var(--c-surface-2); overflow: hidden; }
.stat-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--c-open); }

/* Today card: calmer, with counts and "Show more" */
.today-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.today-date { font-size: var(--fs-sm); font-weight: 500; color: var(--c-muted); }
.news-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.news-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-text);
  text-align: center;
  letter-spacing: 0;
}
.news-firsts { margin: 4px -8px; padding: 10px 8px; border-top: 0; border-radius: var(--radius-sm); background: var(--c-open-bg); }
.news-firsts .news-title { color: var(--c-open); }
.news-firsts .news-count { background: var(--c-surface); }
.news-firsts .status { background: var(--c-surface); } /* the green pill would vanish on the green block */
.news-firsts + .news-section { border-top: 0; }
.news-beyond { margin: 4px 0 0; font-size: var(--fs-sm); }

/* Lifts / Trails switch sticks under the header while scrolling */
.toolbar {
  position: sticky;
  top: var(--bar-h, 64px);
  z-index: 4;
  display: grid;
  gap: 8px;
  margin: 0 -16px;
  padding: 4px 16px 8px;
  background: var(--c-page);
}
.toolbar .tabs { margin-bottom: 0; }
.tab { transition: transform 160ms var(--ease-out); }
.tab:active { transform: scale(0.97); }

/* Area headings: name in normal case (long names wrap better), count on the right */
.area-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 4px 8px;
  font-size: var(--fs-md);
  font-weight: 650;
}
.area-title > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.area-count { flex: none; font-size: var(--fs-sm); font-weight: 500; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.area-count.has-open { color: var(--c-open); }

/* Trail filters: one row that scrolls sideways, edges fading out */
.filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-left: -16px;
  margin-right: -16px;
  padding: 2px 16px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; transition: transform 160ms var(--ease-out); }

/* Rows that open something: background on press (a list shouldn't shrink) */
.row:has(.row-button:active) { background: var(--c-surface-2); }
.row-button:active { opacity: 1; }

/* Sheet: slides up with an iOS-like curve, backdrop fades; closes faster */
.sheet-backdrop { transition: opacity 250ms ease; }
.sheet { transition: transform 380ms var(--ease-drawer); }
@starting-style {
  .sheet-backdrop:not([hidden]) { opacity: 0; }
  .sheet-backdrop:not([hidden]) .sheet { transform: translateY(100%); }
}
.sheet-backdrop.closing { opacity: 0; transition: opacity 200ms ease; }
.sheet-backdrop.closing .sheet { transform: translateY(100%); transition: transform 200ms var(--ease-out); }

/* Toast: rises a little and fades in */
.toast { transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out); }
@starting-style {
  .toast:not([hidden]) { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop.closing .sheet { transition: none; }
  @starting-style { .sheet-backdrop:not([hidden]) .sheet { transform: none; } }
  .sheet-backdrop.closing .sheet { transform: none; }
  @starting-style { .toast:not([hidden]) { transform: none; } }
  .stat:active, .tab:active { transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  .stat:hover { border-color: var(--c-muted); }
  .news-item:hover .news-name { text-decoration: underline; text-underline-offset: 3px; }
}

/* Compact Today card on the resort page: headlines and a way to the full Today page */
.today-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 16px 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.today-summary:active { transform: scale(0.985); }
.today-summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.today-summary-title { font-size: var(--fs-lg); font-weight: 750; }
.headline { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); line-height: 1.35; }
.headline-dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--c-muted); }
.headline-dot.good { background: var(--c-open); }
.headline-dot.info { background: var(--c-scheduled); }
.headline-dot.warn { background: var(--c-hold); }
.today-summary-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin-top: 2px;
  border-top: 1px solid var(--c-border);
  color: var(--c-accent);
  font-size: var(--fs-sm);
  font-weight: 650;
}
.today-summary-foot .chevron { margin-left: auto; color: var(--c-accent); }
.today-summary-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-text);
  text-align: center;
  font-size: var(--fs-xs);
}
@media (prefers-reduced-motion: reduce) { .today-summary:active { transform: none; } }
@media (hover: hover) and (pointer: fine) { .today-summary:hover { border-color: var(--c-muted); } }

/* Search field (16px text so iPhone doesn't zoom in) */
.search {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  cursor: text;
}
.search:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 20%, transparent); }
.search-icon { flex: none; width: 18px; height: 18px; margin-left: 12px; color: var(--c-muted); }
.search input {
  flex: 1;
  min-width: 0;
  height: var(--tap);
  padding: 0 8px 0 8px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--c-muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
}
.search-clear[hidden] { display: none; }
.search-clear svg { width: 18px; height: 18px; }

/* Summary line with "Collapse all" on the right */
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); margin-bottom: 4px; }
.link-btn {
  flex: none;
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--c-accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.link-btn:active { opacity: 0.6; }

/* Trail area headings open and close their list */
.area-title:has(.area-toggle) { margin: 12px 0 8px; }
.area-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.area-toggle .area-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.area-chev { flex: none; width: 18px; height: 18px; color: var(--c-muted); transition: transform 200ms var(--ease-out); }
.area-toggle[aria-expanded="true"] .area-chev { transform: rotate(90deg); }
.area-toggle:active { opacity: 0.7; }
@media (prefers-reduced-motion: reduce) { .area-chev { transition: none; } }

/* Area chip on the Trails tab (from a lift) */
.chip-area { max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Trails in a lift's area, in the lift sheet */
.area-note { margin: 0 0 6px; font-size: var(--fs-sm); }
.sheet-trails { margin-bottom: 4px; }
/* A long sheet scrolls inside itself instead of running off the screen */
.sheet { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); overflow-y: auto; }
.btn-secondary { background: var(--c-surface-2); color: var(--c-text); }

/* Groomer's picks (hand-made Daykeep report) */
.tag.pick { color: var(--c-open); background: var(--c-open-bg); }
.news-picks .news-title { color: var(--c-open); }

/* The badge sits after the trail name and wraps with it */
.row-name .tag.pick { display: inline-block; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }

/* ---------- Account and premium ---------- */
.signin { margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 8px; color: var(--c-text); font-size: var(--fs-sm); font-weight: 600; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-page);
  color: var(--c-text);
  font: inherit;
  font-size: 16px; /* 16px or more: iPhone doesn't zoom into the field */
  font-weight: 500;
}
.field input:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; border-color: transparent; }
.sheet .field-error { margin: 0 0 8px; color: var(--c-danger); font-size: var(--fs-sm); }
.link-btn {
  display: block;
  margin: 12px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--c-accent);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.link-btn:active { opacity: 0.6; }
.btn:disabled { opacity: 0.5; }
.btn-quiet { background: var(--c-surface-2); color: var(--c-text); }
.sheet .account-phone { margin-bottom: 4px; color: var(--c-text); font-size: var(--fs-lg); font-weight: 700; }
.tag.premium { color: var(--c-accent); background: var(--c-scheduled-bg); }
.channel { margin-top: 4px; }
/* Push / Text / Call: small checkboxes, all on one line; each label is a 44px-tall tap target. */
.checks { display: flex; gap: 20px; margin: -6px 0 2px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  color: var(--c-text);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-accent); cursor: pointer; }
.check input:disabled + span { opacity: 0.5; }
#recaptcha:empty { display: none; }

/* Your lifts (premium): which alerts are on, as small icons before the second line's text. */
.alert-icons { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: -2px; color: var(--c-muted); }
.alert-icons svg { width: 14px; height: 14px; }

/* "Add Shreddy to Contacts": the link, then why, in the muted text color. */
.contact-link { margin: 4px 0 0; color: var(--c-muted); font-size: 14px; line-height: 1.4; }
.contact-link .link-btn { display: inline-flex; align-items: center; padding: 0; text-decoration: none; }
.contact-link span { display: block; margin-top: -8px; }

/* The text-message disclosure under Alert me by (carriers require it where people opt in). */
.sms-terms { margin: 0 0 4px; color: var(--c-muted); font-size: var(--fs-xs); line-height: 1.45; }
.sms-terms a { color: inherit; }

/* Home: "Add Shreddy to Contacts" (signed in), with Add and Hide side by side, same size. */
.contact-card { padding: 11px 13px 13px; margin-bottom: 12px; } /* + its 1px border: lines up with the banners around it */
.contact-card .row-meta { margin-top: 2px; }
.contact-actions { display: flex; gap: 10px; margin-top: 12px; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.pill-btn:active { transform: scale(0.97); }
.pill-btn.primary { background: var(--c-accent); color: var(--c-accent-text); }
.pill-btn.quiet { background: var(--c-surface-2); color: var(--c-text); }
.nowrap { white-space: nowrap; }
