/* Wear: the hero with the bottle on the horizon, the window card with its
   pick and shelf, the week board, occasions and "When and where?", the
   trip planner, the journal teaser. */

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: calc(clamp(288px, 36vh, 320px) + env(safe-area-inset-top));
  margin: 0 calc(-1 * var(--s-4));
  overflow: hidden;
  border-radius: 0 0 var(--r-surface) var(--r-surface);
  background: var(--tint-top);
  isolation: isolate;
}
.hero.compact { height: calc(148px + env(safe-area-inset-top)); }
@media (min-width: 720px) {
  .hero { height: 320px; margin: var(--s-4) auto 0; border-radius: var(--r-surface); box-shadow: 0 30px 60px -40px rgb(var(--shade) / 0.9); }
  .hero.compact { height: 156px; }
}
.hero-scene, .hero-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-shade {
  position: absolute;
  inset: 0;
  /* Dark enough at the top and bottom that text over a bright day sky still
     reads at 4.5:1 (measured on clear midday scenes). */
  background: linear-gradient(180deg, rgb(var(--ink-deep) / 0.6) 0%, rgb(var(--ink-deep) / 0.2) 18%, transparent 30%, transparent 40%, rgb(var(--ink-deep) / 0.82) 100%);
}
.hero.compact .hero-shade { background: linear-gradient(180deg, rgb(var(--ink-deep) / 0.55), rgb(var(--ink-deep) / 0.35) 45%, rgb(var(--ink-deep) / 0.82)); }
.hero-top {
  position: absolute;
  top: calc(var(--s-3) + env(safe-area-inset-top));
  left: var(--s-3);
  right: var(--s-3);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}
.hero-top .loc-btn { max-width: 52%; }
.hero-top .seg { margin-left: auto; flex: none; }
.hero-top .seg button { min-height: 32px; padding: 0 var(--s-3); gap: var(--s-1); }
@media (min-width: 720px) { .hero-top { top: var(--s-4); left: var(--s-4); right: var(--s-4); } }

.hero-foot { position: absolute; left: var(--s-4); bottom: var(--s-4); z-index: 1; max-width: 50%; color: var(--on-scene); }
/* On a narrow phone it stops short of the name under the bottle (centered
   at 73%, wear.js stageX, 168px wide), wrapping its last line instead. */
@media (max-width: 719px) { .hero-pick ~ .hero-foot { max-width: min(50%, 73% - 84px - var(--s-2)); } }
.hero.compact .hero-foot { max-width: none; right: var(--s-4); }
.hero-wx { display: grid; gap: var(--s-1); }
.hero-temp {
  font-family: var(--display);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--glow-text);
}
/* The degree sign drawn at half size by transform, so the page keeps one
   display size. */
.hero-temp .deg { display: inline-block; margin-right: -0.16em; transform: scale(0.56); transform-origin: 0 14%; }
.hero-meta { min-width: 0; padding-top: var(--s-1); }
.hero-cond { font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: 600; letter-spacing: -0.01em; }
.hero-sub, .hero-status { display: block; color: color-mix(in srgb, var(--on-scene) 82%, transparent); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-variant-numeric: tabular-nums; }
.hero-status.updating::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--s-2);
  border-radius: var(--r-round);
  background: currentColor;
  animation: breathe 1.4s ease-in-out infinite;
}
/* The band over Week, Occasion and Trip: the same sky, the temperature small. */
.hero.compact .hero-wx { display: flex; align-items: flex-end; gap: var(--s-3); }
.hero.compact .hero-temp { font-size: var(--fs-title-1); line-height: 0.9; letter-spacing: -0.02em; }
.hero.compact .hero-temp .deg { margin-right: 0; transform: none; }
.hero.compact .hero-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); padding: 0; }
.hero.compact .hero-cond { font-size: var(--fs-headline); line-height: var(--lh-headline); }
@media (min-width: 720px) {
  .hero-foot { left: var(--s-5); bottom: var(--s-5); max-width: 46%; }
  .hero:not(.compact) .hero-wx { display: flex; align-items: flex-end; gap: var(--s-3); }
  .hero:not(.compact) .hero-meta { padding-bottom: var(--s-0); }
}

/* The pick stands on the middle hill (--x, --y from src/scene.js
   stagePoint), rim-lit from the side the sun or moon is on (--rim,
   --rim-side, --rim-k: the light's color, side and strength). On phones its
   name sits under it; with room, beside it. */
.hero-pick {
  --bh: 104px; /* bottle height */
  --bw: 112px; /* bottle box */
  position: absolute;
  left: var(--x);
  top: calc(var(--y) - var(--bh));
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 168px;
  margin-left: -84px;
  color: var(--on-scene);
  text-align: center;
  border-radius: var(--r-inset);
}
.hero-bottle { position: relative; display: flex; align-items: flex-end; justify-content: center; width: var(--bw); height: var(--bh); }
.hero-bottle img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter:
    drop-shadow(calc(var(--rim-side) * 1.5px) -1px 0 color-mix(in srgb, var(--rim) calc(var(--rim-k) * 75%), transparent))
    drop-shadow(calc(var(--rim-side) * 5px) -3px 12px color-mix(in srgb, var(--rim) calc(var(--rim-k) * 38%), transparent))
    drop-shadow(0 10px 12px rgb(var(--shade) / 0.6));
  transform-origin: 50% 100%;
  transition: transform var(--dur-3) var(--ease-out);
}
/* Where it meets the ground: a soft contact shadow. */
.hero-bottle::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5px;
  z-index: -1;
  height: 12px;
  border-radius: var(--r-round);
  background: radial-gradient(closest-side, rgb(var(--shade) / 0.6), transparent);
}
@media (hover: hover) { .hero-pick:hover .hero-bottle img { transform: translateY(-3px) rotate(-2deg); } }
.hero-pick:active .hero-bottle img { transform: scale(0.96); }
.hero-label { position: relative; display: grid; justify-items: center; max-width: 100%; margin-top: var(--s-2); text-shadow: 0 1px 2px rgb(var(--shade) / 0.6); }
/* A soft pool of shade under the name, so it reads over the trees and a
   bright hillside alike; no edge, so it stays part of the scene. */
.hero-label::before {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--s-3)) calc(-1 * var(--s-5));
  z-index: -1;
  border-radius: var(--r-round);
  background: radial-gradient(closest-side, rgb(var(--ink-deep) / 0.5), rgb(var(--ink-deep) / 0.28) 55%, transparent);
  pointer-events: none;
}
/* The kicker is small and stands highest, over the brightest sky: full
   white with a tight dark halo keeps it over 4.5:1 in clear, fog and snow. */
.hero-label small {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  color: var(--on-scene);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  text-shadow: 0 1px 2px rgb(var(--shade) / 0.7), 0 0 8px rgb(var(--ink-deep) / 0.8), 0 0 16px rgb(var(--ink-deep) / 0.7);
}
.hero-label small svg { width: 12px; height: 12px; }
.hero-label b { max-width: 100%; overflow: hidden; font-family: var(--display); font-size: var(--fs-headline); line-height: var(--lh-headline); font-style: italic; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hero-label > span { max-width: 100%; overflow: hidden; color: color-mix(in srgb, var(--on-scene) 78%, transparent); font-size: var(--fs-caption); line-height: var(--lh-caption); text-overflow: ellipsis; white-space: nowrap; }
/* The name and brand clip to their boxes for the ellipsis, which cuts a
   text-shadow's glow off at the box's edge into a hard dark rectangle. A
   drop-shadow glows past the box (an element's overflow clips its content,
   not its filter); its blur is a standard deviation, so 8px is the 16px a
   text-shadow would take. */
.hero-label b, .hero-label > span { filter: drop-shadow(0 0 8px rgb(var(--ink-deep) / 0.7)); }
/* Forced colors drop text shadows but not filters: the glow goes with them. */
@media (forced-colors: active) { .hero-label b, .hero-label > span { filter: none; } }
/* On phones a long name (`.long`, over about 18 characters, which is what
   one line holds) takes two lines, and the brand joins the kicker's line
   above it ("Tonight · Afnan"), so the label still ends inside the hero.
   The outer columns center that line; the name spans them all. */
@media (max-width: 719px) {
  .hero-pick.long .hero-label { grid-template-columns: minmax(0, 1fr) auto minmax(0, max-content) minmax(0, 1fr); column-gap: var(--s-1); margin-top: var(--s-1); }
  .hero-pick.long .hero-label small { grid-area: 1 / 2; }
  .hero-pick.long .hero-label > span { grid-area: 1 / 3; justify-self: start; }
  .hero-pick.long .hero-label > span::before { content: '· ' / ''; }
  .hero-pick.long .hero-label b { grid-area: 2 / 1 / 3 / -1; display: -webkit-box; line-height: 1.25; white-space: normal; text-wrap: balance; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (min-width: 720px) {
  .hero-pick {
    --bh: 132px;
    --bw: 132px;
    grid-template-columns: var(--bw) minmax(0, 240px);
    align-items: end;
    justify-items: start;
    gap: var(--s-3);
    width: auto;
    /* The name keeps the toggle's inset from the hero's right edge. */
    max-width: calc(100% - var(--x) + var(--bw) / 2 - var(--s-4));
    margin-left: calc(var(--bw) / -2);
    text-align: left;
  }
  .hero-label { justify-items: start; margin: 0 0 var(--s-1); }
  /* Beside the bottle the kicker stands over open sky: the shade reaches up behind it. */
  .hero-label::before { inset: calc(-1 * var(--s-6)) calc(-1 * var(--s-5)) calc(-1 * var(--s-3)); }
  /* The name has 165 to 180px beside the bottle (the hero's max-width above
     binds, not the 240px column). Two lines of the title size hold about 26
     characters there; a longer name (`.longer`, wear.js) steps down to the
     headline size, whose two lines hold about 40 (Supremacy Collector's
     Edition Pour Homme). A third line takes the rest before the ellipsis,
     and stays shorter than the bottle. */
  .hero-label b { font-size: var(--fs-title-3); line-height: var(--lh-title-3); white-space: normal; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .hero-pick.longer .hero-label b { font-size: var(--fs-headline); line-height: var(--lh-headline); }
  .hero-label small svg { width: 14px; height: 14px; }
}

/* Off screen, the scene's loops stop (the shell watches the hero). */
.hero.offscreen .scene * { animation-play-state: paused !important; }

/* ---------- The window card ---------- */

.slot { scroll-margin-top: var(--s-10); }
.slot-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.slot-thumb { width: 78px; height: 54px; flex: none; overflow: hidden; border-radius: var(--r-control); box-shadow: 0 0 0 1px var(--border-subtle); }
.slot-thumb svg { width: 100%; height: 100%; }
.slot-title { display: grid; gap: var(--s-1); min-width: 0; }
.slot-title h2 { display: flex; align-items: flex-start; gap: var(--s-2); font-family: var(--display); font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: 600; letter-spacing: -0.01em; }
.slot-title h2 svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--ambient); }
.slot-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.slot-time { padding: 0 var(--s-2); border-radius: var(--r-chip); background: var(--fill); color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.slot-wx { display: inline-flex; align-items: flex-start; gap: var(--s-2); min-width: 0; }
.slot-wx .wx { margin-top: 1px; }
.slot-line .wx svg { width: 16px; height: 16px; }
.slot-title h2 > span { min-width: 0; }
.slot-typical { padding: 0 var(--s-2); border-radius: var(--r-chip); border: 1px dashed var(--border-strong); color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-footnote); font-weight: 500; }

/* The pick: an inset card washed in its top accord's color. */
.pick {
  position: relative;
  padding: var(--s-4);
  border-radius: var(--r-inset);
  background:
    radial-gradient(120% 110% at 0% 0%, color-mix(in srgb, var(--accord) 20%, transparent), transparent 62%),
    var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accord) 24%, var(--border-subtle));
  box-shadow: var(--e2);
}
.pick-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: calc(-1 * var(--s-2)) calc(-1 * var(--s-2)) var(--s-2) 0; }
.pick-top .btn svg { width: 14px; height: 14px; }
.pick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); }
.pick-actions .match { margin-left: auto; }
/* The match sits in the glow's corner: a light accord (white floral,
   vanilla) lifts it enough to take secondary text under 4.5:1. */
.pick .match { color: var(--text-primary); }
/* A bottle the rotation nudge brought back: its own quiet line, the sky's
   color, so it doesn't read as one more reason it fits. */
.nudge { display: inline-flex; align-items: center; gap: var(--s-1); margin: 0 0 var(--s-3); padding: var(--s-0) var(--s-2) var(--s-0) var(--s-1); border-radius: var(--r-pill); background: color-mix(in srgb, var(--ambient) 12%, transparent); color: var(--ambient); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
.nudge svg { width: 14px; height: 14px; flex: none; }
.pick.full .nudge { margin-top: calc(-1 * var(--s-1)); }
.next-window .nudge { align-self: flex-start; margin: 0; }
/* How much to spray: one line that opens the bottle page's spray section. */
.spray-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--hit);
  padding: 0 var(--s-2);
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-2), background-color var(--dur-2);
}
.spray-hint svg { width: 16px; height: 16px; flex: none; color: var(--ambient); }
.spray-hint svg:last-child { width: 14px; height: 14px; color: var(--text-tertiary); }
@media (hover: hover) { .spray-hint:hover { color: var(--text-primary); background: var(--fill); } }
/* It sits above Wear this (before it in the markup too, so Tab meets it
   there), in line with the reasons: beside it, a long count wrapped under
   the button on all but the widest cards. */
.pick-actions .spray-hint { width: calc(100% + var(--s-2)); margin: calc(-1 * var(--s-3)) 0 0 calc(-1 * var(--s-2)); }
.spray-hint svg:last-child { margin-left: auto; }
/* Elsewhere the card shows the bottle too. Its wash is a fixed size, so on
   a wide card it lights the bottle and fades before the kicker beside it
   (secondary text there keeps 4.5:1 over the lightest accords). */
.pick.full {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--s-1) var(--s-4);
  background:
    radial-gradient(300px 260px at 0% 0%, color-mix(in srgb, var(--accord) 20%, transparent), transparent 62%),
    var(--surface-2);
}
.pick.full .pick-actions { grid-column: 1 / -1; }
.pick-bottle { display: grid; place-items: center; align-self: start; padding-top: var(--s-2); border-radius: var(--r-control); }
.pick-bottle img { width: 88px; height: auto; filter: var(--drop-bottle); transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) { .pick-bottle:hover img { transform: translateY(-3px) rotate(-2deg); } }
.pick-info { min-width: 0; }
.kicker { display: flex; align-items: center; gap: var(--s-2); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 500; }
/* Bottle names are set like book titles: Fraunces italic. */
.pick-name-btn { text-align: left; text-decoration: underline transparent; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color var(--dur-2); }
@media (hover: hover) { .pick-name-btn:hover { text-decoration-color: color-mix(in srgb, var(--text-primary) 40%, transparent); } }
.pick-name { margin: var(--s-1) 0 var(--s-0); font-family: var(--display); font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-style: italic; font-weight: 600; letter-spacing: -0.01em; }
/* Two lines at most; the bottle page has the whole name. */
.pick-name .clamp { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pick-info .brand { margin-bottom: var(--s-3); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
@container page (min-width: 560px) { .pick.full { grid-template-columns: 112px minmax(0, 1fr); } .pick-bottle img { width: 104px; } }

/* Today's other window beside the pick, once the column has room (phones
   switch windows with the hero's Day/Night toggle instead). */
.next-window { display: none; }
@container page (min-width: 700px) {
  .now-picks { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-3); }
  .next-window {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-4);
    border-radius: var(--r-inset);
    border: 1px solid var(--border-subtle);
    background:
      radial-gradient(120% 110% at 100% 0%, color-mix(in srgb, var(--accord) 10%, transparent), transparent 62%),
      var(--fill-faint);
  }
}
.next-window .kicker svg { width: 14px; height: 14px; color: var(--ambient); }
/* In the glow's corner too: secondary, which keeps 4.5:1 over the lightest accord. */
.next-time { margin-left: auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.next-pick { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: var(--s-3); }
.next-pick .pick-bottle { padding-top: 0; }
.next-pick .pick-bottle img { width: 52px; }
.next-pick .pick-name { margin: 0; font-size: var(--fs-title-3); line-height: var(--lh-title-3); }
.next-pick .brand { margin-bottom: var(--s-2); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.next-window .reasons { margin: 0; }
.next-more { align-self: flex-start; margin: auto 0 0 calc(-1 * var(--s-3)); }
.next-more svg { width: 14px; height: 14px; }

.also { margin-top: var(--s-5); }
.also-title { margin-bottom: var(--s-2); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }

/* ---------- Week ---------- */

.wk-list { display: grid; }
.wk-day {
  display: grid;
  grid-template-columns: 52px 52px 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-0);
  border-top: 1px solid var(--border-subtle);
}
.wk-day:first-child { border-top: 0; padding-top: var(--s-1); }
.wk-date { display: grid; }
.wk-date b { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600; letter-spacing: -0.01em; }
.wk-date small { color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.wk-day.today .wk-date b { color: var(--accent); }
.wk-wx { display: grid; justify-items: center; gap: var(--s-0); }
.wk-wx .wx svg { width: 28px; height: 28px; }
.wk-temps { display: flex; gap: var(--s-1); align-items: baseline; font-variant-numeric: tabular-nums; }
.wk-temps b { font-size: var(--fs-footnote); font-weight: 600; }
.wk-temps small { color: var(--text-tertiary); font-size: var(--fs-caption); }
/* "87% rain": two lines in a phone's narrow column. */
.wk-pop { color: var(--info); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.wk-picks { display: grid; gap: var(--s-1); min-width: 0; }
/* A pick: the photo with its time of day as a badge (a check once worn),
   then the name, which gets the rest of the row. */
.wk-pick {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  min-height: var(--hit);
  padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  border-radius: var(--r-control);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  text-align: left;
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), border-color var(--dur-2);
}
.wk-pick:active { transform: scale(0.97); }
@media (hover: hover) { .wk-pick:hover { border-color: var(--border-strong); background: var(--surface-3); } }
.wk-pick img { width: 26px; height: 32px; object-fit: contain; }
.wk-pick.worn { border-color: color-mix(in srgb, var(--positive) 45%, transparent); }
/* The badge sits on the photo's lower right, cut out of it by the card's
   own color (inherited, so it follows the hover). */
.wk-slot {
  position: absolute;
  left: calc(var(--s-2) + 19px);
  bottom: var(--s-1);
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: var(--r-round);
  background: inherit;
  box-shadow: 0 0 0 1px var(--border-subtle);
  color: var(--text-secondary);
}
.wk-slot svg { width: 10px; height: 10px; }
.wk-pick.worn .wk-slot { color: var(--positive); }
.wk-text { display: grid; min-width: 0; }
.wk-text b { overflow: hidden; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wk-nudge { display: flex; align-items: center; gap: var(--s-1); overflow: hidden; color: var(--ambient); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; white-space: nowrap; }
.wk-nudge svg { width: 11px; height: 11px; flex: none; }
.wk-nudge span { overflow: hidden; text-overflow: ellipsis; }
.wk-nudge .wk-short { display: none; }
/* The note under the head says what the clock means. */
.wk-legend { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-1); color: var(--ambient); }
.wk-legend svg { width: 13px; height: 13px; flex: none; }
.wk-pick.empty { grid-template-columns: 16px 1fr; background: transparent; border-style: dashed; color: var(--text-tertiary); font-size: var(--fs-caption); }
.wk-pick.empty .wk-slot { position: static; width: auto; height: auto; background: none; box-shadow: none; color: var(--text-tertiary); }
.wk-pick.empty .wk-slot svg { width: 14px; height: 14px; }
@media (max-width: 374px) {
  .wk-day { grid-template-columns: 40px 44px 1fr; gap: var(--s-2); }
  .wk-temps { flex-direction: column; align-items: center; gap: 0; line-height: 1.2; }
  .wk-pick { grid-template-columns: 26px minmax(0, 1fr); padding-right: var(--s-2); }
  .wk-pick img { width: 22px; height: 28px; }
  .wk-slot { left: calc(var(--s-2) + 15px); }
}
/* Room for the whole week side by side: a column a day, the day's pick
   over the night's. */
@container page (min-width: 700px) {
  .wk-list { grid-template-columns: repeat(var(--days, 7), minmax(0, 1fr)); gap: var(--s-2); }
  .wk-day {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    align-items: start;
    justify-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-1) var(--s-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-inset);
    background: var(--fill-faint);
    text-align: center;
  }
  .wk-day:first-child { padding-top: var(--s-3); border-top: 1px solid var(--border-subtle); }
  .wk-day.today { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
  .wk-wx { grid-template-columns: auto auto; align-items: center; column-gap: var(--s-1); }
  .wk-wx .wx svg { width: 26px; height: 26px; }
  .wk-temps { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
  .wk-pop { grid-column: 1 / -1; }
  .wk-pop[aria-hidden='true'] { display: none; }
  .wk-picks { width: 100%; align-self: end; }
  .wk-pick { grid-template-columns: 1fr; justify-items: center; gap: var(--s-1); padding: var(--s-2) var(--s-1); text-align: center; }
  .wk-pick .wk-slot { top: var(--s-2); left: var(--s-2); bottom: auto; width: auto; height: auto; background: none; box-shadow: none; color: var(--text-tertiary); }
  .wk-pick .wk-slot svg { width: 14px; height: 14px; }
  .wk-pick.worn .wk-slot { color: var(--positive); }
  .wk-pick img { width: 40px; height: 48px; }
  .wk-text { justify-items: center; max-width: 100%; }
  .wk-text b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; min-height: calc(2 * var(--lh-footnote)); }
  /* The nudge in the column's words: the clock and "34 days", on a line
     every cell keeps while one has it, so the days' cells stay in rows. */
  .wk-list.nudged .wk-text { align-content: start; min-height: calc(2 * var(--lh-footnote) + var(--lh-caption)); }
  .wk-nudge { justify-content: center; max-width: 100%; }
  .wk-nudge .wk-long { display: none; }
  .wk-nudge .wk-short { display: inline; }
  .wk-pick.empty { grid-template-columns: 1fr; min-height: 104px; place-content: center; }
}

/* ---------- Occasions ---------- */

.occasions {
  display: flex;
  gap: var(--s-2);
  /* Room above for the focus ring, which the sideways scroll would clip. */
  margin: calc(-1 * var(--s-0)) calc(-1 * var(--s-4)) 0;
  padding: var(--s-1) var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--s-4);
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
}
.occasions::-webkit-scrollbar { display: none; }
/* A tile: the occasion's glyph over its name. */
.occ {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  align-content: center;
  gap: var(--s-1);
  min-width: 84px;
  min-height: 72px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-inset);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--e2);
  text-align: center;
  scroll-snap-align: start;
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), border-color var(--dur-2);
}
.occ:active { transform: scale(0.97); }
@media (hover: hover) { .occ:hover:not(.on) { border-color: var(--border-strong); background: var(--surface-2); } }
.occ.on { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-1)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.occ-icon { color: var(--text-secondary); }
.occ-icon svg { width: 22px; height: 22px; }
.occ.on .occ-icon { color: var(--accent); }
.occ-label { font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; white-space: nowrap; }
/* Forced colors drop the gold border, tint and glow: the chosen tile gets
   the system's highlight ring. */
@media (forced-colors: active) {
  .occ[aria-checked='true'] { outline: 2px solid Highlight; outline-offset: -2px; }
}
@container page (min-width: 700px) {
  .occasions { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; mask-image: none; }
  .occ { min-width: 0; min-height: 76px; padding-inline: var(--s-1); }
}

/* "When and where?": the date, the place, and day or night. */
.occ-when { display: grid; gap: var(--s-2); }
.occ-when-label { color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
.occ-when-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.occ-when-controls .occ-slots { margin-left: auto; }
.occ-when-reset { margin-left: calc(-1 * var(--s-1)); }
@container page (max-width: 519px) {
  .occ-when-controls .occ-slots { display: flex; width: 100%; margin-left: 0; }
  .occ-when-controls .occ-slots > * { flex: 1; }
}
@container page (min-width: 700px) {
  .occ-when { grid-template-columns: auto 1fr; align-items: center; column-gap: var(--s-4); }
}

/* Date and place pills: the date in words (a button, for keyboards) with a
   native date input laid over it for pointers, and a place button. */
.date-pill { position: relative; display: inline-flex; min-width: 0; border-radius: var(--r-pill); }
.date-pill-btn, .place-pill {
  position: relative;
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  min-height: var(--hit);
  padding: 0 var(--s-4) 0 var(--s-3);
  border-radius: inherit;
  border: 1px solid var(--border-strong);
  background: var(--fill-faint);
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur-2), border-color var(--dur-2);
}
.place-pill { flex: none; border-radius: var(--r-pill); }
.date-pill svg, .place-pill svg { width: 16px; height: 16px; flex: none; color: var(--ambient); }
:is(.date-pill-btn, .place-pill) span { overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { :is(.date-pill:hover .date-pill-btn, .place-pill:hover) { background: var(--fill); border-color: color-mix(in srgb, var(--text-primary) 22%, transparent); } }
.date-pill input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: var(--fs-headline); }
/* Chromium opens its calendar from this indicator: stretch it over the pill. */
.date-pill input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }

/* ---------- Journal teaser ---------- */

.jt-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-2); }
.jt-cell { display: grid; justify-items: center; gap: var(--s-1); padding: var(--s-2) var(--s-0); border-radius: var(--r-control); background: var(--fill-faint); }
.jt-cell.today { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.jt-cell small { color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; }
.jt-cell.today small { color: var(--accent); }
.jt-bottles { display: flex; justify-content: center; align-items: center; height: 34px; }
.jt-bottles img { width: 26px; height: 30px; object-fit: contain; }
.jt-bottles img + img { margin-left: -9px; }
.jt-bottles i { width: 5px; height: 5px; border-radius: var(--r-round); background: var(--fill-strong); }

/* ---------- Trip ---------- */

/* The form: where and when on top, then the bottle count and the events. */
.trip-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4) var(--s-3); }
.trip-field { display: grid; align-content: start; gap: var(--s-2); min-width: 0; }
.trip-field.where, .trip-field.events, .trip-field.bottles, .trip-error, .trip-submit { grid-column: 1 / -1; }
.trip-label { color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
@container page (min-width: 640px) {
  .trip-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .trip-field.where { grid-column: 1; }
  .trip-field.events { grid-column: 1 / 3; }
  .trip-field.bottles { grid-column: 3; grid-row: 2; }
}
.trip-place {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 52px;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background: var(--fill-faint);
  text-align: left;
  transition: background-color var(--dur-2), border-color var(--dur-2);
}
@media (hover: hover) { .trip-place:hover { background: var(--fill); } }
.trip-place svg { width: 18px; height: 18px; color: var(--ambient); }
.trip-place svg:last-child { width: 16px; height: 16px; color: var(--text-tertiary); }
.trip-place-text { display: grid; min-width: 0; }
.trip-place-text b { overflow: hidden; font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.trip-place-text small { overflow: hidden; color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-caption); text-overflow: ellipsis; white-space: nowrap; }
.trip-place.empty b { color: var(--text-secondary); font-weight: 500; }
/* In the form a date reads like a field, not a pill. */
.trip-field .date-pill { display: flex; width: 100%; border-radius: var(--r-control); }
.trip-field .date-pill-btn { min-height: 52px; font-weight: 500; }
.trip-field .seg { align-self: start; justify-self: start; }
.trip-field .seg button { min-width: 52px; }

.trip-event-list { display: grid; gap: var(--s-1); }
.trip-event { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-1) var(--s-1) var(--s-2); border-radius: var(--r-control); background: var(--surface-2); border: 1px solid var(--border-subtle); }
.trip-event-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-round); background: color-mix(in srgb, var(--ambient) 12%, transparent); color: var(--ambient); }
.trip-event-icon svg { width: 18px; height: 18px; }
.trip-event-text { display: grid; min-width: 0; }
.trip-event-text b { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600; }
.trip-event-text small { color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.trip-add-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.trip-add-line small { color: var(--text-tertiary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
/* A new event: which day, day or night, and the occasion. */
.trip-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-3); border-radius: var(--r-inset); border: 1px dashed var(--border-strong); background: var(--fill-faint); }
.trip-add-actions { display: flex; gap: var(--s-1); margin-left: auto; }
.trip-select { position: relative; display: inline-flex; flex: 1 1 140px; align-items: center; min-width: 0; }
.trip-select select {
  width: 100%;
  min-height: var(--hit);
  padding: 0 var(--s-8) 0 var(--s-3);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-headline);
  appearance: none;
  cursor: pointer;
}
.trip-select svg { position: absolute; right: var(--s-3); width: 14px; height: 14px; color: var(--text-tertiary); transform: rotate(90deg); pointer-events: none; }
.trip-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trip-error { margin: 0; }
/* While the weather loads the fields are inert: they say so. */
.trip-fields[inert] .trip-field { opacity: 0.5; transition: opacity var(--dur-2); }
.trip-submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }

/* The trip at a glance. */
.trip-head-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-3); }
.trip-badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-control); background: color-mix(in srgb, var(--ambient) 14%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ambient) 25%, transparent); color: var(--ambient); }
.trip-badge svg { width: 22px; height: 22px; }
.trip-head-text { min-width: 0; }
.trip-head-text h2:focus { outline: none; } /* focused after packing, for screen readers */
.trip-head-text h2 { overflow: hidden; font-family: var(--display); font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: 600; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.trip-head-text p { color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
/* Its events, as tags under the dates. */
.trip-tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.trip-tag { display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-0) var(--s-2); border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; white-space: nowrap; }
.trip-tag svg { width: 12px; height: 12px; }
.trip-wx { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.trip-wx > svg { width: 18px; height: 18px; flex: none; color: var(--ambient); }
.trip-wx.updating span::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: var(--s-2); border-radius: var(--r-round); background: currentColor; animation: breathe 1.4s ease-in-out infinite; }
.trip-note { margin-top: var(--s-2); color: var(--negative); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }

/* What to pack: each bottle stands on the shelf line with its name and
   why. On a phone a row each; with room, side by side on one shelf. */
.trip-bags { display: grid; gap: var(--s-3); }
.trip-bag { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--s-3); }
.trip-bag-photo { display: grid; place-items: end center; height: 76px; padding-bottom: var(--s-1); border-radius: var(--r-thumb); background: radial-gradient(closest-side at 50% 85%, var(--fill), transparent); }
.trip-bag-photo img { width: auto; max-width: 100%; height: 66px; object-fit: contain; object-position: bottom; filter: var(--drop-small); transition: transform var(--dur-3) var(--ease-out); }
@media (hover: hover) { .trip-bag-photo:hover img { transform: translateY(-3px) rotate(-2deg); } }
.trip-bag-text { min-width: 0; }
.trip-bag-name { font-family: var(--display); font-size: var(--fs-headline); line-height: var(--lh-headline); font-style: italic; font-weight: 600; }
.trip-bag-name .clamp { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trip-bag .brand { color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.trip-role { margin-top: var(--s-1); color: var(--text-primary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
.trip-bag .reasons { margin: var(--s-0) 0 0; color: var(--text-secondary); }
@container page (min-width: 560px) {
  /* The bags share rows (subgrid): photo, name, brand, role, reason, so a
     name on two lines moves the lines under every bag alike. */
  .trip-bags { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); grid-template-rows: repeat(4, auto) 1fr; gap: 0 var(--s-4); }
  .trip-bag { grid-row: span 5; grid-template-columns: 1fr; grid-template-rows: subgrid; align-items: start; gap: 0; text-align: center; }
  .trip-bag-text { display: grid; grid-row: 2 / span 4; grid-template-rows: subgrid; }
  .trip-bag-photo { height: 116px; margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--border-strong); border-radius: 0; background: radial-gradient(closest-side at 50% 100%, var(--fill), transparent); }
  .trip-bag-photo img { height: 100px; }
  /* A shorter name sits on its brand. */
  .trip-bag-name { align-self: end; }
  .trip-bag-name .pick-name-btn { text-align: center; }
  .trip-bag .reasons { justify-items: center; }
  .trip-bag .reasons li { text-align: left; }
}
.trip-notice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); padding: var(--s-3); border-radius: var(--r-control); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.trip-notice p { flex: 1 1 240px; color: var(--text-secondary); }
.trip-notice b { color: var(--text-primary); font-weight: 600; }
.trip-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border-subtle); }
.trip-max { display: flex; align-items: center; gap: var(--s-3); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
.trip-max .seg button { min-width: 44px; }
.trip-share { display: flex; flex-wrap: wrap; gap: var(--s-1); }

/* Day by day: a row a day, the day's bottle and the night's. Phones stack
   them; with room they sit in two columns under Day and Night. */
.trip-cols { display: none; }
.trip-days { display: grid; }
.trip-day { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: 'date day' 'date night'; align-items: center; gap: var(--s-1) var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--border-subtle); }
.trip-day:first-child { border-top: 0; padding-top: 0; }
.trip-date { grid-area: date; display: grid; align-self: start; padding-top: var(--s-2); }
.trip-date b { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600; }
.trip-date small { color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-caption); font-variant-numeric: tabular-nums; }
.trip-day.today .trip-date b { color: var(--accent); }
.trip-cell[data-slot='day'] { grid-area: day; }
.trip-cell[data-slot='night'] { grid-area: night; }
.trip-cell {
  display: grid;
  grid-template-columns: 16px 58px 24px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  min-height: var(--hit);
  padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  border-radius: var(--r-control);
  text-align: left;
  transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
button.trip-cell:active { transform: scale(0.98); }
@media (hover: hover) { button.trip-cell:hover { background: var(--fill); } }
.trip-slot { display: grid; place-items: center; color: var(--text-tertiary); }
.trip-slot svg { width: 14px; height: 14px; }
.trip-wx-cell { display: flex; align-items: center; gap: var(--s-1); color: var(--text-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-variant-numeric: tabular-nums; }
.trip-wx-cell .wx svg { width: 18px; height: 18px; }
.trip-temp i { margin-right: 1px; font-style: normal; color: var(--text-tertiary); }
.trip-cell img { width: 24px; height: 30px; object-fit: contain; }
.trip-name { display: grid; justify-items: start; min-width: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; }
.trip-name-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-name small { display: flex; align-items: center; gap: var(--s-1); color: var(--accent); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; }
.trip-name small svg { width: 12px; height: 12px; flex: none; }
.trip-cell.off .trip-name-text { color: var(--text-secondary); }
.trip-cell.off img { opacity: 0.55; }
/* Not ideal: a dashed tag in words, so it doesn't rest on color. */
.trip-name .trip-off { margin-top: var(--s-0); padding: 0 var(--s-2); border: 1px dashed currentColor; border-radius: var(--r-pill); color: var(--negative); font-weight: 600; }
.trip-cell.none { grid-template-columns: 16px 1fr; color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-caption); }
@container page (min-width: 560px) {
  .trip-cols { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-1); color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; }
  .trip-cols span { display: flex; align-items: center; gap: var(--s-1); padding-left: var(--s-2); }
  .trip-cols svg { width: 13px; height: 13px; }
  .trip-day { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'date day night'; gap: var(--s-3); padding: var(--s-1) 0; }
  .trip-day:first-child { padding-top: var(--s-1); border-top: 1px solid var(--border-subtle); }
  .trip-date { align-self: center; padding: 0; }
  .trip-cell { grid-template-columns: 58px 24px minmax(0, 1fr); }
  .trip-cell .trip-slot { display: none; }
  .trip-cell.none { grid-template-columns: 1fr; }
}

/* Packing again: the last plan stays, dimmed, until the new one is in. */
.trip-out { display: grid; gap: inherit; transition: opacity var(--dur-2); }
.trip-out.refreshing { opacity: 0.55; }
.trip-sk:focus { outline: none; } /* focused while the weather loads, for screen readers */
.trip-sk-bags { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-4); }
.trip-sk-bags .sk { height: 120px; border-radius: var(--r-inset); }
.trip-sk .sk-line.w40 { margin-bottom: var(--s-3); }
.trip-sk-row { height: 40px; margin-top: var(--s-2); border-radius: var(--r-control); }
