/* ============================================================
   Cal360 marketing site — brand tokens mirrored from the app
   ============================================================ */
:root {
  /* Colours from the approved Cal360 2.0 design. Every text/background pair
     meets WCAG AA: brand mint is a fill only (dark text on it), buttons use the
     control green with white text, and links use the deep green. */
  --bg: #f5f6f5;
  --fg: #0a2533;
  --card: #ffffff;
  --primary: #56be9d;
  --primary-dark: #1e6b53;
  --primary-soft: #ddf2ea;
  --control: #32836a;
  --control-hover: #1e6b53;
  --secondary: #eef0ef;
  --muted: #eef0ef;
  --muted-fg: #5c6670;
  --border: #d7dfd9;
  --accent: #f5fbf6;
  --lavender: #8b7ec8;
  --coral: #e87e7e;
  /* The app's chat colours: lagoon is only for the member's own bubbles and the send button.
     The app's gradient starts at #1c8e9e; here it starts a shade deeper so white 16px text
     passes WCAG AA (4.5:1) from the first line. Faint grey is for dots and chevrons, not text. */
  --lagoon: linear-gradient(180deg, #198190, #177784);
  --lulu-bubble: #e9e9eb;
  --chat-secondary: #6c747a;
  --chat-faint: #8a9196;
  --changed-ring: #a4f2d5;
  --inset: #eef0ef;
  --mint-icon: #2f8c6e;
  --hairline: rgba(10, 37, 51, 0.1);
  --radius: 1rem;
  --radius-card: 1.5rem;
  --font-heading: "Outfit", "Outfit Fallback", system-ui, sans-serif;
  --font-body: "Outfit", "Outfit Fallback", system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(10, 37, 51, 0.06);
  --shadow-md: 0 6px 24px rgba(10, 37, 51, 0.09);
  --shadow-lg: 0 16px 48px rgba(10, 37, 51, 0.14);
  --max-w: 72rem;
}

/* Outfit (SIL Open Font License, see /fonts/OFL.txt), served from this site. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/outfit-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/outfit-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/outfit-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/outfit-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/outfit-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/outfit-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Same line box and near-same width as Outfit, so text barely moves when Outfit arrives. */
@font-face {
  font-family: "Outfit Fallback";
  src: local("Arial");
  size-adjust: 99.6%;
  ascent-override: 100.4%;
  descent-override: 26.1%;
  line-gap-override: 0%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Keep in-page anchors (#sources, #faq, etc.) clear of the fixed navbar. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

[id] {
  scroll-margin-top: 5.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Outfit is loaded at 400, 500 and 600 (the approved design's weights). */
strong,
b {
  font-weight: 600;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

/* Reduce short stranded last lines; JS also glues the final two words. */
p,
li,
.hero-sub,
.not-found-lead,
.sticky-cta-note,
.guide-card p,
.faq-body p,
.legal-article p {
  text-wrap: pretty;
}

h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }

p {
  margin: 0 0 1rem;
}

a {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.btn:focus-visible,
.chip:focus-visible,
.demo-tab:focus-visible {
  border-radius: 999px;
}

.download-box :focus-visible,
.cta-box :focus-visible {
  outline-color: #fff;
}

/* In-page targets take focus from the script so keyboard users land there; no ring for that. */
[tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--fg);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3rem 0;
}

@media (min-width: 860px) {
  .section {
    padding: 4.5rem 0;
  }
}

/* Guides index sits under the fixed navbar (not a long-scroll marketing page). */
.guides-listing {
  padding-top: 6.5rem;
}

.section-alt {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto 2rem;
}

@media (min-width: 860px) {
  .section-head {
    margin-bottom: 3rem;
  }
}

.section-head p {
  color: var(--muted-fg);
  font-size: 1.075rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  touch-action: manipulation;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--control);
  color: #fff;
  padding: 0.95rem 2.1rem;
  font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(50, 131, 106, 0.35);
}

.btn-primary:hover {
  background: var(--control-hover);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 1.15rem 2.75rem;
  font-size: 1.2rem;
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--border);
  padding: 0.9rem 1.9rem;
  font-size: 1.05rem;
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.navbar-logo {
  flex-shrink: 0;
}

.navbar-logo img {
  height: 2rem;
  width: auto;
}

.navbar-links {
  display: none;
  gap: 1.6rem;
  align-items: center;
}

.navbar-links a {
  color: var(--muted-fg);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.navbar-links a:hover {
  color: var(--fg);
}

.navbar .btn-primary {
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  box-shadow: none;
}

/* Mobile menu: a hamburger opens the section links under the bar. The button comes before
   the links in the page so the keyboard reaches them next; flex order keeps it on the right. */
.navbar-toggle {
  order: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: -0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}

@media (max-width: 859px) {
  .navbar-inner {
    position: relative;
    padding-block: 0.55rem;
  }

  .navbar-logo {
    margin-right: auto;
  }

  .navbar .btn-primary {
    order: 2;
    padding: 0.55rem 1rem;
    white-space: nowrap;
  }

  .navbar-logo img {
    height: 1.7rem;
  }

  .navbar.open .navbar-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .navbar.open .navbar-links a {
    padding: 0.8rem 0;
    font-size: 1.05rem;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
  }

  .navbar.open .navbar-links a:last-child {
    border-bottom: 0;
  }
}

/* The narrowest phones: logo, button and menu still fit on one row, with space between them. */
@media (max-width: 359px) {
  .navbar-inner {
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .navbar-toggle {
    margin-left: 0;
  }

  .navbar .btn-primary {
    padding-inline: 0.75rem;
  }
}

@media (min-width: 860px) {
  .navbar-links {
    display: flex;
  }

  .navbar-toggle {
    display: none;
  }
}

main {
  padding-top: 4.2rem;
}

@media (max-width: 859px) {
  main {
    padding-top: 3.9rem;
  }
}

@media (max-width: 639px) {
  main {
    padding-top: 3.65rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: clip;
  padding: 0.8rem 0 2.5rem;
}

@media (min-width: 960px) {
  .hero {
    padding: 3.5rem 0 4rem;
  }
}

.hero::before {
  content: "";
  position: absolute;
  top: -22rem;
  left: 50%;
  transform: translateX(-50%);
  width: 68rem;
  height: 42rem;
  background: radial-gradient(closest-side, rgba(86, 190, 157, 0.24), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 1.15rem;
  align-items: start;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 3.5rem;
    align-items: center;
  }
}

.hero-copy {
  text-align: center;
}

@media (min-width: 960px) {
  .hero-copy {
    text-align: left;
  }
}

.hero .eyebrow {
  margin-bottom: 0.6rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero h1 .accent {
  color: var(--control);
}

.hero-sub {
  color: var(--muted-fg);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 34rem;
  margin: 0 auto 0.95rem;
  text-wrap: pretty;
}

/* Phones get straight to what Cal360 does; the scene-setting line shows from tablets up. */
.hero-sub-lead {
  display: none;
}

@media (min-width: 720px) {
  .hero-sub {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 1.6rem;
  }

  .hero-sub-lead {
    display: inline;
  }
}

@media (min-width: 960px) {
  .hero-sub {
    margin-left: 0;
  }
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

/* One full-width, thumb-friendly button on phones */
@media (max-width: 639px) {
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .hero-ctas .btn-lg {
    min-height: 3.25rem;
    padding-block: 0.8rem;
    font-size: 1.15rem;
  }
}

@media (max-width: 959px) {
  .hero-secondary {
    display: none;
  }
}

@media (min-width: 960px) {
  .hero-ctas {
    justify-content: flex-start;
  }
}

.hero-proof {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.hero-proof .stars {
  color: var(--primary-dark);
}

@media (max-width: 359px) {
  .hero-proof {
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

.hero-trust {
  margin: 0.2rem 0 0;
  color: var(--muted-fg);
  font-size: 0.9rem;
}

.phone {
  border-radius: 2rem;
  border: 2px solid rgba(10, 37, 51, 0.1);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

/* ---------- LuLu chat examples ----------
   Sizes, colours and wording follow the app's approved chat design. Lagoon is used only on
   the member's own bubbles. */
.demo {
  width: 100%;
  max-width: 24.5rem;
  margin: 0 auto;
}

.demo-phone {
  position: relative;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 2.125rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.chat-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(10, 37, 51, 0.06);
}

.chat-grabber {
  width: 2.25rem;
  height: 0.3125rem;
  border-radius: 999px;
  background: rgba(10, 37, 51, 0.18);
  margin-bottom: 0.4rem;
}

/* LuLu's seat is her ring; her arms and her hops reach outside it, as in the app. */
.lulu-seat {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  margin-top: 0.2rem;
}

.lulu-art,
.lulu-sprite {
  position: absolute;
  left: -0.875rem;
  top: -1.5rem;
  width: 5rem;
  height: 5.3125rem;
  max-width: none;
}

.lulu-sprite {
  display: none;
  background-repeat: no-repeat;
  background-size: 1000% 800%;
}

.lulu-seat.is-live .lulu-sprite {
  display: block;
}

.lulu-seat.is-live .lulu-art {
  visibility: hidden;
}

.chat-name {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.chat-left {
  font-size: 0.8125rem;
  color: var(--chat-secondary);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.chat-replay {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--inset);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* A 44px touch target around the 36px circle */
.chat-replay::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
}

.chat-replay[hidden] {
  display: none;
}

.chat-replay .icon-replay,
.chat-replay.is-done .icon-skip {
  display: none;
}

.chat-replay.is-done .icon-replay {
  display: block;
}

/* Tall enough to follow a chat, short enough that the whole example fits between the
   site's top bar and the phone's bottom button. Earlier lines stay reachable by scrolling. */
.chat-thread {
  height: 21rem;
  height: clamp(14rem, calc(100svh - 22.5rem), 26rem);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0 0.875rem;
}

.chat-thread::-webkit-scrollbar {
  display: none;
}

.chat-panel:focus-visible {
  outline-offset: -3px;
  border-radius: 0.75rem;
}

/* Nothing is being revealed line by line (no script, a script error, or reduced motion):
   the chat is simply as tall as its words. */
html:not(.js) .chat-thread,
[data-demo].is-still .chat-thread {
  height: auto;
  overflow: visible;
}

/* A chat starts under LuLu and grows down. Its buttons and the Saved note always sit just
   above the message field, as in the app (see .chips and .chat-toast). */
.chat-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 100%;
  padding: 0.25rem 0 0.75rem;
}

.chat-panel[hidden] {
  display: none;
}

.chat-time {
  align-self: center;
  margin: 0.6rem 0 0.1rem;
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

.chat-time b {
  font-weight: 600;
}

.msg {
  position: relative;
  max-width: 82%;
  margin: 0;
  padding: 0.5rem 0.8125rem;
  border-radius: 1.1875rem;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.msg-lulu {
  background: var(--lulu-bubble);
  color: var(--fg);
}

.msg-you {
  align-self: flex-end;
  background: var(--lagoon);
  color: #fff;
  border-bottom-right-radius: 0.3125rem;
}

/* The last bubble of LuLu's turn has the small tail corner, as the cards and her typing dots do. */
.msg-tail {
  border-bottom-left-radius: 0.3125rem;
}

/* A second line or a card from the same speaker sits closer, like one thought. */
.msg-run,
.msg-lulu + .food-card {
  margin-top: -0.3125rem;
}

.msg-photo {
  align-self: flex-end;
  padding: 0;
  background: none;
  width: 12.5rem;
  max-width: 62%;
}

.msg-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1.125rem;
}

.food-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: 84%;
  padding: 0.5rem 0.625rem 0.5rem 0.5rem;
  background: var(--lulu-bubble);
  border-radius: 1.1875rem;
  border-bottom-left-radius: 0.3125rem;
  transition: box-shadow 0.25s ease-in-out;
}

.food-card.is-changed {
  box-shadow: 0 0 0 2px var(--changed-ring);
}

.food-tile {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  background: #fff;
  color: var(--mint-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease-in-out, color 0.25s ease-in-out;
}

.food-check,
.food-card.is-logged .food-fork,
.food-logged,
.food-card.is-logged .food-draft {
  display: none;
}

.food-card.is-logged .food-tile {
  background: var(--control);
  color: #fff;
}

.food-card.is-logged .food-check,
.food-card.is-logged .food-logged {
  display: block;
}

.food-card.is-logged.is-fresh .food-tile {
  animation: tile-pop 0.3s ease-out;
}

@keyframes tile-pop {
  50% {
    transform: scale(1.1);
  }
}

.food-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.food-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
}

.food-detail {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
}

.food-chevron {
  flex: none;
  color: var(--chat-faint);
}

.food-card-photo {
  flex-wrap: wrap;
  gap: 0;
  width: 15.625rem;
  max-width: 84%;
  padding: 0;
  overflow: hidden;
}

.food-photo {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 250 / 168;
  object-fit: cover;
}

.food-card-photo .food-text {
  flex: 1;
  padding: 0.5625rem 0.375rem 0.625rem 0.875rem;
}

.food-card-photo .food-chevron {
  margin-right: 0.625rem;
}

.chips {
  align-self: stretch;
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.125rem;
}

.chip {
  flex: 1 1 auto;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid #c6c6c8;
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}

/* Two buttons still fit side by side on the narrowest phones. */
@media (max-width: 339px) {
  .chip {
    padding: 0 0.5rem;
    font-size: 0.875rem;
  }
}

.chip:hover {
  border-color: var(--control);
}

/* The button that was taken stays lit for a moment before the chat moves on. */
.chip.is-chosen {
  background: var(--primary-soft);
  border-color: var(--control);
}

.chips-single .chip {
  flex: 0 1 auto;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Without the script nothing can be tapped, so the chat stops at LuLu's estimate. */
html:not(.js) .chips,
html:not(.js) .demo-tabs,
html:not(.js) .chat-replay,
html:not(.js) [data-demo] [data-echo],
html:not(.js) [data-demo] [data-echo] ~ [data-step] {
  display: none;
}

.chat-toast {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: auto 0 0;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-md);
  font-size: 1rem;
}

.chat-toast-action {
  color: var(--control);
  font-weight: 600;
}

.typing {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0.75rem 0.875rem;
  border-radius: 1.1875rem;
  border-bottom-left-radius: 0.3125rem;
  background: var(--lulu-bubble);
}

.typing i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--chat-faint);
  animation: typing 1.2s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.typing i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* With the script running, each line waits for its turn. Without it, the first chat is plain
   text up to LuLu's estimate (see the html:not(.js) rules above). */
.js [data-demo] [data-step]:not(.is-in) {
  display: none;
}

.js [data-demo] .is-in.msg,
.js [data-demo] .is-in.food-card,
.js [data-demo] .is-in.chips,
.js [data-demo] .is-in.chat-toast,
.js [data-demo] .typing {
  animation: line-in 0.36s cubic-bezier(0.34, 1.36, 0.64, 1) both;
  transform-origin: bottom left;
}

.js [data-demo] .is-in.msg-you {
  transform-origin: bottom right;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
}

.chat-compose {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.75rem 0.5rem;
  background: #fff;
}

.compose-plus {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--inset);
  color: #3c4449;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-field {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.375rem;
  padding: 0 0.625rem 0 0.875rem;
  border: 1px solid rgba(10, 37, 51, 0.16);
  border-radius: 999px;
  color: #6f777c;
  font-size: 1rem;
}

.compose-field svg {
  color: var(--chat-secondary);
}

/* The plan LuLu built, shown as the real app screen */
.chat-cover {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  animation: cover-in 0.4s ease-out both;
}

.chat-cover[hidden] {
  display: none;
}

/* The screenshot's own status bar is cropped away: the example is not a second phone. */
.chat-cover img {
  width: 100%;
  height: auto;
  max-width: none;
  margin-top: -12.5%;
}

@keyframes cover-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.demo-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.demo-tab {
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease-out, border-color 0.15s ease-out;
}

.demo-tab:hover {
  border-color: var(--control);
}

/* The chosen example is marked by a ring as well as its fill, so it does not rest on a pale colour alone. */
.demo-tab[aria-selected="true"] {
  background: var(--primary-soft);
  border-color: var(--control);
  box-shadow: inset 0 0 0 1px var(--control);
  color: var(--primary-dark);
  font-weight: 600;
}

.demo-note {
  margin: 0.7rem auto 0;
  max-width: 22rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

@media (prefers-reduced-motion: reduce) {
  .typing i {
    animation: none;
    opacity: 0.6;
  }
}

/* ---------- Logging methods ----------
   Phones: one grouped list, icon beside the words. Wider screens: cards in a grid. */
.log-methods {
  list-style: none;
  margin: 0;
  padding: 0 1.125rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.log-methods > .log-method {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.05rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.log-methods > .log-method:last-child {
  border-bottom: 0;
}

.log-methods > .log-method .icon {
  flex: none;
  margin: 0.15rem 0 0;
}

.log-methods > .log-method h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.2rem;
}

.log-methods > .log-method p {
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (min-width: 720px) {
  .log-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }

  .log-methods > .log-method,
  .log-methods > .log-method:last-child {
    padding: 1.4rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
  }
}

@media (min-width: 1024px) {
  .log-methods {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Shared with the guide's swipeable method cards */
.log-method {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.log-method .icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.65rem;
  border-radius: 0.85rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.log-method h3 {
  font-size: 1.02rem;
  margin-bottom: 0.25rem;
}

.log-method p {
  color: var(--muted-fg);
  font-size: 0.88rem;
  margin: 0;
}

/* ---------- Download ---------- */
.download-box {
  background: var(--fg);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 2.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 720px) {
  .download-box {
    padding: 3.5rem 2.5rem;
  }
}

.download-box h2,
.download-box h3 {
  color: #fff;
}

.download-box p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 36rem;
  margin: 0 auto 1.6rem;
}

.download-box .eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.download-box .hero-trust {
  margin: 0.9rem auto 0;
  color: rgba(255, 255, 255, 0.78);
}

.download-box .btn-primary {
  background: var(--primary);
  color: var(--fg);
  box-shadow: none;
}

.download-box .btn-primary:hover {
  background: var(--primary-soft);
}

@media (max-width: 639px) {
  .download-box .btn-lg {
    width: 100%;
    padding-inline: 1rem;
  }
}

.download-stores {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.download-stores h3 {
  font-size: 1.2rem;
}

.download-stores > p {
  font-size: 0.95rem;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem 2.5rem;
}

/* A code to scan is only useful when the visitor is not already on their phone. */
.qr-card {
  display: none;
}

@media (min-width: 860px) and (hover: hover) {
  .qr-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-align: left;
  }

  .qr-card img {
    width: 6.5rem;
    height: 6.5rem;
    padding: 0.4rem;
    background: #fff;
    border-radius: 0.75rem;
  }

  .qr-card p {
    max-width: 11rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-fg);
  }

  .download-box .qr-card p {
    color: rgba(255, 255, 255, 0.78);
  }

  .hero-qr {
    margin-top: 1.5rem;
  }

  .hero-qr img {
    width: 5.5rem;
    height: 5.5rem;
    border: 1px solid var(--border);
  }

  /* On the dark box the white pad is the code's only quiet margin: four modules, as scanners expect. */
  .download-box .qr-card img {
    width: 7.5rem;
    height: 7.5rem;
    padding: 0.9rem;
  }
}

/* Beside the chat there is room for the code; under centred copy on a narrower window there is not. */
@media (max-width: 959px) {
  .hero-qr {
    display: none;
  }
}

.store-badge img {
  height: 3.4rem;
  width: auto;
  margin: 0 auto;
}

/* /invite: both store badges side by side (Google Play first on Android) */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1rem;
}

/* Google's badge image has transparent padding; enlarge it so the badge itself matches the App Store one */
.store-badge-play img {
  height: 4.94rem;
  margin: -0.77rem 0;
}

/* /invite: a friend's code, large enough to read and type, with a Copy button */
.download-box h1 {
  color: #fff;
}

.invite-benefits {
  list-style: none;
  padding: 0;
  margin: 0 auto 1rem;
  max-width: 26rem;
  text-align: left;
}

.invite-benefits li {
  position: relative;
  padding-left: 1.6rem;
  margin: 0.45rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.invite-benefits li::before {
  content: "✓" / "";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 600;
}

.invite-code {
  margin: 0 auto 1.8rem;
}

.invite-code-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.invite-code-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0.5rem 1rem 0.5rem 1.2rem;
}

.download-box .invite-copy {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.download-box .invite-copy:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.invite-copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.store-badge[aria-disabled="true"] {
  cursor: default;
}

/* ---------- Screenshots gallery ---------- */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(58vw, 15rem);
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 1.25rem 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery:focus-visible {
  outline-offset: -3px;
}

.gallery::-webkit-scrollbar {
  height: 8px;
}

.gallery::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.gallery figure {
  margin: 0;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
}

/* Center a shorter screenshot so every caption lines up at the bottom */
.gallery figure img {
  flex: none;
  margin-block: auto;
}

.gallery figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-top: 0.6rem;
}

/* Desktop: arrow buttons scroll the screenshot strip */
.gallery-nav {
  display: none;
}

@media (min-width: 860px) {
  .gallery-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
  }
}

.gallery-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.gallery-btn:hover {
  border-color: var(--control);
  color: var(--primary-dark);
}

/* Guides: a direct answer under the title */
.quick-answer {
  background: var(--primary-soft);
  border-left: 4px solid var(--control);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
}

/* Wide comparison tables scroll sideways inside the article on small screens */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.compare {
  min-width: 44rem;
}

table.compare caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted-fg);
}

table.compare tbody th {
  font-weight: 600;
  background: none;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
}

table.compare td:nth-child(2) {
  background: var(--accent);
  font-weight: 600;
}

/* ---------- App Store reviews ---------- */
.rating-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.stars {
  color: var(--primary-dark);
  letter-spacing: 0.08em;
}

.reviews-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 52rem;
  margin: 0 auto;
}

@media (min-width: 720px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.review-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.review-card blockquote {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.1rem;
}

.review-card blockquote p {
  margin: 0;
}

.review-card figcaption {
  color: var(--muted-fg);
  font-size: 0.9rem;
}

.guides-all {
  text-align: center;
  margin: 2rem 0 0;
}

/* ---------- How it works ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

@media (min-width: 860px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Phones: number beside the words. Wider screens: number on top, three across. */
.step-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.125rem;
}

.step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.8rem;
  background: var(--primary);
  color: var(--fg);
  font-family: var(--font-heading);
  font-weight: 600;
}

.step-card h3 {
  margin-bottom: 0.35rem;
}

@media (min-width: 860px) {
  .steps {
    gap: 1.25rem;
  }

  .step-card {
    display: block;
    padding: 1.9rem 1.5rem;
  }

  .step-num {
    margin-bottom: 1rem;
  }
}

.step-card p {
  color: var(--muted-fg);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Meal plan cards ---------- */
.meals {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 860px) {
  .meals {
    grid-template-columns: repeat(3, 1fr);
  }
}

.meal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* These photos carry a back button and a title from the app screen they were taken from.
   The frame shows only the clean part of each: the right 83% and the top 69%. */
.meal-photo {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.meal-card .meal-photo img {
  width: 119.8%;
  max-width: none;
  height: auto;
  margin-left: -19.8%;
}

.meal-card .meal-body {
  padding: 0.9rem 1rem 1.1rem;
}

.meal-tag {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin-bottom: 0.45rem;
}

/* Two cards across leave little room on the narrowest phones: let the label use it all. */
@media (max-width: 359px) {
  .meal-card .meal-body {
    padding-inline: 0.625rem;
  }

  .meal-tag {
    padding-inline: 0.4rem;
    white-space: normal;
    border-radius: 0.75rem;
  }
}

.meal-card h3 {
  font-size: 0.98rem;
  margin: 0 0 0.3rem;
}

.meal-macros {
  color: var(--muted-fg);
  font-size: 0.82rem;
  margin: 0;
}

/* Who makes Cal360: sits with the recipes it vouches for */
.maker-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 44rem;
  margin: 1.5rem auto 0;
  padding: 1.25rem;
  background: var(--primary-soft);
  border-radius: var(--radius-card);
}

.maker-card img {
  flex: none;
  width: 3rem;
  height: 3rem;
}

.maker-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.2rem;
}

.maker-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (min-width: 720px) {
  .maker-card {
    margin-top: 2.25rem;
    padding: 1.5rem 1.75rem;
    gap: 1.25rem;
  }

  .maker-card img {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* ---------- Guides grid ---------- */
.guides-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 680px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .guides-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}

.guide-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(86, 190, 157, 0.55);
  transform: translateY(-2px);
}

.guide-card .guide-kicker {
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.guide-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}

.guide-card p {
  color: var(--muted-fg);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.guide-card .guide-more {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary-dark);
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 48rem;
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.02rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--primary-dark);
  line-height: 1;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item .faq-body {
  padding: 0 1.4rem 1.25rem;
  color: var(--muted-fg);
  font-size: 0.96rem;
}

.faq-item .faq-body a {
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 2.25rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.footer .footer-heading {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-fg);
  margin: 0 0 0.8rem;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.93rem;
}

.footer a:hover {
  color: var(--primary-dark);
}

.footer-brand img {
  height: 1.9rem;
  width: auto;
  margin-bottom: 0.8rem;
}

.footer-brand p {
  color: var(--muted-fg);
  font-size: 0.9rem;
  max-width: 22rem;
}

.footer-bottom {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted-fg);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

/* ---------- Guide article pages ---------- */
.article {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--muted-fg);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary-dark);
}

.article-meta {
  color: var(--muted-fg);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.article h2 {
  margin-top: 2.75rem;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
}

.article h3 {
  margin-top: 1.9rem;
}

.article p,
.article li {
  color: #3f4944;
  font-size: 1.02rem;
}

.article ul,
.article ol {
  padding-left: 1.4rem;
}

.article li {
  margin-bottom: 0.5rem;
}

.article .lede {
  font-size: 1.15rem;
  color: var(--muted-fg);
}

.article-figure {
  margin: 2.25rem auto;
  max-width: 17rem;
}

.article-figure img {
  border-radius: 1.6rem;
  border: 2px solid rgba(10, 37, 51, 0.1);
  box-shadow: var(--shadow-md);
}

.article-figure figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-top: 0.7rem;
}

/* Wide 16:9 figures (diagrams, food photos) */
.article-figure-wide {
  margin: 2.25rem 0;
}

/* Square diagrams: cap width so they don't dominate the column */
.article-figure-square {
  max-width: 27rem;
  margin-left: auto;
  margin-right: auto;
}

/* Logging methods: swipeable cards on mobile, grid on wide screens */
.method-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(76%, 15rem);
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.25rem 1rem;
  margin: 2rem 0 0.25rem;
  scrollbar-width: thin;
}

.method-slider .log-method {
  scroll-snap-align: center;
  padding: 1.5rem 1.25rem;
}

.method-slider .icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.1rem;
  margin-bottom: 0.85rem;
}

.method-slider .icon svg {
  width: 28px;
  height: 28px;
}

.method-slider .log-method dl {
  margin: 0.35rem 0 0;
  text-align: left;
}

.method-slider .log-method dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-top: 0.7rem;
}

.method-slider .log-method dd {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  text-wrap: pretty;
}

.method-slider-hint {
  font-size: 0.85rem;
  color: var(--muted-fg);
  text-align: center;
  margin: 0 0 2rem;
}

@media (min-width: 700px) {
  .method-slider {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-columns: auto;
    overflow-x: visible;
  }

  .method-slider-hint {
    display: none;
  }
}

.article-figure-wide img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.article-figure-wide figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-top: 0.7rem;
}

.callout {
  background: var(--primary-soft);
  border: 1px solid rgba(86, 190, 157, 0.45);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 2rem 0;
}

.callout p {
  margin: 0;
}

.cta-box {
  background: var(--fg);
  border-radius: calc(var(--radius) * 1.25);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.75rem;
  margin: 3rem 0 1rem;
}

.cta-box h2 {
  color: #fff;
  margin-top: 0;
  font-size: 1.6rem;
}

.cta-box p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 30rem;
  margin: 0 auto 1.4rem;
}

.related {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 2rem;
}

.related h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

.related ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.related a {
  font-weight: 600;
  text-decoration: none;
}

.related a:hover {
  text-decoration: underline;
}

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 55;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(10, 37, 51, 0.1);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta:not(.visible) {
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s 0.25s;
}

.sticky-cta .btn {
  width: 100%;
  min-height: 3rem;
  padding-block: 0.6rem;
  font-size: 1.0625rem;
}

.sticky-cta .sticky-cta-note {
  margin: 0.3rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

@media (min-width: 860px) {
  .sticky-cta {
    display: none;
  }
}

/* Keep the footer, and anything reached by keyboard, clear of the sticky bar on phones */
@media (max-width: 859px) {
  html {
    scroll-padding-bottom: 7rem;
  }

  .footer {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
}

/* ============================================================
   Science / methodology page (ported from science.html <style>)
   ============================================================ */
.formula {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  overflow-x: auto;
  white-space: nowrap;
}
.formula .var { color: var(--primary-dark); font-weight: 600; }
table.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.96rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.spec th, table.spec td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
table.spec th {
  background: var(--primary-soft);
  color: var(--fg);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.spec tr:last-child td { border-bottom: 0; }
sup.cite { font-size: 0.72em; line-height: 0; }
sup.cite a { text-decoration: none; font-weight: 600; }
.refs { padding-left: 1.4rem; }
.refs li { margin-bottom: 0.9rem; font-size: 0.92rem; color: #3f4944; }
.refs li a { word-break: break-word; }
.jump-sources {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-soft);
  border: 1px solid rgba(86, 190, 157, 0.45);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.example-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
}
.example-box h3 { margin-top: 0; }
.example-box ol { padding-left: 1.3rem; }
.disclaimer {
  background: #fdf6ec;
  border: 1px solid #ecd9b8;
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.disclaimer p { margin-bottom: 0.6rem; }
.disclaimer p:last-child { margin-bottom: 0; }

/* Legal pages — brand-aligned on marketing tokens (not a redesign) */
.legal-main {
  padding-top: 6.5rem;
  padding-bottom: 3rem;
  max-width: 48rem;
}

.legal-article h1 {
  margin-bottom: 0.5rem;
}

.legal-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.legal-article section {
  margin-top: 1.5rem;
}

.legal-article h2 {
  font-size: 1.35rem;
  margin-top: 0.5rem;
}

.legal-article h3 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

.legal-article h4 {
  font-size: 1rem;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

.legal-page .sticky-cta {
  display: none !important;
}

/* Branded 404 — served via CloudFront custom error responses */
.not-found-main {
  padding-top: 7.5rem;
  padding-bottom: 4rem;
  max-width: 36rem;
  text-align: center;
}

.not-found-main h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  line-height: 1.25;
}

.not-found-lead {
  margin: 0 auto 1.75rem;
  color: var(--muted-fg);
  font-size: 1.05rem;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}


/* ---------- Your Privacy Choices ---------- */
.privacy-choices-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.privacy-choices-link img {
  width: 30px;
  height: 14px;
  flex: none;
}

.choices-form [hidden] {
  display: none !important;
}

.choices-form {
  display: grid;
  gap: 1.25rem;
  margin: 1.75rem 0 2.5rem;
}

.choices-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.legal-article .choices-card {
  margin-top: 0;
}

.legal-article .choices-card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.choices-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--primary-soft);
  font-weight: 500;
  cursor: pointer;
}

.choices-toggle strong {
  font-weight: 700;
}

.choices-toggle input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.1rem 0 0;
  accent-color: var(--primary-dark);
  cursor: pointer;
}

.choices-toggle input:disabled,
.choices-toggle input:disabled + span {
  cursor: default;
}

.choices-hint {
  margin: 0.75rem 0 0;
  color: var(--muted-fg);
  font-size: 0.92rem;
}

.choices-honored {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(93, 190, 163, 0.45);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.choices-honored img {
  flex: none;
  margin-top: 0.3rem;
}

.choices-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.legal-article .choices-status {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ---------- Privacy choices banner (outside the US, Washington and Nevada) ---------- */
.consent-banner {
  /* The share of the screen the banner may take: a third (owner, 2026-11-26), or half once it
     shows the switches, so both are always in view (Washington and Nevada, Manage choices). */
  --banner-share: 33.333;
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.consent-banner-inner {
  width: 100%;
  max-width: 44rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 1.4rem;
  pointer-events: auto;
  /* As tall as its text, never past a third of the screen with the space under it (owner,
     2026-11-26): about a quarter on phones 390–430 pt wide and on laptops. Where the text doesn't
     fit, it scrolls and the title and the answers stay put. */
  display: flex;
  flex-direction: column;
  max-height: calc(var(--banner-share) * 1vh - max(1rem, env(safe-area-inset-bottom)));
  max-height: calc(var(--banner-share) * 1dvh - max(1rem, env(safe-area-inset-bottom)));
}

.consent-banner-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

.consent-banner-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* What runs on fades out at the bottom edge, a cue to scroll; the padding keeps the last line
     clear of the fade once scrolled to the end. */
  padding-bottom: 0.7rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1rem), transparent);
}

.consent-banner-text {
  margin: 0;
  color: var(--muted-fg);
  font-size: 0.93rem;
}

.consent-banner-text a,
.consent-banner-links a {
  color: inherit;
  text-decoration: underline;
}

.consent-switches {
  display: grid;
  gap: 0.5rem 2rem;
  margin-top: 0.6rem;
}

/* Side by side where there's room, so both switches show within the banner's third. */
@media (min-width: 521px) {
  .consent-switches {
    grid-template-columns: 1fr 1fr;
  }
}

.consent-switches[hidden] {
  display: none;
}

.consent-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.consent-switch-label {
  display: grid;
  font-size: 0.93rem;
}

.consent-switch-label span {
  color: var(--muted-fg);
  font-size: 0.85rem;
}

/* A switch: the checkbox drawn as a track and knob, both off until turned on. The track's edge,
   the knob and the "on" fill all stand out at 3:1 or more against the card. */
.consent-switch input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 2.75rem;
  height: 1.6rem;
  margin: 0;
  border: 2px solid var(--muted-fg);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.consent-switch input::before {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--muted-fg);
  transition: transform 0.15s ease;
}

.consent-switch input:checked {
  border-color: #2c7d67;
  background: #2c7d67;
}

.consent-switch input:checked::before {
  background: #fff;
  transform: translateX(1.15rem);
}

.consent-switch input:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.consent-switch input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .consent-switch input,
  .consent-switch input::before {
    transition: none;
  }
}

.consent-banner-actions [hidden] {
  display: none;
}

.consent-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.consent-banner-actions .btn {
  min-height: 2.75rem;
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
}

.consent-banner-links {
  /* First, so the answers end the row with "Allow all" (or "Save choices") last. */
  margin: 0 auto 0 0;
  color: var(--muted-fg);
  font-size: 0.9rem;
}

.consent-banner-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 520px) {
  .consent-banner-inner {
    padding: 0.75rem 1rem;
  }

  .consent-banner-title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
  }

  .consent-banner-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* The links take their own line, so the two answers share the row below. */
  .consent-banner-actions {
    gap: 0.4rem;
    margin-top: 0.3rem;
  }

  .consent-banner-links {
    flex: 1 0 100%;
    font-size: 0.85rem;
  }

  /* With the switches, only "Privacy Policy" is left: it shares the row with "Save choices". */
  .consent-banner--switches .consent-banner-links {
    flex: 0 0 auto;
    margin-right: 0.75rem;
  }

  .consent-switch-label span {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .consent-banner-actions .btn {
    flex: 1 1 0;
    min-height: 2.5rem;
    padding: 0.5rem 0.5rem;
    font-size: 0.93rem;
    white-space: nowrap;
  }
}

/* A small phone: the title is for screen readers only, so the banner stays within its share. */
@media (max-width: 520px) and (max-height: 740px) {
  .consent-banner-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    margin: 0;
  }
}

/* Short screens (a phone on its side, a page zoomed in): a tighter banner, so the answers still
   fit in the third with some of the text above them. */
@media (max-height: 480px) {
  .consent-banner {
    bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .consent-banner-inner {
    padding: 0.5rem 0.9rem;
    max-height: calc(var(--banner-share) * 1vh - max(0.5rem, env(safe-area-inset-bottom)));
    max-height: calc(var(--banner-share) * 1dvh - max(0.5rem, env(safe-area-inset-bottom)));
  }

  .consent-banner-title {
    margin-bottom: 0.1rem;
    font-size: 0.95rem;
  }

  /* A shorter fade, so the last line is clear once scrolled to the end. */
  .consent-banner-body {
    padding-bottom: 0.35rem;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 0.35rem), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 0.35rem), transparent);
  }

  .consent-banner-actions {
    margin-top: 0.25rem;
  }

  .consent-banner-actions .btn {
    min-height: 2rem;
    padding: 0.3rem 0.9rem;
    font-size: 0.9rem;
  }
}

/* Very short screens (a phone on its side, a page zoomed in a long way): the title is still read
   out but not shown, so the answers and a line of text fit in the third. */
@media (max-height: 340px) {
  .consent-banner {
    bottom: 0;
  }

  .consent-banner-inner {
    padding: 0.25rem 0.75rem;
    max-height: calc(var(--banner-share) * 1vh);
    max-height: calc(var(--banner-share) * 1dvh);
  }

  .consent-banner-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* No room for a fade: every line at full contrast. */
  .consent-banner-body {
    padding-bottom: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .consent-banner-actions {
    margin-top: 0.1rem;
  }
}

.consent-banner--switches {
  --banner-share: 50;
}

/* The smallest phones need a little more for both switches and their lines. */
@media (max-height: 600px) {
  .consent-banner--switches {
    --banner-share: 60;
  }
}

/* The banner takes the sticky download button's place until it's answered. */
.has-consent-banner .sticky-cta {
  display: none !important;
}

/* Your Privacy Choices: until the site's tags run (consent.js's TAGS_LIVE adds "tags-live"), this
   browser's choices have nothing to control, so a note takes their place. */
:root:not(.tags-live) .privacy-browser,
.tags-live .privacy-browser-later,
.privacy-account .privacy-browser-later {
  display: none !important;
}
