/* home.css — the home surface + the location consent inside #consent.
   Uber-light: warm paper, ink, one forest accent. Band hues (--b0..--b5
   via home.js BANDS) appear ONLY where they mean air quality. */

/* ── local tokens ── */
.hs, .cs {
  --s2: #F3F2EC;      /* V2T.surface2 */
  --hairc: #E3E0D7;   /* V2T.hairline */
  --linec: #ECE9E2;   /* V2T.line */
}

/* ══ the home surface ══ */
.hs {
  position: absolute; inset: 0;
  background: var(--paper);
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* mood: the band's deep wash floods the top → paper at 80% */
.hs-mood { position: absolute; inset: 0; pointer-events: none; }
.hs-mood-prev, .hs-mood-cur {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      var(--hs-mood, var(--paper)) 0%,
      color-mix(in srgb, var(--hs-mood, var(--paper)) 62%, transparent) 26%,
      color-mix(in srgb, var(--hs-mood, var(--paper)) 30%, transparent) 52%,
      var(--paper) 80%);
}
.hs-mood-cur { animation: hs-mood-breathe 5.6s ease-in-out infinite, hs-mood-fade .75s ease-in-out 1; }
@keyframes hs-mood-breathe { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
@keyframes hs-mood-fade { from { opacity: 0; } to { opacity: 1; } }

/* ══ header ══ */
.hs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--sat, 0px) + 6px) 20px 6px;
  position: relative; z-index: 2; flex: 0 0 auto;
}
.hs-brandwrap { flex: 1; min-width: 0; }
.hs-brand {
  color: var(--ink); font-size: clamp(22px, 7.5vw, 30px); font-weight: 500;
  letter-spacing: -0.6px; line-height: 1.2;
  /* the greeting carries the user's name — shrink a little on narrow
     phones and wrap to a second line; never clip the name */
  overflow-wrap: break-word;
}
.hs-sub {
  color: var(--ink3); font-size: 13px; font-weight: 400;
  margin-top: 1px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-menubtn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22,24,29,.05); cursor: pointer; flex: 0 0 auto;
  transition: transform .2s var(--ease);
}
.hs-menubtn:active { transform: scale(.94); }
.hs-menubars { display: flex; flex-direction: column; gap: 5px; }
.hs-menubars i { width: 16px; height: 2px; border-radius: 1px; background: var(--ink); }

/* ══ pinned CTA: Where to? ══ */
.hs-ctabar { padding: 2px 20px 10px; position: relative; z-index: 2; flex: 0 0 auto; }
.hs-cta {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 999px; height: 56px; padding: 0 20px;
  box-shadow: var(--sh-float); cursor: pointer;
  font-family: var(--font); font-size: 17px; font-weight: 500;
  transition: transform .2s var(--ease);
}
.hs-cta:active { transform: scale(.98); }
.hs-cta .ic { color: var(--paper); flex: 0 0 auto; }
.hs-ctatxt { flex: 1; text-align: left; letter-spacing: -0.1px; }
.hs-ctaarrow {
  width: 30px; height: 30px; border-radius: 15px;
  background: rgba(250,250,247,.16);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.hs-ctaarrow .ic { color: var(--paper); }

/* ══ scroll content ══ */
.hs-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
}
.hs-scroll > section { margin: 0 16px; }
.hs-scroll > section:first-child { margin-top: 4px; }
.hs-scroll > section + section { margin-top: 18px; }
.hs-scroll > section:last-child { margin-bottom: calc(var(--sab, 0px) + 20px); }
.hs-fade { animation: hs-cardin .45s cubic-bezier(.32,.72,0,1) backwards; }
@keyframes hs-cardin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ══ hero: the exact spot ══ */
.hs-hero { padding: 10px 4px 2px; }
.hs-eyerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.hs-eyebrow {
  color: var(--ink2); font-size: 15px; font-weight: 500; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-locbtn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--sh-card);
  color: var(--accent-ink); font-family: var(--font); font-size: 14px; font-weight: 500;
  transition: transform .2s var(--ease);
}
.hs-locbtn:active { transform: scale(.96); }
.hs-locbtn .ic { color: var(--accent); }

.hs-aqirow { display: flex; align-items: flex-end; gap: 12px; margin-top: 2px; min-width: 0; }
.hs-aqinum {
  font-size: clamp(88px, 29vw, 124px); line-height: .98; font-weight: 300;
  letter-spacing: -0.045em; margin-left: -4px; flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  transition: color .6s var(--ease);
}
.hs-aqimeta { display: flex; flex-direction: column; gap: 6px; padding-bottom: clamp(10px, 3.4vw, 14px); min-width: 0; flex: 1 1 auto; }
.hs-aqilbl { color: var(--ink3); font-size: 13px; font-weight: 600; letter-spacing: .1em; }
.hs-bandrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hs-bandsq { width: 10px; height: 10px; border-radius: 2.5px; flex: 0 0 auto; }
.hs-bandword {
  font-size: clamp(18px, 5.6vw, 24px); font-weight: 500; letter-spacing: -0.3px; line-height: 1.15;
  min-width: 0; overflow-wrap: anywhere;
}

.hs-pmrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.hs-pm {
  background: var(--surface); border-radius: 18px; box-shadow: var(--sh-card);
  padding: 12px 14px 11px; min-width: 0; display: flex; flex-direction: column;
}
.hs-pmk { display: flex; align-items: center; gap: 7px; color: var(--ink3); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.hs-pmdot { width: 8px; height: 8px; border-radius: 4px; flex: 0 0 auto; }
.hs-pmv {
  color: var(--ink); font-size: 30px; font-weight: 400; letter-spacing: -0.6px;
  line-height: 36px; margin-top: 2px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hs-pmu { color: var(--ink3); font-size: 13px; font-weight: 500; letter-spacing: 0; margin-left: 5px; }

.hs-plain { color: var(--ink); font-size: 16px; line-height: 22px; margin-top: 16px; }
.hs-note { color: var(--ink2); font-size: 14px; line-height: 20px; margin-top: 10px; }
.hs-prov { color: var(--ink3); font-size: 13px; line-height: 18px; margin-top: 8px; }
.hs-spot { display: flex; align-items: flex-start; gap: 6px; color: var(--ink2); font-size: 13px; line-height: 18px; margin-top: 6px; overflow-wrap: anywhere; }
.hs-spot .hs-spotic { flex: none; margin-top: 2px; opacity: .7; }
.hs-exact { margin-top: 10px; }
.hs-spot { color: var(--ink); font-size: 14px; margin-top: 12px; }
.hs-spotk { font-weight: 600; margin-right: 4px; }
button.hs-spot { background: none; border: 0; padding: 0; width: 100%; text-align: left; font-family: inherit; font-size: 14px; line-height: 18px; color: var(--ink); cursor: pointer; min-height: 40px; }
.hs-blur { filter: blur(6px); user-select: none; transition: filter .2s ease; }
.hs-spot.shown .hs-blur { filter: none; user-select: text; }
.hs-spothint { color: var(--ink3); font-size: 12px; margin-left: 6px; white-space: nowrap; }

.hs-dose {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; margin-top: 14px; padding: 0 12px 0 14px;
  border-radius: 14px; background: rgba(22,24,29,.045);
  color: var(--ink2); font-family: var(--font); font-size: 14px; font-weight: 500; text-align: left;
  font-variant-numeric: tabular-nums;
}
.hs-dose:active { background: rgba(22,24,29,.08); }
.hs-doseic { color: var(--ink3); flex: 0 0 auto; }
.hs-dosetxt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-dosechev { color: var(--ink4); flex: 0 0 auto; }

/* honest waiting / empty / error */
.hs-wait { display: flex; flex-direction: column; gap: 12px; padding: 10px 0 6px; }
.hs-waitnum { display: block; width: 168px; height: 96px; border-radius: 18px; }
.hs-waittxt { color: var(--ink3); font-size: 14px; }
.hs-quiet { color: var(--ink); font-size: 17px; line-height: 24px; font-weight: 500; margin-top: 10px; }
.hs-retry {
  margin-top: 12px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-family: var(--font); font-size: 15px; font-weight: 500;
}

/* ══ doors — one grouped list card ══ */
.hcard {
  background: var(--surface); border-radius: 24px;
  box-shadow: var(--sh-card);
  padding: 18px 20px;
  animation: hs-cardin .45s cubic-bezier(.32,.72,0,1) backwards;
}
.hs-doorcard { padding: 0; overflow: hidden; }
.hs-doorrow {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 0 18px; background: none; border: 0;
  font-family: var(--font); text-align: left; cursor: pointer;
}
.hs-doorrow:active { background: var(--s2); }
.hs-dooric { color: var(--ink2); flex: 0 0 auto; }
.hs-doorlbl { flex: 1; min-width: 0; font-size: 17px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-doorchev { color: var(--ink4); flex: 0 0 auto; }
.hs-doorsep { height: .5px; background: var(--hairc); margin-left: 56px; }

/* your days — the measured-exposure card */
.hs-days { margin: 12px 0 0; }
.hs-dayscard { padding: 16px 18px 8px; }
.hs-dayst { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink4); text-transform: lowercase; margin-bottom: 8px; }
.hs-dayrow { padding: 9px 0; border-top: .5px solid var(--hairc); }
.hs-dayrow:first-of-type { border-top: 0; padding-top: 2px; }
.hs-dayname { font-size: 13.5px; font-weight: 600; color: var(--ink); text-transform: lowercase; }
.hs-daynum { font-size: 15px; font-weight: 650; color: var(--ink); margin-top: 1px; }
.hs-daynum span { font-size: 11px; font-weight: 500; color: var(--ink3); margin-left: 5px; }
.hs-daymeta { font-size: 12px; color: var(--ink3); margin-top: 2px; }

.ic { display: inline-block; vertical-align: middle; }

/* paper screens own their top — the frozen #chrome duplicates it on home */
body[data-top="home"] #chrome { display: none; }

/* ── pick mode: the map IS the picker — the surface goes transparent
   and inert; only the hint card stays clickable ── */
.hs-pickcard { display: none; }
.hs.hs-picking { background: transparent; pointer-events: none; }
.hs-picking .hs-mood, .hs-picking .hs-scroll, .hs-picking .hs-ctabar,
.hs-picking .hs-head { display: none; }
.hs-picking .hs-pickcard {
  display: block; position: absolute; left: 12px; right: 12px;
  bottom: calc(14px + var(--sab)); z-index: 5;
  background: var(--paper); border-radius: 22px;
  box-shadow: var(--sh-sheet); padding: 16px 16px 14px;
  pointer-events: auto;
  animation: cs-rise .45s var(--ease) backwards;
}
.hs-picktxt { font-size: 16px; line-height: 22px; color: var(--ink); font-weight: 500; margin: 0 2px 12px; }
.hs-pickbtns { display: flex; gap: 8px; }
.hs-pickgps {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-family: var(--font); font-size: 15px; font-weight: 500;
}
.hs-pickgps .ic { color: var(--paper); }
.hs-pickcancel {
  flex: 0 0 auto; min-height: 48px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink15);
  color: var(--ink2); font-family: var(--font); font-size: 15px; font-weight: 500;
}

/* ══ consent — the frozen #consent element; its interior is ours ══ */
#consent {
  align-items: stretch; justify-content: stretch;
  background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.cs { position: absolute; inset: 0; overflow: hidden; }

/* the one short intro: the live number */
.cs-intro {
  position: absolute; inset: 0; background: var(--paper);
  display: flex; flex-direction: column;
  padding: calc(var(--sat, 0px) + 18px) 28px calc(var(--sab, 0px) + 22px);
}
.cs-introtop { display: flex; align-items: center; min-height: 24px; }
.cs-word { font-size: 12px; font-weight: 600; letter-spacing: 3px; color: var(--ink3); }
.cs-introbody { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; transition: transform .45s var(--ease); }
/* the sheet rises → the live number lifts clear of it */
.cs.sheet-on .cs-introbody { transform: translateY(-20vh); }
.cs-kicker { color: var(--ink3); font-size: 13px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 14px; }
.cs-airrow { display: flex; align-items: flex-end; gap: 12px; min-height: 96px; }
.cs-airnum { font-size: 96px; line-height: 96px; font-weight: 300; letter-spacing: -4px; font-variant-numeric: tabular-nums; animation: hs-mood-fade .5s ease backwards; }
.cs-airmeta { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; min-width: 0; }
.cs-airlbl { color: var(--ink3); font-size: 13px; font-weight: 600; letter-spacing: .1em; }
.cs-airband { display: flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 500; }
.cs-airsq { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.cs-line { color: var(--ink); font-size: 26px; font-weight: 500; line-height: 32px; letter-spacing: -0.4px; margin-top: 26px; max-width: 320px; }
.cs-next {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 56px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font); font-size: 17px; font-weight: 500;
  transition: transform .2s var(--ease);
}
.cs-next:active { transform: scale(.98); }
.cs-next .ic { color: var(--paper); }

/* scrim + sheet: transform/opacity only */
.cs-scrim {
  position: absolute; inset: 0; background: rgba(22,24,29,.38);
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.cs-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - var(--sat, 0px) - 12px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 26px 26px 0 0;
  box-shadow: var(--sh-sheet);
  padding: 10px 22px calc(var(--sab, 0px) + 16px);
  transform: translateY(105%);
  transition: transform .45s var(--ease);
}
.cs.sheet-on .cs-scrim { opacity: 1; pointer-events: auto; }
.cs.sheet-on .cs-sheet { transform: none; }
.cs.anim .cs-sheet { animation: cs-rise .45s var(--ease) backwards; }
.cs.anim .cs-scrim { animation: hs-mood-fade .35s ease backwards; }
.cs.closing .cs-scrim { opacity: 0; transition-duration: .3s; }
.cs.closing .cs-sheet { transform: translateY(105%); transition-duration: .3s; }
.cs.closing .cs-intro { opacity: 0; transition: opacity .3s ease; }
@keyframes cs-rise { from { transform: translateY(105%); } to { transform: none; } }

.cs-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--ink15); margin: 0 auto 18px; }
.cs-glyph {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--accent-wash); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.cs-title { margin: 0; color: var(--ink); font-size: 24px; font-weight: 500; letter-spacing: -0.4px; line-height: 30px; }
.cs-body { margin: 8px 0 0; color: var(--ink2); font-size: 16px; line-height: 23px; }
.cs-note {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--s2); color: var(--ink); font-size: 14px; line-height: 20px;
}

/* the trip-sharing switch — default OFF */
.cs-trip {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin-top: 16px; padding: 12px 14px; min-height: 56px;
  border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink10);
  font-family: var(--font); text-align: left;
}
.cs-tripmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cs-tripk { color: var(--ink); font-size: 15px; font-weight: 500; }
.cs-tript { color: var(--ink3); font-size: 13px; line-height: 18px; }
.cs-sw {
  position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 14px;
  background: var(--linec); transition: background .18s;
}
.cs-sw i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(22,24,29,.25);
  transition: transform .18s var(--ease);
}
.cs-sw.on { background: var(--accent); }
.cs-sw.on i { transform: translateX(20px); }

.cs-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.cs-primary, .cs-secondary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; border-radius: 999px;
  font-family: var(--font); font-size: 16px; font-weight: 500;
  transition: transform .2s var(--ease), opacity .2s;
}
.cs-primary { background: var(--ink); color: var(--paper); }
.cs-primary .ic { color: var(--paper); }
.cs-primary[disabled] { opacity: .6; }
.cs-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink15); }
.cs-secondary .ic { color: var(--ink2); }
.cs-primary:active, .cs-secondary:active { transform: scale(.98); }
.cs-later {
  align-self: center; min-height: 44px; padding: 0 24px; border-radius: 999px;
  color: var(--ink2); font-family: var(--font); font-size: 15px; font-weight: 500;
}

/* wide screens: the sheet floats as a card */
@media (min-width: 600px) {
  .cs-sheet { left: 50%; right: auto; width: 440px; margin-left: -220px; bottom: 24px; border-radius: 26px; }
  /* pick mode: the hint card floats over the map it refers to —
     a card in the corner, not a viewport-wide strip */
  .hs-picking .hs-pickcard { right: auto; width: 440px; }
}
