/*
 * The home page's moving parts: the app's own screens rebuilt in HTML (Today, the tally, Don't miss
 * twice, a shared streak) and the Live Activities, animated with the app's motion: a check fills
 * from the centre (350 ms spring), the mark draws 60 ms later, numbers tick up (220 ms), tally
 * strokes draw one every 40 ms, the Dynamic Island morphs on a spring and settles back within 2 s.
 * With Reduce Motion, everything shows its final state.
 */

.landing {
  --spring: cubic-bezier(0.32, 1.32, 0.48, 1);
  --ease-out: cubic-bezier(0.25, 0.9, 0.3, 1);
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Sections rise in as they come into view (only once home.js runs, so nothing hides without it). */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Habit hues: the app's light values on its screens, dark values in the island and Lock Screen. */
.h-violet { --hue: #5e4db2; --tint: rgba(94, 77, 178, 0.13); }
.h-teal { --hue: #19797f; --tint: rgba(25, 121, 127, 0.13); }
.h-ochre { --hue: #a6720c; --tint: rgba(166, 114, 12, 0.13); }
.h-rose { --hue: #b23a6a; --tint: rgba(178, 58, 106, 0.13); }
.h-sienna { --hue: #93542a; --tint: rgba(147, 84, 42, 0.13); }

.island .h-violet, .ls-card .h-violet, .island-dark .h-violet { --hue: #9d90f2; }
.island .h-teal, .ls-card .h-teal { --hue: #4fbfc4; }
.island .h-ochre, .ls-card .h-ochre { --hue: #e3ab3f; }
.island .h-rose, .ls-card .h-rose { --hue: #e57aa3; }
.island .h-sienna, .ls-card .h-sienna { --hue: #d39163; }

/* MARK: Device */

.device-fit {
  --s: 0.72;
  position: relative;
  width: calc(426px * var(--s));
  height: calc(898px * var(--s));
  margin: 0 auto;
}

.device {
  position: absolute;
  top: 0;
  left: 0;
  width: 426px;
  height: 898px;
  padding: 12px;
  border-radius: 74px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  background: linear-gradient(145deg, #8e8a84 0%, #3e3b38 18%, #6f6b66 50%, #2e2c2a 82%, #7b7771 100%);
  box-shadow: 0 0 0 1.5px #1a1918 inset, 0 40px 70px rgba(52, 38, 22, 0.25), 0 8px 18px rgba(52, 38, 22, 0.16);
}

.device::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 70px;
  background: #0b0b0b;
}

.screen {
  position: relative;
  width: 402px;
  height: 874px;
  border-radius: 62px;
  overflow: hidden;
  isolation: isolate;
}

.hero-fit { --s: 0.62; }
.island-fit { --s: 0.8; height: calc(330px * var(--s)); overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.lock-fit { --s: 0.5; }

@media (min-width: 480px) {
  .hero-fit { --s: 0.7; }
}

@media (min-width: 900px) {
  .hero-fit { --s: 0.74; }
  .lock-fit { --s: 0.56; }
}

/* MARK: The Dynamic Island */

.island {
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 5;
  width: 126px;
  height: 37px;
  border-radius: 18.5px;
  transform: translateX(-50%);
  background: #000;
  color: #f3eee5;
  overflow: hidden;
  font-family: Nunito, sans-serif;
  transition: width 0.55s var(--spring), height 0.55s var(--spring), border-radius 0.55s var(--spring);
}

.island.compact { width: 235px; }
.island.expanded { width: 380px; height: 160px; border-radius: 46px; }
.island.alert { width: 380px; height: 86px; border-radius: 43px; }

.i-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out);
}

.i-layer.on {
  opacity: 1;
  transition-delay: 0.12s;
}

#heroIsland.compact .i-compact,
#heroIsland.alert .i-alert {
  opacity: 1;
  transition-delay: 0.12s;
}

.i-compact {
  justify-content: space-between;
  padding: 0 15px;
}

.i-mark {
  width: 20px;
  height: 19px;
  fill: none;
  stroke: #f0794c;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.i-mark.small { width: 16px; height: 15px; }
.i-mark.tiny { width: 13px; height: 12px; margin-right: 5px; }

.i-ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--hue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-ico.small { width: 17px; height: 17px; }

.i-count {
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  font-size: 15px;
}

.i-count span { color: #a9a195; }
.c-violet { color: #9d90f2; }

.i-alert {
  gap: 14px;
  padding: 0 22px;
}

.i-disc {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hue, #e57aa3);
}

.i-disc svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #141210;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-alert.on .i-disc,
#heroIsland.alert .i-disc {
  animation: pop 0.5s var(--spring) 0.1s both;
}

.i-alert-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.i-alert-text b { font-weight: 900; font-size: 17px; }

.i-alert-text small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a9a195;
  font-weight: 700;
  font-size: 13px;
}

.tally {
  width: 13px;
  height: 12px;
  fill: none;
  stroke: #f0794c;
  stroke-width: 1.5;
  stroke-linecap: round;
  flex: none;
}

.i-ring {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
}

.i-ring svg,
.a-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.i-ring circle,
.a-ring circle {
  fill: none;
}

.i-ring .track { stroke: rgba(255, 255, 255, 0.18); stroke-width: 3.5; }

.i-ring .prog {
  stroke: #f0794c;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 106.8;
  stroke-dashoffset: calc(106.8 * (1 - var(--p, 0.2)));
  transition: stroke-dashoffset 0.6s var(--ease-out);
}

.i-pill {
  flex: none;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
  font-size: 15px;
}

.i-pill.accent { color: #f0794c; background: rgba(240, 121, 76, 0.16); }

.i-avs { display: flex; }
.i-avs .av { width: 24px; height: 24px; font-size: 11px; border: 2px solid #000; }
.i-avs .av + .av { margin-left: -7px; }
.i-avs.big .av { width: 42px; height: 42px; font-size: 16px; }
.i-avs.big .av + .av { margin-left: -11px; }

.av {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: #141210;
  position: relative;
  flex: none;
}

.av.you { background: #e57aa3; z-index: 2; }
.av.maya { background: #e3ab3f; }

/* Expanded */

.i-expanded {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 16px 20px 18px;
}

.x-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
}

.x-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.x-meta {
  font-weight: 800;
  font-size: 13px;
  color: #a9a195;
}

.x-meta b { color: inherit; }
.island .x-meta b, .ls-card .x-meta b { color: #f3eee5; font-weight: 900; }

.x-discs {
  display: flex;
  justify-content: space-between;
}

.x-discs .d {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.8px var(--hue);
  transition: background 0.35s;
}

.x-discs .d svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--hue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.x-discs .d.on { background: var(--hue); }
.x-discs .d.on svg { stroke: #141210; stroke-width: 2.8; }
.x-discs .d.pop { animation: pop 0.5s var(--spring); }

.x-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.x-bottom > span:first-child {
  display: grid;
  min-width: 0;
}

.x-bottom small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a9a195;
}

.x-bottom b {
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--hue);
  color: #141210;
  font-weight: 800;
  font-size: 14px;
  flex: none;
}

.x-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.x-btn.ghost { background: rgba(255, 255, 255, 0.14); color: #f3eee5; }
.x-btn.ghost svg { stroke-width: 2.2; }

.x-timer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-timer b {
  flex: 1;
  font-weight: 900;
  font-size: 44px;
  letter-spacing: -1px;
  line-height: 1;
}

.x-round {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}

.x-round svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #f3eee5;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.x-round.fill { background: var(--hue); }
.x-round.fill svg { stroke: #141210; stroke-width: 2.8; }

.x-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.x-bar i {
  display: block;
  height: 100%;
  width: calc(var(--p, 0.23) * 100%);
  border-radius: 3px;
  background: #9d90f2;
  transition: width 0.8s linear;
}

.x-pair {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.x-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.x-person .av { width: 34px; height: 34px; font-size: 14px; }
.x-person b { display: block; font-weight: 800; font-size: 14px; }
.x-person small { font-weight: 800; font-size: 12px; color: #a9a195; }
.x-person .ok-text { color: #86c06a; }
.x-person.right { text-align: right; }

.x-big {
  display: grid;
  justify-items: center;
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
}

.x-big small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a9a195;
  margin-top: 4px;
}

.x-center { display: flex; justify-content: center; }

/* MARK: Today, rebuilt (the hero phone) */

.app {
  background: #f4efe6;
  color: #1d1b18;
  font-family: Nunito, sans-serif;
}

.app-status,
.hs-status {
  position: absolute;
  top: 21px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px 0 36px;
  font: 700 16px/1 -apple-system, 'SF Pro Text', Nunito, sans-serif;
  z-index: 3;
}

.bat {
  width: 25px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  opacity: 0.85;
  position: relative;
}

.bat::after {
  content: '';
  position: absolute;
  inset: 1.5px 4px 1.5px 1.5px;
  border-radius: 2px;
  background: currentColor;
}

.app-body {
  padding: 66px 20px 0;
}

.a-date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #665f55;
}

.a-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.a-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.a-sub {
  margin-top: 2px;
  font-size: 15px;
  color: #665f55;
}

.a-sub b { font-weight: 400; color: inherit; }

.a-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
}

.a-ring .track { stroke: #e6dfd3; stroke-width: 6; }

.a-ring .prog {
  stroke: #d2451e;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 194.8;
  stroke-dashoffset: calc(194.8 * (1 - var(--p, 0.2)));
  transition: stroke-dashoffset 0.6s var(--ease-out);
}

.a-ring.full { animation: pop 0.6s var(--spring); }

.a-week {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 6px;
  padding: 8px;
  border-radius: 22px;
  background: #fffcf6;
  border: 1px solid #ece5d9;
}

.a-week span {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 42px;
  padding: 6px 0;
  border-radius: 14px;
}

.a-week i {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #665f55;
}

.a-week em {
  font-style: normal;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 2.5px #d2451e;
}

.a-week em.later { box-shadow: inset 0 0 0 1.5px #d3cbbd; color: #8f877b; }
.a-week .today { background: #1d1b18; }
.a-week .today i { color: rgba(255, 252, 246, 0.75); }
.a-week .today em { color: #fffcf6; box-shadow: inset 0 0 0 2.5px rgba(255, 252, 246, 0.22); }

.a-section {
  margin: 14px 4px 8px;
  font-size: 19px;
  font-weight: 800;
}

.a-row,
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 6px 7px 6px 9px;
  border-radius: 20px;
  background: #fffcf6;
  border: 1px solid #ece5d9;
}

.a-tile {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--tint);
}

.a-tile svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--hue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.a-text b { font-weight: 600; font-size: 16px; }

.a-text small {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #665f55;
}

.a-text .tally { stroke: #d2451e; margin-left: 4px; }

.js-streak.tick { display: inline-block; animation: tickUp 0.22s var(--ease-out); }

/* The check control: a ring in the habit's hue that fills from the centre, then the mark draws. */
.a-check {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2.4px var(--hue);
  display: grid;
  place-items: center;
  margin-right: 2px;
}

.a-check::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--hue);
  transform: scale(0);
  transition: transform 0.35s var(--spring);
}

.a-check svg {
  position: relative;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fffcf6;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.18s var(--ease-out) 0.06s;
}

.kept .a-check::before { transform: scale(1); }
.kept .a-check svg { stroke-dashoffset: 0; }

.a-tabbar {
  position: absolute;
  left: 20px;
  right: 86px;
  bottom: 30px;
  height: 62px;
  border-radius: 31px;
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 12px 32px rgba(52, 38, 22, 0.14);
  display: flex;
  gap: 2px;
  padding: 5px;
}

/* The app's tab bar (src/components/tab-bar.tsx): four tabs with labels, and the New habit button. */
.a-tabbar span {
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 26px;
  color: #5e574d;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
}

.a-tabbar span.on { background: rgba(29, 27, 24, 0.07); color: #1d1b18; }

.a-tabbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-tabbar .a-fab {
  position: absolute;
  right: -72px;
  top: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #1d1b18;
  box-shadow: 0 10px 24px rgba(29, 27, 24, 0.28);
}

.a-tabbar .a-fab svg { width: 26px; height: 26px; stroke: #fffcf6; stroke-width: 2.2; }

/* MARK: Visual cards beside the features */

.visual-card {
  width: 100%;
  max-width: 420px;
  justify-self: center;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 26px;
  box-shadow: 0 30px 60px rgba(52, 38, 22, 0.08);
}

/* The tally, drawing itself */
.board-cap {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
}

.board-count {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 4px;
}

.board-count .num {
  font-weight: 900;
  font-size: clamp(5rem, 14vw, 7rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.board-count small {
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: 14px;
}

.board-tally {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.35;
  stroke-linecap: round;
}

.board-tally path {
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
}

.board-tally.draw path {
  animation: draw 0.16s linear forwards;
  animation-delay: calc(var(--i) * 70ms);
}

.board-milestone {
  display: inline-block;
  margin-top: 26px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 800;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--spring);
}

.board-milestone.on { opacity: 1; transform: none; }

/* Don't miss twice: the warning, then the habit kept and the line turning green (a 7 s loop) */
.twice .mini-row {
  margin: 0;
  padding: 10px 10px 10px 12px;
  background: var(--bg);
  border-color: var(--line);
  color: var(--text);
}

.twice .a-text small { color: var(--text2); }

.swap {
  position: relative;
  height: 18px;
}

.swap span {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  white-space: nowrap;
}

.swap .warn { color: #b8391a; }
.swap .good { color: #3f6b2d; opacity: 0; }

@media (prefers-color-scheme: dark) {
  .swap .warn { color: #f28a62; }
  .swap .good { color: #86c06a; }
  .twice .h-sienna { --hue: #d39163; --tint: rgba(211, 145, 99, 0.18); }
}

.twice.run .swap .warn { animation: twiceOut 7s infinite; }
.twice.run .swap .good { animation: twiceIn 7s infinite; }
.twice.run .a-check::before { animation: twiceFill 7s infinite; }
.twice.run .a-check svg { animation: twiceDraw 7s infinite; }
.twice.run .twice-options span { animation: twiceFade 7s infinite; }

.twice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.twice-options span {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.9rem;
}

.twice-options span:first-child { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

@keyframes twiceOut { 0%, 38% { opacity: 1; transform: none; } 42%, 92% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; } }
@keyframes twiceIn { 0%, 40% { opacity: 0; transform: translateY(6px); } 45%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes twiceFill { 0%, 33% { transform: scale(0); } 38%, 92% { transform: scale(1); } 98%, 100% { transform: scale(0); } }
@keyframes twiceDraw { 0%, 34% { stroke-dashoffset: 24; } 38%, 92% { stroke-dashoffset: 0; } 98%, 100% { stroke-dashoffset: 24; } }
@keyframes twiceFade { 0%, 34% { opacity: 1; } 40%, 92% { opacity: 0.35; } 100% { opacity: 1; } }

/* A shared streak: you keep it, Maya keeps it, the number goes up */
.sh-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
}

.sh-avs { display: flex; }
.sh-avs .av { width: 38px; height: 38px; font-size: 15px; border: 2px solid var(--surface); }
.sh-avs .av + .av { margin-left: -10px; }

.av .ok {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4b7d36;
  border: 2px solid var(--surface);
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform 0.4s var(--spring);
}

.av .ok svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

.shared.you-kept .you .ok,
.shared.maya-kept .maya .ok { transform: scale(1); }

.sh-streak {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 16px;
}

.sh-streak .num {
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sh-streak .num.tick { display: inline-block; animation: tickUp 0.3s var(--ease-out); }

.sh-side { display: grid; gap: 6px; padding-bottom: 8px; }
.sh-side small { font-weight: 700; font-size: 1rem; }

.sh-tally {
  width: 120px;
  height: auto;
  fill: none;
  stroke: #b23a6a;
  stroke-width: 1.3;
  stroke-linecap: round;
}

@media (prefers-color-scheme: dark) {
  .sh-tally { stroke: #e57aa3; }
}

.sh-tally .new { stroke-dasharray: 12; stroke-dashoffset: 12; transition: stroke-dashoffset 0.2s linear; }
.shared.both .sh-tally .new { stroke-dashoffset: 0; }

.sh-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.sh-status > span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 0.95rem;
}

.sh-status i { width: 9px; height: 9px; border-radius: 50%; background: #b5ac9e; transition: background 0.3s; }
.sh-status em { font-style: normal; color: var(--text2); }
.sh-status .st-yes { display: none; }
.shared.you-kept .you i { background: #b23a6a; }
.shared.maya-kept .maya i { background: #a6720c; }
.shared.you-kept .you .st-yes,
.shared.maya-kept .maya .st-yes { display: inline; }
.shared.you-kept .you .st-not,
.shared.maya-kept .maya .st-not { display: none; }

.sh-toast {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--spring);
}

.shared.both .sh-toast { opacity: 1; transform: none; }

/* MARK: Live Activities band */

.live {
  max-width: none !important;
  margin: 40px 0 !important;
  padding: 72px var(--gutter) 80px !important;
  background: #110f0d;
  color: #f3eee5;
}

.live-inner {
  max-width: var(--wide);
  margin: 0 auto;
}

.live .eyebrow { color: #f0794c; }
.live .section-lede { color: #a9a195; }

.live-tabs {
  display: inline-flex;
  gap: 4px;
  margin-top: 28px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.live-tabs button {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: none;
  color: #a9a195;
  font: 800 0.95rem Nunito, sans-serif;
  cursor: pointer;
}

.live-tabs button[aria-selected='true'] {
  background: #f3eee5;
  color: #141210;
}

.live-stage {
  display: grid;
  gap: 36px;
  margin-top: 36px;
  align-items: start;
}

.live-phone { margin: 0; display: grid; justify-items: center; gap: 14px; }

.live-state {
  font-weight: 800;
  font-size: 0.95rem;
  color: #a9a195;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

@media (min-width: 900px) {
  .live-stage {
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
  }
}

/* The home screen behind the island */
.home-screen {
  background:
    radial-gradient(120% 70% at 20% 10%, #3b2f5e 0%, transparent 60%),
    radial-gradient(90% 60% at 90% 40%, #8a3e23 0%, transparent 60%),
    radial-gradient(120% 80% at 30% 100%, #1d4e52 0%, transparent 60%),
    linear-gradient(180deg, #17141f, #0e1216);
  color: #fff;
}

.hs-icons {
  position: absolute;
  top: 210px;
  left: 26px;
  right: 26px;
  display: grid;
  grid-template-columns: repeat(4, 64px);
  justify-content: space-between;
  gap: 26px 0;
}

.hs-icons i {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.14);
}

.hs-icons i.chalk {
  background: #1d1b18;
  display: grid;
  place-items: center;
}

.hs-icons i.chalk svg { width: 34px; height: 31px; fill: none; stroke: #fffcf6; stroke-width: 1.4; stroke-linecap: round; }

/* The Lock Screen */
.lock-screen {
  background:
    radial-gradient(120% 70% at 20% 10%, #3b2f5e 0%, transparent 60%),
    radial-gradient(90% 60% at 90% 40%, #8a3e23 0%, transparent 60%),
    radial-gradient(120% 80% at 30% 100%, #1d4e52 0%, transparent 60%),
    linear-gradient(180deg, #17141f, #0e1216);
  color: #fff;
  text-align: center;
}

.ls-date { margin-top: 84px; font: 600 20px/1 -apple-system, 'SF Pro Display', Nunito, sans-serif; opacity: 0.85; }
.ls-time { font: 700 104px/1.05 -apple-system, 'SF Pro Display', Nunito, sans-serif; letter-spacing: -2px; margin-top: 6px; }

.ls-card {
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 116px;
  height: 162px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(29, 27, 24, 0.88);
  color: #f3eee5;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: Nunito, sans-serif;
}

.ls-quick {
  position: absolute;
  bottom: 44px;
  left: 46px;
  right: 46px;
  display: flex;
  justify-content: space-between;
}

.ls-quick i { width: 50px; height: 50px; border-radius: 25px; background: rgba(0, 0, 0, 0.35); }

/* MARK: A look inside */

.shots {
  display: flex;
  gap: 22px;
  margin: 32px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter) 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.shots img {
  flex: none;
  width: 240px;
  height: auto;
  scroll-snap-align: center;
  border-radius: 13% / 6.2%;
  filter: drop-shadow(0 22px 30px rgba(52, 38, 22, 0.16));
}

/* The rail: home.js moves the screens along on their own and with page scrolling. It runs edge to
   edge of the window and fades out at both sides; main clips what runs past. */
main { overflow-x: clip; }

.shots.rail {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  scroll-snap-type: none;
  touch-action: pan-y;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.shots.rail.dragging { cursor: grabbing; }

.shots.rail:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.shots-track {
  flex: none;
  display: flex;
  gap: 22px;
  will-change: transform;
}

.shots.rail img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* MARK: Keyframes */

@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes tickUp { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }

/* Reduce Motion: no movement, final states only (home.js stops its loops too). */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .island, .i-layer, .a-check::before, .a-check svg, .board-milestone, .sh-toast, .av .ok { transition-duration: 0.01s !important; }
  .board-tally path { stroke-dashoffset: 0; animation: none !important; }
  .twice.run * { animation: none !important; }
}
