/* Home dashboard (A9): the resort you're at, and widgets that link to each part of the app (dashboard.js).
   Colours, type and motion come from design/tokens.css; the app bar and picker from resort.css. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.dash-page {
  margin: 0;
  font-family: var(--font); font-size: var(--text-base); line-height: 1.5;
  color: var(--text); background: var(--page);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.dash { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 56px; }
.dash a { color: var(--accent); }
.data-error { margin: 0; padding: 12px 20px; background: #fde8e8; color: var(--destructive); font-weight: 600; text-align: center; }

/* ---------- Buttons ---------- */
.dbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px;
  background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-out);
}
.dbtn:hover { background: var(--fill-hover); }
.dbtn:active { transform: scale(.97); }
.dbtn.primary { background: var(--accent); color: var(--on-accent); }
.dbtn.primary:hover { background: var(--accent-hover); }
.dbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash button:focus-visible, .dash a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Hero: the resort you're at ---------- */
.dash-hero { padding: 36px 0 28px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-hero h1 {
  margin: 0; font-family: var(--font-display); font-size: clamp(32px, 5vw, 48px); line-height: 1.1;
  font-weight: 700; letter-spacing: var(--tracking-title); color: var(--navy);
}
.hero-star { width: 44px; height: 44px; }
.hero-star svg { width: 24px; height: 24px; }
.hero-place { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.hero-lead { margin: 10px 0 0; max-width: 560px; font-size: 17px; color: var(--muted); }
.hero-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts li { padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-facts li.season { background: rgb(31 157 85 / .12); color: #14683a; }
.hero-facts li.season.closed { background: var(--fill); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-quick { margin-top: 20px; }
.hero-quick p { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px var(--stroke);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
}
.chip-btn:hover { background: var(--snow-light); }
.chip-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* The piste mix bar (.mix) is styled in resort.css */

/* ---------- Widgets ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.widget {
  --tint: var(--navy-rgb);
  position: relative;
  display: flex; flex-direction: column;
  min-height: 168px;
  min-width: 0;   /* long favourite names ellipsise instead of widening the grid on phones */
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgb(var(--navy-rgb) / .08), 0 6px 20px rgb(var(--navy-rgb) / .06);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease);
}
.widget:has(.widget-link[href]:hover) { transform: translateY(-2px); box-shadow: var(--shadow); }
.widget.wide { grid-column: span 2; }
.widget-link { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 16px; color: inherit; text-decoration: none; border-radius: inherit; }
.widget header { display: flex; align-items: center; gap: 10px; }
.widget-icon {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: rgb(var(--tint) / .1); color: rgb(var(--tint));
}
.widget-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.widget h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: var(--tracking-title); color: var(--text); }
.widget-cta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.widget-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.widget-body { flex: 1; margin-top: 12px; font-size: 15px; color: var(--muted); }
.widget-body p { margin: 0; }
.widget-body p + p { margin-top: 6px; }
.widget-body strong { color: var(--text); }
.widget-foot { display: flex; align-items: center; gap: 12px; padding: 10px 20px 12px; border-top: 1px solid var(--separator-soft); font-size: 13px; color: var(--muted); }
.widget-foot a { color: var(--accent); text-decoration: none; font-weight: 600; }
.widget-foot a:hover { text-decoration: underline; }
.widget-foot .grow { flex: 1; }

/* Widget tints */
.widget.conditions { --tint: 10 132 255; }
.widget.map, .widget.trail-map { --tint: 77 122 88; }
.widget.directions { --tint: 21 101 192; }
.widget.sos { --tint: var(--sos-rgb); }
.widget.reviews { --tint: 245 163 0; }
.widget.offline { --tint: 90 110 140; }
.widget.friends { --tint: 31 157 85; }
.widget.browse { --tint: 11 37 69; }
.widget.favourites { --tint: 245 163 0; }
.widget.tickets, .widget.lessons, .widget.rentals { --tint: 164 80 42; }
.widget.plan { --tint: 215 40 47; }
.widget.webcams { --tint: 90 110 140; }
.widget.demo-pick { --tint: 164 80 42; }
.widget.closures { --tint: 217 115 13; }

/* Conditions widget */
.w-now { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text); }
.w-temp { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-temp small { font-size: 20px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.w-icon { font-size: 40px; line-height: 1; }
.w-desc { display: flex; flex-direction: column; line-height: 1.3; }
.w-desc strong { font-size: 17px; }
.w-desc span { font-size: 13px; color: var(--muted); }
.w-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.w-stats div { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--fill); }
.w-stats dt { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.w-stats dd { margin: 1px 0 0; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-stats dd small { font-size: 12px; font-weight: 400; color: var(--muted); }
.w-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.w-days li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: var(--radius-sm); background: var(--fill); font-size: 13px; font-variant-numeric: tabular-nums; }
.w-days li:first-child { background: rgb(var(--accent-rgb) / .1); }
.w-days .d-name { font-weight: 600; color: var(--text); }
.w-days .d-icon { font-size: 22px; line-height: 1.2; }
.w-days .d-temp { color: var(--text); }
.w-days .d-temp small { color: var(--muted); }
.w-days .d-snow { font-size: 12px; color: var(--muted); }
.w-loading { color: var(--muted); }

/* SOS widget */
.w-112 { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.w-112 strong { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--sos); line-height: 1; }
.w-numbers { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.w-numbers li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.w-numbers li span { color: var(--muted); }
.w-numbers li strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Favourites widget */
.w-favs { list-style: none; margin: 0; padding: 0; }
.w-favs li { display: flex; align-items: center; gap: 4px; }
.w-favs li + li { border-top: 1px solid var(--separator-soft); }
.w-fav-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.w-fav-pick:hover strong { color: var(--accent); }
.w-fav-pick .rp-text strong { font-size: 15px; }
.w-fav-pick .rp-text small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-fav-pick .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--separator); flex: none; }
.w-fav-pick.mine .dot { background: var(--accent); }
.w-favs .rp-star { width: 36px; height: 36px; }
.w-favs .rp-star svg { width: 18px; height: 18px; }
.w-favs .w-fav-map { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.w-favs .w-fav-map:hover { background: var(--fill); color: var(--text); }
.w-favs .w-fav-map svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* Ticket and status lists */
.w-list { list-style: none; margin: 0; padding: 0; }
.w-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 14px; }
.w-list li strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-status { display: flex; gap: 8px; flex-wrap: wrap; }
.w-status span { padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--text); }
.w-status .open { background: rgb(31 157 85 / .12); color: #14683a; }
.w-saved { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgb(31 157 85 / .12); color: #14683a; font-size: 13px; font-weight: 600; }
.w-saved svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Closures widget (alerts.js): closed pistes, off-piste and parks at the favourite resorts */
.al-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; vertical-align: 2px;
  border-radius: 999px; background: var(--severe); color: #fff; font-family: var(--font-text, inherit); font-size: 12px; font-weight: 700; letter-spacing: 0;
}
.al-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.al-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px 0 10px; border: 0; border-radius: 999px;
  background: var(--fill-2); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.al-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.al-chip[aria-pressed="true"] { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.al-chip[aria-pressed="true"] svg { opacity: 1; }
.al-chip[aria-pressed="false"] { padding-left: 12px; }
.al-chip[aria-pressed="false"] svg { display: none; }
.al-chip:hover { background: var(--fill-hover); }
.al-chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.al-resorts { list-style: none; margin: 0; padding: 0; }
.al-resort + .al-resort { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--separator-soft); }
.al-resort-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.al-resort-head a { font-weight: 700; color: var(--text); text-decoration: none; }
.al-resort-head a:hover { color: var(--accent); }
.al-resort-head span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.al-resort.has .al-resort-head span { color: var(--severe-ink); font-weight: 600; }
.al-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.al-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.al-icon { flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); }
.al-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.al-icon.piste { background: var(--c); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--stroke); }
.al-icon.offpiste { background: rgb(238 125 26 / .14); color: var(--piste-offpiste); }
.al-icon.park { background: rgb(var(--navy-rgb) / .08); color: var(--navy); }
.al-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.al-text strong { font-size: 15px; color: var(--text); }
.al-text small { font-size: 13px; color: var(--muted); }
.al-text .al-src { font-size: 12px; opacity: .85; }
.al-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.al-new { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.al-pill { flex: none; margin-top: 3px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.al-pill.closed { background: rgb(215 0 21 / .1); color: var(--severe-ink); }
.al-pill.advised { background: rgb(238 125 26 / .14); color: var(--caution-strong); }
.al-sources { margin: 4px 0 0 !important; font-size: 12px; color: var(--muted); }
.al-sources a { color: inherit; text-decoration: underline; text-decoration-color: var(--stroke); text-underline-offset: 2px; }
.al-sources a:hover { color: var(--accent); }
.widget.closures .widget-foot .grow { white-space: nowrap; }
.widget.closures .widget-foot .link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.widget.closures .widget-foot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Footer ---------- */
.dash-foot { border-top: 1px solid var(--separator); padding: 24px var(--gutter) calc(28px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); }
.dash-foot-inner { max-width: 1120px; margin: 0 auto; }
.dash-foot p { margin: 0 0 6px; }
.dash-foot a { color: var(--accent); text-decoration: none; }
.dash-foot a:hover { text-decoration: underline; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .dash-hero { padding: 24px 0 20px; }
  .dash-grid { grid-template-columns: 1fr; gap: 12px; }
  .widget.wide { grid-column: auto; }
  .widget { min-height: 0; }
  .w-days { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .w-days li { padding: 6px 2px; font-size: 12px; }
  .w-days .d-icon { font-size: 18px; }
  .w-temp { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .widget, .dbtn { transition: none; }
  .widget:has(.widget-link[href]:hover) { transform: none; }
}
