/* The home page's themes. Clicking a swatch sets <html data-theme> (home-theme.js) and keeps it in localStorage 'gc.theme',
   the same key and ids the app uses (brand/brand.js THEMES), so the app opens in the theme chosen here.
   Glacier (id glass) is the default and has no block: its palette is the :root block in index.html. */
html[data-theme="sky"] { --p-bg:#f4f8fd; --p-surface:#e6effb; --p-ink:#0f2a4a; --p-muted:#3a5878; --p-accent:#1b63bd; --p-accent-ink:#ffffff; --p-action:#1b63bd; --p-action-ink:#ffffff; --p-inv-bg:#12365f; --p-inv-surface:#1c4676; --p-inv-ink:#f4f8fd; --p-inv-muted:#a9bfd9; --p-inv-accent:#f4f8fd; --p-inv-accent-ink:#12365f; --p-inv-action:#f4f8fd; --p-inv-action-ink:#12365f; }
html[data-theme="sand"] { --p-bg:#fbf6ec; --p-surface:#f1e8d8; --p-ink:#3a2a1a; --p-muted:#68533d; --p-accent:#a54808; --p-accent-ink:#ffffff; --p-action:#a54808; --p-action-ink:#ffffff; --p-inv-bg:#3a2a1a; --p-inv-surface:#4d3a26; --p-inv-ink:#fbf6ec; --p-inv-muted:#cdb9a0; --p-inv-accent:#fbf6ec; --p-inv-accent-ink:#3a2a1a; --p-inv-action:#fbf6ec; --p-inv-action-ink:#3a2a1a; }
html[data-theme="sunset"] { --p-bg:#2a1518; --p-surface:#3a1f23; --p-ink:#fdf0ea; --p-muted:#dbbbb1; --p-accent:#f97316; --p-accent-ink:#2a1518; --p-action:#f97316; --p-action-ink:#2a1518; --p-inv-bg:#fdf0ea; --p-inv-surface:#f6e0d6; --p-inv-ink:#2a1518; --p-inv-muted:#6f4a45; --p-inv-accent:#2a1518; --p-inv-accent-ink:#fdf0ea; --p-inv-action:#2a1518; --p-inv-action-ink:#fdf0ea; }
html[data-theme="lava"] { --p-bg:#241008; --p-surface:#34190d; --p-ink:#fff1e8; --p-muted:#e2baa0; --p-accent:#ff5a1f; --p-accent-ink:#241008; --p-action:#ff5a1f; --p-action-ink:#241008; --p-inv-bg:#fff1e8; --p-inv-surface:#fbdfcd; --p-inv-ink:#241008; --p-inv-muted:#7a4a30; --p-inv-accent:#241008; --p-inv-accent-ink:#fff1e8; --p-inv-action:#241008; --p-inv-action-ink:#fff1e8; }
html[data-theme="purple"] { --p-bg:#211438; --p-surface:#2d1c4b; --p-ink:#f4ecff; --p-muted:#cbbbe8; --p-accent:#d4baff; --p-accent-ink:#211438; --p-action:#7a52cf; --p-action-ink:#ffffff; --p-inv-bg:#f4ecff; --p-inv-surface:#e6d9fb; --p-inv-ink:#211438; --p-inv-muted:#5d4a82; --p-inv-accent:#211438; --p-inv-accent-ink:#f4ecff; --p-inv-action:#211438; --p-inv-action-ink:#f4ecff; }
html { transition:background-color .25s ease; }
@media (prefers-reduced-motion:reduce) { html { transition:none; } }

/* The theme chooser: six swatches that are real buttons. */
.themes { margin-top:24px; }
.themes .t-label { margin:0 0 12px; }
.swatches { display:flex; flex-wrap:wrap; gap:10px 18px; }
.swatch { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px 0 8px; border:1px solid color-mix(in srgb,var(--p-ink) 22%,transparent); border-radius:999px; background:transparent; color:var(--p-ink); font:inherit; font-size:14px; font-weight:500; cursor:pointer; transition:transform .18s ease, border-color .18s ease; }
.swatch:hover { transform:translateY(-2px); border-color:var(--p-ink); }
.swatch:active { transform:translateY(1px); }
.swatch[aria-checked="true"] { border-color:var(--p-ink); box-shadow:inset 0 0 0 1px var(--p-ink); }
.swatch__dot { flex:none; width:28px; aspect-ratio:1; border-radius:50%; border:2px solid var(--bar); background:linear-gradient(135deg,var(--card) 50%,var(--dot) 50%); }
.swatch:focus-visible { outline:3px solid var(--p-accent); outline-offset:3px; }

/* Screenshots of the app sit whole and centred on a quiet ground inside the kit's frames (they are screens, not photographs). */
.shot { display:flex; align-items:center; justify-content:center; background:var(--p-surface); overflow:hidden; }
.shot .frame__img { position:static; inset:auto; width:min(88%,560px); height:auto; max-height:90%; object-fit:contain; border-radius:var(--r-md,12px); }
.hero-visual.shot .frame__img { width:auto; max-width:88%; height:auto; max-height:92%; }


.shot--cover .frame__img { width:auto; max-width:100%; height:100%; max-height:100%; object-fit:contain; border-radius:var(--r-md,12px); }
/* Narrow phones: a section may need two screens, and the bar drops its text so it fits. */
@media (max-width:420px) { .nav__logo { font-size:17px; gap:8px; } .nav__actions .btn { padding-inline:14px; font-size:14px; } }
@media (max-width:359px) { .section { --hm:2; } .nav__logo { font-size:0; gap:0; } }

#ai .panel { --p-h: 460px; background:var(--p-bg); }
@media (min-width:1024px) { .shot--cover { height:560px; aspect-ratio:auto; padding:12px; } }
.chatwrap { display:flex; align-items:center; justify-content:center; height:100%; padding:24px; }
.chatfit { width:min(100%,520px); }
.chatfit .ui-chat { width:100%; }
/* On a phone each screen holds less: the third row of a list waits for the wider screen. */

/* Wide screens: the list beside a picture is set in larger type and centred on the picture. Rows keep their own height. */
@media (min-width:1024px) {
  .grid--top.fill { align-items:center; }
  .section .rows { --row-name:22px; }
  .section .rows__name { font-size:22px; line-height:1.25; }
  .section .rows li p { font-size:18px; line-height:1.45; margin-top:6px; }
  .section .section-head { margin-bottom:40px; }
}
.with-icon { display:flex; align-items:flex-start; gap:10px; }
.with-icon .ic { flex:none; margin-top:.3em; }

/* The exercise sheet's panel takes the page's quiet ground like the other pictures (the kit's panel is a warm gradient). */
.panel.shot { background:var(--p-surface); background-image:none; }
/* Two phones side by side in one frame. */
.shot--duo { gap:14px; }
.shot--duo .frame__img { width:auto; max-width:46%; }
@media (min-width:1024px) { .shot--duo { height:476px; aspect-ratio:auto; padding:12px; } }
/* The two phones share one top edge. */
.shot--duo { align-items:flex-start; }
@media (min-width:1024px) { .shot--duo { padding:28px 12px 12px; } }

/* Below desktop width each picture is shown whole (never cropped through a card). A phone also keeps only the first row of text. */
.only-phone { display:none; }
@media (max-width:1023px) {
  .section .shot, .section .shot--cover, .section .shot--duo, .section .panel.shot { height:auto; min-height:0; aspect-ratio:auto; padding:14px; }
  .section .shot .frame__img { display:block; width:auto; max-width:100%; height:auto; max-height:520px; margin-inline:auto; object-fit:contain; border-radius:var(--r-md,12px); }
  .section .shot--duo { display:flex; justify-content:center; gap:14px; }
  .section .shot .frame__img.only-phone { display:none; }
  .section .shot--duo .frame__img { max-width:46%; margin-inline:0; }
}
@media (max-width:639px) {
  .section .shot .frame__img.not-phone { display:none; }
  .section .shot .frame__img.only-phone { display:block; }
  .section .shot, .section .shot--duo, .section .panel.shot { display:block; }
  .section .shot .frame__img, .section .shot--duo .frame__img { width:100%; max-width:100%; max-height:none; }
  .section .grid--top > ul.rows li:nth-child(n+2), #progress .rows li:nth-child(n+2) { display:none; }
  #ai .panel { --p-h:340px; }
}

/* The kit's panel is a warm lit ground; here it takes the page's own quiet ground, so a screen sits on a flat colour in every theme. */
.panel.shot, #ai .panel { --ground-bg:var(--p-surface); --ground-surface:var(--p-surface); --ground-accent:var(--p-surface); }
.panel.shot, #ai .panel { background-image:none !important; background-color:var(--p-surface) !important; }
@media (max-width:1023px) { .section .panel.shot { --p-h:auto; height:auto !important; min-height:0 !important; overflow:visible; } }

/* Compact layout (2026-11-27): only the hero is a screen tall. Every other section, and the closing footer, is as tall
   as what it holds, at every width. This overrides the kit's one-section-per-screen heights on purpose. */
html { scroll-padding-top:24px; }
main > section.section:not(.hero), body > footer.closing { height:auto; min-height:0; padding-block:clamp(56px,6vw,88px) clamp(40px,4vw,56px); }
main > section.section:not(.hero) > .wrap, body > footer.closing > .wrap { height:auto; flex:none; }
main > section.section:not(.hero) > .wrap > .fill { flex:none; }
body > footer.closing > .wrap { grid-template-rows:auto auto; row-gap:clamp(48px,6vw,72px); }
/* A frame hugs its screenshot. */
@media (min-width:1024px) {
  .section .shot, .section .shot--cover, .section .shot--duo, .section .panel.shot { height:auto !important; min-height:0 !important; aspect-ratio:auto; padding:28px; }
  .section .shot::before { display:none; }
  .section .shot .frame__img { width:auto; max-width:100%; height:auto; max-height:440px; }
  .section .shot--duo .frame__img { max-width:47%; }
  #ai .panel { --p-h:auto; height:auto; min-height:0; }
  /* The hero: the words sit in the middle of the picture's height with the three facts right under the buttons,
     and the screen is never taller than 860px, so a large monitor does not open on a half-empty screen. */
  main > .hero { height:min(100svh,860px); }
  .hero-split > .hero-copy { align-self:center; height:auto; }
  .hero-split > .hero-copy > .hero-facts { margin-top:48px; }
  .hero-visual.shot { padding:24px; }
  .hero-visual.shot .frame__img { max-height:100%; }
}
/* Wide screens: the heading and the list share the left column and the picture stands beside both, so a section is
   one compact block (the heading used to take a row of its own above the picture). */
@media (min-width:1024px) {
  main > section.section:not(.hero) > .wrap { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); grid-template-rows:auto auto; column-gap:var(--gutter); align-content:center; }
  main > section.section:not(.hero) > .wrap > .section-head { grid-column:1 / span 6; grid-row:1; align-self:end; max-width:none; margin-bottom:28px; }
  main > section.section:not(.hero) > .wrap > .grid.fill { display:contents; }
  main > section.section:not(.hero) > .wrap > .grid.fill > :first-child { grid-column:1 / span 6; grid-row:2; align-self:start; }
  main > section.section:not(.hero) > .wrap > .grid.fill > :last-child { grid-column:7 / span 6; grid-row:1 / span 2; align-self:center; }
}
/* Six themes as two tidy rows of three (they no longer fit on one line beside the picture). */
.swatches { display:grid; grid-template-columns:repeat(3,max-content); justify-content:start; gap:10px; }
@media (min-width:1280px) {
  main > section.section:not(.hero) > .wrap > .section-head, main > section.section:not(.hero) > .wrap > .grid.fill > :first-child { grid-column:1 / span 5; }
}
/* A picture's frame is as tall as its picture at every width (the kit sized it from a screen-tall section, which cut
   the weekly plan and progress pictures on a phone once sections stopped being a screen tall). */
main > section.section:not(.hero) .grid.fill > .frame--fill { flex:none; height:auto; min-height:0; }
/* The hero screenshot is a whole phone screen, so beside the cropped cards below it looked small. On wide screens it is shown
   larger, like them, and the frame crops its foot. */
@media (min-width:1024px) {
  .hero-visual.shot { align-items:flex-start; padding:28px 24px 0; }
  .hero-visual.shot .frame__img { width:min(92%,410px); max-width:none; max-height:none; height:auto; }
}

/* The hero's screens: Home and a workout under way, swiped sideways (hero-swipe.js). No timer: the person moves it. */
.hero-visual.hero-swipe { flex-direction:column; align-items:stretch; justify-content:flex-start; padding:0; }
.hero-swipe__track { flex:1 1 0; min-height:0; display:flex; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scrollbar-width:none; overscroll-behavior-x:contain; }
.hero-swipe__track::-webkit-scrollbar { display:none; }
.hero-swipe__track:focus-visible { outline:3px solid var(--p-accent); outline-offset:-3px; }
.hero-swipe__slide { flex:0 0 100%; min-width:0; display:flex; justify-content:center; align-items:flex-start; scroll-snap-align:center; padding:28px 24px 0; }
.hero-visual.hero-swipe .frame__img { width:min(92%,410px); max-width:none; max-height:none; height:auto; flex:none; }
.hero-swipe__dots { flex:none; display:flex; justify-content:center; background:var(--p-surface); }
.hero-swipe__dots button { display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; background:transparent; cursor:pointer; }
.hero-swipe__dots button::after { content:""; width:9px; height:9px; border-radius:50%; border:2px solid var(--p-ink); background:transparent; transition:background .18s ease, transform .18s ease; }
.hero-swipe__dots button[aria-pressed="true"]::after { background:var(--p-ink); }
.hero-swipe__dots button:hover::after { transform:scale(1.25); }
.hero-swipe__dots button:focus-visible { outline:3px solid var(--p-accent); outline-offset:-6px; border-radius:50%; }
/* The two screens are different heights; the frame is as tall as the shorter one needs, never taller than the picture. */
@media (max-width:1023px) {
  .hero-visual.hero-swipe { height:auto; min-height:0; flex:none; }
  .hero-swipe__track { flex:none; }
  .hero-swipe__slide { padding:18px 16px 4px; align-items:center; }
  .hero-visual.hero-swipe .frame__img { width:auto; max-width:100%; height:min(56svh,440px); }
}
/* Phone footer: the legal line reads as one tight paragraph. */
@media (max-width:639px) { .footer__legal span { display:block; line-height:1.6; } }

/* The theme menu lives in the header, beside Sign in, not in a section. */
.themepick { position:relative; }
.themepick__btn { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px 0 8px; border:1px solid color-mix(in srgb,var(--p-ink) 22%,transparent); border-radius:999px; background:transparent; color:var(--p-ink); font:inherit; font-size:14px; font-weight:500; cursor:pointer; transition:transform .18s ease, border-color .18s ease; }
.themepick__btn:hover { transform:translateY(-2px); border-color:var(--p-ink); }
.themepick__btn:active { transform:translateY(1px); }
.themepick__btn:focus-visible { outline:3px solid var(--p-accent); outline-offset:3px; }
.themepick__panel { position:absolute; right:0; top:calc(100% + 10px); z-index:20; display:grid; grid-template-columns:repeat(2,max-content); gap:8px; padding:12px; background:var(--p-bg); border:1px solid color-mix(in srgb,var(--p-ink) 18%,transparent); border-radius:16px; box-shadow:0 12px 32px color-mix(in srgb,var(--p-ink) 18%,transparent); }
.themepick__panel[hidden] { display:none; }
@media (max-width:639px) { .themepick__label { display:none; } .themepick__btn { padding:0 8px; } .themepick__panel { right:-56px; } }
/* On a phone the kit keeps only the primary button in the closed bar; the theme button stays too, as just its dot. */
@media (max-width:1023px) { .nav:not(.is-open) .nav__actions > .themepick.themepick { display:block; } .nav:not(.is-open) .nav__actions { gap:8px; } }
@media (max-width:1023px) { .nav.is-open .themepick { width:100%; } .nav.is-open .themepick__btn { width:100%; justify-content:center; } .nav.is-open .themepick__label { display:inline; } .nav.is-open .themepick__panel { position:static; margin-top:10px; grid-template-columns:repeat(2,1fr); box-shadow:none; } .nav.is-open .swatch { justify-content:flex-start; } }

/* Where a section starts: a hairline across the top and a small label over its heading. */
main > section.section:not(.hero) { border-top:1px solid color-mix(in srgb,var(--p-ink) 14%,transparent); }
.section-tag { margin:0 0 14px; font:500 13px/1 var(--font-mono); letter-spacing:.08em; text-transform:uppercase; color:var(--p-accent); display:flex; align-items:center; gap:10px; }
.section-tag::before { content:""; width:28px; height:2px; background:currentColor; border-radius:2px; }
.section-head .section-tag + h2 { margin-top:0; }

/* The sign-in page on the home page's kit: same fonts, themes and header. The sign-in script (login.js) switches the panel between
   sign-in, welcome (terms) and not-invited, so those states are styled here too. Colours come from the --p-* theme variables. */

.signin-main { padding: calc(var(--nav, 72px) + clamp(32px, 6vw, 72px)) 0 clamp(48px, 7vw, 96px); min-height: calc(100svh - 120px); }
.signin-grid { display: grid; grid-template-columns: minmax(0, 520px); justify-content: center; }

.access-panel { width: 100%; max-width: 520px; }
.access-panel h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; margin: 0 0 14px; }
.access-panel > p { color: var(--p-muted); font-size: 18px; line-height: 1.5; margin: 0; }
.form-box { margin-top: 28px; display: grid; gap: 14px; }
.form-box p { margin: 0; }
#error { color: color-mix(in srgb, var(--p-ink) 55%, #c0264b); font-weight: 500; }
#error:empty { display: none; }
.form-box label { display: grid; gap: 6px; font-weight: 500; }
.form-box input[type="text"], .form-box input:not([type]), .form-box input[type="password"] { width: 100%; font: inherit; padding: 13px 14px; color: var(--p-ink); background: var(--p-bg); border: 1px solid color-mix(in srgb, var(--p-ink) 28%, transparent); border-radius: 12px; }
.form-box input:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 2px; }
.btn--wide { width: 100%; justify-content: center; }
.hint { font-size: 15px; color: var(--p-muted); text-align: center; }
.beta { font-size: 14px; color: var(--p-muted); text-align: center; }
.beta a, .install__more a { color: var(--p-ink); text-underline-offset: 3px; }

/* Asking for an invite is a clear button, not a footnote. */
.invite-ask { margin-top: 6px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--p-ink) 14%, transparent); }
.invite-ask p { margin: 0 0 12px; }
.invite-ask a, .ni-link { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1.5px solid var(--p-accent); border-radius: 999px; color: var(--p-ink); font-weight: 600; text-decoration: none; transition: transform .18s ease, background .18s ease, color .18s ease; }
.invite-ask a:hover, .ni-link:hover { background: var(--p-action); color: var(--p-action-ink); transform: translateY(-2px); }
.invite-ask a:active, .ni-link:active { transform: translateY(1px); }

/* Terms: the tick box and button. */
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; margin: 0 0 14px; }
.agree input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--p-action); }
#accept:disabled { opacity: .5; cursor: not-allowed; }
.welcome-page { text-align: center; }
.welcome-page .section-tag { justify-content: center; }
.welcome-page .welcome-name { display: flex; align-items: center; justify-content: center; gap: 10px; width: fit-content; max-width: 100%; margin: 10px auto 12px; padding: 6px 16px 6px 6px; background: var(--p-surface); border: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); border-radius: 999px; font-size: 16px; word-break: break-all; }
.welcome-initial { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--p-action); color: var(--p-action-ink); font-size: 14px; font-weight: 700; }
.welcome-page .welcome-name + br { display: none; }
.welcome-page #agreement { text-align: left; margin-top: 22px; padding: 18px 20px; background: var(--p-surface); border: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); border-radius: 16px; transition: border-color .18s, box-shadow .18s; }
.welcome-page #agreement:hover, .welcome-page #agreement:focus-within { border-color: var(--p-accent); }
.welcome-page .agree { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .welcome-page > h1, .welcome-page > p, .welcome-page #agreement { animation: welcome-in .5s cubic-bezier(.2,.7,.2,1) both; }
  .welcome-page > p { animation-delay: .08s; }
  .welcome-page #agreement { animation-delay: .16s; }
}
@keyframes welcome-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Not invited. */
#error.not-invited { color: var(--p-ink); background: var(--p-surface); border: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); border-radius: 16px; padding: 22px 24px; }
.not-invited p { margin: 0; }
.ni-title { font-size: clamp(28px, 4vw, 38px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.ni-email { margin-top: 14px !important; font-weight: 600; font-size: 17px; word-break: break-all; background: var(--p-bg); border-radius: 10px; padding: 10px 12px; }
.ni-note { margin-top: 12px !important; color: var(--p-muted); font-size: 15px; line-height: 1.45; }
.ni-page { text-align: center; }
.ni-page #error.not-invited { text-align: left; }
.ni-page .ni-link { margin-top: 4px; }
body:has(.ni-page) .install, body:has(.welcome-page) .install { display: none !important; }

/* Install as an app. */
.install { margin-top: 28px; padding: 18px 20px; background: var(--p-surface); border: 1px solid color-mix(in srgb, var(--p-ink) 14%, transparent); border-radius: 16px; display: grid; gap: 10px; justify-items: start; }
.install[hidden], .install [hidden] { display: none; }
.install p { margin: 0; }
.install__title { font-weight: 600; font-size: 18px; }
.install__text, .install__steps { color: var(--p-muted); font-size: 15px; line-height: 1.5; }
.install__steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; list-style: decimal; }
.install__more { font-size: 14px; }

.signin-foot { border-top: 1px solid color-mix(in srgb, var(--p-ink) 14%, transparent); padding: 24px 0; font-size: 14px; color: var(--p-muted); }
.signin-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.signin-foot nav { display: flex; gap: 20px; }
.signin-foot a { color: inherit; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
