/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-accent:     #c8f000;
  --color-accent-fg:  #0a0a0a;
  --color-bg:         #f5f3ee;   /* warm paper (redesign D) */
  --color-surface:    #ffffff;
  --color-surface-2:  #f1eee8;   /* inset rows, pills and icon wells on a card */
  --color-text:       #14130f;
  --color-text-muted: #6b675f;   /* 5.0:1 on bg, 5.6:1 on surface */
  --color-danger:     #c4001a;   /* destructive text/fills; 5.1:1 on bg (UX-6.2) */
  --color-good:       #1b7a3d;   /* positive status text ("Gerade entspannt"), 5.4:1 on surface */
  --color-idle:       #dedad2;   /* empty bar/track segments */
  --color-shadow:     rgba(60, 50, 30, 0.10);
  --color-nav-bg:     rgba(255, 255, 255, 0.82);  /* frosted floating tab bar */
  --color-nav-border: rgba(20, 19, 15, 0.07);
  --shimmer-opacity:  0.30;
  /* Floating tab bar: 64px pill, lifted off the bottom edge by at least
     14px or the home-indicator inset. --nav-height = everything it covers. */
  --nav-bar-h:        64px;
  --nav-gap:          max(14px, env(safe-area-inset-bottom));
  --nav-height:       calc(var(--nav-bar-h) + var(--nav-gap) + 12px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Semantic open/closed status colors (Entdecken gym sheet): "open" and
     "closed" carry meaning on their own, not tied to brand/mode. Open stays
     the iOS system green in both themes; closed reuses --color-danger so
     there is a single red (UX-6.2). */
  --color-status-open:   #34c759;
  --color-status-closed: var(--color-danger);
  /* Side padding shared by every bottom-sheet fragment (.sheet-content) so
     picker, config, week-day, soreness, bodyweight, add-to-routine and the
     exercise detail line up (UX-6.2). */
  --sheet-pad-x: 16px;
  /* Brand colour as *text/icon on a surface* (checkmarks, links): the club's
     --brand-fg on light surfaces, the bright --brand on dark ones, where
     --brand-fg (dark text meant for brand fills) would vanish. */
  --brand-ink: var(--brand-fg);
  /* Smallest touch target (Apple HIG 44 pt). Every control in the training
     area is at least this big in its tappable area; the visible shape may be
     smaller (UX-6.1, see the "UX-6.1 R2-G" block at the end of this file). */
  --tap-min: 44px;
  /* Redesign D (design canvas "Ventrax D"): one display face for titles and
     big numbers, big soft cards, and a springy press. Platform design, not
     configurable by clubs or members (hard rule 5). */
  --font-display: "Bricolage Grotesque", var(--font);
  --radius-card: 26px;   /* cards and big tiles */
  --radius-tile: 22px;   /* cards inside a horizontal scroller */
  --radius-well: 12px;   /* icon wells and small inset blocks */
  --ease-spring: cubic-bezier(0.3, 1.7, 0.5, 1);
  --ease-out-soft: cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:         #0d0c0a;
    --color-surface:    #1b1a17;
    --color-surface-2:  #292723;
    --color-text:       #f6f4ef;
    --color-text-muted: #a6a198;   /* 7.6:1 on bg, 6.8:1 on surface */
    --color-danger:     #ff6961;
    --color-good:       #4cd471;
    --color-idle:       #3b3833;
    --color-shadow:     rgba(0, 0, 0, 0.5);
    --brand-ink:        var(--brand);
    --color-nav-bg:     rgba(27, 26, 23, 0.82);
    --color-nav-border: rgba(255, 255, 255, 0.09);
    --shimmer-opacity:  0.20;
  }
}

/* Explicit in-app choice (Settings → Darstellung) overrides system preference either way. */
:root[data-theme="dark"] {
  --color-bg:         #0d0c0a;
  --color-surface:    #1b1a17;
  --color-surface-2:  #292723;
  --color-text:       #f6f4ef;
  --color-text-muted: #a6a198;   /* 7.6:1 on bg, 6.8:1 on surface */
  --color-danger:     #ff6961;
  --color-good:       #4cd471;
  --color-idle:       #3b3833;
  --color-shadow:     rgba(0, 0, 0, 0.5);
  --brand-ink:        var(--brand);
  --color-nav-bg:     rgba(27, 26, 23, 0.82);
  --color-nav-border: rgba(255, 255, 255, 0.09);
  --shimmer-opacity:  0.20;
}

:root[data-theme="light"] {
  --color-bg:         #f5f3ee;   /* warm paper (redesign D) */
  --color-surface:    #ffffff;
  --color-surface-2:  #f1eee8;   /* inset rows, pills and icon wells on a card */
  --color-text:       #14130f;
  --color-text-muted: #6b675f;   /* 5.0:1 on bg, 5.6:1 on surface */
  --color-danger:     #c4001a;   /* destructive text/fills; 5.1:1 on bg (UX-6.2) */
  --color-good:       #1b7a3d;   /* positive status text ("Gerade entspannt"), 5.4:1 on surface */
  --color-idle:       #dedad2;   /* empty bar/track segments */
  --color-shadow:     rgba(60, 50, 30, 0.10);
  --color-nav-bg:     rgba(255, 255, 255, 0.82);  /* frosted floating tab bar */
  --color-nav-border: rgba(20, 19, 15, 0.07);
  --shimmer-opacity:  0.30;
  --brand-ink:        var(--brand-fg);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

/* ── Layout shell ────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.page-content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--nav-height);
}

.app-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 0;
}

.app-message {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-nav-border);
  color: var(--color-text);
}

.app-message--success,
.app-message--info {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}

.app-message--error {
  color: #fff;
  background: #d64545;
  border-color: #d64545;
}

/* Sync status on the active session (workout_log/active_session.html,
   static/js/workout/session_page.js) - only shown when uploads are stuck.
   Neutral while merely offline (nothing is lost, it's on the device);
   .app-message--error when the user has to act (signed out, rejected).
   Sticky so it stays visible while scrolling through sets. */
.sync-status {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 8px);
  z-index: 20;
  margin-bottom: 10px;
}

.sync-status__box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-status__text {
  flex: 1;
}

.sync-status__link {
  color: inherit;
  font-weight: 700;
}

.sync-status__action {
  flex-shrink: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: color-mix(in srgb, currentColor 14%, transparent);
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.session-closed__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

/* ── Ops banner (deploy-in-progress hint, gymapp templates + context
   processor) - reuses the accent/text tokens rather than a new color, same
   as .app-message above, so it looks like part of this app's own chrome
   instead of a third-party alert bar. */
.ops-banner {
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--brand) 20%, var(--color-surface));
  color: var(--color-text);
  border-bottom: 1px solid var(--color-nav-border);
}

/* Assistant-connection expiry reminder (apps/mcp_access/renewal.py): same strip
   as .ops-banner, plus two 44pt actions. Colors come from the theme tokens. */
.expiry-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  font-size: 13px;
  padding: calc(6px + env(safe-area-inset-top)) 16px 6px;
  background: color-mix(in srgb, var(--brand) 20%, var(--color-surface));
  color: var(--color-text);
  border-bottom: 1px solid var(--color-nav-border);
}
.expiry-banner__text { flex: 1 1 200px; text-align: center; line-height: 1.4; overflow-wrap: anywhere; }
.expiry-banner__actions { display: flex; gap: 4px; }
.expiry-banner__actions form { margin: 0; }
.expiry-banner__btn {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
}
.expiry-banner__btn--primary { background: var(--brand); color: var(--brand-fg); }

/* ── Status pages (templates/errors/status_page.html: 400/404/500, CSRF, maintenance) ── */
.status-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
}

.status-page__icon {
  font-size: 40px;
}

.status-page__title {
  font-size: 20px;
  font-weight: 600;
}

.status-page__message {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 320px;
}

.status-page__action {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-fg);
  background: var(--brand);
  border-radius: 10px;
  padding: 13px 20px;
  text-decoration: none;
}

/* ── Team grid (club_team) ── */
.team-section { margin-bottom: 20px; }

.team-section__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 18px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 100ms ease-out;
}
.team-card:active { transform: scale(0.97); }

.team-card__photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.team-card__photo--placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.team-card__photo--warm   { background: linear-gradient(135deg, #c8763a, #7a3b1e); }
.team-card__photo--cool   { background: linear-gradient(135deg, #3a7ac8, #1e2f7a); }
.team-card__photo--olive  { background: linear-gradient(135deg, #8a9a3a, #4a531e); }
.team-card__photo--slate  { background: linear-gradient(135deg, #5a6a7a, #232c36); }
.team-card__photo--forest { background: linear-gradient(135deg, #2f8a5a, #16402c); }

.team-card__name {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.team-card__role {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-text-muted);
}

/* Pill badge - still used by the staff detail sheet. */
.team-card__badge {
  display: inline-block;
  margin: 6px 12px 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 11px;
  font-weight: 700;
}

/* ── Trainer finden (club_trainer) ── */
.trainer-hero {
  margin: 4px 0 16px;
  padding: 16px;
  border-radius: 20px;
  background: var(--color-surface);
}
.trainer-hero--set { background: color-mix(in srgb, var(--brand) 14%, var(--color-surface)); }

.trainer-hero__label { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.trainer-hero__row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.trainer-hero__body { flex: 1; min-width: 0; }
.trainer-hero__name { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.trainer-hero__hint { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--color-text-muted); }

/* Quiet text action, secondary to the filled primary button. */
.trainer-link {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: opacity 100ms ease-out;
}
.trainer-link:active { opacity: 0.5; }

.trainer-filter-bar {
  display: flex;
  gap: 8px;
  margin: 0 -16px 14px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trainer-filter-bar::-webkit-scrollbar { display: none; }
.trainer-filter-bar .filter-chip { flex: 0 0 auto; min-height: 36px; white-space: nowrap; transition: transform 100ms ease-out; }
.trainer-filter-bar .filter-chip:active { transform: scale(0.96); }

.trainer-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.trainer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 14px;
}
.trainer-card[hidden] { display: none; }

.trainer-card__clickable {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  cursor: pointer;
  transition: opacity 100ms ease-out;
}
.trainer-card__clickable:active { opacity: 0.6; }

.trainer-card__photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.trainer-card__photo--placeholder { display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.trainer-card__photo--warm   { background: linear-gradient(135deg, #c8763a, #7a3b1e); }
.trainer-card__photo--cool   { background: linear-gradient(135deg, #3a7ac8, #1e2f7a); }
.trainer-card__photo--olive  { background: linear-gradient(135deg, #8a9a3a, #4a531e); }
.trainer-card__photo--slate  { background: linear-gradient(135deg, #5a6a7a, #232c36); }
.trainer-card__photo--forest { background: linear-gradient(135deg, #2f8a5a, #16402c); }

.trainer-card__body { flex: 1; min-width: 0; }
.trainer-card__name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.trainer-card__desc { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: var(--color-text-muted); }

/* Seven-day availability strip: lit days are bookable. */
.trainer-week { display: flex; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.trainer-week__day {
  flex: 1;
  max-width: 34px;
  padding: 4px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
}
.trainer-week__day--on { color: var(--brand-fg); background: var(--brand); }

.trainer-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trainer-card__actions form { margin: 0; }

.trainer-card__book {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
  transition: transform 100ms ease-out;
}
.trainer-card__book:active { transform: scale(0.97); }

.trainer-card__current { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--color-text); }
.trainer-card__current svg { width: 16px; height: 16px; color: var(--brand); }

.trainer-any-card {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 20px;
  padding: 14px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: opacity 100ms ease-out;
}
.trainer-any-card:active { opacity: 0.6; }
.trainer-any-card__hint { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--color-text-muted); }

/* ── Staff-Detailkarte (club_team, geteilt mit club_trainer) ── */
.staff-detail {
  padding: 16px 16px 32px;
}

.staff-detail__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 260px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  margin-bottom: 14px;
}

.staff-detail__photo--placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 40px;
  font-weight: 700;
}

.staff-detail__name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}

.staff-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.staff-detail__specialty {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: -8px 0 16px;
}

.staff-detail__section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.staff-detail__bio {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0 0 20px;
  white-space: pre-line;
}

.staff-detail__book-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
}

/* ── Kurskalender (club_kurse), redesign D: day pills and one card per
   session on the page background (docs/notes/design.md). ── */
.kurse-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-strip {
  display: flex;
  gap: 6px;
  margin: 0 -16px 4px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }

.day-strip__day {
  flex: none;
  width: 52px;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 20px;
  background: var(--color-surface);
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s var(--ease-out-soft);
}
.day-strip__day:active { transform: scale(0.95); }

.day-strip__label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.day-strip__number {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.day-strip__day--selected {
  background: var(--brand);
  color: var(--brand-fg);
}

.kurse-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kurse-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  transition: box-shadow 0.4s ease;
}

.kurse-row[hidden] {
  display: none;
}

.kurse-row--highlight {
  box-shadow: 0 0 0 2px var(--brand);
}

.kurse-row__time {
  width: 62px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kurse-row__duration {
  display: block;
  margin-top: 1px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-muted);
}

.kurse-row__body {
  flex: 1;
  min-width: 0;
}

.kurse-row__name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.kurse-row__meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.kurse-row__action {
  flex-shrink: 0;
}

.kurse-row__book {
  min-height: var(--tap-min);
  border: 0;
  border-radius: 22px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out-soft);
}
.kurse-row__book:active { transform: scale(0.95); }
.kurse-row__book--secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.kurse-row__status {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Feedback (club_feedback) ── */
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
}

.feedback-card__question {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.feedback-stars {
  display: flex;
  gap: 4px;
}

.feedback-star {
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-nav-border);
}

.feedback-star svg {
  width: 100%;
  height: 100%;
}

.feedback-star--filled {
  color: #f5a623;
}

.feedback-card__toggle {
  display: inline-block;
  margin-top: 8px;
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.feedback-card__reason {
  margin-top: 8px;
}

.feedback-card__reason[hidden] {
  display: none;
}

.feedback-card__reason textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--color-nav-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
}

/* ── Mitgliedschaft (club_mitgliedschaft) ── */
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
}

.member-card__photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #1a1a1a;
  color: #4a4a4a;
}

.member-card__photo svg {
  width: 26px;
  height: 26px;
}

.member-card__body {
  flex: 1;
  min-width: 0;
}

.member-card__name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.member-card__club {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.member-card__tier {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  font-weight: 700;
}

.member-stats {
  display: flex;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 0;
  margin-top: 10px;
}

.member-stats__item {
  flex: 1;
  text-align: center;
  border-left: 1px solid var(--color-nav-border);
}

.member-stats__item:first-child {
  border-left: 0;
}

.member-stats__value {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.member-stats__label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.member-section {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 10px;
}

.member-section__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.member-section__title svg {
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
}

.member-trainer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-trainer-row__photo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--color-nav-border);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.member-trainer-row__body {
  flex: 1;
  min-width: 0;
}

.member-trainer-row__name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.member-trainer-row__meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.member-trainer-row__action {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.member-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.member-grid .member-section {
  margin-top: 0;
}

.member-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.member-macro {
  margin-bottom: 8px;
}

.member-macro__label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.member-macro__bar {
  height: 5px;
  border-radius: 3px;
  background: var(--color-nav-border);
  overflow: hidden;
}

.member-macro__bar-fill {
  height: 100%;
  background: var(--color-text);
  border-radius: 3px;
}

.member-kcal-goal {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.member-week-strip {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}

.member-week-strip__day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.member-week-strip__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.member-week-strip__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-nav-border);
}

.member-week-strip__dot--active {
  background: var(--brand);
}

.member-week-strip__day--today .member-week-strip__label {
  color: var(--color-text);
}

.member-week-strip__day--today .member-week-strip__dot {
  outline: 2px solid var(--color-text);
  outline-offset: 1px;
}

.member-week-plan__routine {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.member-contract-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--color-nav-border);
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.member-contract-row:first-child {
  border-top: 0;
}

.member-contract-row svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* ── Bottom sheet (openGym-style detail overlay) ────────────────
 * Background page stays mounted instead of navigating away — feels lighter
 * than a full page transition for "look at one thing" views (exercise
 * detail, map pin detail, ...). The dark backdrop below provides the
 * separation/focus cue; no blur on the background, same as native map apps
 * (Google/Apple Maps) where the map stays sharp under a sheet.
 */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 200;
}

.sheet-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 430px;
  max-height: 88dvh;
  background: var(--color-bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet--open {
  transform: translate(-50%, 0);
}

.sheet__handle {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--color-nav-border);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet__body {
  overflow-y: auto;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 16px));
}

/* Inner side padding for every fragment loaded into the sheet, so none of
   them runs edge to edge (UX-6.2). Full-page renders of the same fragments
   are already inset by their page wrapper (.routine-edit). */
.sheet-content {
  padding: 0 var(--sheet-pad-x);
}

.routine-edit .sheet-content {
  padding: 0;
}

/* Selection checkmark in a settings-style row (week-day picker, progression
   and intensifier pickers, equipment profile). Theme colour, not an inline
   --brand-fg, which is near-black on the dark surface. */
.check-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--brand-ink);
}

/* ── Account pages (Account bearbeiten, 2FA, assistant consent) ──
 * Full pages, not sheets (rule in docs/notes/identity-auth.md): header with
 * a back arrow, then the content scrolls with the page. Reuses the Settings
 * topbar/rows/cards so the area feels like Einstellungen's sibling.
 */
.account-body {
  min-height: 100dvh;
  background: var(--color-bg);
}

.account-shell {
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.account-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 0;
}

/* 44pt touch target (HIG) around the Settings back arrow. */
.account-back {
  width: 44px;
  height: 44px;
}

.account-title {
  font-size: 22px;
  font-weight: 700;
}

.account-page {
  padding: 16px 16px 24px;
}

.account-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 28px;
  text-align: center;
}

/* Rows meet the 44pt minimum even with a short label. */
.account-row {
  min-height: 52px;
}

.account-hint {
  padding: 0;
}

.account-hint--center {
  text-align: center;
  padding-bottom: 4px;
}

.account-avatar-single {
  align-self: center;
}

/* "Foto entfernen": shown by the profile page's script in place of the
   clear checkbox; danger-coloured text button, 44pt high. */
.avatar-remove-btn {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 4px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-danger);
  background: none;
  border: none;
  cursor: pointer;
}

/* ── Auth pages (login / register / invite / recovery / 2FA verify) ──
 * Full pages on their own minimal shell (base_auth.html): there's no tab to
 * mark active while you're signing in, so no bottom nav. Brand stage on top,
 * the form below it; the page scrolls normally. Not a sheet: no backdrop, no
 * close button - a protected link sends visitors here via /login/?next=...
 */
.auth-body {
  min-height: 100dvh;
  background: var(--color-bg);
}

.auth-main {
  padding-bottom: max(24px, env(safe-area-inset-bottom, 16px));
}

.auth-body .auth-page {
  padding-top: 8px;
}

/* Brand stage above the form: logo lockup with a heartbeat. Only
   transform/opacity animate; reduced motion gets the static lockup. */
.auth-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: calc(32px + env(safe-area-inset-top, 0px)) 0 24px;
  background: radial-gradient(ellipse 70% 80% at 50% 45%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%);
  pointer-events: none;
}

.auth-stage__logo { position: relative; width: 96px; height: 96px; margin-bottom: 14px; }
.auth-stage__mark {
  position: relative;
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--brand) 45%, transparent));
  animation: stage-in 700ms cubic-bezier(0.2, 0.9, 0.25, 1) both, stage-beat 2.6s ease-in-out 1.4s infinite;
}
.auth-stage__tile { fill: var(--brand); }
.auth-stage__pulse {
  fill: none;
  stroke: var(--brand-fg);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  animation: stage-draw 1100ms cubic-bezier(0.3, 0.7, 0.2, 1) 350ms both;
}

.auth-stage__ring {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 2px solid var(--brand);
  opacity: 0;
  animation: stage-ring 2.6s ease-out 1.4s infinite;
}
.auth-stage__ring--late { animation-delay: 1.9s; }

.auth-stage__name {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  animation: stage-rise 600ms cubic-bezier(0.2, 0.9, 0.25, 1) 250ms both;
}
.auth-stage__tag {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-muted);
  animation: stage-rise 600ms cubic-bezier(0.2, 0.9, 0.25, 1) 380ms both;
}

@keyframes stage-in { from { opacity: 0; transform: scale(0.82); } }
@keyframes stage-draw { from { stroke-dashoffset: 1; } }
@keyframes stage-rise { from { opacity: 0; transform: translateY(8px); } }
/* Double thump like a heartbeat, then rest. */
@keyframes stage-beat {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.05); }
  16% { transform: scale(1); }
  24% { transform: scale(1.035); }
  34% { transform: scale(1); }
}
@keyframes stage-ring {
  0% { opacity: 0.45; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.7); }
}

@media (max-height: 640px) { .auth-stage__tag { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .auth-stage__mark, .auth-stage__pulse, .auth-stage__name, .auth-stage__tag { animation: none; }
  .auth-stage__ring { display: none; }
}

/* ── Bottom nav (HIG: Tab Bar) ───────────────────────────────── */
/*
 * Apple HIG Tab Bar guidelines applied:
 * - Floats above content with translucent backdrop-filter
 * - Minimum touch target 44×44pt per item
 * - Icons above labels in portrait (compact)
 * - Filled icon for active tab, outline for inactive
 * - Labels: single words, 11pt, semibold when active
 * - Always visible, never hidden or disabled
 * - Safe-area aware via env(safe-area-inset-bottom)
 */
/* Floating tab bar (redesign D): a frosted pill that hovers above the
   content instead of a full-width strip. --nav-height is the whole space it
   claims from the bottom edge (bar + gap + safe area), so page padding,
   toasts and the rest timer keep clearing it without knowing its shape. */
.bottom-nav {
  position: fixed;
  bottom: var(--nav-gap);
  left: 50%;
  transform: translateX(-50%);
  width: calc(min(100vw, 430px) - 32px);
  height: var(--nav-bar-h);
  padding: 6px;
  border-radius: calc(var(--nav-bar-h) / 2);
  background: var(--color-nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px var(--color-nav-border), 0 10px 30px var(--color-shadow);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  z-index: 100;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  /* HIG: minimum 44×44pt touch target (the item is 52 tall) */
  min-width: 44px;
  min-height: 44px;
  border-radius: 26px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s, transform 0.38s var(--ease-spring);
}
.nav-item:active { transform: scale(0.94); transition-duration: 0.07s; }

/* inactive: outline icon */
.nav-item .icon-outline { display: block; }
.nav-item .icon-filled  { display: none; }

/* active: filled icon on a soft pill that pops in on arrival */
.nav-item.active { color: var(--color-text); }
.nav-item.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--color-surface-2);
  animation: d-pop 0.45s var(--ease-out-soft) backwards;
}

.nav-item.active .icon-outline { display: none; }
.nav-item.active .icon-filled  { display: block; }

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
}

/* ── Club Page ───────────────────────────────────────────────── */

/* Fallback: wenn kein :root{--brand} gesetzt ist, auf accent zurückfallen */
:root {
  --brand:    var(--color-accent);
  --brand-fg: var(--color-accent-fg);
}

.club-page {
  padding-bottom: 8px;
}

/* club_* sub-pages (Team, Kurse, Trainer, ...): the D title header
   (partials/title_header.html) scrolls with the content, so no clearance
   for a pinned header is needed any more; detail pages without a title
   header (announcement, staff, PT steps) still get the safe-area top. */
.club-subpage-content {
  padding: calc(env(safe-area-inset-top) + 12px) 16px 16px;
}
.club-subpage-content > .tab-header--sub { padding-top: 0; }

/* Club home header (redesign D): greeting and status tiles sit on the page
   background and scroll with the content - no brand-filled slab. The club's
   colour lives in the logo button and the tiles' shimmer. Sub-pages use the
   D title header instead (partials/title_header.html). */
.club-hero {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 4px;
}

.hero-widgets { margin-top: 14px; }

.hero-widgets-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

/* align-items: center keeps logo and buttons level with a two-line
   greeting's middle; a long nickname wraps instead of pushing them out. */
.club-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.club-header__identity {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.club-header__identity > div { min-width: 0; }

.club-logo {
  flex: none;
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: var(--brand-fg);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

button.club-logo {
  border: none;
  padding: 0;
  cursor: pointer;
}

.club-header__studio-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-header__greeting {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.club-header__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Kept for the Entdecken sheet/search bar, which still use it. */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-fg) 15%, transparent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-fg);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

/* Same photo/blobatar priority as .profile-avatar, scaled down for this
   header slot - falls through to the plain initials text above when
   neither is set (see club_header_context). */
.avatar-btn__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-btn__blob {
  display: flex;
  width: 100%;
  height: 100%;
}
.avatar-btn__blob svg {
  width: 100%;
  height: 100%;
}


/* Status tiles under the greeting: plain cards, the wide occupancy tile with
   the brand shimmer behind a big number and the day curve. */
.hero-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  min-width: 0;
}

.hero-card--wide {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

/* Opening-hours tile: status dot, label, closing time. */
.hero-card--dark {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 104px;
}

.occupancy-info {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.occupancy-label-small {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.occupancy-value {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.occupancy-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-good);
}

/* Day curve: one bar per hour slot; past slots dimmed, the current one in
   the brand colour. Bars grow in once, from the baseline. */
.occupancy-curve {
  position: relative;
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
}
.occupancy-curve__bar {
  width: 9px;
  border-radius: 4px;
  background: var(--color-idle);
  transform-origin: bottom;
  animation: d-grow 0.7s var(--ease-out-soft) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.occupancy-curve__bar--past { opacity: 0.5; }
.occupancy-curve__bar--now { background: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .occupancy-curve__bar { animation: none; }
}

.open-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-good);
  margin-bottom: 6px;
}

.open-dot--closed {
  background: var(--color-danger);
}

.open-small {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.open-time {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* Action Cards */
.action-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 12px;
}

/* One available target only: the tile spans the row instead of leaving a gap. */
.action-cards--single {
  grid-template-columns: 1fr;
}

.action-card {
  min-height: 104px;
  border-radius: var(--radius-card);
  padding: 14px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  background: var(--color-surface);
  color: var(--color-text);
}

.action-card svg {
  width: 26px;
  height: 26px;
}

.action-card--accent {
  background: var(--brand);
  color: var(--brand-fg);
}

.action-card__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.action-card__sub {
  margin-top: -6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.action-card--accent .action-card__sub { color: inherit; opacity: 0.75; }

/* Amenities */
.amenities-scroll {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.amenities-scroll::-webkit-scrollbar { display: none; }

.amenity-pill {
  flex-shrink: 0;
  background: var(--color-surface);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

/* Section */
.section {
  padding: 0 16px 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}

/* Classes: time-first cards in a horizontal scroller that bleeds off the
   right edge, like the design. */
.classes-scroll {
  display: flex;
  gap: 10px;
  margin-right: -16px;
  padding-right: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.classes-scroll::-webkit-scrollbar { display: none; }

.classes-empty {
  font-size: 14px;
  color: var(--color-text-muted);
  padding: 0 4px;
}

.class-card {
  flex: none;
  width: 164px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--color-surface);
  border-radius: var(--radius-tile);
  color: inherit;
  text-decoration: none;
}

.class-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.class-card__time {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.class-duration {
  flex: none;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.class-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.class-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-status { margin-top: auto; font-size: 13px; font-weight: 600; }
.status--booked    { color: var(--color-good); }
.status--waitlisted { color: #ff9500; }
.status--free      { color: var(--color-good); }
.status--full      { color: var(--color-text-muted); }

/* Announcements */
.announcements-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.announcements-scroll::-webkit-scrollbar { display: none; }

.announcement-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
}

.announcement-card--scroll {
  flex-shrink: 0;
  width: 260px;
  cursor: pointer;
}

.announcement-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ann-tag {
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ann-title {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ann-chevron {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.ann-body {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.announcement-card--scroll .ann-body {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ann-detail {
  padding: 16px 16px 32px;
}

.ann-detail__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ann-detail__date {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.ann-detail__title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.ann-detail__body {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.55;
  white-space: pre-line;
}

/* Shortcuts: round icon buttons with the label underneath. Five fit one
   row on a phone; more scroll sideways. */
.shortcuts-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * 4px) / 5);
  gap: 4px;
  padding: 0 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shortcuts-grid::-webkit-scrollbar { display: none; }

.shortcut-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-decoration: none;
  color: var(--color-text-muted);
}

.shortcut-item__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: d-pop 0.45s var(--ease-out-soft) backwards;
}

.shortcut-item svg {
  width: 22px;
  height: 22px;
}

.shortcut-item__label {
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .shortcut-item__icon { animation: none; }
}

/* Membership */
.membership-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}

.membership-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.membership-card__top svg {
  width: 16px;
  height: 16px;
}

.membership-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.membership-plan {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.membership-status {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}
/* The bright green is about 2:1 on a light card; a darker green passes AA. */
:root[data-theme="light"] .membership-status { color: #1d7a37; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .membership-status { color: #1d7a37; }
}

.membership-price {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}

.membership-end {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Profile page ────────────────────────────────────────────── */

.profile-page {
  padding: 32px 16px 16px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 28px;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  object-fit: cover; /* only applies when rendered as <img> (uploaded photo) */
}

/* Wraps an inline blobatar SVG (apps/user/avatar.py) - its own `background:
   circle` fill already covers the full circle, so the brand-color background
   above would never show through, but that's an implicit coincidence of the
   two shapes matching; making it explicit keeps this robust if either one
   changes independently. */
.profile-avatar--blob {
  background: transparent;
}
.profile-avatar--blob svg {
  width: 100%;
  height: 100%;
}

/* Idle animation for every blobatar render (this one, and .avatar-btn__blob
   in the CLUB header) - a blink, and every fourth blink a "look around"
   instead. One combined keyframe rather than two separate animations: both
   act on the same element (the eyes group, always the second <g> the SVG
   renders - see apps/user/avatar.py/fallback_avatar_svg), and two
   animations targeting the same property would just overwrite each other's
   `transform` instead of composing. 19.2s = four blink cycles (4.8s each);
   the first three dip briefly (scaleY), the fourth swaps that dip for a
   quick look left-then-right (translateX) so the loop doesn't read as
   mechanically identical every cycle. transform-box/-origin center the
   scale/shift on the eyes' own bounding box rather than the SVG's 0-100
   viewBox origin (top-left), which would otherwise scale/shift from the
   wrong point entirely. Off for anyone who asked for less motion - this is
   decorative, nothing depends on it running. */
.profile-avatar--blob svg > g:nth-of-type(2),
.avatar-btn__blob svg > g:nth-of-type(2) {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: blobatar-blink-and-glance 19.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .profile-avatar--blob svg > g:nth-of-type(2),
  .avatar-btn__blob svg > g:nth-of-type(2) {
    animation: none;
  }
}
@keyframes blobatar-blink-and-glance {
  0%, 23%, 25%, 48%, 50%, 73%, 75%, 95%, 100% { transform: scaleY(1) translateX(0); }
  24%, 49%, 74% { transform: scaleY(0.08) translateX(0); } /* blink */
  96.25% { transform: scaleY(1) translateX(-1.6px); } /* look around, 4th cycle only */
  97.5% { transform: scaleY(1) translateX(1.6px); }
  98.75% { transform: scaleY(1) translateX(0); }
}

/* Account bearbeiten's avatar picker (photo vs. blobatar) - two tappable
   options side by side, the active one marked with a brand-colored ring
   rather than a checkbox (see UserProfile.prefer_blob_avatar). */
.avatar-picker {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 4px;
}

.avatar-picker__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px;
  font: inherit;
  color: var(--color-text-muted);
  opacity: 0.5;
  cursor: pointer;
}

.avatar-picker__option .profile-avatar {
  margin-bottom: 0;
  box-shadow: 0 0 0 3px transparent;
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.avatar-picker__option--selected {
  opacity: 1;
  color: var(--color-text);
}

.avatar-picker__option--selected .profile-avatar {
  box-shadow: 0 0 0 3px var(--brand);
}

.avatar-picker__label {
  font-size: 12px;
  font-weight: 600;
}

/* Account bearbeiten's avatar field (apps/user/forms.py's custom
   ClearableFileInput template) - a restyled clear checkbox and a
   button-styled stand-in for the native file input, which browsers style
   too inconsistently ("Choose File" / "Datei auswählen" / ...) to match
   anything else on the page. */
.avatar-file-clear[hidden] { display: none; }
.avatar-file-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  cursor: pointer;
}

.avatar-file-clear__checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.avatar-file-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-nav-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

/* Visually hidden but still keyboard-focusable/accessible - the label
   above triggers it natively via `for`, same technique as any "custom
   file input" button. */
.avatar-file-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
}

.profile-email {
  font-size: 14px;
  color: var(--color-text-muted);
}

.profile-menu {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--color-text);
}

.profile-menu-item__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.profile-menu-item__icon svg {
  width: 22px;
  height: 22px;
}

.profile-menu-item__label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.profile-menu-item__chevron {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ── Auth pages (login / register) ──────────────────────────── */

.auth-page {
  padding: 48px 16px 16px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding-bottom: 28px;
}

.auth-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
  padding-bottom: 20px;
}

/* 2FA setup QR code (two_factor_setup.html) - a fixed white card
   regardless of theme, not var(--color-surface): a QR code needs a light
   background with a real quiet zone around it to scan reliably, which a
   dark-mode surface color would break. */
.auth-qr-wrap {
  width: fit-content;
  margin: 8px auto 24px;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
}

.auth-qr {
  display: block;
  width: 200px;
  height: 200px;
}

/* Connect invite (invite_connect.html, epic #156 T6): the member number
   the club assigned, so the member sees which membership they connect. */
.invite-member-card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.invite-member-card__label { color: var(--color-text-muted); font-size: 13px; }
.invite-member-card__number { font-weight: 700; font-variant-numeric: tabular-nums; }

/* "Auf diesem Gerät? ..." deep link (two_factor_setup.html) - shares
   .exercises-more's block/background/padding shape but is deliberately
   smaller and more spaced out than that class's default: it's a secondary
   path (most people scan the QR above), not another primary action
   competing with "Bestätigen und aktivieren". */
.auth-deep-link {
  margin: 0 0 24px;
  font-size: 13px;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 20px 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.auth-field input,
.auth-field textarea,
.auth-field select {
  font: inherit;
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-nav-border);
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 14px;
}

.auth-field input:focus,
.auth-field textarea:focus,
.auth-field select:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

.auth-errors {
  font-size: 13px;
  color: var(--color-danger);
  list-style: none;
}

.auth-submit {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-fg);
  background: var(--brand);
  border: none;
  border-radius: 14px;
  min-height: 50px;
  padding: 0 13px;
  cursor: pointer;
  transition: transform 100ms ease-out;
}
.auth-submit:active { transform: scale(0.98); }
/* Same look on an <a> (e.g. the backup-codes "done" link): a button centers
   its label itself, a link needs flex to do the same. */
a.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.auth-switch {
  text-align: center;
  padding-top: 20px;
}

.auth-switch a {
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.auth-switch a strong {
  color: var(--color-text);
}

/* Logout is a POST (Django 5 LogoutView rejects GET), so where the switch
   row needs an "Abmelden" action it is a form button that looks like the
   link next to it. */
.auth-switch form { margin: 0; }
.auth-switch__button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* ── Settings page ───────────────────────────────────────────── */

.settings-page {
  padding: 16px 16px 24px;
}

.settings-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 20px;
}

.settings-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--color-text);
}

.settings-back svg {
  width: 22px;
  height: 22px;
}

.settings-title {
  font-size: 28px;
  font-weight: 700;
}

.settings-section {
  padding-bottom: 24px;
}

.settings-section__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0 4px 8px;
}

.settings-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 10px 4px 0;
  line-height: 1.5;
}

/* Device status under "Pausenende melden" (push notifications): small text
   aligned with the row label, plus one text button. */
.settings-push {
  padding: 0 14px 12px calc(14px + 30px + 12px);
  border-bottom: 1px solid var(--color-nav-border);
}

.settings-push[hidden] {
  display: none;
}

/* The status belongs to the row above it: no divider between the two. */
.settings-row:has(+ .settings-push:not([hidden])) {
  border-bottom: none;
}

.settings-push__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.settings-push__action {
  min-height: var(--tap-min);
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: underline;
  cursor: pointer;
}

.settings-push__action[hidden] {
  display: none;
}

.settings-push__action:disabled {
  opacity: 0.5;
  cursor: default;
}

.settings-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px;
}

.settings-tip__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-tip__icon svg {
  width: 17px;
  height: 17px;
}

.settings-tip__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}

.settings-card {
  background: var(--color-surface);
  border-radius: 14px;
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-nav-border);
  /* A nav row (Zwei-Faktor-Authentifizierung, Account bearbeiten) is a plain
     <a>, not a <button> - reset the browser's default link styling so it
     reads the same as every other (div-based) settings row. */
  color: inherit;
  text-decoration: none;
}

.settings-row--last,
.settings-card .settings-row:last-child {
  border-bottom: none;
}

.settings-row--nav {
  cursor: pointer;
}

.settings-row__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.settings-row__icon svg {
  width: 18px;
  height: 18px;
}

.settings-row__icon--indigo { background: #5856d6; }
.settings-row__icon--blue   { background: #007aff; }
.settings-row__icon--teal   { background: #30b0c7; }
.settings-row__icon--orange { background: #ff9500; }
.settings-row__icon--green  { background: #34c759; }
.settings-row__icon--yellow { background: #ffcc00; }
.settings-row__icon--pink   { background: #ff2d55; }
.settings-row__icon--purple { background: #af52de; }

.settings-row__label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.settings-row__value {
  font-size: 15px;
  color: var(--color-text-muted);
}

.settings-row__chevron {
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.settings-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-muted) 25%, transparent);
  color: var(--color-text-muted);
  font-size: 11px;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

/* Toggle switch */
.settings-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.settings-toggle__track {
  width: 46px;
  height: 27px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-text-muted) 35%, transparent);
  display: block;
  position: relative;
  transition: background 0.2s ease;
}

.settings-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.settings-toggle input:checked + .settings-toggle__track {
  background: #34c759;
}

.settings-toggle input:checked + .settings-toggle__track .settings-toggle__thumb {
  transform: translateX(19px);
}

.settings-toggle input:focus-visible + .settings-toggle__track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Segmented control (display-only for now) */
.settings-segmented {
  display: flex;
  background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  border-radius: 8px;
  padding: 2px;
}

.settings-segmented__option {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 6px;
}

:where(button).settings-segmented__option {
  border: 0;
  background: none;
  font-family: inherit;
  min-height: var(--tap-min); /* the language switch is tappable */
  cursor: pointer;
}

.settings-segmented__option--active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Full-width variant for a choice of 2-3 labelled options (routine share level). */
.settings-segmented--full .settings-segmented__option {
  flex: 1;
  text-align: center;
  border: 0;
  background: transparent;
  font-family: inherit;
  min-height: 44px; /* HIG touch target */
  cursor: pointer;
}

.settings-segmented--full .settings-segmented__option--active {
  background: var(--color-surface);
}

.routine-share {
  margin: 12px 0 4px;
}

.routine-share__label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* ── Training page ───────────────────────────────────────────── */

.training-page {
  padding: 12px 16px 24px;
}

/* Week calendar / today (redesign D): one card with the week strip and an
   inset "today" block carrying the brand shimmer. */
.training-week-placeholder {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 6px 12px 12px;
  margin-bottom: 12px;
}

.training-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.training-week-nav__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.training-week-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-text-muted);
  text-decoration: none;
}

.training-week-nav__arrow svg {
  width: 18px;
  height: 18px;
}

.training-week-nav__arrow--disabled {
  opacity: 0.35;
}

.training-week-placeholder__row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 0 8px;
}

.training-week-placeholder__dot {
  justify-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-muted) 40%, transparent);
}

.training-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 72px;
  border: none;
  background: none;
  padding: 2px 0;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.38s var(--ease-spring);
}
.training-week-day:active { transform: scale(0.93); transition-duration: 0.07s; }

.training-week-day__letter {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.training-week-day__num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1;
}

.training-week-day__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.training-week-day__dot--done {
  background: var(--color-text);
}

.training-week-day__dot--missed {
  border: 1.5px solid var(--color-text-muted);
}

.training-week-day__rest-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6px;
  color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

.training-week-day__rest-icon svg {
  width: 18px;
  height: 18px;
  overflow: visible;
}

.training-week-day--today .training-week-day__letter {
  color: var(--color-text);
  font-weight: 700;
}

.training-week-day--today .training-week-day__num {
  background: var(--brand);
  color: var(--brand-fg);
  font-weight: 700;
  animation: d-pop 0.45s var(--ease-out-soft) 0.25s backwards;
}

.training-week-day--today .training-week-day__dot {
  display: none;
}

.training-today-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: 20px;
  padding: 14px;
}
.training-today-card .d-shimmer { right: -90px; top: -110px; width: 240px; height: 240px; }

.training-today-card__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.training-today-card__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
}

.training-today-card__icon svg {
  width: 22px;
  height: 22px;
}

.training-today-card__body {
  flex: 1;
  min-width: 0;
}

.training-today-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.training-today-card__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-today-card__subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: normal;
  margin-top: 1px;
}

.training-today-card__actions {
  position: relative;
  display: flex;
  gap: 8px;
}

.training-today-card__cta {
  flex: 1;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 25px;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.38s var(--ease-spring);
}

.training-today-card__secondary {
  flex: none;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 25px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.38s var(--ease-spring);
}
.training-today-card__cta:active,
.training-today-card__secondary:active { transform: scale(0.955); transition-duration: 0.07s; }

/* Tile grid */
.training-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.training-grid + .training-grid {
  margin-top: 12px;
}

.training-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--color-text);
  min-height: 104px;
}

.training-tile--accent {
  background: var(--brand);
  color: var(--brand-fg);
}

.training-tile--wide {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
  padding: 12px 14px;
  margin-top: 12px;
}

.training-tile--wide .training-tile__sub {
  display: block;
}

/* Habits + friends: two compact tiles side by side (one alone fills the row). */
.training-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.training-pair .training-tile--wide { margin-top: 0; }

.training-tile__icon {
  width: 26px;
  height: 26px;
}

.training-tile__icon svg {
  width: 24px;
  height: 24px;
}

.training-tile__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.training-tile__sub {
  font-size: 13px;
  color: var(--color-text-muted);
}
.training-tile--accent .training-tile__sub { color: inherit; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  .training-week-day--today .training-week-day__num { animation: none; }
  .training-week-day, .training-today-card__cta, .training-today-card__secondary { transition: none; }
}

.training-tile--locked {
  position: relative;
  opacity: 0.72;
}

.training-tile__lock {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.training-tile--accent .training-tile__lock {
  background: color-mix(in srgb, var(--brand-fg) 20%, transparent);
  color: var(--brand-fg);
}

.training-tile__lock svg {
  width: 13px;
  height: 13px;
}

.training-today-card__cta--locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.training-today-card__cta--locked svg {
  width: 15px;
  height: 15px;
}

.training-today-card__cta--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.training-today-card__cta--icon svg {
  width: 16px;
  height: 16px;
}

/* ── Exercises list ──────────────────────────────────────────── */

.exercises-page {
  padding: 16px 16px 24px;
}

.exercises-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
}

.exercises-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.exercises-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.exercises-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.exercises-search svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.exercises-search__input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--color-text);
  width: 100%;
  font-family: inherit;
}

.exercises-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
}

.exercises-chips::-webkit-scrollbar { display: none; }

.exercises-chips--secondary {
  padding-bottom: 14px;
}

.exercises-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* The session logger's picker renders its chips as <button>s (they filter
   in place, nothing to link to) - strip the native button chrome. */
button.exercises-chip {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.exercises-chip--on {
  background: var(--brand);
  color: var(--brand-fg);
}

.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercises-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--color-text);
}

.exercises-item__thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
}

.exercises-item__thumb svg {
  width: 24px;
  height: 24px;
}

.exercises-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exercises-item__title {
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercises-item__sub {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-attribution {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercises-item--routine {
  padding-right: 8px;
}

.exercises-item__link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.exercises-item__start-btn {
  flex-shrink: 0;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 12px;
}

.exercises-item__plan {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-fg);
  background: var(--brand);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.exercises-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.exercises-more {
  display: block;
  text-align: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

/* ── Exercise detail ─────────────────────────────────────────── */

.exercise-detail {
  padding: 16px var(--sheet-pad-x) 32px;
}

.exercise-detail__title {
  font-size: 24px;
  font-weight: 700;
  margin: 8px 0 14px;
}

.exercise-detail__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  background: var(--color-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* The muscle map takes the media slot until an animation exists (same card as in the routine). */
.exercise-detail__muscles {
  margin-top: 0;
  margin-bottom: 14px;
}

.exercise-detail__media svg {
  width: 64px;
  height: 64px;
}

.exercise-detail__media-hint {
  font-size: 12px;
}

.exercise-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.exercise-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text);
}

.exercise-tag--accent {
  background: var(--brand);
  color: var(--brand-fg);
}

.exercise-detail__plan-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  margin-bottom: 20px;
  font-family: inherit;
  cursor: pointer;
}

.session-finish-btn {
  border: none;
  border-radius: 14px;
  /* Readable default state: muted text on a faint tint read as disabled
     (UX-6.2); the brand fill still marks "everything logged". */
  background: color-mix(in srgb, var(--color-text) 12%, transparent);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  margin-bottom: 20px;
  font-family: inherit;
  cursor: pointer;
}

.session-finish-btn--complete {
  background: var(--brand);
  color: var(--brand-fg);
}

.session-menu {
  position: relative;
  margin-left: auto;
}

.session-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 50%;
}

.session-menu__trigger:hover {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}

.session-menu__trigger svg {
  width: 22px;
  height: 22px;
}

.session-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.session-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.session-menu__item:hover {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}

.session-menu__item--disabled {
  color: var(--color-text-muted);
  cursor: default;
}

.session-menu__item--disabled:hover {
  background: none;
}

.session-menu__item--danger {
  color: var(--color-danger);
}

.onerm-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.onerm-card__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.onerm-steppers {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.stepper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper[hidden] {
  display: none;
}

.stepper__label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.stepper__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  border-radius: 12px;
  padding: 6px 8px;
}

.stepper__btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  color: var(--color-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.stepper__value {
  font-size: 16px;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.onerm-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.onerm-result__label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.onerm-result__value {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-fg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .onerm-result__value { color: var(--brand); }
}
:root[data-theme="dark"] .onerm-result__value { color: var(--brand); }

.onerm-result__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.exercise-detail__section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.exercise-detail__steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exercise-detail__steps li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  padding-left: 4px;
}

.exercise-note {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.exercise-note--trainer {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.exercise-note__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.exercise-note__text {
  font-size: 14px;
  color: var(--color-text);
  white-space: pre-wrap;
}

.exercise-note-form__textarea {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  padding: 12px 14px;
  resize: vertical;
  margin-bottom: 10px;
}

.exercise-note-form__save-btn {
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  font-family: inherit;
  cursor: pointer;
}

/* ── Plan / routines list ────────────────────────────────────── */

.plan-page {
  padding: 16px 16px 24px;
}

.plan-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
}

.plan-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.plan-new-btn {
  border: none;
  border-radius: 20px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  font-family: inherit;
}

.routine-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.routine-icon svg {
  width: 22px;
  height: 22px;
}

/* ── Routine editor ──────────────────────────────────────────── */

.routine-edit {
  padding: 16px 16px 32px;
}

.routine-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.routine-name-input {
  flex: 1;
  border: none;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  font-family: inherit;
  min-width: 0;
}

.input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--color-text);
  font-family: inherit;
  resize: none;
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.routine-icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.routine-icon-btn svg {
  width: 20px;
  height: 20px;
}

.routine-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 14px 2px;
}

.routine-delete-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-danger) 15%, transparent);
  color: var(--color-danger);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  font-family: inherit;
  cursor: pointer;
}

/* Routine exercise rows */
.superset-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-fg);
  padding: 2px 4px;
  margin-top: 4px;
}

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .superset-label { color: var(--brand); } }
:root[data-theme="dark"] .superset-label { color: var(--brand); }

.routine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 10px 12px;
}

.routine-row--in-superset {
  border-left: 3px solid var(--brand);
}

.routine-row__fields {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.routine-row__body-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.routine-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.routine-link-btn,
.routine-remove-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.routine-link-btn svg,
.routine-remove-btn svg {
  width: 15px;
  height: 15px;
}

.session-entry__header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.session-entry__note-toggle {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.session-entry__note-toggle svg {
  width: 15px;
  height: 15px;
}

.session-entry__note-toggle--has-note {
  background: var(--brand);
  color: var(--brand-fg);
}

.session-entry__note-panel {
  margin-bottom: 10px;
}

.routine-link-btn--on {
  background: var(--brand);
  color: var(--brand-fg);
}

.routine-row__move {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.routine-move-btn {
  width: 22px;
  height: 15px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.routine-move-btn svg {
  width: 14px;
  height: 14px;
}

/* Muscle map — which muscles the routine's exercises train, shaded by relative volume */
.muscle-map-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.muscle-map {
  display: flex;
  gap: 20px;
}

.muscle-map__view {
  width: 90px;
  height: 158px;
}

.muscle-map__silhouette {
  fill: color-mix(in srgb, var(--color-text-muted) 18%, transparent);
}

.muscle-map__region {
  fill: color-mix(in srgb, var(--color-text-muted) 30%, transparent);
}

.muscle-map__region--l1 { fill: color-mix(in srgb, var(--brand) 25%, var(--color-text-muted) 30%); }
.muscle-map__region--l2 { fill: color-mix(in srgb, var(--brand) 50%, var(--color-text-muted) 20%); }
.muscle-map__region--l3 { fill: color-mix(in srgb, var(--brand) 75%, var(--color-text-muted) 10%); }
.muscle-map__region--l4 { fill: var(--brand); }

/* ── Workout log: active session ─────────────────────────────── */

.session-entry {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 8px;
}

.session-entry--in-superset {
  border-left: 3px solid var(--brand);
}

.session-entry > .superset-label {
  margin-top: 0;
  margin-bottom: 8px;
  padding: 0;
}

.session-entry__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.session-entry__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.25;
}

.session-entry__sets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 6%, transparent);
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
}

.session-set-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.session-set-header__phase {
  width: 22px;
  flex-shrink: 0;
}

.session-set-header__col {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-align: center;
}

.session-set-header__spacer {
  width: 56px;
  flex-shrink: 0;
}

.session-set {
  font-size: 13px;
  color: var(--color-text-muted);
}

.session-set--done {
  color: var(--color-text);
}

.session-set__pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  /* Names the record type ("PR Wdh. · 1RM · Volumen", up to four parts): small,
     but 11px so it stays readable, and it may wrap on a narrow phone. */
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brand-fg);
  background: var(--brand);
  border-radius: 6px;
  padding: 1px 6px;
  margin: 2px 0 3px 28px;
  max-width: calc(100% - 28px);
}

.session-set__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-set__phase {
  width: 22px;
  flex-shrink: 0;
  font-weight: 700;
  text-align: center;
}

.session-set__row--readonly {
  padding: 4px 0;
}

.session-set__value {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.session-set__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  font-family: inherit;
  text-align: center;
}

.session-set__toggle {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.session-set__toggle svg {
  width: 15px;
  height: 15px;
}

.session-set__toggle--on {
  background: var(--brand);
  color: var(--brand-fg);
}

.session-entry__add-set {
  width: 100%;
  border: none;
  background: none;
  color: var(--brand-fg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0 2px;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .session-entry__add-set { color: var(--brand); } }
:root[data-theme="dark"] .session-entry__add-set { color: var(--brand); }

/* ── Workout log: bodyweight check-in ────────────────────────── */
/* .bodyweight-checkin__value/__step/__number are a generic "stepper row"
   pattern also reused by the Ruhezeit setting (_rest_seconds_form.html) -
   keep them even though the bodyweight check-in itself no longer uses
   them (see the ruler slider below, added for that instead). */

.bodyweight-checkin__value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.bodyweight-checkin__step {
  width: 44px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bodyweight-checkin__number {
  min-width: 110px;
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
}

/* A draggable ruler (Fitbit-style, see _bodyweight_form.html) replaces the
   old +/-1kg step buttons for the bodyweight check-in itself - those
   capped every adjustment at 1kg jumps, which is fine for a small
   correction but tedious for a bigger one; a slider covers both with the
   same gesture (drag far for a big change, nudge for a precise one). */

.weight-slider__readout {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--color-text);
  margin: 8px 0 18px;
}

.weight-slider-wrap {
  position: relative;
}

.weight-slider {
  position: relative;
  height: 72px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  cursor: grab;
}

.weight-slider::-webkit-scrollbar {
  display: none;
}

.weight-slider--dragging,
.weight-slider:active {
  cursor: grabbing;
}

.weight-slider__track {
  position: relative;
  height: 100%;
  /* Three tick tiers baked into the background instead of one DOM element
     per subdivision - a tall tick every 10kg (aligned with the tick-label
     loop below), a medium one every 1kg (the actual selectable step - see
     STEP in _bodyweight_form.html), and a fine decorative one every
     0.25kg purely for the ruler's visual texture, not a selectable value.
     Dropping that fine tier earlier made the ruler read as a handful of
     sparse lines instead of a ruler - this restores the denser look
     while the slider still only ever lands on a whole kg. All three are
     centered vertically so the indicator line crosses through their
     middle. The 10kg tier is the app's text color so it reads as the
     "main" mark; the 1kg and 0.25kg tiers share the muted color so both
     read as subordinate to it rather than the 1kg tier looking like a
     second set of full-strength ticks. */
  background-image:
    repeating-linear-gradient(90deg, var(--color-text) 0 2.5px, transparent 2.5px 800px),
    repeating-linear-gradient(90deg, var(--color-text-muted) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--color-text-muted) 70%, transparent) 0 1px, transparent 1px 20px);
  background-repeat: repeat-x, repeat-x, repeat-x;
  background-position: center, center, center;
  background-size: 100% 74%, 100% 50%, 100% 26%;
}

.weight-slider__tick-label {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  white-space: nowrap;
  user-select: none;
}

.weight-slider__indicator {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  margin-left: -1px;
  background: var(--brand);
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
}

.weight-slider__indicator::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--brand);
}

/* ── Workout log: focus navigation, rest timer, progress, last-time ─── */

.session-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.session-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-align: center;
  margin: -4px 0 10px;
}

.session-nav {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 10px;
}

.session-nav[hidden] {
  display: none;
}

.session-nav__btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.session-nav__btn--next {
  background: var(--brand);
  color: var(--brand-fg);
}

.session-nav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.session-entry__last-time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.session-entry__recommendation {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.session-entry__recommendation-text {
  font-size: 12px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.session-entry__recommendation-actions {
  display: flex;
  gap: 8px;
}

.session-entry__recommendation-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text);
  cursor: pointer;
}

.session-entry__recommendation-btn[data-dismiss-recommendation] {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  background: transparent;
}

.session-set__input--effort {
  font-size: 12px;
}

/* ── Icon / progression picker overlays ──────────────────────── */

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.picker-overlay[hidden] {
  display: none;
}

.picker-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 80dvh;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: 20px 20px 0 0;
  padding: 0 var(--sheet-pad-x) calc(20px + env(safe-area-inset-bottom, 0px));
}

.picker-sheet__title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 14px;
}

.picker-sheet__group {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 14px 2px 8px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.icon-grid__item {
  aspect-ratio: 1;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-grid__item svg {
  width: 22px;
  height: 22px;
}

/* ── Exercise picker (inside routine editor sheet) ───────────── */

.exercises-item--picker {
  cursor: default;
}

.exercises-item__plan--btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.exercises-item__plan--added {
  background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  color: var(--color-text-muted);
}

.exercises-item__fav-form {
  display: inline-flex;
  flex-shrink: 0;
}

.exercises-item__fav {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
}

.exercises-item__fav--on {
  color: var(--brand);
}

/* ── Exercise config sheet (ExConfig) ────────────────────────── */

.exconfig__seg {
  display: flex;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 3px;
}

.exconfig__seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 4px;
  border-radius: 9px;
  cursor: pointer;
}

.exconfig__seg-btn--on {
  background: var(--color-bg);
  color: var(--color-text);
}

.exconfig__steppers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.exconfig__steppers .stepper {
  flex: 1 1 130px;
}

.exconfig__steppers[hidden] {
  display: none;
}

.sec {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 4px 2px 8px;
}

/* ── Week schedule (Plan page) ───────────────────────────────── */

/* Week plan grid (redesign D, training_plan/_week_schedule.html): seven
   equal columns inside the .plan-week card. */
.week-schedule {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 8px 12px;
}

.week-day {
  min-height: var(--tap-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-family: inherit;
  cursor: pointer;
}

.week-day__name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.week-day--today .week-day__name {
  font-weight: 700;
  color: var(--color-text);
}

/* Rest day: dashed outline; a routine: surface-2 with its icon; today:
   brand-filled whatever it holds. */
.week-day__tile {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1.5px dashed var(--color-idle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-day__tile--set {
  border: 0;
  background: var(--color-surface-2);
}

.week-day--today .week-day__tile {
  border: 0;
  background: var(--brand);
  color: var(--brand-fg);
}

.week-day__tile svg {
  width: 20px;
  height: 20px;
}

/* ── Routine ownership/sharing badges ────────────────────────── */

.routine-owner-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 18%, transparent);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.routine-owner-badge--public {
  color: var(--brand-fg);
  background: var(--brand);
}

/* ── Training stats: muscle card rows (recovery + soreness) ───── */

/* The body map's own .muscle-map is a flex row that needs a width to share
   between its two figures; inside this centring wrapper it would otherwise
   shrink to nothing (the absolute-positioned raster layers have no
   intrinsic width). */
.stats-body {
  padding: 4px 0 14px;
}
.stats-body > .muscle-map { width: 100%; }

.muscle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap-min);
  padding: 6px 0;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--color-text-muted) 16%, transparent);
  background: none;
  font-family: inherit;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
  transition: opacity 100ms ease-out;
}
.muscle-row:active { opacity: 0.55; }

.muscle-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.muscle-row__name { font-size: 15px; font-weight: 600; line-height: 1.2; }

/* Four-step recovery meter; filled steps take the colour of the current level. */
.fatigue-meter { display: flex; gap: 3px; flex: 0 0 auto; }
.fatigue-meter i {
  width: 14px;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--color-text-muted) 22%, transparent);
}
.fatigue-meter.level-l1 i:nth-child(-n+1) { background: color-mix(in srgb, var(--brand) 40%, var(--color-text-muted) 30%); }
.fatigue-meter.level-l2 i:nth-child(-n+2) { background: color-mix(in srgb, var(--brand) 62%, var(--color-text-muted) 20%); }
.fatigue-meter.level-l3 i:nth-child(-n+3) { background: color-mix(in srgb, var(--brand) 82%, var(--color-text-muted) 8%); }
.fatigue-meter.level-l4 i { background: var(--brand); }

.muscle-row__fatigue { font-size: 12px; color: var(--color-text-muted); }

.muscle-row__soreness {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
  color: var(--color-text);
}
.muscle-row__soreness--empty { background: none; border: 1px dashed color-mix(in srgb, var(--color-text-muted) 45%, transparent); color: var(--color-text-muted); font-weight: 500; }
.muscle-row__soreness.level-l2 { background: color-mix(in srgb, var(--brand) 30%, var(--color-surface)); }
.muscle-row__soreness.level-l3 { background: color-mix(in srgb, var(--brand) 60%, var(--color-surface)); }
.muscle-row__soreness.level-l4 { background: var(--brand); color: var(--brand-fg); }


/* ── Training stats: soreness check-in sheet ─────────────────── */

.soreness-checkin__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.soreness-checkin__option {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
}

/* ── Food ─────────────────────────────────────────────────────── */
/* Protein-first diary (apps/food, docs/FOOD_PLAN.md). Rules of this block:
   going over a goal is never drawn as an error (no red, bars simply stop at
   full), and water/supplement trackers take their colour from the habit
   they are (--habit, the theme-invariant habit palette). */

.food-page {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.food-note {
  background: color-mix(in srgb, var(--brand) 16%, var(--color-surface));
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}
.food-foot {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
  margin: 6px 12px 0;
}

/* Hero: the protein ring leads, calories sit beside it, fat and
   carbohydrates fold away below. */
.food-hero {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 18px 16px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  align-items: center;
}
.food-ring { position: relative; width: 132px; height: 132px; }
.food-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.food-ring__track,
.food-ring__fill { fill: none; stroke-width: 11; }
.food-ring__track { stroke: color-mix(in srgb, var(--color-text) 9%, transparent); }
.food-ring__fill {
  stroke: var(--brand);
  stroke-linecap: round;
  animation: food-ring 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes food-ring { from { stroke-dasharray: 0 100; } }
.food-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.food-ring__value { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.food-ring__unit { font-size: 12px; color: var(--color-text-muted); margin-top: 5px; }

.food-hero__side { min-width: 0; display: flex; flex-direction: column; }
.food-hero__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.food-hero__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
}
.food-hero__status svg { width: 18px; height: 18px; color: var(--brand-ink); }
:root[data-theme="dark"] .food-ring--done .food-ring__value { color: var(--brand); }
.food-kcal {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 9%, transparent);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 6px;
  row-gap: 7px;
}
.food-kcal__value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.food-kcal__value small { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
.food-kcal__goal { font-size: 12px; color: var(--color-text-muted); }
.food-kcal .food-bar { grid-column: 1 / -1; }

.food-bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 9%, transparent);
  overflow: hidden;
}
.food-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--color-text) 55%, transparent);
  transition: width 0.3s ease;
}

.food-macros { grid-column: 1 / -1; margin-top: 12px; }
.food-macros summary {
  list-style: none;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.food-macros summary::-webkit-details-marker { display: none; }
.food-macros summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}
.food-macros[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.food-macros__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 8px 2px 4px; }
.food-macro { display: flex; flex-direction: column; gap: 5px; }
.food-macro__name { font-size: 12px; color: var(--color-text-muted); }
.food-macro__value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.food-macro__value small { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }

/* Water and supplements */
.food-trackers { display: flex; flex-direction: column; gap: 10px; }
.food-water {
  background: var(--color-surface);
  border-radius: 18px;
  padding: 12px 14px 12px;
}
.food-water__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.food-water__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--habit);
  background: color-mix(in srgb, var(--habit) 16%, transparent);
}
.food-water__icon svg { width: 18px; height: 18px; }
.food-water__name { font-size: 15px; font-weight: 700; }
.food-water__count { margin-left: auto; font-size: 13px; color: var(--color-text-muted); }
.food-water__count b { color: var(--color-text); font-variant-numeric: tabular-nums; }
.food-water__steps { display: flex; flex-wrap: wrap; margin: 0 -3px; }
.food-glass {
  flex: 1 0 10%;
  max-width: 12.5%;
  min-width: 34px;
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.food-glass svg { width: 26px; height: 30px; overflow: visible; }
.food-glass__line {
  fill: none;
  stroke: color-mix(in srgb, var(--color-text) 26%, transparent);
  stroke-width: 1.7;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}
.food-glass__fill {
  fill: var(--habit);
  transform-origin: 50% 100%;
  transform-box: fill-box;
  transform: scaleY(0);
  transition: transform 0.28s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.food-glass--on .food-glass__fill { transform: scaleY(1); }
.food-glass--on .food-glass__line { stroke: var(--habit); }
/* Water: a column filling towards the day's goal (--fill), litres beside it. */
.food-tank-card {
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--color-surface);
}
.food-tank {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 132px;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--habit) 12%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--habit) 30%, transparent);
}
.food-tank__fill {
  position: absolute;
  inset: auto 0 0;
  height: var(--fill, 0%);
  background: linear-gradient(to top, var(--habit), color-mix(in srgb, var(--habit) 70%, white));
  transition: height 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
/* Quarter marks so the column reads as a measure. */
.food-tank::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), color-mix(in srgb, var(--color-text) 14%, transparent) calc(25% - 1px) 25%);
  -webkit-mask: linear-gradient(to right, transparent 0 60%, #000 60%);
  mask: linear-gradient(to right, transparent 0 60%, #000 60%);
  pointer-events: none;
}
.food-tank-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.food-tank-card__name { font-size: 15px; font-weight: 700; }
.food-tank-card__amount { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--color-text-muted); }
.food-tank-card__amount b { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; color: var(--color-text); font-variant-numeric: tabular-nums; }
.food-tank-card__goal { font-size: 13px; color: var(--color-text-muted); }
.food-tank-card__btns { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.food-tank-card__btns button {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, opacity 0.15s ease;
}
.food-tank-card__btns button:active:not(:disabled) { transform: scale(0.96); }
.food-tank-card__btns button:disabled { opacity: 0.4; cursor: default; }
.food-tank-card__btns svg { width: 18px; height: 18px; }
.food-tank-card__minus { width: var(--tap-min); background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text); }
.food-tank-card__plus { flex: 1; padding: 0 16px; background: var(--habit); color: #fff; }
.food-goalpick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px 42px; }
.food-chip--on { background: var(--color-text); color: var(--color-bg); }

.food-pop svg { animation: food-pop 0.3s ease; }
@keyframes food-pop { 40% { transform: scale(1.18); } }

.food-supps { display: flex; flex-wrap: wrap; gap: 8px; }
.food-supp {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 0 14px 0 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.food-supp__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--habit);
  background: color-mix(in srgb, var(--habit) 16%, transparent);
}
.food-supp__icon svg { width: 17px; height: 17px; }
.food-supp__check { width: 0; height: 16px; opacity: 0; transition: width 0.2s ease, opacity 0.2s ease; }
.food-supp--on { background: color-mix(in srgb, var(--habit) 20%, var(--color-surface)); }
.food-supp--on .food-supp__icon { background: var(--habit); color: var(--color-accent-fg); }
.food-supp--on .food-supp__check { width: 16px; opacity: 1; }
.food-supp--add { padding-left: 12px; color: var(--color-text-muted); background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 14%, transparent); }
.food-supp--add svg { width: 16px; height: 16px; }

/* Meals */
.food-meal { background: var(--color-surface); border-radius: 18px; padding: 4px 6px 6px 14px; }
.food-meal__head { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.food-meal__title { font-size: 16px; font-weight: 700; }
.food-meal__sum { margin-left: auto; font-size: 12px; color: var(--color-text-muted); text-align: right; }
.food-meal__sum b { color: var(--color-text); font-weight: 700; }
.food-meal__add {
  flex-shrink: 0;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
}
.food-meal__title + .food-meal__add { margin-left: auto; }
.food-meal__add svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
.food-meal__foot { padding: 4px 8px 8px 0; }

.food-entry,
.food-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 8px 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 7%, transparent);
  color: inherit;
  text-decoration: none;
}
.food-entry__text,
.food-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: inherit; text-decoration: none; }
.food-entry__name,
.food-row__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.food-entry__meta,
.food-row__meta { font-size: 12px; color: var(--color-text-muted); }
.food-entry__protein,
.food-row__protein { flex-shrink: 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.food-entry__protein small,
.food-row__protein small { font-size: 11px; font-weight: 600; color: var(--color-text-muted); }

.food-row__protein--labelled { text-align: right; line-height: 1.1; }
.food-row__protein--labelled span { display: block; font-size: 10px; font-weight: 600; color: var(--color-text-muted); }

.food-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.food-chip svg { width: 15px; height: 15px; }

.food-copyday__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 18px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--brand) 18%, var(--color-surface));
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.food-copyday__btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.food-copyday__btn b { display: block; font-size: 15px; }
.food-copyday__btn small { font-size: 12px; color: var(--color-text-muted); }

/* Sheets */
.food-sheet { padding-bottom: 24px; }
.food-sheetpage .food-sheet { padding-left: 0; padding-right: 0; }
.food-sheet__label { margin: 18px 2px 4px; }
.food-source { font-size: 13px; line-height: 1.45; color: var(--color-text-muted); text-align: center; margin: -8px 8px 14px; }
.food-empty { font-size: 14px; line-height: 1.5; color: var(--color-text-muted); text-align: center; padding: 22px 12px; }

.food-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  border-radius: 14px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.food-search svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-muted); }
.food-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.food-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.food-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.food-list .food-row:first-child { border-top: none; }
.food-row--static { padding-right: 0; }
.food-results__more { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }

.food-plus,
.food-row__del button {
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.food-plus { color: var(--brand-ink); }
.food-plus svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.food-plus__check { opacity: 0; }
.food-plus--done svg { background: var(--brand); color: var(--brand-fg); transform: scale(1.12); }
.food-plus--done .food-plus__plus { opacity: 0; }
.food-plus--done .food-plus__check { opacity: 1; }
.food-row__del button { color: var(--color-text-muted); }
.food-row__del svg { width: 18px; height: 18px; }

.food-amount__preview {
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  text-align: center;
}
.food-amount__big { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.food-amount__big b { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.food-amount__big span { font-size: 14px; font-weight: 600; color: var(--color-text-muted); }
.food-amount__small { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--color-text-muted); }
.food-amount__small b { color: var(--color-text); font-variant-numeric: tabular-nums; }
.food-amount__input {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-radius: 14px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.food-amount__input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.food-amount__input span { font-size: 15px; font-weight: 600; color: var(--color-text-muted); }
.food-amount__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }

.food-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  border: none;
  border-radius: 12px;
  padding: 3px;
  margin: 0 0 18px;
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.food-seg--2 { grid-template-columns: repeat(2, 1fr); }
.food-seg--3 { grid-template-columns: repeat(3, 1fr); }
.food-seg label { position: relative; display: block; }
.food-seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.food-seg span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 9px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
}
.food-seg input:checked + span {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.sheet .food-seg input:checked + span { background: var(--color-bg); }
.food-seg input:focus-visible + span { outline: 2px solid var(--brand-ink); outline-offset: 1px; }

.food-form { display: flex; flex-direction: column; }
.food-form .field-label { display: block; margin-top: 14px; }
.food-form__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.food-form__pair--wide { grid-template-columns: 1fr 84px; }
.food-form .exercise-detail__plan-btn { margin-top: 20px; }
.sheet .food-form .habit-input,
.food-input--inset,
.habit-input.food-input--inset { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.food-sheet__links { text-align: center; margin-top: -4px; }
.food-sheet__links a,
.food-danger-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
}
.food-danger-link { color: var(--color-danger); }

/* Setup and goals */
.food-intro { padding: 10px 4px 18px; }
.food-intro__title { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.food-intro__list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.food-intro__list li { display: flex; gap: 10px; font-size: 15px; line-height: 1.4; }
.food-intro__list svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
}
.food-setup__form,
.food-setup__form [data-when] { display: flex; flex-direction: column; gap: 12px; }
.food-setup__form [data-when][hidden] { display: none; }
.food-card {
  border: none;
  margin: 0;
  min-width: 0;
  background: var(--color-surface);
  border-radius: 18px;
  padding: 16px;
}
/* A <legend> normally sits on the fieldset's border; floated, it flows
   inside the card like any other heading. */
.food-card__title { display: block; float: left; width: 100%; padding: 0; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.food-card__title + * { clear: both; }
.food-title { flex: 1; min-width: 0; font-size: 22px; font-weight: 800; }
.food-card__sub { display: block; margin-top: 16px; }
.food-card__text { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.food-card .food-seg { margin-bottom: 0; }
.food-card .routine-hint { margin: 10px 0 0; }
.food-card .food-seg input:checked + span { background: var(--color-bg); }
.food-options { display: flex; flex-direction: column; gap: 8px; }
.food-option { position: relative; display: block; cursor: pointer; }
.food-option input { position: absolute; opacity: 0; }
.food-option__body {
  display: block;
  border-radius: 14px;
  padding: 11px 44px 11px 14px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 12%, transparent);
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.food-option__body b { display: block; font-size: 15px; }
.food-option__body small { font-size: 13px; color: var(--color-text-muted); }
.food-option__body::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 22%, transparent);
}
.food-option input:checked + .food-option__body {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  box-shadow: inset 0 0 0 2px var(--brand-ink);
}
.food-option input:checked + .food-option__body::after {
  background: var(--brand-ink);
  box-shadow: inset 0 0 0 5px var(--brand-ink), inset 0 0 0 10px var(--color-surface);
}
/* Checkbox options tick instead of filling a radio dot. */
.food-option input[type="checkbox"] + .food-option__body::after { border-radius: 6px; }
.food-option input[type="checkbox"]:checked + .food-option__body::after {
  box-shadow: none;
  background: var(--brand-ink) center / 14px no-repeat;
  -webkit-mask: none;
}
.food-option input[type="checkbox"]:checked + .food-option__body::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: 20px;
  top: 50%;
  width: 6px;
  height: 11px;
  margin-top: -8px;
  border-right: 2.2px solid var(--color-surface);
  border-bottom: 2.2px solid var(--color-surface);
  transform: rotate(45deg);
}
.food-option input:focus-visible + .food-option__body { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.food-check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; cursor: pointer; padding: 6px 0; }
.food-check input { flex-shrink: 0; width: 22px; height: 22px; margin: 0; accent-color: var(--brand-ink); }
.food-setup .exercise-detail__plan-btn { margin: 6px 0 0; }

.food-goals { display: flex; flex-direction: column; gap: 12px; }
.food-goals .routine-topbar { margin-bottom: 2px; }
.food-goalcard {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.food-goalcard__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.food-goalcard__value { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.food-goalcard__value small { font-size: 22px; font-weight: 700; color: var(--color-text-muted); }
.food-goalcard__why { font-size: 13px; color: var(--color-text-muted); }
.food-goalcard__row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 9%, transparent);
}
.food-goalcard__row b { display: block; font-size: 15px; margin-top: 3px; }
.food-goalcard__row small { display: block; font-size: 11px; color: var(--color-text-muted); }
.food-goalcard__row .food-goalcard__label { font-size: 10px; }
.food-goals__cta { display: block; text-align: center; text-decoration: none; margin: 0; }
.food-goals__section { margin: 12px 2px 0; }
.food-method summary { list-style: none; cursor: pointer; margin: 0; display: flex; align-items: center; justify-content: space-between; float: none; }
.food-method summary::-webkit-details-marker { display: none; }
.food-method summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}
.food-method[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.food-method[open] summary { margin-bottom: 10px; }
.food-method__body p { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.food-method__body .food-method__sources { font-size: 12px; color: var(--color-text-muted); margin-bottom: 0; }
.food-linkrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  background: var(--color-surface);
  border-radius: 18px;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}
.food-linkrow small { display: block; font-size: 13px; font-weight: 400; color: var(--color-text-muted); }
.food-linkrow svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--color-text-muted); }
.food-btn-quiet {
  align-self: flex-start;
  min-height: var(--tap-min);
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  margin-top: 14px;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.food-btn-quiet--danger { color: var(--color-danger); }

.food-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  border-radius: 14px;
  padding: 12px 8px 12px 14px;
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  color: inherit;
  text-decoration: none;
}
.food-hint__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.food-hint__text b { font-size: 15px; }
.food-hint__text small { font-size: 13px; color: var(--color-text-muted); }
.food-hint .food-bar { margin-top: 5px; }
.food-hint .food-bar span { background: var(--brand); }
.food-hint > svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand-ink);
}

@media (prefers-reduced-motion: reduce) {
  .food-ring__fill,
  .food-pop svg { animation: none; }
  .food-glass__fill,
  .food-tank__fill,
  .food-plus svg { transition: none; }
}

/* ── Entdecken (map + gym sheets) ───────────────────────────── */

.discover-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* OSM/ODbL requires visible attribution on the map at all times. Leaflet's
   default bottom-right placement sits under .bottom-nav (fixed, full-width,
   higher stacking context) and is invisible there - lift it above the nav
   and match the map-overlay pill style used elsewhere (search bar, filter
   button) instead of Leaflet's plain white default. */
.discover-map .leaflet-control-attribution {
  margin-bottom: calc(var(--nav-height) + 8px) !important;
  background: color-mix(in srgb, var(--color-surface) 85%, transparent);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
}

.discover-map .leaflet-control-attribution a {
  color: var(--color-text-muted);
}

.discover-searchbar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.discover-searchbar__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.discover-searchbar__input {
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding-right: 38px;
}

.discover-searchbar__clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-nav-border);
  color: var(--color-text-muted);
}

.discover-searchbar__clear[hidden] {
  display: none;
}

.discover-searchbar__clear svg {
  width: 13px;
  height: 13px;
}

.discover-searchbar__filter-btn {
  position: relative;
  flex-shrink: 0;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.discover-searchbar__filter-btn--active {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.discover-filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.discover-empty {
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  transform: translateY(-50%);
  z-index: 5;
  text-align: center;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.discover-empty__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.discover-empty__body {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.discover-filter-sheet .sheet__body {
  padding: 0 16px;
}

.discover-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

.discover-filter__title {
  font-size: 18px;
  font-weight: 700;
}

.discover-filter__reset {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.discover-filter__group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 16px 0 8px;
}

.discover-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-nav-border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.filter-chip--selected {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-fg);
}

.discover-filter__apply {
  margin: 24px 0 8px;
}

.gym-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.gym-pin--partner {
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  color: var(--color-accent-fg);
  border: 2px solid var(--color-surface);
}

.gym-pin--partner svg {
  width: 20px;
  height: 20px;
}

.gym-pin--claimed {
  width: 32px;
  height: 32px;
  background: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-accent);
}

.gym-pin--claimed svg {
  width: 15px;
  height: 15px;
}

.gym-pin--unclaimed {
  width: 14px;
  height: 14px;
  background: var(--color-surface);
  border: 2px solid var(--color-text-muted);
}

.gym-pin--selected {
  transform: scale(1.2);
}

/* Padding lives on the content itself, not its container: this same
   partial renders both as a full page (entdecken/gym_detail.html, inside
   .page-content, which has no horizontal padding of its own) and as a
   bottom sheet (.sheet__body, likewise unpadded so sheets that want
   edge-to-edge content - like the filter sheet's own chips - aren't
   fighting an inherited inset). Without this, the title/actions/detail
   rows sit flush against the sheet's rounded edge. */
.gym-detail {
  padding: 0 16px 16px;
}

.gym-detail__header {
  margin-bottom: 10px;
}

.gym-detail__title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gym-detail__verified {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.gym-detail__subline {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.gym-detail__status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 500;
}

.gym-detail__status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gym-detail__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gym-detail__status-text--open {
  color: var(--color-status-open);
}

.gym-detail__status-text--open .gym-detail__status-dot {
  background: var(--color-status-open);
}

.gym-detail__status-text--closed {
  color: var(--color-status-closed);
}

.gym-detail__status-text--closed .gym-detail__status-dot {
  background: var(--color-status-closed);
}

.gym-caption--muted {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: -6px 0 12px;
}

.gym-detail__description {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

/* Studio photos (ClubPhoto) as a sideways-scrolling strip that runs to the
   sheet's edges; one photo alone takes the full width instead of sitting as a
   lonely thumbnail. Width/height on the <img> reserve the space. */
.gym-photo-strip {
  display: flex;
  gap: 8px;
  margin: 14px -16px;
  padding: 0 16px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}

.gym-photo-strip::-webkit-scrollbar { display: none; }

.gym-photo-strip__tile {
  flex: 0 0 auto;
  width: 176px;
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  scroll-snap-align: start;
}

.gym-photo-strip__tile:only-child {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.gym-photo-strip__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gym-detail__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.gym-detail__actions-primary {
  flex: 1;
  margin-bottom: 0;
}

.btn-outline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--color-nav-border);
  border-radius: 14px;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
  cursor: pointer;
}

.btn-outline svg {
  width: 18px;
  height: 18px;
}

.gym-upsell-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
  border-radius: 16px;
  padding: 14px;
  margin-top: 18px;
}

.gym-upsell-box p {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.gym-recommend-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 18px;
  text-decoration: none;
  color: var(--color-text);
}

.gym-recommend-cta strong {
  display: block;
  font-size: 14px;
}

.gym-recommend-cta__sub {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.gym-recommend-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.text-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 14px 0;
  cursor: pointer;
  text-decoration: none;
}

/* Same reasoning as .gym-detail's padding above - this partial also
   renders inside both an unpadded .page-content and an unpadded
   .sheet__body. */
.gym-recommend {
  padding: 0 16px 16px;
}

.gym-recommend__header {
  margin-bottom: 8px;
}

.gym-recommend__gym-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.gym-recommend__gym-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gym-recommend__gym-icon svg {
  width: 22px;
  height: 22px;
}

.gym-recommend__gym-name {
  font-size: 16px;
  font-weight: 700;
}

.gym-recommend__body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.check-list__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.check-list__item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-accent);
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.gym-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 24px;
}

.gym-link-box__url {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gym-link-box__copy {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────────────
   Studio dashboard (B2B, /studio/)

   The member app is a 430px phone shell; this is a full-width desktop
   layout. They share every colour token above — that is what keeps them one
   product — but no structure, so everything here is namespaced `studio-`
   and cannot leak into member screens.

   Two tokens are studio-only: a dark sidebar that stays dark in both themes
   (the mockup's signature), and a canvas slightly off the surface colour so
   white cards read as raised.
   ───────────────────────────────────────────────────────────────────── */
:root {
  --studio-sidebar-bg:    #14140f;
  --studio-sidebar-fg:    #f2f2f7;
  --studio-sidebar-muted: #8a8a80;
  --studio-canvas:        color-mix(in srgb, var(--color-text) 4%, var(--color-bg));
  --studio-border:        color-mix(in srgb, var(--color-text) 12%, transparent);
}

/* Overrides the member app's `html, body { max-width: 430px; margin: 0 auto }`
   (near the top of this file) - that rule has no class guard, so it applies
   here too via plain element selector. Both html AND body need the override:
   body doesn't inherit max-width from html, but html itself stays clipped to
   430px otherwise, capping everything inside it regardless of body's own
   width. base_studio.html sets `studio-html` on <html> and `studio-body` on
   <body> for exactly this. */
.studio-html,
.studio-body {
  max-width: none;
}

.studio-body {
  margin: 0;
  background: var(--studio-canvas);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Scrollbars: slim, theme-coloured, and quiet until the pointer is over the
   scroll area. Standard properties first (Chrome 121+, Firefox, Safari 18.2+),
   the ::-webkit-scrollbar block is for older Safari/iPad. Scoped to the
   studio so the member app keeps its own look. The sidebar stays dark in both
   themes, so it gets light thumb colours. */
.studio-html {
  --studio-scroll-thumb: color-mix(in srgb, var(--color-text) 22%, transparent);
  --studio-scroll-thumb-hover: color-mix(in srgb, var(--color-text) 42%, transparent);
}
.studio-html * {
  scrollbar-width: thin;
  scrollbar-color: var(--studio-scroll-thumb) transparent;
}
.studio-html *:hover {
  scrollbar-color: var(--studio-scroll-thumb-hover) transparent;
}
.studio-html *::-webkit-scrollbar { width: 10px; height: 10px; }
.studio-html *::-webkit-scrollbar-track { background: transparent; }
.studio-html *::-webkit-scrollbar-thumb {
  background-color: var(--studio-scroll-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.studio-html *::-webkit-scrollbar-thumb:hover {
  background-color: var(--studio-scroll-thumb-hover);
  background-clip: content-box;
}
.studio-nav { --studio-scroll-thumb: rgba(255, 255, 255, .22); --studio-scroll-thumb-hover: rgba(255, 255, 255, .42); }

/* Status text colours. The bright greens/oranges read well on the dark
   studio but fail contrast (about 2:1) on the light one, so light mode gets
   darker shades. The muted grey is a touch darker too: on the studio canvas
   (darker than a card) the shared value was 4.48:1, just under AA. */
.studio-html { --studio-ok-text: #2dc76d; --studio-warn-text: #f5a623; --studio-bad-text: #ff7a59; }
:root[data-theme="light"].studio-html {
  --studio-ok-text: #167a3c; --studio-warn-text: #8a5300; --studio-bad-text: #b3341a;
  --color-text-muted: #58585c;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]).studio-html {
    --studio-ok-text: #167a3c; --studio-warn-text: #8a5300; --studio-bad-text: #b3341a;
    --color-text-muted: #58585c;
  }
}

/* Native file inputs: the browser's white "Datei auswählen" button clashes
   with the dark studio. Same look as the other secondary studio buttons. */
.studio-html input[type="file"] { font: inherit; font-size: 13px; color: var(--color-text-muted); max-width: 100%; }
.studio-html input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  padding: 7px 14px;
  margin-right: 10px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.studio-html input[type="file"]::file-selector-button:hover {
  background: var(--studio-canvas);
  border-color: color-mix(in srgb, var(--color-text) 28%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .studio-html input[type="file"]::file-selector-button { transition: none; }
}

.studio { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top bar ── */
.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--studio-border);
}

/* Collapsible side navigation (button in the top bar, narrow screens only;
   the state class is set on <html> from base_studio.html). Wide screens
   always show the navigation, so the button and the rule live in the media
   query. */
.studio-nav-toggle { display: none; flex: 0 0 auto; }
@media (max-width: 1100px) {
  .studio-nav-toggle { display: inline-grid; place-items: center; }
  .studio-nav-collapsed .studio-nav { display: none; }
}

.studio-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }

.studio-brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 17px;
}

.studio-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.studio-brand__name { font-size: 15px; font-weight: 700; }
.studio-brand__sub  { font-size: 11px; color: var(--color-text-muted); }

.studio-topbar__actions { display: flex; align-items: center; gap: 10px; }

.studio-icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--studio-border);
  background: transparent;
  color: var(--color-text);
  font-size: 15px;
  cursor: pointer;
}

.studio-avatar {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}

/* Blobatar's own SVG already paints a circular background (see
   apps/user/avatar.py) - the brand fill behind it here would only show as
   a mismatched ring around the SVG's edges. */
.studio-avatar--blob { background: none; }

.studio-logout { margin: 0; }

.studio-logout__btn {
  border: 1px solid var(--studio-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.studio-logout__btn:hover { color: var(--color-text); }

/* ── Layout ── */
.studio-body-row { display: flex; flex: 1; min-height: 0; }

/* ── Sidebar ── */
.studio-nav {
  flex: 0 0 220px;
  background: var(--studio-sidebar-bg);
  color: var(--studio-sidebar-fg);
  padding: 16px 12px;
  overflow-y: auto;
}

/* On long pages the document scrolls, and a sidebar that scrolled away with it
   left a blank dark column. Keep it in view (own scrolling if it is taller
   than the window). Not in the stacked phone layout, where it is a top strip. */
@media (min-width: 721px) {
  .studio-nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; }
}

.studio-nav__group { margin-bottom: 18px; }

.studio-nav__group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--studio-sidebar-muted);
  padding: 0 10px 6px;
}

.studio-nav__item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--studio-sidebar-fg);
  text-decoration: none;
}

a.studio-nav__item:hover {
  background: color-mix(in srgb, var(--studio-sidebar-fg) 10%, transparent);
}

.studio-nav__item--active {
  background: var(--brand);
  color: var(--brand-fg);
  font-weight: 700;
}

/* Planned modules: visible so the structure is legible, clearly not clickable. */
.studio-nav__item--soon { color: var(--studio-sidebar-muted); cursor: default; }

/* ── Canvas ── */
.studio-canvas {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 48px;
  overflow-y: auto;
}

.studio-page-head { margin-bottom: 20px; }
.studio-page-head__title { margin: 0; font-size: 26px; font-weight: 700; }
.studio-page-head__sub { margin: 4px 0 0; font-size: 14px; color: var(--color-text-muted); }

/* ── Stat cards ── */
.studio-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.studio-stat {
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  padding: 18px 20px;
}

.studio-stat__value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.studio-stat__label { margin-top: 4px; font-size: 13px; color: var(--color-text-muted); }

/* ── Content cards ── */
.studio-card {
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.studio-card--nudge { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.studio-card__title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.studio-card__hint { margin: 10px 0 0; font-size: 12px; color: var(--color-text-muted); }

.studio-checklist { margin: 0; padding: 0; list-style: none; }
.studio-checklist__item { display: flex; gap: 10px; font-size: 14px; padding: 5px 0; }
.studio-checklist__mark { color: var(--color-text-muted); }

.studio-list { margin: 0; padding: 0; list-style: none; }

.studio-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--studio-border);
}

.studio-list__row:last-child { border-bottom: 0; }
.studio-list__main { font-size: 14px; }
.studio-list__meta { font-size: 12px; color: var(--color-text-muted); }

.studio-empty { margin: 0; font-size: 14px; color: var(--color-text-muted); }
/* Inline links in hints/empty states: without this they fall back to the
   browser's default dark blue, unreadable on the dark surface. */
.studio-empty a, .studio-card__hint a { color: var(--color-text); text-decoration: underline; text-underline-offset: 2px; }

/* ── Inline row forms (trainer assignment, routine assignment) ── */
.studio-list__row--form { flex-wrap: wrap; }
.studio-list__form { display: flex; align-items: center; gap: 8px; }

.studio-select,
.studio-text-input {
  font: inherit;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 6px 10px;
}

.studio-btn-sm {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-fg);
  background: var(--brand);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.studio-btn-sm:hover { opacity: 0.9; }

.studio-btn-sm--danger { color: #fff; background: #c93a3a; }  /* #d64545 was 4.4:1 with white text */
.studio-btn-sm--on { outline: 2px solid var(--brand); outline-offset: 1px; }

.studio-back-link {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
}
.studio-back-link:hover { color: var(--color-text); }

/* ── Forms (routine editor) ── */
.studio-form-row { margin-bottom: 12px; }
.studio-form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.studio-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
}

.studio-card__title--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.studio-card__title--sub {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.studio-section-spacer { margin-top: 20px; }

.studio-list__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── Chips (body-part filter) ── */
.studio-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-chips form { display: contents; }

.studio-chip {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.studio-chip:hover { color: var(--color-text); }
.studio-chip--on { color: var(--brand-fg); background: var(--brand); border-color: var(--brand); }

/* ── Favorite star toggle ── */
.studio-star-form { display: inline-flex; }

.studio-star-btn {
  font-size: 16px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--studio-border);
  padding: 4px;
}
.studio-star-btn--on { color: var(--brand); }
.studio-star-btn:hover { color: var(--brand); }

.studio-customer-block { margin-bottom: 18px; }
.studio-customer-block:last-child { margin-bottom: 0; }
.studio-customer-block .studio-list { margin-top: 4px; margin-left: 4px; }

.studio-avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}

.studio-avatar-preview--placeholder {
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 24px;
  font-weight: 700;
}

/* ── Login ── */
.studio-body--auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.studio-auth { width: 100%; max-width: 380px; }
.studio-auth__brand { text-align: center; margin-bottom: 22px; }

.studio-auth__mark {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 26px;
}

.studio-auth__name { margin: 0; font-size: 26px; font-weight: 700; }

.studio-auth__kicker {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.studio-auth__card {
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  padding: 22px;
}

.studio-auth__title { margin: 0; font-size: 19px; font-weight: 700; }
.studio-auth__sub { margin: 4px 0 18px; font-size: 13px; color: var(--color-text-muted); }

.studio-auth__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.studio-auth__card input,
.studio-auth__card textarea,
.studio-auth__card select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  background: var(--studio-canvas);
  color: var(--color-text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

/* Replaces the browser's default focus ring (thick, square-cornered, breaks
   out of the input's own border-radius) with one that matches it. The email
   field carries `autofocus`, so this is visible on every page load. */
.studio-auth__card input:focus,
.studio-auth__card textarea:focus,
.studio-auth__card select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* Also used as an <a> (claim_landing's CTA, claim_status' "Zum Dashboard"),
   not just the login/claim-request <button> it was designed for - these
   three are no-ops on a button but make an anchor behave like one. */
.studio-auth__submit {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-fg);
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* Brand-colored outline would nearly vanish against this button's own
   brand-colored background, so the ring uses --color-text instead - same
   fix the inputs above already needed, just against a different ground. */
.studio-auth__submit:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.studio-auth__error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-danger);
  font-size: 13px;
}

.studio-auth__error p { margin: 0; }
.studio-auth__error ul { margin: 0; padding-left: 18px; }

.studio-auth__foot { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--color-text-muted); }
.studio-auth__foot a,
.studio-auth__sub a { color: var(--color-text); }

/* ── Claim status (studio/claim_status.html) ── */
.claim-status-detail {
  margin: 18px 0 0;
  padding: 4px 0 0;
  border-top: 1px solid var(--studio-border);
}

.claim-status-detail__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
}

.claim-status-detail__row + .claim-status-detail__row {
  border-top: 1px solid var(--studio-border);
}

.claim-status-detail__row dt {
  font-size: 12px;
  color: var(--color-text-muted);
}

.claim-status-detail__row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: break-word;
}

/* Narrow screens: the sidebar becomes a horizontal strip above the canvas.
   The dashboard is laptop/tablet-first by design, but an operator checking
   something on a phone should not hit a broken layout. */
@media (max-width: 720px) {
  .studio-body-row { flex-direction: column; }
  .studio-nav { flex: none; display: flex; gap: 16px; overflow-x: auto; padding: 12px; }
  .studio-nav__group { margin-bottom: 0; }
  .studio-nav__group-label { white-space: nowrap; }
  .studio-canvas { padding: 20px 16px 32px; }
  /* The top bar (brand + 2 text buttons + theme + avatar + logout) is wider
     than a phone: let it wrap instead of pushing the whole page sideways,
     which also clipped the logout button off-screen. */
  .studio-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .studio-topbar__actions { flex-wrap: wrap; gap: 8px; min-width: 0; }
}

/* ─────────────────────────────────────────────────────────────────────
   Studio dashboard v2 components (Dashboard KPIs, Setup-Checklist,
   Mitglieder, Statistiken, Kurse, Mitteilungen, Studio-Profil).

   Ported from a Claude Design mockup ("Studio Dashboard") - class names
   and layout intentionally mirror that source so the two stay easy to
   diff against each other. Colours/radii route through the existing
   --color- and --brand tokens above rather than the mockup's own --ink/--bg
   names, so these components stay in sync with the rest of the app's
   theming instead of forking it.
   ───────────────────────────────────────────────────────────────────── */

/* ── Dashboard overview: KPI cards + setup checklist ──
   .studio-canvas (the shared page frame) already scrolls itself and owns
   the page padding, so this can't be a second inset flex row without a
   defined height - it's a normal row instead, and the setup sidebar
   scrolls with the page rather than independently. */
.studio-overview { display: flex; align-items: flex-start; gap: 24px; margin: -28px -32px; padding: 28px 32px 48px; }
.studio-overview-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.studio-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .studio-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.studio-kpi-card { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; }
/* Cards that lead somewhere: keep the card look, drop link styling, and give
   mouse and keyboard users the same visible response. */
.studio-kpi-card--link { color: inherit; text-decoration: none; transition: border-color 120ms ease-out, transform 120ms ease-out; }
.studio-kpi-card--link:hover { border-color: var(--brand); }
.studio-kpi-card--link:active { transform: scale(0.98); }
.studio-kpi-card--link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.studio-list__link { color: inherit; text-decoration: none; }
.studio-list__link:hover { text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .studio-kpi-card--link { transition: none; } .studio-kpi-card--link:active { transform: none; } }
.studio-kpi-card__top { display: flex; align-items: center; justify-content: space-between; }
.studio-kpi-card__icon { width: 32px; height: 32px; border-radius: 9px; background: var(--studio-canvas); display: grid; place-items: center; color: var(--color-text-muted); flex: 0 0 auto; }
.studio-kpi-card__delta { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.studio-kpi-card__delta--pos { background: color-mix(in srgb, #2dc76d 14%, transparent); color: #1a8a4a; }
.studio-kpi-card__delta--neg { background: color-mix(in srgb, #d9542c 11%, transparent); color: #b03020; }
.studio-kpi-card__delta--neu { background: var(--studio-canvas); color: var(--color-text-muted); }
.studio-kpi-card__value { font-weight: 800; font-size: 28px; letter-spacing: -0.5px; line-height: 1; }
.studio-kpi-card__label { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }

.studio-setup-sidebar { width: 316px; flex: 0 0 auto; border: 1px solid var(--studio-border); border-radius: 16px; background: var(--color-surface); display: flex; flex-direction: column; overflow: hidden; }
.studio-setup-sidebar__head { padding: 10px 12px; border-bottom: 1px solid var(--studio-border); display: flex; align-items: center; gap: 8px; min-height: 44px; }
.studio-setup-sidebar__title { font-weight: 700; font-size: 13px; flex: 1; }
.studio-setup-sidebar__pct { font-weight: 800; font-size: 18px; }
.studio-setup-sidebar__body { padding: 14px 14px 28px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) {
  .studio-overview { flex-direction: column; }
  .studio-setup-sidebar { width: 100%; }
}
/* Must follow the .studio-overview rule above: its negative margin cancels
   the canvas padding, which is smaller on phones (16px, see the 720px block),
   so the desktop -32px pushed the page 16px past the screen edge. */
@media (max-width: 720px) {
  .studio-overview { margin: -20px -16px; padding: 20px 16px 32px; }
}

.studio-setup-progress { height: 4px; background: var(--studio-border); border-radius: 4px; overflow: hidden; }
.studio-setup-progress__bar { height: 100%; background: var(--brand); border-radius: 4px; }

.studio-setup-phase { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 16px; overflow: hidden; }
.studio-setup-phase__head { padding: 11px 16px; background: var(--studio-canvas); border-bottom: 1px solid var(--studio-border); display: flex; align-items: center; gap: 8px; }
.studio-setup-phase__icon { width: 26px; height: 26px; border-radius: 8px; background: var(--color-surface); border: 1px solid var(--studio-border); display: grid; place-items: center; flex: 0 0 auto; color: var(--color-text-muted); font-size: 12px; }
.studio-setup-phase__icon--done { background: var(--brand); border-color: transparent; color: var(--brand-fg); }
.studio-setup-phase__title { font-weight: 700; font-size: 13px; flex: 1; }
.studio-setup-phase__count { font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
.studio-setup-phase__count--done { color: var(--brand-fg); }

.studio-setup-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--studio-border); }
.studio-setup-item:first-child { border-top: none; }
.studio-setup-item--done { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.studio-setup-item__box { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; background: var(--studio-canvas); border: 1.5px solid var(--studio-border); display: grid; place-items: center; font-size: 11px; }
.studio-setup-item--done .studio-setup-item__box { background: var(--brand); border-color: transparent; color: var(--brand-fg); }
.studio-setup-item__label { display: block; font-size: 13.5px; font-weight: 600; }
.studio-setup-item--done .studio-setup-item__label { color: var(--color-text-muted); text-decoration: line-through; }
.studio-setup-item__desc { font-size: 11.5px; color: var(--color-text-muted); font-weight: 500; }

.studio-setup-cta { background: var(--color-text); color: var(--color-bg); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.studio-setup-cta__kicker { font-size: 10.5px; font-weight: 700; opacity: .5; text-transform: uppercase; letter-spacing: .5px; display: block; }
.studio-setup-cta__label { font-weight: 700; font-size: 14.5px; display: block; margin-top: 2px; }
.studio-setup-cta__btn { height: 34px; padding: 0 14px; border-radius: 9px; background: var(--brand); color: var(--brand-fg); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap; }

.studio-setup-done { background: color-mix(in srgb, var(--brand) 14%, transparent); border: 1.5px solid color-mix(in srgb, var(--brand) 45%, transparent); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }

/* ── Toolbar: search + filter tabs + actions (Mitglieder) ── */
.studio-toolbar { padding: 12px 0; border-bottom: 1px solid var(--studio-border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.studio-toolbar__search { position: relative; flex: 1 1 200px; min-width: 160px; }
.studio-toolbar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.studio-toolbar__search input { width: 100%; height: 35px; border: 1.5px solid var(--studio-border); border-radius: 10px; padding-left: 32px; padding-right: 12px; font-size: 13px; font-weight: 500; background: var(--studio-canvas); color: var(--color-text); }
.studio-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.studio-filter-tab { height: 35px; padding: 0 11px; border-radius: 9px; font-weight: 700; font-size: 12px; background: var(--studio-canvas); color: var(--color-text-muted); border: 1.5px solid var(--studio-border); white-space: nowrap; }
.studio-filter-tab--on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.studio-filter-tab__count { opacity: .5; margin-left: 3px; }
.studio-toolbar__actions { display: flex; gap: 6px; margin-left: auto; }
.studio-btn { height: 35px; padding: 0 13px; border-radius: 9px; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.studio-btn--ghost { background: var(--studio-canvas); color: var(--color-text); border: 1.5px solid var(--studio-border); }
.studio-btn--brand { background: var(--brand); color: var(--brand-fg); }

/* ── Member table ── */
.studio-table { width: 100%; border-collapse: collapse; }
.studio-table thead th { font-size: 10px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; text-align: left; padding: 5px 12px; }
.studio-table tbody tr { cursor: pointer; }
.studio-table tbody tr:hover td { background: var(--studio-canvas); }
.studio-table tbody tr.is-selected td { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.studio-table td { padding: 9px 12px; border-top: 1px solid var(--studio-border); font-size: 12.5px; }
.studio-table td:first-child { border-radius: 11px 0 0 11px; }
.studio-table td:last-child { border-radius: 0 11px 11px 0; }

.studio-table__member { display: flex; align-items: center; gap: 10px; }
.studio-table__name { font-weight: 700; display: block; }
.studio-table__meta { font-size: 11px; color: var(--color-text-muted); font-weight: 500; }

.studio-av { width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto; color: var(--brand-fg); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; }

.studio-status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.studio-status-badge__dot { width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto; }
.studio-status-badge--active { background: rgba(45,199,109,.12); color: var(--studio-ok-text); }
.studio-status-badge--active .studio-status-badge__dot { background: #2dc76d; }
.studio-status-badge--paused { background: rgba(245,166,35,.12); color: var(--studio-warn-text); }
.studio-status-badge--paused .studio-status-badge__dot { background: #f5a623; }
.studio-status-badge--cancelled { background: rgba(217,84,44,.12); color: var(--studio-bad-text); }
.studio-status-badge--cancelled .studio-status-badge__dot { background: #d9542c; }

/* ── Member detail panel (Mitglieder row click) ── */
.studio-list-layout { display: flex; align-items: flex-start; gap: 16px; }
.studio-list-layout__main { flex: 1; min-width: 0; }
.studio-detail-panel { width: 280px; flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 14px; overflow: hidden; }
.studio-detail-panel__head { padding: 13px 14px 11px; border-bottom: 1px solid var(--studio-border); display: flex; align-items: center; justify-content: space-between; }
.studio-detail-panel__title { font-weight: 700; font-size: 13px; }
.studio-detail-panel__close { width: 22px; height: 22px; border-radius: 6px; background: var(--studio-canvas); border: none; display: grid; place-items: center; color: var(--color-text-muted); font-size: 11px; cursor: pointer; }
.studio-detail-panel__body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

.studio-detail-identity { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.studio-detail-identity__av { width: 52px; height: 52px; border-radius: 16px; }
.studio-detail-identity__name { font-weight: 700; font-size: 15.5px; display: block; text-align: center; }
.studio-detail-identity__since { font-size: 12px; color: var(--color-text-muted); font-weight: 500; text-align: center; }

.studio-detail-section { display: flex; flex-direction: column; gap: 5px; }
.studio-detail-section__label { font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; display: block; }
.studio-detail-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; background: var(--studio-canvas); border-radius: 9px; }
.studio-detail-row__label { font-size: 12px; color: var(--color-text-muted); font-weight: 500; }
.studio-detail-row__value { font-size: 12px; font-weight: 600; }
.studio-detail-row__value--badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.studio-detail-row__value--badge.is-on { background: rgba(45,199,109,.12); color: #2dc76d; }
.studio-detail-row__value--badge.is-off { background: rgba(217,84,44,.12); color: #d9542c; }

.studio-detail-action { width: 100%; height: 34px; border-radius: 9px; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 1.5px solid var(--studio-border); background: var(--studio-canvas); color: var(--color-text-muted); margin-bottom: 6px; }
.studio-detail-action:last-child { margin-bottom: 0; }
.studio-detail-action--danger { color: #c0392b; border-color: rgba(210,55,42,.18); background: rgba(210,55,42,.07); }
.studio-detail-action--positive { color: #2dc76d; border-color: rgba(45,199,109,.25); background: rgba(45,199,109,.08); }

@media (max-width: 1000px) {
  .studio-list-layout { flex-direction: column; }
  .studio-detail-panel { width: 100%; }
}

/* ── KPI row (Statistiken) ── */
.studio-stats-kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1100px) { .studio-stats-kpi-row { grid-template-columns: repeat(3, 1fr); } }
.studio-stats-kpi-row--auto { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* Statistiken has six figures: six in a row on wide screens, two rows of
   three below (the 5-column rule above steps down to 3 at 1100px as well). */
.studio-stats-kpi-row--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .studio-stats-kpi-row--six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.studio-stats-kpi { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 4px; }
/* Brand-coloured so it reads in both themes (it used --color-text with a
   hardcoded white value: white on white in dark mode). */
.studio-stats-kpi--accent { background: var(--brand); border-color: transparent; }
.studio-stats-kpi--muted { opacity: .55; }
.studio-stats-kpi__label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-text-muted); }
.studio-stats-kpi--accent .studio-stats-kpi__label { color: color-mix(in srgb, var(--brand-fg) 65%, transparent); }
.studio-stats-kpi__value { font-weight: 800; font-size: 26px; letter-spacing: -.5px; line-height: 1.05; }
.studio-stats-kpi--accent .studio-stats-kpi__value { color: var(--brand-fg); }
.studio-stats-kpi__row { display: flex; align-items: center; gap: 5px; }
.studio-stats-kpi__trend { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.studio-stats-kpi__trend--up { background: rgba(45,199,109,.15); color: var(--studio-ok-text); }
.studio-stats-kpi__trend--down { background: rgba(217,84,44,.12); color: var(--studio-bad-text); }
.studio-stats-kpi__sub { font-size: 11px; color: var(--color-text-muted); font-weight: 500; }
.studio-stats-kpi--accent .studio-stats-kpi__sub { color: color-mix(in srgb, var(--brand-fg) 78%, transparent); }

.studio-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .studio-stats-grid { grid-template-columns: 1fr; } }
.studio-stats-grid--wide { grid-template-columns: 1fr 2fr; }
@media (max-width: 1000px) { .studio-stats-grid--wide { grid-template-columns: 1fr; } }

.studio-chart-card { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 14px; overflow: hidden; }
.studio-chart-card__head { padding: 12px 15px; border-bottom: 1px solid var(--studio-border); }
.studio-chart-card__title { font-weight: 700; font-size: 14px; display: block; margin: 0 0 2px; letter-spacing: -.1px; }
.studio-chart-card__sub { font-size: 11px; color: var(--color-text-muted); font-weight: 500; }
.studio-chart-card__body { padding: 13px 15px; }

.studio-heatmap { display: grid; grid-template-columns: 28px repeat(7, 1fr); gap: 3px; align-items: center; }
.studio-heatmap__day { font-size: 10px; font-weight: 700; color: var(--color-text-muted); text-align: center; }
.studio-heatmap__slot { font-size: 9px; font-weight: 600; color: var(--color-text-muted); text-align: right; padding-right: 3px; }
.studio-heatmap__cell { height: 18px; border-radius: 4px; transition: transform .12s ease, outline-color .12s ease; outline: 2px solid transparent; outline-offset: 1px; }
.studio-heatmap__cell:hover { outline-color: var(--color-text); transform: scale(1.12); }
/* Level 0 = no visits, 1..4 relative to the club's own busiest cell. The ink
   tint follows the theme, so an empty cell is visible in dark mode too. */
.studio-heatmap__cell--l0 { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.studio-heatmap__cell--l1 { background: color-mix(in srgb, var(--brand) 28%, transparent); }
.studio-heatmap__cell--l2 { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.studio-heatmap__cell--l3 { background: color-mix(in srgb, var(--brand) 78%, transparent); }
.studio-heatmap__cell--l4 { background: color-mix(in srgb, var(--brand) 96%, transparent); }
.studio-heatmap__legend { display: flex; align-items: center; gap: 5px; margin-top: 8px; justify-content: flex-end; font-size: 9.5px; color: var(--color-text-muted); font-weight: 500; }
.studio-heatmap__swatch { width: 12px; height: 12px; border-radius: 3px; }

.studio-course-bar { display: flex; flex-direction: column; gap: 5px; }
.studio-course-bar__row { display: flex; justify-content: space-between; align-items: center; }
.studio-course-bar__name { font-size: 12.5px; font-weight: 600; }
.studio-course-bar__frac { font-size: 12px; font-weight: 700; }
.studio-course-bar__track { height: 6px; background: var(--studio-canvas); border-radius: 3px; overflow: hidden; }
.studio-course-bar__fill { height: 100%; border-radius: 3px; }


.studio-retention-rings { display: flex; justify-content: space-around; align-items: center; padding: 4px 0; }
.studio-retention-ring { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.studio-retention-ring__label { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); }



/* ── Statistiken: spacing, bar chart, status split, rings ── */
.studio-stats-section { margin-bottom: 14px; }
.studio-stats-grid--lead { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) { .studio-stats-grid--lead { grid-template-columns: 1fr; } }
.studio-stats-kpi__trend--flat { background: var(--studio-canvas); color: var(--color-text-muted); }
.studio-stack { display: flex; flex-direction: column; gap: 12px; }
.studio-muted { color: var(--color-text-muted); font-weight: 600; }
.studio-stats-foot { margin: 4px 2px 0; font-size: 12px; color: var(--color-text-muted); }

/* Monthly bar chart: a flex row of columns, each a value, a track and a
   label. Heights are percentages computed on the server. */
.studio-bars { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: stretch; height: 190px; }
.studio-bars__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: default; }
.studio-bars__val { height: 14px; font-size: 11px; font-weight: 700; color: var(--color-text-muted); line-height: 14px; }
.studio-bars__track { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 8px; background: var(--studio-canvas); overflow: hidden; }
.studio-bars__bar {
  display: block; width: 100%; min-height: 0; border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--brand) 62%, transparent);
  transform-origin: bottom;
  animation: studio-grow .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: background-color .15s ease;
}
.studio-bars__col.is-current .studio-bars__bar { background: var(--brand); }
.studio-bars__col:hover .studio-bars__bar { background: var(--brand); }
.studio-bars__col:hover .studio-bars__val { color: var(--color-text); }
.studio-bars__lbl { font-size: 10.5px; font-weight: 600; color: var(--color-text-muted); line-height: 1.15; text-align: center; height: 26px; }
.studio-bars__lbl small { display: block; font-size: 9px; font-weight: 600; opacity: .7; }
@keyframes studio-grow { from { transform: scaleY(0); } }

/* Status split: one stacked bar plus a legend with counts and shares. */
.studio-split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin-bottom: 16px; }
.studio-split__seg { min-width: 6px; animation: studio-reveal .6s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes studio-reveal { from { transform: scaleX(0); } }
.studio-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.studio-legend__row { display: grid; grid-template-columns: 10px 1fr auto 44px; align-items: center; gap: 10px; font-size: 13px; }
.studio-legend__dot { width: 10px; height: 10px; border-radius: 50%; }
.studio-legend__name { font-weight: 600; }
.studio-legend__count { font-weight: 800; }
.studio-legend__pct { text-align: right; color: var(--color-text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.studio-ring__text { font-size: 14px; font-weight: 800; fill: var(--color-text); }
.studio-ring__arc { animation: studio-ring .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes studio-ring { from { stroke-dashoffset: var(--ring-from); } }

@media (prefers-reduced-motion: reduce) {
  .studio-bars__bar, .studio-split__seg, .studio-ring__arc { animation: none; }
  .studio-heatmap__cell { transition: none; }
}

/* ── Kurse: card grid ── */
.studio-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.studio-course-card { background: var(--color-surface); border: 1.5px solid var(--studio-border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.studio-course-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.studio-course-card__name { font-weight: 700; font-size: 14.5px; display: block; }
.studio-course-card__sched { font-size: 11.5px; color: var(--color-text-muted); font-weight: 500; margin-top: 2px; display: block; }
.studio-course-card__tag { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--studio-canvas); color: var(--color-text-muted); white-space: nowrap; border: 1px solid var(--studio-border); }
.studio-course-card__meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--color-text-muted); }
.studio-course-card__meta span { display: flex; align-items: center; gap: 4px; }
.studio-course-card__meta span:last-child { margin-left: auto; }


/* ── Mitteilungen ── */
.studio-msg-card { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 14px; padding: 13px 16px; display: flex; flex-direction: column; gap: 8px; }
.studio-msg-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.studio-msg-card__type { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.studio-msg-card__type--news { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand-fg); }
.studio-msg-card__type--info { background: rgba(59,130,246,.12); color: #1d4ed8; }
.studio-msg-card__type--promo { background: rgba(245,166,35,.12); color: #92400e; }
.studio-msg-card__title {
  font-weight: 700;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.studio-msg-card__date { font-size: 11px; color: var(--color-text-muted); margin-left: auto; }
.studio-msg-card__body { font-size: 12.5px; color: var(--color-text-muted); font-weight: 500; margin: 0; line-height: 1.45; }
.studio-msg-card__stats { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--color-text-muted); }
.studio-msg-card__stats span { display: flex; align-items: center; gap: 4px; }
.studio-msg-card__progress { flex: 1; height: 4px; background: var(--studio-canvas); border-radius: 2px; max-width: 160px; }
.studio-msg-card__progress-fill { height: 100%; background: var(--brand); border-radius: 2px; }
.studio-msg-delete-form { display: contents; }
.studio-msg-card .studio-icon-btn {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio-msg-card .studio-icon-btn:hover { background: var(--studio-canvas); }

/* ── Feedback ── */
.studio-fb-range-tabs { display: flex; gap: 4px; }

.studio-fb-kpi-value-row { display: flex; align-items: baseline; gap: 4px; }
.studio-fb-kpi-unit { font-size: 14px; font-weight: 600; color: var(--color-text-muted); }
.studio-fb-kpi-sub { font-size: 11px; color: var(--color-text-muted); }

.studio-fb-stars { display: inline-flex; align-items: center; gap: 1px; flex-shrink: 0; }
.studio-fb-stars svg { width: 12px; height: 12px; }
.studio-fb-stars svg.is-filled { color: var(--brand-fg); }
.studio-fb-stars svg.is-empty { color: var(--studio-border); }

.studio-fb-trend-card { grid-column: 1 / -1; }
.studio-fb-trend-svg-wrap { position: relative; padding: 4px 15px 13px 34px; }
.studio-fb-trend-axis {
  position: absolute;
  left: 15px;
  top: 4px;
  bottom: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.studio-fb-trend-empty { color: var(--color-text-muted); font-size: 13px; padding: 4px 15px 15px; }

.studio-fb-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .studio-fb-layout { grid-template-columns: 1fr; } }

.studio-fb-question-form { display: none; gap: 8px; margin-bottom: 14px; }
.studio-fb-question-form .studio-text-input { flex: 1; }

.studio-fb-question-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--studio-border);
}
.studio-fb-question-row:last-child { border-bottom: none; }
.studio-fb-question-row__text { flex: 1; font-size: 13.5px; }
.studio-fb-question-row__text--inactive { color: var(--color-text-muted); text-decoration: line-through; }
.studio-fb-question-row .studio-filter-tab { font-size: 11px; white-space: nowrap; }
.studio-fb-question-row .studio-icon-btn { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.studio-fb-question-row .studio-icon-btn:hover { background: var(--studio-canvas); }
.studio-fb-delete-form { display: contents; }

.studio-fb-empty { color: var(--color-text-muted); font-size: 13px; padding: 4px 0; }

.studio-fb-submission {
  background: var(--studio-canvas);
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-fb-submission--stale { opacity: .55; }

.studio-fb-submission__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-fb-submission__who { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: var(--color-text-muted); }
.studio-fb-submission__meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.studio-fb-submission__stale-tag { font-style: italic; }

.studio-fb-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--color-surface);
  border: 1px solid var(--studio-border);
  color: var(--color-text-muted);
}

.studio-fb-trend { font-weight: 800; font-size: 14px; line-height: 1; }
.studio-fb-trend--up { color: #2dc76d; }
.studio-fb-trend--down { color: #d9542c; }

.studio-fb-answer { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; }
.studio-fb-answer__question { color: var(--color-text-muted); }
.studio-fb-answer__rating { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-weight: 700; }
.studio-fb-answer__reason { font-size: 12px; color: var(--color-text-muted); margin: -2px 0 2px; font-style: italic; }

.studio-fb-history-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.studio-fb-history-toggle:hover { color: var(--color-text); }
.studio-fb-history-group { display: none; flex-direction: column; gap: 10px; }
.studio-fb-history-group.is-open { display: flex; }

.studio-fb-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.studio-fb-pagination__info { font-size: 12px; color: var(--color-text-muted); }
.studio-fb-pagination__nav { display: flex; gap: 6px; }

.studio-compose { background: var(--color-surface); border: 1.5px solid var(--studio-border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.studio-compose textarea { border: 1.5px solid var(--studio-border); border-radius: 10px; padding: 10px 13px; font-family: inherit; font-size: 13px; background: var(--studio-canvas); color: var(--color-text); resize: none; line-height: 1.5; width: 100%; box-sizing: border-box; }

/* ── Studio-Profil: form + phone preview ── */
.studio-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .studio-profile-layout { grid-template-columns: minmax(0, 1fr); } }
.studio-profile-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.studio-profile-form [hidden] { display: none !important; }
/* position: sticky (preview, save bar) needs the page itself to be the
   scroller. .studio-canvas is overflow-y: auto, which makes it a scroll
   container that never scrolls (the document does), so sticky never engaged.
   Only this page opts out. */
.studio-canvas:has(.studio-profile-layout) { overflow: visible; }
/* The preview follows the page while the long form scrolls. */
.studio-profile-preview { display: flex; flex-direction: column; align-items: center; background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 20px; padding: 20px; position: sticky; top: 16px; }
@media (max-width: 1000px) { .studio-profile-preview { position: static; } }

/* Form cards: one topic per card, heading and one line of help first. */
.studio-form-card { background: var(--color-surface); border: 1px solid var(--studio-border); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.studio-form-card__title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.15px; }
.studio-form-card__titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.studio-form-card__hint { margin: -8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--color-text-muted); }
.studio-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.studio-field .studio-form-label { margin: 0; }
.studio-field__hint { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
.studio-form-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.studio-form-grid2--zip { grid-template-columns: 120px minmax(0, 1fr); }
@media (max-width: 640px) { .studio-form-grid2 { grid-template-columns: minmax(0, 1fr); } .studio-form-grid2--zip { grid-template-columns: 110px minmax(0, 1fr); } }

/* Inputs inside a form card: roomier than the dense table controls. */
.studio-form-card .studio-text-input, .studio-form-card .studio-select { width: 100%; box-sizing: border-box; min-height: 40px; padding: 9px 12px; border-radius: 10px; background: var(--studio-canvas); }
.studio-form-card .studio-textarea { min-height: 96px; resize: vertical; line-height: 1.5; font-family: inherit; }
/* Older forms (course, team, session) use .studio-form-row / .studio-form-grid
   instead of cards: same field size and colour, so they match the profile. */
.studio-form-row .studio-text-input, .studio-form-row .studio-select,
.studio-form-grid .studio-text-input, .studio-form-grid .studio-select { width: 100%; box-sizing: border-box; min-height: 40px; padding: 9px 12px; border-radius: 10px; background: var(--studio-canvas); }
.studio-form-row textarea.studio-text-input, .studio-form-grid textarea.studio-text-input { min-height: 84px; line-height: 1.5; font-family: inherit; resize: vertical; }
.studio-text-input, .studio-select { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.studio-text-input::placeholder { color: color-mix(in srgb, var(--color-text) 38%, transparent); }
.studio-text-input:hover, .studio-select:hover { border-color: color-mix(in srgb, var(--color-text) 26%, transparent); }
.studio-text-input:focus-visible, .studio-select:focus-visible {
  outline: none;
  border-color: var(--brand-ink, var(--brand));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent);
}

.studio-btn-ghost { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--color-text); background: transparent; border: 1px solid var(--studio-border); border-radius: 9px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: background-color .15s ease, border-color .15s ease; }
.studio-btn-ghost:hover { background: var(--studio-canvas); border-color: color-mix(in srgb, var(--color-text) 28%, transparent); }
.studio-btn-ghost:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

.studio-brandrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--studio-canvas); border: 1px solid var(--studio-border); border-radius: 12px; }
.studio-brandrow__logo { width: 44px; height: 44px; border-radius: 12px; background: var(--color-text); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.studio-brandrow__logo img { width: 100%; height: 100%; object-fit: contain; }
.studio-brandrow__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 12px; color: var(--color-text-muted); }
.studio-brandrow__text strong { font-size: 13.5px; color: var(--color-text); }

.studio-status { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; }
.studio-status > svg, .studio-status > span:first-child { flex: 0 0 auto; margin-top: 2px; }
.studio-status div { display: flex; flex-direction: column; gap: 2px; }
.studio-status strong { font-size: 13px; }
.studio-status span { color: color-mix(in srgb, var(--color-text) 76%, transparent); }
.studio-status--ok { background: color-mix(in srgb, var(--brand) 14%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.studio-status--ok strong { color: var(--color-text); }
.studio-status--warn { background: color-mix(in srgb, #f5a623 12%, transparent); border: 1px solid color-mix(in srgb, #f5a623 40%, transparent); }

.studio-hours-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
@media (max-width: 640px) { .studio-hours-grid { grid-template-columns: minmax(0, 1fr); } }
.studio-hours-row { display: flex; align-items: center; gap: 10px; }
.studio-hours-row__day { width: 26px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); flex: 0 0 auto; }

.studio-switch-list { display: flex; flex-direction: column; }
.studio-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--studio-border); }
.studio-switch-row:first-child { border-top: 0; padding-top: 2px; }
.studio-switch-row__label { font-size: 13.5px; font-weight: 600; }

/* The save bar sticks to the bottom while the form scrolls, with the state
   of the form next to it. */
.studio-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; background: color-mix(in srgb, var(--color-surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--studio-border); border-radius: 14px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .35); }
.studio-savebar__state { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.studio-savebar__state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2dc76d; }
.studio-savebar__state.is-dirty { color: var(--color-text); }
.studio-savebar__state.is-dirty::before { background: #f5a623; }
.studio-savebar__btn { min-width: 160px; justify-content: center; height: 38px; }

/* Studio photos card (studio/_photo_card.html): thumbnail grid, first tile is
   the cover. Every control is a 44 px target. */
.studio-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.studio-photo-card { scroll-margin-top: 16px; } /* the actions redirect to #fotos */
.studio-photo-count {font-size: 12px; font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.studio-photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.studio-photo { display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--studio-canvas); border: 1px solid var(--studio-border); border-radius: 14px; min-width: 0; }
.studio-photo__media { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--studio-border); }
.studio-photo__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.studio-photo__badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: var(--brand); color: var(--brand-fg); font-size: 11px; font-weight: 800; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.studio-photo__badge svg { fill: currentColor; }
.studio-photo__alt { display: flex; gap: 6px; }
.studio-form-card .studio-photo__alt .studio-text-input { flex: 1; min-width: 0; min-height: var(--tap-min); background: var(--color-surface); font-size: 13px; }
.studio-photo__actions { display: flex; align-items: center; gap: 6px; }
.studio-photo__cover-btn, .studio-photo__cover-note { flex: 1; min-height: var(--tap-min); justify-content: center; }
.studio-photo__cover-note { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.studio-icon-btn { flex: 0 0 auto; width: var(--tap-min); height: var(--tap-min); display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid var(--studio-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.studio-icon-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--color-text) 28%, transparent); }
.studio-icon-btn:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.studio-icon-btn:disabled { opacity: .35; cursor: default; }
.studio-icon-btn--danger { color: var(--color-danger); }
.studio-icon-btn--danger:hover:not(:disabled) { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 8%, var(--color-surface)); }
/* The upload target: a large dashed area when empty, a grid tile otherwise.
   The real file input is visually hidden next to it (label for=). */
.studio-photo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 20px; text-align: center; border: 1.5px dashed color-mix(in srgb, var(--color-text) 24%, transparent); border-radius: 14px; background: var(--studio-canvas); color: var(--color-text-muted); font-size: 12.5px; line-height: 1.45; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.studio-photo-drop strong { font-size: 14px; color: var(--color-text); }
.studio-photo-drop span { max-width: 380px; }
.studio-photo-drop:hover { border-color: var(--color-text); }
.studio-form-card:has(#sp-photo-input:focus-visible) .studio-photo-drop { outline: 2px solid var(--color-text); outline-offset: 2px; }
.studio-photo-drop__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--color-text); margin-bottom: 4px; }
.studio-photo-drop__btn { margin-top: 8px; height: var(--tap-min); padding: 0 18px; }
.studio-photo-drop--tile { flex: 1; min-height: 180px; padding: 16px; }
.studio-photo--add { padding: 0; background: none; border: 0; }
.studio-photo-drop.is-busy { opacity: .55; pointer-events: none; }
.studio-photo-uploading { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }

.studio-form-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--studio-canvas); border-radius: 9px; gap: 10px; }
.studio-form-toggle { width: 35px; height: 20px; border-radius: 10px; background: var(--studio-border); position: relative; flex: 0 0 auto; cursor: pointer; transition: background-color .16s ease; }
.studio-form-toggle:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.studio-form-toggle::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .16s; }
.studio-form-toggle--on { background: var(--brand); }
.studio-form-toggle--on::after { left: 17.5px; }

.studio-amenity-chip { font: inherit; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--studio-border); background: var(--studio-canvas); color: var(--color-text-muted); font-size: 12.5px; font-weight: 600; display: inline-flex; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease; }
.studio-amenity-chip:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); color: var(--color-text); }
.studio-amenity-chip:active { transform: scale(.97); }
.studio-amenity-chip:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.studio-amenity-chip--on { border-color: var(--color-text); background: var(--color-text); color: var(--color-bg); }

.studio-phone-mock { width: 260px; height: 546px; background: #0c0d0a; border-radius: 34px; padding: 8px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.4); flex: 0 0 auto; }
.studio-phone-mock__screen { width: 100%; height: 100%; border-radius: 27px; overflow: hidden; background: #EEF0E8; position: relative; display: flex; flex-direction: column; }
.studio-phone-mock__tabs { display: flex; gap: 4px; margin-bottom: 14px; background: rgba(0,0,0,.06); padding: 3px; border-radius: 10px; }
.studio-phone-mock__tab { height: 26px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.studio-phone-mock__tab--on { background: var(--color-surface); color: var(--color-text); }

/* Real Leaflet/OSM map behind the profile-preview card, replacing the
   mockup's flat #e8ebe0 rectangle - same tile source/pin styling as the
   Entdecken map (.gym-pin etc. above), non-interactive (dragging: false)
   since this is a small static preview, not a real map to navigate. */
.pm-map { position: absolute; inset: 0; background: #e8ebe0; z-index: 0; }
.pm-map .leaflet-control-container { display: none; }
#sp-preview-card-sheet { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#sp-preview-card-sheet > * { pointer-events: auto; }

/* ── Phone-screen chrome: statusbar + bottom tab bar ──
   These simulate the MEMBER app's own iOS-style chrome inside the small
   preview phone - always the member app's light look, independent of the
   studio dashboard's own theme, same as the design mockup's PhoneFrame/
   StatusBar/TabBar (ui.jsx). Kept literal (not theme tokens) on purpose:
   this is a picture of another product's screen, not themed UI of this
   page - see the existing "fixed decorative accents" exception in
   CLAUDE.md's theming rule. */
.pm-statusbar { height: 30px; display: flex; align-items: center; padding: 0 18px; color: #15180F; flex: 0 0 auto; position: relative; font-weight: 700; font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.pm-statusbar__island { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 56px; height: 18px; background: #0c0d0a; border-radius: 10px; }
.pm-statusbar__right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pm-statusbar__batt { width: 16px; height: 9px; border: 1.2px solid currentColor; border-radius: 3px; position: relative; padding: 1px; }
.pm-statusbar__batt i { display: block; height: 100%; width: 72%; background: currentColor; border-radius: 1px; }

.pm-tabbar { background: rgba(255,255,255,.88); border-top: 1px solid rgba(21,24,15,.09); padding-top: 6px; flex: 0 0 auto; margin-top: auto; }
.pm-tabbar__row { display: flex; justify-content: space-around; align-items: flex-start; padding: 0 4px; }
.pm-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; color: rgba(21,24,15,.46); font-size: 8px; font-weight: 600; flex: 1; }
.pm-tab--on { color: #15180F; }
.pm-tab--center { margin-top: -8px; }
.pm-tab--center .pm-tab__ic { width: 34px; height: 24px; border-radius: 9px; background: var(--brand); color: #15180F; box-shadow: 0 5px 12px -6px rgba(200,242,62,.8); margin-bottom: 2px; }
.pm-tab--center .pm-tab__lbl { font-weight: 700; }
.pm-tab__ic { display: grid; place-items: center; }
.pm-home-indicator { width: 90px; height: 3px; border-radius: 2px; background: #15180F; opacity: .85; margin: 5px auto 6px; }

.pm-stats-row { display: flex; background: var(--color-surface); padding: 8px 12px; border-bottom: 1px solid rgba(21,24,15,.09); }
.pm-stats-row__item { flex: 1; text-align: center; }
.pm-stats-row__value { font-weight: 700; font-size: 12px; display: block; }
.pm-stats-row__label { font-size: 9px; color: #888; font-weight: 500; }

.pm-hours { padding: 10px 12px; background: var(--color-surface); margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.pm-hours__title { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }
.pm-hours__row { display: flex; justify-content: space-between; font-size: 10px; }
.pm-hours__day { color: #555; font-weight: 600; }
.pm-hours__time { color: #888; font-weight: 500; }

.pm-courses { padding: 10px 12px; background: var(--color-surface); margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.pm-courses__title { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 2px; }
.pm-courses__row { display: flex; align-items: center; gap: 8px; }
.pm-courses__icon { width: 26px; height: 26px; border-radius: 8px; background: #1a1c14; display: grid; place-items: center; flex: 0 0 auto; color: rgba(255,255,255,.5); }
.pm-courses__mid { flex: 1; min-width: 0; }
.pm-courses__name { font-size: 11px; font-weight: 700; color: #15180F; display: block; }
.pm-courses__meta { font-size: 9.5px; color: #888; font-weight: 500; }

.pm-photos { padding: 10px 12px; background: var(--color-surface); margin-top: 4px; }
.pm-photos__title { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 6px; }
.pm-photos__row { display: flex; gap: 5px; }
.pm-photos__tile { flex: 1; min-width: 0; height: 54px; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg,#2a2f22,#15170f); }
.pm-photos__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pm-contact { padding: 10px 12px; background: var(--color-surface); margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.pm-contact__title { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .4px; display: block; margin-bottom: 3px; }
.pm-contact__row { font-size: 10px; color: #555; font-weight: 500; }

.kontakt-map {
  position: relative;
  width: 100%;
  height: 210px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--color-surface);
}

.kontakt-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.kontakt-map__badge {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.kontakt-map__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
}

.kontakt-status {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.kontakt-actions {
  display: flex;
  gap: 8px;
}

.kontakt-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: transform 100ms ease-out;
}
.kontakt-action:active { transform: scale(0.96); }

.kontakt-action svg {
  width: 20px;
  height: 20px;
}

.kontakt-action--primary {
  background: var(--brand);
  color: var(--brand-fg);
}

.kontakt-details {
  background: var(--color-surface);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 16px;
}

.kontakt-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-nav-border);
}

.kontakt-detail-row:last-child {
  border-bottom: 0;
}

/* The hours row's body holds a multi-line day list (.hours-list) instead
   of one value line, so its icon aligns to the top of the row like the
   rest of the card instead of drifting to the (now taller) row's center. */
.kontakt-detail-row--hours {
  align-items: flex-start;
  padding-top: 12px;
  padding-bottom: 12px;
}

.kontakt-detail-row--hours .kontakt-detail-row__icon {
  margin-top: 1px;
}

.kontakt-detail-row__icon {
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.kontakt-detail-row__body {
  flex: 1;
  min-width: 0;
}

/* Per-day opening hours (Apple/Google Maps-style list), nested inside the
   "Öffnungszeiten" kontakt-detail-row rather than the old single
   concatenated line - lets today stand out and each day read on its own,
   without inventing rows for days Club.opening_hours has no data for
   (see its docstring: a missing day means "not set", not "closed"). */
.hours-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hours-list__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.hours-list__row--today {
  color: var(--color-text);
  font-weight: 700;
}

.hours-list__day {
  flex-shrink: 0;
}

/* A split-shift day renders as several .hours-list__range lines (one per
   time range - see the view) stacked instead of joined on one line, so a
   narrow lunch-break gym's hours never overflow the sheet's mobile width. */
.hours-list__value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
}

.kontakt-detail-row__label {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.kontakt-detail-row__value {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.kontakt-hours-status { font-weight: 600; color: var(--color-text-muted); }
.kontakt-hours-status--open { color: #34c759; }

a.kontakt-detail-row__value {
  display: block;
  text-decoration: none;
}

.kontakt-social {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.kontakt-social__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.kontakt-social__item svg {
  width: 15px;
  height: 15px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.faq-item {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px;
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq-item__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

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

.faq-item__answer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-top: 10px;
}

.faq-contact-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 18px;
  text-decoration: none;
  color: var(--color-text);
}

.faq-contact-cta strong {
  display: block;
  font-size: 14px;
}

.faq-contact-cta__sub {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.faq-contact-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

/* UX-0.7/0.8/0.10 — done-today week-strip dot, weekly-template picker hint. */
/* Today's column hides the dot (the brand-filled date circle marks "today"),
   but a finished session today must still show the done dot. */
.training-week-day--today .training-week-day__dot.training-week-day__dot--done {
  display: block;
}

.picker-sheet__hint {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  margin: -8px 0 14px;
}

.picker-sheet__error {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-danger);
  text-align: center;
  margin: 10px 0 0;
}

.picker-sheet__error[hidden] {
  display: none;
}

/* UX-0.9 R1-C — "Zu Routine hinzufügen" sheet and the library's "+ Plan" pill.
   Appended as one block so parallel work in app.css merges cleanly. */

/* The pill is visually small; its tap area is grown to --tap-min by the
   shared .tap-hit pattern (UX-6.1 R2-G block at the end of this file). */

/* A <button> row inside .settings-card: reset the native button look so it
   reads exactly like the link rows next to it. */
.add-to-routine__row {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.add-to-routine__row:disabled {
  opacity: 0.5;
}

.add-to-routine .settings-row {
  min-height: var(--tap-min);
  text-decoration: none;
  color: var(--color-text);
}

.add-to-routine__empty p {
  margin: 0 0 12px;
}

.add-to-routine__create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 20px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

/* UX-0.1/0.2 R1-D: decimal-input hint, empty-value mark, placeholders that
   read as hints rather than values. */
.session-set__input::placeholder {
  font-style: italic;
  font-weight: 400;
  color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

.session-set__input--missing {
  outline: 2px solid var(--color-danger);
  outline-offset: -2px;
}

.session-set__hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0 28px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-danger);
}

.session-set__hint-fix {
  min-height: 32px;
  border: none;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
}

/* UX-0.1 R1-D: weight steppers in the plan config sheet are text fields. */
.stepper__value--input {
  width: 72px;
  border: none;
  border-radius: 8px;
  padding: 6px 4px;
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
  color: var(--color-text);
  font-family: inherit;
}

/* UX-0.6/0.11 R1-E: the routine's note under the exercise name, and the
   session name as a title instead of an input-looking box. */
.session-entry__routine-note {
  margin: -2px 0 10px;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.session-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--color-text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  /* Long names wrap to two lines rather than being cut off. */
  overflow-wrap: anywhere;
}

/* UX-1.1 R2-A: set row (number/type, Vorher, kg, reps, tick), set menu, undo toast.
   Scoped to .session-entry__sets--live so the history's read-only rows,
   which share the base .session-set classes, keep their layout. */
:root {
  --set-tick: 44px;      /* tick button: a full touch target */
  --set-num-w: 32px;     /* number / type column */
  /* Bottom edge of the undo toast: above the bottom nav. One variable so a
     sticky rest timer (UX-1.3) can raise it instead of colliding. */
  --toast-bottom: calc(var(--nav-height) + 12px);
}

.session-entry__sets--live .session-set-header,
.session-entry__sets--live .session-set__row {
  display: grid;
  grid-template-columns: var(--set-num-w) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) var(--set-tick);
  gap: 4px;
  align-items: center;
}

.session-entry__sets--effort .session-set-header,
.session-entry__sets--effort .session-set__row {
  grid-template-columns: var(--set-num-w) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) var(--set-tick);
}

.session-entry__sets--live .session-set-header__phase,
.session-entry__sets--live .session-set-header__spacer {
  width: auto;
}

.session-entry__sets--live .session-set-header__phase {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--color-text-muted);
}

/* A done row is tinted as a whole, not just its tick. */
.session-entry__sets--live .session-set {
  margin: 2px -4px 0;
  padding: 0 4px;
  border-radius: 12px;
}

.session-entry__sets--live .session-set--done {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}

.session-entry__sets--live .session-set__pr-badge {
  margin-left: calc(var(--set-num-w) + 4px);
}

.session-entry__sets--live .session-set__hint {
  margin-left: calc(var(--set-num-w) + 4px);
}

.session-entry__sets--live .session-set__input {
  min-height: 40px;
}

.session-set__input--effort {
  min-width: 0;
}

.session-set__toggle {
  width: var(--set-tick);
  height: var(--set-tick);
}

.session-set__toggle svg {
  width: 20px;
  height: 20px;
}

/* Number / type: the chip is 30 px tall, the button 44 px. */
.session-set__phase--btn {
  position: relative;
  isolation: isolate;
  width: var(--set-num-w);
  height: var(--set-tick);
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--color-text);
  cursor: pointer;
}

.session-set__phase--btn::before {
  content: "";
  position: absolute;
  inset: 7px 0;
  z-index: -1;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
}

.session-set__phase--warmup {
  color: var(--color-text-muted);
}

.session-set__phase--dropset,
.session-set__phase--restpause,
.session-set__phase--failure,
.session-set__phase--amrap {
  color: var(--brand-ink);
}

.session-set__phase--dropset::before,
.session-set__phase--restpause::before,
.session-set__phase--failure::before,
.session-set__phase--amrap::before {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}

.session-set__ref {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--set-tick);
}

.session-set__previous {
  max-width: 100%;
  min-height: 32px;
  border: none;
  border-radius: 8px;
  background: none;
  padding: 0 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
}

button.session-set__previous {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-text-muted) 50%, transparent);
  text-underline-offset: 3px;
}

.session-set__previous--none {
  min-height: var(--set-tick);
}

.set-menu .exercises-more {
  width: 100%;
}

.set-menu__heading {
  margin: 0 4px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.set-menu__group {
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--color-surface);
  overflow: hidden;
}

.set-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  border: none;
  background: none;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.set-menu__item[hidden] {
  display: none;
}

.set-menu__item + .set-menu__item {
  border-top: 0.5px solid var(--color-nav-border);
}

.set-menu__item[aria-checked="true"]::after {
  content: "\2713";
  font-weight: 800;
  color: var(--brand-ink);
}

.set-menu__item--danger {
  color: var(--color-danger);
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: var(--toast-bottom);
  transform: translateX(-50%);
  z-index: 240;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 398px;
  min-height: 52px;
  padding: 4px 4px 4px 16px;
  border: 0.5px solid var(--color-nav-border);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.undo-toast[hidden] {
  display: none;
}

.undo-toast__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.undo-toast__btn {
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* UX-1.2 R2-B: compact exercise head - body-map thumbnail, name, muscle chips
   - instead of the 16:11 placeholder image (docs/TRAINING_UX_PLAN.md UX-1.2).
   Shared by the live session (render.js) and the history
   (training_exercises/_exercise_head.html). */
:root {
  --exercise-thumb-w: 48px;
  --exercise-thumb-h: 64px;
  --exercise-thumb-pad: 4px;
}

.session-entry__header {
  align-items: center;
}

.exercise-head {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.exercise-head__thumb {
  flex: 0 0 auto;
  width: var(--exercise-thumb-w);
  height: var(--exercise-thumb-h);
  padding: var(--exercise-thumb-pad);
  box-sizing: border-box;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-head__map {
  height: 100%;
  width: auto;
  display: block;
}

.exercise-head__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exercise-head__name {
  color: var(--color-text);
  text-decoration: none;
  /* A long name wraps to two lines at most; the rest is cut rather than pushing the sets down. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.exercise-head__chips {
  display: flex;
  /* Wraps rather than cutting a muscle name short on a narrow screen: there is room, the image it replaced was 225 px. */
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}

.exercise-head__chip {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* UX-1.3 R2-C: sticky rest timer, per-exercise pause field, next-set pointer.
   The timer is fixed above the bottom nav (same centred 430 px column as the
   nav), so it stays in reach while the sets scroll. While it runs
   (body.has-rest-timer, set by session_page.js) the page keeps room for it
   below the last row and the undo toast moves up with it. */
:root {
  --rest-timer-h: 60px;   /* 44 px buttons + 8 px padding above and below */
  --rest-timer-gap: 8px;  /* between the timer and the nav, and above it */
}

.rest-timer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--rest-timer-gap));
  transform: translateX(-50%);
  z-index: 230; /* above the page, below the undo toast (240) and sheets */
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 398px;
  min-height: var(--rest-timer-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  color: var(--color-text);
  /* Same hairline + shadow as the floating tab bar, so it reads in dark too. */
  box-shadow: 0 0 0 1px var(--color-nav-border), 0 10px 30px var(--color-shadow);
  animation: rest-timer-in 0.4s var(--ease-out-soft);
}

.rest-timer[hidden] {
  display: none;
}

@keyframes rest-timer-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
}

/* Redesign D: a ring that empties as the pause runs out. Starts at the top
   (rotated), pathLength 100 in the markup, the offset set by session_page.js. */
.rest-timer__ring {
  flex: none;
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.rest-timer__track,
.rest-timer__arc {
  fill: none;
  stroke-width: 5;
}

.rest-timer__track {
  stroke: var(--color-idle);
}

.rest-timer__arc {
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s linear;
}

.rest-timer__time {
  flex: 1;
  min-width: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  margin-left: 4px;
}

.rest-timer__label {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.rest-timer__count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.rest-timer__adjust,
.rest-timer__skip {
  flex: none;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: none;
  border-radius: 22px;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

/* "Überspringen" as a word on wide screens; on phones (up to ~440 px) the ring,
   the countdown and three worded pills do not fit, so skip is an icon there
   (its aria-label still says "Pause überspringen"). */
.rest-timer__skip svg {
  display: none;
  width: 18px;
  height: 18px;
}

@media (max-width: 440px) {
  .rest-timer__skip { padding: 0; }
  .rest-timer__skip-text { display: none; }
  .rest-timer__skip svg { display: block; }
}

@media (max-width: 370px) {
  .rest-timer__adjust { padding: 0 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .rest-timer { animation: none; }
  .rest-timer__arc { transition: none; }
}

.has-rest-timer #session-main {
  padding-bottom: calc(var(--rest-timer-h) + var(--rest-timer-gap) * 2);
}

/* The undo toast sits above the timer, not on it. */
.has-rest-timer {
  --toast-bottom: calc(var(--nav-height) + var(--rest-timer-h) + var(--rest-timer-gap) * 2);
}

/* Ring + time are one button (.rest-timer__face) that opens the big view. */
.rest-timer__face {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rest-timer__total,
.rest-timer__collapse {
  display: none;
}

/* A small grabber on the compact bar says "this pulls up", like a sheet. */
.rest-timer:not(.rest-timer--open)::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 28px;
  height: 4px;
  margin-left: -14px;
  border-radius: 2px;
  background: var(--color-idle);
}

/* The big view (rest-timer--open): a panel from the bottom over the tab bar,
   the ring large with the time in its middle, the adjust buttons in a row and
   skip full width below - the layout lifters know from other timer apps. The
   compact bar's elements are reused, only their arrangement changes. */
.rest-timer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 225; /* over the tab bar (100), under the timer (230) */
  background: rgba(0, 0, 0, 0.35);
  animation: rest-backdrop-in 0.3s ease;
}

.rest-timer-backdrop[hidden] {
  display: none;
}

@keyframes rest-backdrop-in {
  from { opacity: 0; }
}

.rest-timer--open {
  bottom: 0;
  width: 100%;
  max-width: 430px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  animation: rest-timer-open 0.45s var(--ease-out-soft);
}

@keyframes rest-timer-open {
  from { opacity: 0.6; transform: translate(-50%, 40%); }
}

.rest-timer--open .rest-timer__collapse {
  flex-basis: 100%;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.rest-timer__grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--color-idle);
}

.rest-timer--open .rest-timer__face {
  flex-basis: 100%;
  position: relative;
  justify-content: center;
  margin-bottom: 8px;
}

.rest-timer--open .rest-timer__ring {
  width: min(64vw, 240px);
  height: min(64vw, 240px);
}

.rest-timer--open .rest-timer__track,
.rest-timer--open .rest-timer__arc {
  stroke-width: 2.6;
}

.rest-timer--open .rest-timer__time {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.rest-timer--open .rest-timer__label {
  font-size: 15px;
}

.rest-timer--open .rest-timer__count {
  font-size: 56px;
  letter-spacing: -0.03em;
}

.rest-timer--open .rest-timer__total {
  display: block;
  font-size: 15px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.rest-timer--open .rest-timer__adjust {
  flex: 1;
  min-height: 56px;
  border-radius: var(--radius-tile);
  font-size: 17px;
}

.rest-timer--open .rest-timer__skip {
  flex-basis: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-tile);
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 17px;
}

.rest-timer--open .rest-timer__skip-text {
  display: inline;
}

.rest-timer--open .rest-timer__skip svg {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .rest-timer--open,
  .rest-timer-backdrop { animation: none; }
}

/* Announcement of the end ("Pause beendet"): for screen readers only. */
.rest-timer-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Config sheet / plan: the "Pause nach jedem Satz" row. */
.exconfig__rest-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.exconfig__rest-hint {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.exconfig__rest-input {
  width: 96px;
  min-height: var(--tap-min);
  box-sizing: border-box;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.exconfig__rest-input::placeholder {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* The set a superset round moves on to: a short pulse, then it is just a row. */
.session-set--next {
  border-radius: 12px;
  animation: session-set-next 1.6s ease-out 1;
}

@keyframes session-set-next {
  0%, 60% { box-shadow: 0 0 0 2px var(--brand); }
  100% { box-shadow: 0 0 0 2px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .session-set--next {
    animation: none;
    box-shadow: 0 0 0 2px var(--brand);
  }
}

/* UX-1.4–1.6 R2-D: progress bar + exercise list, swap button, "Übung
   hinzufügen" within reach, opaque disabled Zurück/Weiter
   (docs/TRAINING_UX_PLAN.md UX-1.4, 1.5, 1.6). */
:root {
  --overview-bar-h: 6px;
  --exercise-status-size: 16px;
  --exercise-list-row-h: 56px;
}

/* Which exercise of how many, sets done as a bar; a tap opens the list. */
.session-overview {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--tap-min);
  margin: 0 0 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.session-overview[hidden] {
  display: none;
}

.session-overview__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-overview__label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.session-overview__sets {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.session-overview__chevron {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--color-text-muted);
}

.session-overview__bar {
  display: block;
  height: var(--overview-bar-h);
  border-radius: calc(var(--overview-bar-h) / 2);
  background: color-mix(in srgb, var(--color-text-muted) 25%, transparent);
  overflow: hidden;
}

.session-overview__fill {
  display: block;
  height: 100%;
  width: calc(var(--progress, 0) * 1%);
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .session-overview__fill,
  .exercise-list__items--dragging .exercise-list__item { transition: none !important; }
}

/* The exercise list sheet. */
.exercise-list__items {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-list__item {
  display: flex;
  align-items: stretch;
  min-height: var(--exercise-list-row-h);
  border-radius: 14px;
  background: var(--color-surface);
}

.exercise-list__item--current {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.exercise-list__items--dragging .exercise-list__item:not(.exercise-list__item--dragging) {
  transition: transform 0.15s ease-out;
}

.exercise-list__item--dragging {
  position: relative;
  z-index: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.exercise-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 8px 14px;
  border: none;
  background: none;
  color: var(--color-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.exercise-list__status {
  flex: none;
  box-sizing: border-box;
  width: var(--exercise-status-size);
  height: var(--exercise-status-size);
  border-radius: 50%;
  border: 2px solid var(--color-text-muted);
}

.exercise-list__status--partial {
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand) 50%, transparent 50%);
}

.exercise-list__status--done {
  border-color: var(--brand);
  background: var(--brand);
}

.exercise-list__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exercise-list__name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-list__meta,
.exercise-list__state {
  font-size: 12px;
  color: var(--color-text-muted);
}

.exercise-list__handle {
  flex: none;
  width: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: grab;
  touch-action: none; /* the finger drags the row instead of scrolling the sheet */
}

.exercise-list__handle svg {
  width: 20px;
  height: 20px;
}

/* "Tauschen" in the exercise head: same small button as the note toggle. */
.session-entry__swap {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.session-entry__swap svg {
  width: 15px;
  height: 15px;
}

/* UX-1.6: the way to add an exercise is a button wherever the sets end. */
.session-add-exercise {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--tap-min);
  margin: 4px 0 10px;
  border: 1.5px dashed var(--color-text-muted);
  border-radius: 12px;
  background: none;
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.session-add-exercise[hidden] {
  display: none;
}

.session-empty__add {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  margin-top: 16px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* A disabled Zurück/Weiter keeps its solid background - only the label is
   dimmed. (opacity let the exercise behind it shine through.) */
.session-nav__btn:disabled {
  opacity: 1;
  background: var(--color-surface);
  color: color-mix(in srgb, var(--color-text) 35%, var(--color-surface));
}

/* UX-1.7 R2-E: finish sheet with an overview of open sets, and the training
   summary (history detail in its "just finished" state, ?fresh=1).
   docs/TRAINING_UX_PLAN.md UX-1.7, UX-1.5. Tokens only, so both themes work. */
.finish-sheet {
  padding-top: 20px;
}

.finish-sheet__summary {
  margin: 0 0 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

.finish-sheet__unsaved {
  list-style: none;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface));
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.4;
}

.finish-sheet__unsaved[hidden] {
  display: none;
}

.finish-sheet__unsaved li + li {
  margin-top: 6px;
}

.finish-sheet__confirm {
  display: block;
  width: 100%;
  min-height: var(--tap-min);
  margin-bottom: 8px;
}

.session-summary {
  margin-bottom: 12px;
}

.session-summary__title {
  margin: 0 2px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.session-summary__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.session-summary__stat {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface);
}

.session-summary__stat dt {
  font-size: 12px;
  color: var(--color-text-muted);
}

.session-summary__stat dd {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* Volume is a trend number (issue #221): quieter than the other tiles. */
.session-summary__stat--quiet dt,
.session-summary__stat--quiet dd {
  color: var(--color-text-muted);
}

.session-summary__stat--quiet dd {
  font-size: 18px;
  font-weight: 700;
}

/* Hard sets per muscle, one text line (issue #221). */
.muscle-sets {
  margin: 10px 2px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.muscle-sets__label {
  color: var(--color-text-muted);
}

.session-summary__compare {
  margin: 10px 2px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
}

.session-summary__compare--up {
  font-weight: 700;
}

/* ── Workout log: bodyweight exercise without KG column ───────────────────
   A bodyweight exercise with no added load drops the KG column in the live
   session (render.js withWeight): the grid loses one input track and Vorher
   and Wdh. share the space. Three-class selectors so they win over the
   4/5-column rules around them whatever the order. */
.session-entry__sets--live.session-entry__sets--no-weight .session-set-header,
.session-entry__sets--live.session-entry__sets--no-weight .session-set__row {
  grid-template-columns: var(--set-num-w) minmax(0, 1.5fr) minmax(0, 1fr) var(--set-tick);
}

.session-entry__sets--live.session-entry__sets--no-weight.session-entry__sets--effort .session-set-header,
.session-entry__sets--live.session-entry__sets--no-weight.session-entry__sets--effort .session-set__row {
  grid-template-columns: var(--set-num-w) minmax(0, 1.4fr) repeat(2, minmax(var(--tap-min), 1fr)) var(--set-tick);
}
/* ── end: bodyweight exercise without KG column ─────────────────────────── */

/* ── Workout log: history detail header ───────────────────────────────────
   Day + clock time under the title and one quiet surface with the facts of
   the training (workout_log/history_detail.html). Value over label, like the
   Fitness summary; a figure that does not exist is not rendered, so the grid
   follows the item count: three across, two and four as 2 x n, one alone. */
.history-when {
  margin: 4px 2px 14px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.history-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 8px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--color-surface);
}

.history-facts:has(> :nth-child(2):last-child),
.history-facts:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-facts:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

/* dt (label) comes first in the markup for assistive technology, the value is
   shown above it. */
.history-facts__item {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  min-width: 0;
}

.history-facts__item dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.history-facts__item dd {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
/* ── end: history detail header ─────────────────────────────────────────── */

/* History list (workout_log/history.html): month blocks, and the facts of a
   training as one muted line under its date. */
.history-month { margin-bottom: 18px; }
.history-month__title { margin: 8px 2px 8px; }
.history-row-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.session-summary__duration {
  margin: 10px 2px 0;
  font-size: 14px;
}

.session-summary__duration > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.session-summary__form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-summary__form--stack {
  flex-direction: column;
  align-items: stretch;
}

.session-summary__label {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* 16 px: iOS would zoom into a smaller field when it gets focus. */
.session-summary__input {
  width: 88px;
  min-height: var(--tap-min);
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
}

.session-summary__input--wide {
  width: 100%;
}

.session-summary__btn {
  min-height: var(--tap-min);
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* "Fertig" is the one primary button of the summary. */
.session-summary__btn--secondary {
  background: color-mix(in srgb, var(--color-text) 12%, transparent);
  color: var(--color-text);
}

.session-summary__btn--block {
  width: 100%;
}

.session-summary__help {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.session-summary__card {
  margin-bottom: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--color-surface);
}

.session-summary__card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.session-summary__changes {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.session-summary__done {
  display: block;
  min-height: var(--tap-min);
  margin: 12px 0 20px;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.finish-sheet .exercises-more {
  width: 100%;
  min-height: var(--tap-min);
  border: none;
  font-family: inherit;
  cursor: pointer;
}

/* A field on a card (--color-surface) needs the page colour to stay visible. */
.session-summary__card .session-summary__input {
  background: var(--color-bg);
}

/* UX-1.8 R2-F: 16 px fields (iOS Safari zooms into anything smaller when it
   gets focus, and does not zoom back), the AMRAP set's hint line and the
   trainer's weight as a reference (UX-8.10). */
:root {
  --font-input-min: 16px;   /* below this, iOS zooms the page on focus */
}

.session-set__input,
.session-set__input--effort,
.session-entry .exercise-note-form__textarea,
#finish-note,
#picker-search-input {
  font-size: var(--font-input-min);
}

.session-set__amrap {
  margin: 0 0 2px calc(var(--set-num-w) + 4px);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.session-entry__trainer-ref {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* UX-6.1 R2-G: touch targets of at least --tap-min (44 px) across the training
   area. Two techniques, both leave the visible shape alone where it should
   stay small:
   1. .tap-hit - a transparent ::after layer that grows the tappable area of
      an isolated control (back arrow, icon button, pill) up to --tap-min and
      never shrinks one that is already bigger. Applied to a class in
      templates and, for controls rendered by JavaScript or shared with other
      areas, by selector in the list below.
   2. A real --tap-min box with padding and background-clip: content-box
      (icon buttons that sit in a row): the chip stays small, the box does
      not, so neighbours cannot overlap by construction.
   Rule of thumb for both: hit areas of neighbours never overlap
   (apps/training/test_browser.py checks it). */
.tap-hit,
.settings-back,
.session-menu__trigger,
.training-week-nav__arrow,
.training-today-card__cta,
.settings-info-btn,
.exercises-item__fav,
.exercises-item__plan--btn,
.exercises-item__start-btn,
.plan-new-btn,
.exercises-chip,
.stepper__btn,
.session-set__phase--btn {
  position: relative;
}

.tap-hit::after,
.settings-back::after,
.session-menu__trigger::after,
.training-week-nav__arrow::after,
.training-today-card__cta::after,
.settings-info-btn::after,
.exercises-item__fav::after,
.exercises-item__plan--btn::after,
.exercises-item__start-btn::after,
.plan-new-btn::after,
.exercises-chip::after,
.stepper__btn::after,
.session-set__phase--btn::after {
  content: "";
  position: absolute;
  /* Percentages resolve against the control's own height (top/bottom) and
     width (left/right): grow by half of what is missing, never negative. */
  top: min(0px, calc((100% - var(--tap-min)) / 2));
  bottom: min(0px, calc((100% - var(--tap-min)) / 2));
  left: min(0px, calc((100% - var(--tap-min)) / 2));
  right: min(0px, calc((100% - var(--tap-min)) / 2));
}

/* The widest set row (number, Vorher, kg, Wdh., effort, tick) on a 360 px
   screen: three 44 px input columns, so Vorher keeps what is left. */
.session-entry__sets--effort .session-set-header,
.session-entry__sets--effort .session-set__row {
  grid-template-columns: var(--set-num-w) minmax(0, 1.4fr) repeat(3, minmax(var(--tap-min), 1fr)) var(--set-tick);
  gap: 2px;
}

/* Real boxes: padding + content-box background keep the 30 px chip. */
.routine-link-btn,
.routine-remove-btn,
.session-entry__note-toggle,
.session-entry__swap {
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 7px;
  border-radius: 15px;
  background-clip: content-box;
}

.session-entry__header-actions {
  gap: 0;
  margin-right: -7px;
}

.session-entry__sets--live .session-set__input,
.input,
.stepper__value--input,
.routine-name-input,
.exercises-search__input {
  min-height: var(--tap-min);
}

.session-set__previous,
.soreness-checkin__option,
.exercises-more,
.session-entry__add-set,
.exconfig__seg-btn,
.exercise-note-form__save-btn,
.session-menu__item,
.bodyweight-checkin__step {
  min-height: var(--tap-min);
}

.session-entry__add-set {
  padding-block: 0;
}

.session-menu__item {
  padding-block: 0;
}

.settings-row {
  min-height: var(--tap-min);
}

/* Settings back arrow, ⋯ menu, week arrows: visible size unchanged. */

/* Week strip: seven days of at least 44 px need the card's side padding
   (16 px) to give some back on a 360 px screen. */
.training-week-placeholder__row {
  margin: 0 -8px;
}

/* Stepper: the control row is one tap target tall, the 30 px buttons grow
   into it. */
.stepper__control {
  min-height: var(--tap-min);
  padding-block: 0;
}

/* Routine row: the action buttons (superset, move, remove) wrap onto their
   own line - four 44 px targets do not fit beside a name on a phone. */
.routine-row {
  flex-wrap: wrap;
}

.routine-row__actions {
  flex-basis: calc(100% + 7px);
  justify-content: flex-end;
  gap: 0;
  margin: -6px -7px -6px 0;
}

.routine-row__move {
  flex-direction: row;
  gap: 0;
}

.routine-move-btn {
  width: var(--tap-min);
  height: var(--tap-min);
}

.routine-row__body-btn {
  min-height: var(--tap-min);
  justify-content: center;
}

.routine-icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
}

/* Chips: the row owns the vertical hit area (7 px above and below the 30 px
   chip, inside its own padding box so overflow-x: auto does not clip it) and
   two stacked rows sit 14 px apart so their hit areas just touch. */
.exercises-chips {
  padding: 7px 0;
  margin: -7px 0 3px;
}

.exercises-chips + .exercises-chips {
  margin-top: -3px;
}

.exercises-chip {
  min-width: var(--tap-min);
  text-align: center;
}

/* A cloud of chips that wraps onto several lines (equipment types): rows are
   14 px apart so the 44 px hit areas of two rows touch, not overlap, and the
   container does not clip them. */
.exercises-chips--wrap {
  flex-wrap: wrap;
  gap: 14px 8px;
  overflow: visible;
  padding: 0;
  margin: 0 0 8px;
}

/* The exercise name in a head is a link; its line-clamp box needs
   overflow: hidden, which clips a ::after, so the box itself is tall. */
.exercise-head__name {
  min-height: var(--tap-min);
  -webkit-box-pack: center;
}

/* ── Training stats (apps/training_stats) ─────────────────────────
   Hero card in the club colour (shareable headline), cards with a live
   readout line that a tap/drag on a chart rewrites, the muscle card with
   coverage + recovery tabs. Chart strokes and fills are classes here; the
   strength/bodyweight SVG itself is built by the page script. */

.stats-hero-card {
  position: relative;
  overflow: hidden;
  margin: 0 0 12px;
  padding: 14px 16px 16px;
  border-radius: 20px;
  color: var(--brand-fg);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--brand-fg) 10%, transparent) 0 28%, transparent 28.5% 42%, color-mix(in srgb, var(--brand-fg) 6%, transparent) 42.5% 56%, transparent 56.5%),
    var(--brand);
}
.stats-hero-card .settings-segmented { background: color-mix(in srgb, var(--brand-fg) 12%, transparent); border-radius: 10px; }
.stats-hero-card .settings-segmented__option { color: color-mix(in srgb, var(--brand-fg) 70%, transparent); padding: 0 4px; border-radius: 8px; }
.stats-hero-card .settings-segmented__option--active { background: var(--brand-fg); color: var(--brand); box-shadow: none; }
.stats-hero-panel { animation: stats-fade 260ms ease-out both; }
@keyframes stats-fade { from { opacity: 0; transform: translateY(4px); } }

.stats-hero-card__title { margin: 18px 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stats-hero-card__big {
  display: block;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.stats-hero-card__sub { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: color-mix(in srgb, var(--brand-fg) 75%, transparent); }

.stats-lifts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stats-lift {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-fg) 9%, transparent);
  font-size: 13px;
}
.stats-lift__name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-lift__val { font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--brand-fg) 75%, transparent); white-space: nowrap; }
.stats-lift__val b { color: var(--brand-fg); }
.stats-hero-card .stats-delta { background: var(--brand-fg); color: var(--brand); }

.stats-hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.stats-hero-facts div { display: flex; flex-direction: column-reverse; gap: 1px; }
.stats-hero-facts dt { font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--brand-fg) 70%, transparent); }
.stats-hero-facts dd { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats-hero-facts small { font-size: 13px; font-weight: 600; }

.stats-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap-min);
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-fg);
  cursor: pointer;
  transition: transform 100ms ease-out;
}
.stats-share svg { width: 18px; height: 18px; }
.stats-share:active { transform: scale(0.97); }

/* KPI tiles - also used by the habit detail (habits/_habit_detail.html). */
.stats-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.stats-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: var(--color-surface); }
.stats-kpi__label { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.stats-kpi__value { font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--color-text); }
.stats-kpi__value small { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--color-text-muted); }
.stats-kpi__sub { font-size: 12px; color: var(--color-text-muted); }

.stats-card {
  margin: 0 0 12px;
  padding: 16px 14px 14px;
  border-radius: 16px;
  background: var(--color-surface);
}
.stats-card__head { margin-bottom: 12px; }
.stats-card__head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stats-card__title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--color-text); }
.stats-card__sub { display: block; font-size: 12px; line-height: 1.4; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* Change badge: brand-ink on a brand tint reads in both themes. */
.stats-delta {
  flex: 0 0 auto;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 24%, transparent);
}
.stats-delta--down,
.stats-delta--neutral { color: var(--color-text-muted); background: color-mix(in srgb, var(--color-text-muted) 15%, transparent); }

/* Live readout above a line chart: value of the touched (or newest) point. */
.stats-readout { display: flex; flex-direction: column; gap: 2px; min-height: 56px; margin-bottom: 4px; }
.stats-readout__value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.stats-readout__value small { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--color-text-muted); }
.stats-readout__meta { font-size: 13px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

.stats-linechart { min-height: 170px; }
.stats-linechart--small { min-height: 120px; }
.stats-line-svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.stats-grid { stroke: color-mix(in srgb, var(--color-text-muted) 18%, transparent); stroke-width: 1; stroke-dasharray: 3 4; }
.stats-axis-label { font-size: 10.5px; fill: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.stats-area-stop-top { stop-color: var(--brand); stop-opacity: 0.32; }
.stats-area-stop-bottom { stop-color: var(--brand); stop-opacity: 0; }
.stats-area { animation: stats-fade 500ms ease-out both; }
.stats-guide { stroke: var(--color-text-muted); stroke-width: 1; opacity: 0; transition: opacity 120ms; }
.is-scrubbing .stats-guide { opacity: 0.6; }
.stats-cursor { fill: var(--brand); stroke: var(--color-surface); stroke-width: 2.5; transition: cx 90ms ease-out, cy 90ms ease-out; }
.stats-dot--pr { fill: var(--brand-ink); stroke: var(--color-surface); stroke-width: 1.5; }

.stats-hint { margin: 6px 0 0; font-size: 12px; color: var(--color-text-muted); }
.stats-hint__pr { color: var(--brand-ink); }

.stats-chart { display: block; width: 100%; height: auto; overflow: visible; }
.stats-chart--bars { touch-action: pan-y; cursor: pointer; }
.stats-chart__axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--color-text-muted); }

.stats-bar {
  fill: color-mix(in srgb, var(--brand) 35%, var(--color-text-muted) 25%);
  transform-box: fill-box;
  transform-origin: bottom;
  animation: stats-grow 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 25ms);
  transition: opacity 120ms;
}
.stats-bar--current { fill: var(--brand); }
.stats-bar--zero { fill: color-mix(in srgb, var(--color-text-muted) 22%, transparent); }
.is-scrubbing .stats-bar { opacity: 0.4; }
.is-scrubbing .stats-bar.is-picked { opacity: 1; fill: var(--brand); }
@keyframes stats-grow { from { transform: scaleY(0); } }

.stats-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: stats-draw 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes stats-draw { from { stroke-dashoffset: 1; } }

/* Consistency: streak facts + day heatmap (7 rows x 16 week columns). */
.stats-streak { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stats-streak__item { display: flex; flex-direction: column; gap: 1px; }
.stats-streak__item b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--color-text); }
.stats-streak__item b small { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.stats-streak__item span { font-size: 11.5px; line-height: 1.3; color: var(--color-text-muted); }

.stats-heatmap { display: grid; grid-template-columns: auto repeat(16, 1fr); gap: 3px; cursor: pointer; }
.stats-heatmap__days,
.stats-heatmap__week { display: grid; grid-template-rows: 14px repeat(7, 1fr); gap: 3px; }
.stats-heatmap__days span { font-size: 9.5px; line-height: 1; align-self: center; padding-right: 3px; color: var(--color-text-muted); }
.stats-heatmap__days span:first-child { grid-row: 2; }
.stats-heatmap__month { font-size: 9.5px; line-height: 14px; white-space: nowrap; overflow: visible; color: var(--color-text-muted); }
.stats-heatmap__cell {
  display: block;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
}
.stats-heatmap__cell.level-l1 { background: color-mix(in srgb, var(--brand) 45%, var(--color-surface)); }
.stats-heatmap__cell.level-l2 { background: color-mix(in srgb, var(--brand) 72%, var(--color-surface)); }
.stats-heatmap__cell.level-l3 { background: var(--brand); }
.stats-heatmap__cell--future { background: none; }
.stats-heatmap__cell--today { box-shadow: inset 0 0 0 1.5px var(--color-text-muted); }
.stats-heatmap__cell.is-picked { box-shadow: 0 0 0 2px var(--color-text); }

/* Muscle card */
.stats-muscle-tabs { margin-bottom: 12px; }
.stats-panel-sub { margin: 0 0 4px; }
.stats-callout {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
}
.stats-callout--good { background: color-mix(in srgb, var(--color-status-open) 16%, transparent); }
.stats-callout--warn { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.stats-callout--info { background: color-mix(in srgb, var(--brand) 22%, transparent); }

.stats-meter { padding: 7px 0; }
.stats-meter--minor { padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--color-text-muted) 14%, transparent); }
.stats-meter__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.stats-meter--minor .stats-meter__row { margin-bottom: 0; }
.stats-meter__name { font-size: 14px; font-weight: 600; color: var(--color-text); }
.stats-meter__val { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-text); }
.stats-meter__avg { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
/* The 10-20 guideline band is drawn into the track itself, so a bar is read
   against it at a glance. */
.stats-meter__track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent var(--band-left), color-mix(in srgb, var(--color-status-open) 22%, transparent) var(--band-left) calc(var(--band-left) + var(--band-w)), transparent 0),
    color-mix(in srgb, var(--color-text-muted) 16%, transparent);
}
.stats-meter__fill {
  height: 100%;
  width: var(--w);
  border-radius: 4px;
  background: color-mix(in srgb, var(--brand) 45%, var(--color-text-muted) 30%);
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stats-meter__fill--ok,
.stats-meter__fill--high { background: var(--brand); }

.stats-tag {
  display: inline-block;
  min-width: 0;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 13%, transparent);
}
.stats-tag--ok { color: var(--color-text); background: color-mix(in srgb, var(--color-status-open) 22%, transparent); }
.stats-tag--high { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 24%, transparent); }
.stats-tag--forgotten { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.stats-tag:empty { display: none; }

.stats-more,
.stats-explain { margin-top: 10px; border-top: 1px solid color-mix(in srgb, var(--color-text-muted) 16%, transparent); }
.stats-more > summary,
.stats-explain > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
}
.stats-more > summary::-webkit-details-marker,
.stats-explain > summary::-webkit-details-marker { display: none; }
.stats-more > summary::after,
.stats-explain > summary::after { content: "›"; margin-left: auto; font-size: 18px; transition: transform 150ms; }
.stats-more[open] > summary::after,
.stats-explain[open] > summary::after { transform: rotate(90deg); }
.stats-explain p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: var(--color-text-muted); }

.stats-footnote, .stats-empty { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--color-text-muted); }
.stats-empty { font-size: 14px; }
.stats-welcome .stats-empty { margin-top: 6px; }

.stats-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 0 14px; }
.stats-chips::-webkit-scrollbar { display: none; }
.stats-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 100ms ease-out;
}
.stats-chip:active { transform: scale(0.96); }
.stats-chip--active { background: var(--brand); color: var(--brand-fg); }

.stats-prs { list-style: none; margin: 0; padding: 0; }
.stats-pr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--color-text-muted) 16%, transparent); }
.stats-pr:first-child { border-top: none; padding-top: 0; }
.stats-pr__badge { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--brand-fg); background: var(--brand); }
.stats-pr__badge svg { width: 16px; height: 16px; }
.stats-pr__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stats-pr__name { font-size: 14px; font-weight: 600; color: var(--color-text); }
.stats-pr__set { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .stats-bar, .stats-line, .stats-area, .stats-hero-panel { animation: none; }
  .stats-meter__fill, .stats-chip, .stats-cursor, .stats-share { transition: none; }
}

/* ══ Body map 3D + muscle legend (routine card, stats card, exercise detail) ═
   Studio-lit redesign of the front/back body map in
   training_plan/_muscle_map.html (+ _muscle_map_figure.html) plus the
   colour-keyed chip legend under it (training_plan/_routine_body.html).
   Everything is scoped to .muscle-map / .muscle-legend, so the flat 40 px
   exercise-head thumbnails (which reuse the .muscle-map__region--lN classes)
   are untouched. Layers, tokens and the "why" of each trick:
   docs/notes/training.md, "Body map: studio-lit figure". */

.muscle-map,
.muscle-legend {
  /* Legend dots and chips (opaque tones; the figure itself uses the ramps
     below). */
  --mm-skin:  color-mix(in srgb, var(--color-text-muted) 30%, var(--color-surface));
  --mm-off:   color-mix(in srgb, var(--color-text-muted) 44%, var(--color-surface));
  --mm-l1:    color-mix(in srgb, var(--brand) 30%, var(--mm-off));
  --mm-l2:    color-mix(in srgb, var(--brand) 55%, var(--mm-off));
  --mm-l3:    color-mix(in srgb, var(--brand) 80%, var(--mm-off));
  --mm-l4:    var(--brand);

  /* Figure, light theme: white-grey studio plastic. Three-step ramp per
     material (highlight / body / shadow) that the per-muscle gradients run
     through, lit from the top left. */
  --mm-base-hi: #ffffff;
  --mm-base:    #cfd0d9;
  --mm-base-lo: #7d7f91;
  --mm-skin-hi: #fbfbfb;
  --mm-skin-md: #cacbd5;
  --mm-skin-lo: #8587a0;
  --mm-glint:   #ffffff;                    /* highlight mixed into hit muscles */
  --mm-deep:    #0d1100;                    /* shadow mixed into hit muscles */
  --mm-fascia:  #f7f1e6;                    /* tendon / fascia between muscles */
  --mm-fibre-dark: rgba(40, 42, 60, 0.26);  /* striation: dark groove ... */
  --mm-fibre-lit:  rgba(255, 255, 255, 0.5); /* ... and its lit edge */
  --mm-stage-hi: #f9f9fa;                   /* studio backdrop: lit centre ... */
  --mm-stage-lo: #dcdde3;                   /* ... falling off to the edges */
  --mm-shade: #e8e8ea;                      /* diffuse light: < white darkens the flats */
  --mm-sheen: #bcbcc2;                      /* specular highlight (light-on-light: dimmed) */
  --mm-contact-ink: #1c1e30;                /* shadow muscles cast on the fascia */
  --mm-contact-a: 0.34;
  --mm-floor-ink: #1c1e30;                  /* contact shadow under the feet */
  --mm-floor-a: 0.26;
  --mm-glow-a: 0.9;                         /* halo of hit muscles (same in both themes) */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .muscle-map,
  :root:not([data-theme="light"]) .muscle-legend {
    --mm-skin:  color-mix(in srgb, var(--color-text-muted) 22%, var(--color-surface));
    --mm-off:   color-mix(in srgb, var(--color-text-muted) 36%, var(--color-surface));
    --mm-base-hi: #8e8e98;
    --mm-base:    #5b5b64;
    --mm-base-lo: #33333a;
    --mm-skin-hi: #8a8a94;
    --mm-skin-md: #585861;
    --mm-skin-lo: #30303a;
    --mm-fascia:  #7b7a82;
    --mm-fibre-dark: rgba(0, 0, 0, 0.34);
    --mm-fibre-lit:  rgba(255, 255, 255, 0.13);
    --mm-stage-hi: #4b4b54;
    --mm-stage-lo: #1d1d21;
    --mm-shade: #ffffff;
    --mm-sheen: #8a8a90;
    --mm-contact-ink: #000000;
    --mm-contact-a: 0.5;
    --mm-floor-ink: #000000;
    --mm-floor-a: 0.55;
  }
}

:root[data-theme="dark"] .muscle-map,
:root[data-theme="dark"] .muscle-legend {
  --mm-skin:  color-mix(in srgb, var(--color-text-muted) 22%, var(--color-surface));
  --mm-off:   color-mix(in srgb, var(--color-text-muted) 36%, var(--color-surface));
  --mm-base-hi: #8e8e98;
  --mm-base:    #5b5b64;
  --mm-base-lo: #33333a;
  --mm-skin-hi: #8a8a94;
  --mm-skin-md: #585861;
  --mm-skin-lo: #30303a;
  --mm-fascia:  #7b7a82;
  --mm-fibre-dark: rgba(0, 0, 0, 0.34);
  --mm-fibre-lit:  rgba(255, 255, 255, 0.13);
  --mm-stage-hi: #4b4b54;
  --mm-stage-lo: #1d1d21;
  --mm-shade: #ffffff;
  --mm-sheen: #8a8a90;
  --mm-contact-ink: #000000;
  --mm-contact-a: 0.5;
  --mm-floor-ink: #000000;
  --mm-floor-a: 0.55;
}

.muscle-map-card__title {
  align-self: stretch;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.muscle-map {
  align-self: stretch;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 6px;
  perspective: 900px;
  /* Studio backdrop: a soft pool of light behind the figures. */
  border-radius: 16px;
  background: radial-gradient(ellipse 85% 70% at 50% 38%, var(--mm-stage-hi), var(--mm-stage-lo));
}

.muscle-map__figure {
  position: relative;
  flex: 0 1 172px;
  min-width: 0;
  margin: 0;
  animation: mm-rise 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The two views turn slightly towards each other, like a figure on a
   turntable shown from both sides. */
.muscle-map__figure--front { transform: rotateY(8deg); }
.muscle-map__figure--back  { transform: rotateY(-8deg); animation-delay: 60ms; }

.muscle-map .muscle-map__view {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 727 / 1280;
  overflow: visible;
}

/* Lighting filter inputs (the feDiffuse/feSpecular elements carry the
   classes; lighting-color is a CSS property, so it can follow the theme). */
.muscle-map__shade { lighting-color: var(--mm-shade); }
.muscle-map__sheen { lighting-color: var(--mm-sheen); }
.muscle-map__contact { flood-color: var(--mm-contact-ink); flood-opacity: var(--mm-contact-a); }

/* Per-muscle gradient tones. The gradient element carries the colours as
   custom properties, its stops pick them up. */
.muscle-map__stop-hi  { stop-color: var(--hi); }
.muscle-map__stop-mid { stop-color: var(--mid); }
.muscle-map__stop-lo  { stop-color: var(--lo); }

.muscle-map__tone--skin { --hi: var(--mm-skin-hi); --mid: var(--mm-skin-md); --lo: var(--mm-skin-lo); }
.muscle-map__tone--l0   { --hi: var(--mm-base-hi); --mid: var(--mm-base);    --lo: var(--mm-base-lo); }
.muscle-map__tone--l1 {
  --hi:  color-mix(in srgb, var(--brand) 22%, var(--mm-base-hi));
  --mid: color-mix(in srgb, var(--brand) 26%, var(--mm-base));
  --lo:  color-mix(in srgb, var(--brand) 22%, var(--mm-base-lo));
}
.muscle-map__tone--l2 {
  --hi:  color-mix(in srgb, var(--brand) 38%, var(--mm-base-hi));
  --mid: color-mix(in srgb, var(--brand) 44%, var(--mm-base));
  --lo:  color-mix(in srgb, color-mix(in srgb, var(--brand) 38%, var(--mm-base-lo)) 90%, var(--mm-deep));
}
.muscle-map__tone--l3 {
  --hi:  color-mix(in srgb, color-mix(in srgb, var(--brand) 82%, var(--mm-glint)) 78%, var(--mm-base-hi));
  --mid: color-mix(in srgb, var(--brand) 80%, var(--mm-base));
  --lo:  color-mix(in srgb, var(--brand) 76%, var(--mm-deep));
}
.muscle-map__tone--l4 {
  --hi:  color-mix(in srgb, var(--brand) 62%, var(--mm-glint));
  --mid: var(--brand);
  --lo:  color-mix(in srgb, var(--brand) 58%, var(--mm-deep));
}

/* Floor shadow under the feet. */
.muscle-map__floor-core { stop-color: var(--mm-floor-ink); stop-opacity: var(--mm-floor-a); }
.muscle-map__floor-edge { stop-color: var(--mm-floor-ink); stop-opacity: 0; }

/* Tendon / fascia: the muscle paths again, stroked fat in a lighter tone, so
   the gaps between muscles read as connective tissue instead of a hole. */
.muscle-map__fascia use {
  fill: var(--mm-fascia);
  stroke: var(--mm-fascia);
  stroke-width: 18;
  stroke-linejoin: round;
}

/* Hit muscles shine: one blurred copy of levels 3-4 behind the figure. */
.muscle-map__glow { opacity: var(--mm-glow-a); }
.muscle-map__glow use { fill: var(--brand); stroke: var(--brand); stroke-width: 26; stroke-linejoin: round; }

/* Fibre striation: a groove with a lit edge, repeated and rotated per muscle
   (the pattern angle comes from muscles.FIBRE_ANGLE). */
.muscle-map__fibre { fill: none; stroke-linecap: round; }
.muscle-map__fibre--deep { stroke: var(--mm-fibre-dark); stroke-width: 2; }
.muscle-map__fibre--soft { stroke: var(--mm-fibre-dark); stroke-width: 1.4; opacity: 0.6; }
.muscle-map__fibre--lit  { stroke: var(--mm-fibre-lit);  stroke-width: 1.6; }
/* Untrained muscles keep only a hint of striation, so the hit ones pop. */
.muscle-map__fibres-l0 { opacity: 0.55; }

@keyframes mm-rise {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Legend: hit muscles as chips whose dot is the colour of their region. */
.muscle-legend {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.muscle-legend + .muscle-legend { margin-top: 4px; }

.muscle-legend__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.muscle-legend__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.muscle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
}

.muscle-chip--primary {
  background: color-mix(in srgb, var(--brand) 16%, var(--color-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent);
}

.muscle-chip__dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mm-off);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.muscle-chip__dot--l1 { background: var(--mm-l1); }
.muscle-chip__dot--l2 { background: var(--mm-l2); }
.muscle-chip__dot--l3,
.muscle-chip__dot--l4 {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 6px var(--brand);
}
.muscle-chip__dot--l3 { background: var(--mm-l3); }
.muscle-chip__dot--l4 { background: var(--mm-l4); }

@media (prefers-reduced-motion: reduce) {
  .muscle-map__figure { animation: none; }
}
/* ══ end Body map 3D + muscle legend ════════════════════════════════════ */

/* ── Raster body map (BEGIN) ────────────────────────────────────────────
   A figure pack (apps/training_exercises/body_packs.py, partial
   training_plan/_muscle_map_raster.html): a neutral base image plus one alpha
   mask per hit muscle. The mask cuts a brand-coloured box to the muscle's
   shape; hard-light keeps the base image's fibre shading visible through the
   colour, and the same rule works in light and dark and for any club colour.
   Stronger levels are more opaque and (3-4) glow. Replacing the pack changes
   no CSS: only these classes are used. */
.muscle-map__figure:has(.bm-stage) { transform: none; }

.bm-stage {
  position: relative;
  width: 100%;
  isolation: isolate;
}

.bm-base,
.bm-region {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bm-base { display: block; object-fit: contain; }

.bm-region {
  background: var(--brand);
  -webkit-mask-image: var(--bm-mask);
  mask-image: var(--bm-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mix-blend-mode: hard-light;
}

.bm-region--l1 { opacity: 0.35; }
.bm-region--l2 { opacity: 0.6; }
.bm-region--l3 { opacity: 0.85; filter: drop-shadow(0 0 4px var(--brand)); }
.bm-region--l4 { opacity: 1; filter: drop-shadow(0 0 6px var(--brand)); }

/* Exercise thumbnail from a figure pack: the box shows a crop of the figure; the
   stage inside is scaled up and shifted (inline style) so only the trained
   muscles' area is visible. Same box size as the vector thumbnail. */
.exercise-head__thumb--raster { padding: 0; overflow: hidden; align-items: stretch; }
/* Square list / picker / routine-row thumbnails: a bit larger when they show a muscle crop. */
.exercises-item__thumb:has(.exercise-head__map--raster) { width: 52px; height: 52px; overflow: hidden; background: color-mix(in srgb, var(--color-text-muted) 10%, transparent); }
.exercise-head__map--raster { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 10px; }
.exercise-head__map--raster .bm-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.exercise-head__map--raster .bm-base,
.exercise-head__map--raster .bm-region { position: absolute; }
/* ══ end Raster body map ═══════════════════════════════════════════════ */

/* Settings > Figur: big cards, one per body-map figure, side by side and swipeable
   (scroll-snap) when they do not all fit. Native radios sit invisibly over the cards,
   so keyboard and screen reader work without script. The chosen card gets the brand
   outline, a tint and a check; the previews are the pack's own front and back views
   shaded like a workout. */
.figure-choice__options {
  display: flex;
  gap: 12px;
  margin: 14px -4px 14px;
  padding: 4px 4px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.figure-choice__options::-webkit-scrollbar { display: none; }
.figure-choice__option { position: relative; display: block; flex: 0 0 min(78%, 280px); scroll-snap-align: center; cursor: pointer; }
.figure-choice__input { position: absolute; z-index: 1; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.figure-choice__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 18px 12px 16px;
  border-radius: 22px;
  background: var(--color-surface);
  border: 2px solid transparent;
  color: var(--color-text);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.figure-choice__preview { display: block; width: 100%; max-width: 230px; height: auto; margin-bottom: 10px; }
.figure-choice__name { font-size: 19px; font-weight: 700; }
.figure-choice__tagline { font-size: 13px; color: var(--color-text-muted); text-align: center; }
.figure-choice__check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.figure-choice__check svg { width: 16px; height: 16px; }
.figure-choice__input:checked + .figure-choice__card {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--color-surface));
}
.figure-choice__input:checked + .figure-choice__card .figure-choice__check { opacity: 1; transform: none; }
.figure-choice__input:focus-visible + .figure-choice__card { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .figure-choice__card, .figure-choice__check { transition: none; }
}

/* ── Exercise config sheet: essentials first (BEGIN) ─────────────
   _exercise_config.html shows only what a quick routine needs - sets,
   reps (or seconds) and weight - in one grouped card, then a single
   "Weitere Optionen" disclosure row for everything else (mode, pause,
   warm-ups, bodyweight, per side, intensifier, progression, note). The
   row's second line names every non-default advanced value, so nothing
   is hidden silently. See docs/DJANGO_ARCHITECTURE_NOTES.md ("Config
   sheet: essentials first"). Keep this block self-contained. */
.exconfig {
  /* The sheet's own curve (.sheet): fast start, long critically-damped
     settle - no overshoot on a plain disclosure. CSS transitions retarget
     from the current value, so a second tap mid-flight reverses smoothly. */
  --exconfig-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --exconfig-dur: 0.38s;
}

.exconfig__basics {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin-bottom: 12px;
}

.exconfig__basics .exconfig__steppers {
  margin-bottom: 0;
  row-gap: 14px;
}

/* The three numbers that matter read a size up from the advanced ones. */
.exconfig__basics .stepper__value {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.exconfig__basics .stepper__value--input {
  width: 96px;
}

.exconfig__more-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: none;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 100ms ease-out;
}

/* Feedback on press, not on release. */
.exconfig__more-toggle:active {
  background: color-mix(in srgb, var(--color-text) 7%, var(--color-surface));
}

.exconfig__more-toggle:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

.exconfig__more-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exconfig__more-label {
  font-size: 15px;
  font-weight: 500;
}

.exconfig__more-summary {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

/* Something is set: the line stops being a hint and becomes a value. */
.exconfig__more-summary--set {
  color: var(--brand-ink);
  font-weight: 600;
}

.exconfig__more-chevron {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--exconfig-dur) var(--exconfig-ease);
}

.exconfig__more-toggle[aria-expanded="true"] .exconfig__more-chevron {
  transform: rotate(90deg);
}

/* Height animates via the 0fr -> 1fr grid-row trick (no measuring in JS);
   the content slides down a few px and fades in as it opens. */
.exconfig__more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--exconfig-dur) var(--exconfig-ease);
}

.exconfig__more--open {
  grid-template-rows: 1fr;
}

.exconfig__more-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  transition:
    opacity 0.18s ease-out,
    transform var(--exconfig-dur) var(--exconfig-ease),
    visibility 0s linear var(--exconfig-dur);
}

.exconfig__more--open .exconfig__more-inner {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition:
    opacity 0.28s ease-out 0.06s,
    transform var(--exconfig-dur) var(--exconfig-ease),
    visibility 0s;
}

/* Room for the whole "Standard (90 s)" placeholder (it was cut off). */
.exconfig__more .exconfig__rest-input {
  width: 124px;
}

/* Bodyweight + per-side now share one grouped card; .settings-row's own
   display:flex would otherwise beat the [hidden] attribute. */
.exconfig .settings-row[hidden] {
  display: none;
}

.exconfig .settings-row:has(+ .settings-row[hidden]) {
  border-bottom: none;
}

/* Advanced steppers sit on the sheet background, not in a card: give their
   control row the card surface so they read like the grouped rows around. */
.exconfig__more .stepper__control {
  background: var(--color-surface);
}

/* The primary action stays reachable while the expanded options scroll
   underneath it; a short fade instead of a hard divider. The sheet body's
   own bottom padding moves inside the fragment, otherwise content would
   scroll visibly through that strip below the stuck button. */
.sheet__body:has(> .exconfig) {
  padding-bottom: 0;
}

.exconfig {
  padding-bottom: max(24px, env(safe-area-inset-bottom, 16px));
}

.exconfig__actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 4px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
}

.exconfig__actions::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 16px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

.exconfig__actions .exercise-detail__plan-btn {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .exconfig__more,
  .exconfig__more-chevron {
    transition: none;
  }

  .exconfig__more-inner {
    transform: none;
    transition: opacity 0.15s ease-out, visibility 0s linear 0.15s;
  }

  .exconfig__more--open .exconfig__more-inner {
    transition: opacity 0.15s ease-out, visibility 0s;
  }
}
/* ── Exercise config sheet: essentials first (END) ───────────── */

/* ── Zugang (club_zugang): pass card, partner programmes, roadmap ──
   Rohbau - see docs/ZUGANG_PLAN.md. All colors follow the theme tokens;
   the partner badges (.zg-provider__badge) are third-party identities and
   carry their own inline color, like the Settings row icon badges. */
.zg-sources {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.zg-sources::-webkit-scrollbar { display: none; }
.zg-source {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-nav-border);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.zg-source--active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-fg);
}

.zg-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-nav-border);
}
.zg-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.zg-card__eyebrow { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.zg-card__name { font-size: 20px; font-weight: 700; margin-top: 2px; }
.zg-card__number { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.zg-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-status-open) 18%, transparent);
  font-size: 12px;
  font-weight: 600;
}
.zg-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-status-open);
}

.zg-tabs { margin-bottom: 16px; }
.zg-tabs .zg-tab {
  flex: 1;
  min-height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.zg-tabs .zg-tab.settings-segmented__option--active { background: var(--color-surface); }

.zg-panel { text-align: center; }
.zg-panel[hidden] { display: none; }
.zg-panel__title { font-size: 16px; font-weight: 700; margin-top: 4px; }
.zg-hint { font-size: 13px; line-height: 1.4; color: var(--color-text-muted); margin: 8px auto 0; max-width: 300px; }

/* The QR must stay black-on-white in both themes or scanners fail. */
.zg-qr {
  display: inline-block;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  line-height: 0;
}
.zg-qr img { width: min(220px, 62vw); height: auto; image-rendering: pixelated; }
.zg-timer {
  height: 4px;
  max-width: 220px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--color-text-muted) 25%, transparent);
  overflow: hidden;
}
.zg-timer__bar {
  display: block;
  height: 100%;
  background: var(--brand);
  transform-origin: left;
  transition: transform 1s linear;
}
.zg-partner-id {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 28px 0 8px;
  word-break: break-all;
}

.zg-nfc { color: var(--brand-ink); padding-top: 4px; }
.zg-nfc svg { width: 96px; height: 96px; }
.zg-nfc__wave { opacity: 0.25; animation: zg-wave 1.8s ease-in-out infinite; }
.zg-nfc__wave--2 { animation-delay: 0.25s; }
.zg-nfc__wave--3 { animation-delay: 0.5s; }
@keyframes zg-wave { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.zg-chip {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.zg-chip--inline { margin: 0 0 0 6px; }
.zg-chip--live { background: var(--brand); color: var(--brand-fg); }

.zg-btn {
  min-height: 44px;
  margin-top: 14px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.zg-btn:active { transform: scale(0.97); }
.zg-btn--link { display: inline-flex; align-items: center; text-decoration: none; }
.zg-btn--link[hidden] { display: none; }
.zg-btn--small { margin-top: 0; min-height: 40px; padding: 0 16px; font-size: 14px; }

.zg-wallet { display: flex; gap: 10px; margin-top: 12px; }
.zg-wallet__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  border: 1px dashed var(--color-nav-border);
  border-radius: 14px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.zg-error { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--color-danger); }
.zg-error[hidden] { display: none; }
.zg-hint--left { text-align: left; margin: 8px 2px 0; max-width: none; }
.zg-wallet__btn { white-space: nowrap; }
.zg-wallet__btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.zg-section-title { font-size: 17px; font-weight: 700; margin: 28px 0 4px; }
.zg-section-sub { font-size: 13px; line-height: 1.45; color: var(--color-text-muted); }
.zg-preview-note { font-size: 12px; color: var(--color-text-muted); margin: 6px 0 12px; font-style: italic; }

.zg-providers { list-style: none; margin: 0; padding: 0; background: var(--color-surface); border-radius: 16px; overflow: hidden; }
.zg-provider { padding: 12px 14px; border-bottom: 1px solid var(--color-nav-border); }
.zg-provider:last-child { border-bottom: 0; }
.zg-provider__row { display: flex; align-items: center; gap: 12px; }
.zg-provider__badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.zg-provider__text { flex: 1; min-width: 0; }
.zg-provider__name { font-size: 15px; font-weight: 600; }
.zg-provider__tag { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.zg-provider--saved .zg-provider__tag { color: var(--brand-ink); font-weight: 600; }
.zg-provider__btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-nav-border);
  border-radius: 18px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.zg-provider__form { padding: 12px 0 2px 52px; }
.zg-provider__form[hidden] { display: none; }
.zg-provider__label { display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 6px; }
.zg-provider__inputrow { display: flex; gap: 8px; }
.zg-provider__input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-nav-border);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 16px; /* >=16px keeps iOS from zooming on focus */
}
.zg-provider__remove {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-danger);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.zg-roadmap { list-style: none; margin: 12px 0 8px; padding: 0 0 0 4px; }
.zg-roadmap__item { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.zg-roadmap__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--color-nav-border);
}
.zg-roadmap__marker {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--color-text-muted);
  background: var(--color-bg);
}
.zg-roadmap__item--live .zg-roadmap__marker { border-color: var(--brand); background: var(--brand); }
.zg-roadmap__title { font-size: 15px; font-weight: 600; }
.zg-roadmap__desc { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }

/* Fullscreen "Vorzeigen". Fixed green on purpose: it must read as "OK" from
   across a desk regardless of the gym's brand color or the theme. */
.zg-show {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a7a35;
  color: #fff;
  text-align: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
.zg-show[hidden] { display: none; }
/* Moving stripes: a screenshot is a still, so motion proves the screen is live. */
.zg-show__stripes {
  position: absolute;
  inset: 0 0 auto 0;
  height: 14px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.55) 0 14px, transparent 14px 28px);
  background-size: 40px 100%;
  animation: zg-stripes 1s linear infinite;
}
@keyframes zg-stripes { to { background-position: 40px 0; } }
.zg-show__body { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.zg-show__check {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  margin-bottom: 8px;
}
.zg-show__check svg { width: 56px; height: 56px; }
.zg-show__title { font-size: 34px; font-weight: 800; }
.zg-show__clock { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 8px; }
.zg-show__date { font-size: 15px; opacity: 0.85; }
.zg-show__name { font-size: 24px; font-weight: 700; margin-top: 22px; }
.zg-show__club { font-size: 15px; opacity: 0.85; }
.zg-show__ref { margin-top: 14px; padding: 6px 14px; border-radius: 12px; background: rgba(255,255,255,0.18); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zg-show__close {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 0 28px;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 22px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .zg-nfc__wave { animation: none; opacity: 0.7; }
  .zg-show__stripes { animation: none; }
  .zg-timer__bar { transition: none; }
}
/* ── Zugang (END) ─────────────────────────────────────────────── */

/* ==[ studio: konfigurator ]==================================================== */
/* Scoped to this page: three-column configurator layout, ported from
   the design mockup's app-shell (Dashboard component: db-lib/db-canvas/
   db-settings). Only the Konfigurator page uses it, but it lives here
   because the studio pages share app.css. */
.conf-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 260px; gap: 0; margin: -28px -32px; height: calc(100vh - 56px); overflow: hidden; }
/* The phone mock is 310px wide and needs ~350px of canvas. With the 220px
   studio sidebar plus library and settings panel, that stops fitting below
   ~1070px and the right side of the preview was cut off. Narrow the side
   panels first, then scale the phone (zoom keeps layout size in step) so the
   preview stays fully visible down to the 720px point where the studio
   switches to its stacked layout. */
@media (max-width: 1180px) {
  .conf-layout { grid-template-columns: 200px minmax(0, 1fr) 230px; }
}
@media (max-width: 1000px) {
  .conf-phone { zoom: .85; }
  /* Too narrow for name + "Bald" badge. "Pflicht" stays: it explains why a
     row has no switch. Column widths and row metrics for this range sit
     after the base row rules below (they must come later to win). */
  .conf-lib-badge.soon { display: none; }
}
@media (max-width: 860px) {
  .conf-phone { zoom: .65; }
  /* Narrow library: names were cut off next to the description. */
  .conf-lib .conf-lib-desc { display: none; }
  /* With the side navigation folded away (the default here) the canvas has
     plenty of room, so the phone does not need to shrink as far. */
  .studio-nav-collapsed .conf-phone { zoom: .85; }
}
.conf-lib { background: var(--color-surface); border-right: 1px solid var(--studio-border); display: flex; flex-direction: column; overflow: hidden; }
/* No hard divider under the head (apple-design: scroll-edge effect). The list
   fades out where it slides under the head/foot instead; the padding keeps
   the first and last row clear of the fade while nothing is scrolled. */
.conf-lib-head { padding: 16px 14px 6px; flex: 0 0 auto; }
.conf-lib-title { font-weight: 700; font-size: 15px; letter-spacing: -.012em; line-height: 1.2; display: block; }
.conf-lib-sub { font-size: 11.5px; line-height: 1.4; color: var(--color-text-muted); font-weight: 500; margin-top: 3px; display: block; letter-spacing: .003em; }
.conf-lib-list { flex: 1; overflow-y: auto; padding: 12px 10px 20px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); }
.conf-lib-section { font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .08em; padding: 12px 6px 4px; display: block; }
.conf-lib-section:first-child { padding-top: 2px; }
.conf-lib-search { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--studio-canvas); color: var(--color-text); font: inherit; font-size: 12.5px; font-weight: 500;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--conf-ease-color), background-color var(--conf-ease-color); }
.conf-lib-search[hidden] { display: none; }
.conf-lib-search::placeholder { color: var(--color-text-muted); opacity: 1; }
.conf-lib-search:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--color-text); }
.conf-lib-empty { margin: 14px 6px; padding: 18px 12px; border-radius: 12px; background: var(--studio-canvas); color: var(--color-text-muted); font-size: 12.5px; font-weight: 600; text-align: center; }
/* Motion tokens for the whole configurator (apple-design / ui-micro-interactions):
   colour and opacity change on a short ease, size and position on a
   critically damped spring-like curve (no overshoot - nothing here carries
   momentum). Only the properties that really change are transitioned, never
   "all", so a new state cannot animate by accident. */
.conf-layout {
  --conf-ease-color: 140ms cubic-bezier(.2, 0, 0, 1);
  --conf-ease-move: 320ms cubic-bezier(.22, 1, .36, 1);
  --conf-press: 100ms ease-out;
}
/* A library row has two separate jobs: the row body SELECTS the widget (shows
   it in the preview and opens its settings), the switch on the right
   ACTIVATES it. Clicking around the list therefore never changes the club.
   The row is a calm card; "on" is carried by the icon tile and the switch
   instead of a tinted background, "selected" by a ring. */
.conf-lib-item { display: flex; align-items: center; gap: 4px; padding: 0; border-radius: 12px; background: var(--color-surface); user-select: none;
  box-shadow: inset 0 0 0 1px var(--studio-border);
  transition: background-color var(--conf-ease-color), box-shadow var(--conf-ease-color), transform var(--conf-press), opacity var(--conf-ease-color); }
.conf-lib-item:hover:not(.is-soon) { background: var(--studio-canvas); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text) 18%, transparent); }
/* Respond on pointer-down: the row gives under the finger at once. */
.conf-lib-item:has(.conf-lib-main:active) { transform: scale(.985); }
.conf-lib-item.is-selected { background: var(--studio-canvas); box-shadow: inset 0 0 0 1.5px var(--color-text); }
.conf-lib-item.is-soon { padding: 9px 10px; gap: 10px; opacity: .45; }
.conf-lib-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 4px 9px 9px; margin: 0; border: 0; border-radius: 12px; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.conf-lib-main:focus-visible { outline: 2px solid var(--color-text); outline-offset: -2px; }
.conf-lib-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--studio-canvas); display: grid; place-items: center; flex: 0 0 auto; color: var(--color-text-muted);
  transition: background-color var(--conf-ease-color), color var(--conf-ease-color); }
.conf-lib-item:hover .conf-lib-icon, .conf-lib-item.is-selected .conf-lib-icon { background: var(--color-surface); }
.conf-lib-item.is-active .conf-lib-icon { background: var(--brand); color: var(--brand-fg); }
.conf-lib-text { flex: 1; min-width: 0; }
/* A long name wraps onto a second line instead of being clipped by the
   switch or badge next to it. */
.conf-lib-name { font-size: 13px; font-weight: 650; display: block; line-height: 1.25; letter-spacing: -.008em; overflow-wrap: break-word; hyphens: auto; text-wrap: balance; }
.conf-lib-desc { font-size: 11.5px; color: var(--color-text-muted); font-weight: 500; display: block; margin-top: 1px; line-height: 1.35; letter-spacing: .003em; }
.conf-lib-badge { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; letter-spacing: .02em; flex: 0 0 auto; margin-right: 10px; }
.conf-lib-badge.on { background: var(--studio-canvas); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--studio-border); }
.conf-lib-badge.soon { background: var(--studio-canvas); color: var(--color-text-muted); margin-right: 0; }

/* Activation switch. 40x24 track, the 44px target comes from the pseudo
   element so the visible size stays small. The thumb moves on the spring
   curve and stretches while pressed; the colour change rides the short ease. */
.conf-switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; margin: 0 12px 0 4px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--color-text) 22%, var(--color-surface));
  transition: background-color var(--conf-ease-color), opacity var(--conf-ease-color); }
.conf-switch::before { content: ''; position: absolute; inset: -10px -6px; }
.conf-switch__thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: #fff; pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .06);
  transition: transform var(--conf-ease-move), width var(--conf-press), background-color var(--conf-ease-color); }
.conf-switch:active:not(:disabled) .conf-switch__thumb { width: 24px; }
.conf-switch[aria-checked="true"] { background: var(--brand); }
.conf-switch[aria-checked="true"] .conf-switch__thumb { transform: translateX(16px); background: var(--brand-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.conf-switch[aria-checked="true"]:active:not(:disabled) .conf-switch__thumb { transform: translateX(12px); }
.conf-switch:disabled { cursor: default; opacity: .5; }
.conf-switch:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

/* Compact library rows for the narrow layouts. Declared after the base row
   rules above so they win at equal specificity; the name column keeps about
   80px, enough for "Öffnungszeiten" to wrap at most once. */
@media (max-width: 1000px) {
  .conf-layout { grid-template-columns: 212px minmax(0, 1fr) 200px; }
  .conf-lib-list { padding-inline: 8px; }
  .conf-lib-main { gap: 8px; padding-left: 7px; }
  .conf-lib-icon { width: 26px; height: 26px; border-radius: 8px; }
  .conf-switch { width: 36px; height: 22px; margin: 0 6px 0 0; }
  .conf-switch__thumb { width: 18px; height: 18px; }
  .conf-switch[aria-checked="true"] .conf-switch__thumb { transform: translateX(14px); }
  .conf-switch:active:not(:disabled) .conf-switch__thumb { width: 22px; }
  .conf-switch[aria-checked="true"]:active:not(:disabled) .conf-switch__thumb { transform: translateX(10px); }
  .conf-lib-badge { margin-right: 6px; padding-inline: 6px; }
}
@media (max-width: 860px) {
  .conf-layout { grid-template-columns: 212px minmax(0, 1fr) 190px; }
}

.conf-canvas { display: flex; flex-direction: column; align-items: center; overflow: auto; background: var(--studio-canvas); position: relative; }
.conf-canvas-topbar { width: 100%; padding: 14px 18px 0; display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.conf-canvas-label { font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 7px; }
.conf-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #2dc76d; box-shadow: 0 0 0 3px rgba(45,199,109,.2); }
.conf-hint { font-size: 11px; color: var(--color-text-muted); font-weight: 500; display: flex; align-items: center; gap: 5px; }

/* app.css lays the member app out at a fixed real-phone width
   (max-width: 430px everywhere - see .app-shell, .club-hero, etc.),
   not a fluid/responsive one. Rendering the real widget partials at
   .conf-phone's display size (292px) would make every font/padding
   look oversized relative to the frame instead of matching the real
   app. Instead .conf-phone-screen-inner renders at the real 430px
   width app.css expects, then gets scaled down as a whole via
   transform: scale() - proportions then match the real app exactly,
   just smaller, rather than reflowing at a width app.css never
   designed for. The inner element's own width/height are set to the
   unscaled (430px-wide) size; scale-with-transform shrinks the box
   itself (not just its content), so no separate "undo the scale on
   height" math is needed - the browser handles that as part of the
   transform. */
.conf-phone { width: 310px; height: 651px; background: #0c0d0a; border-radius: 40px; padding: 9px; margin: 20px auto 32px;
  /* Depth: a bright rim where light catches the bezel, a tight contact
     shadow and a wide soft one (bigger surface = deeper shadow). */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 2px 6px rgba(0,0,0,.18), 0 40px 80px -30px rgba(0,0,0,.4); }
.conf-phone-screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: var(--color-bg); position: relative; }
.conf-phone-screen-inner {
  width: 430px; height: calc(633px / (292 / 430));
  transform: scale(calc(292 / 430)); transform-origin: top left;
  /* transform also makes this the containing block for the
     position:fixed floating tab bar inside it (standard CSS behaviour for
     any transformed ancestor) - without it the bar would break out of the
     phone frame and dock to the browser window instead. */
  display: flex; flex-direction: column;
}
.conf-phone-status { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 2px; font-size: 12px; font-weight: 700; color: var(--color-text); }
.conf-phone-status svg { display: block; }
.conf-phone-content { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.conf-w-slot { position: relative; flex: 0 0 auto; cursor: pointer; }
.conf-w-slot::after { content: ''; position: absolute; inset: 0; border-radius: 6px; border: 2px solid transparent; pointer-events: none; transition: border-color var(--conf-ease-color), box-shadow var(--conf-ease-color); }
/* Hover used a hard-coded lime that vanished on the light phone screen. */
.conf-w-slot:hover::after { border-color: color-mix(in srgb, var(--color-text) 38%, transparent); }
.conf-w-slot.sel::after { border-color: var(--color-text) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-text) 10%, transparent); }
.conf-w-slot.is-dragging { opacity: .3; transition: opacity var(--conf-ease-color); }
.conf-drop-zone { flex: 0 0 auto; height: 4px; transition: height var(--conf-ease-move), margin var(--conf-ease-move), background-color var(--conf-ease-color); }
.conf-drop-zone.is-over { height: 40px; background: color-mix(in srgb, var(--brand) 18%, transparent); border: 2px dashed var(--brand-fg); border-radius: 10px; margin: 0 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--brand-fg); }
.conf-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 12.5px; font-weight: 600; padding: 24px; text-align: center; }
/* Bottom nav is the real partials/bottom_nav.html (position: fixed in
   app.css, same containing-block trick as the header widget applies to
   it here) - no page-local CSS needed for it. */

.conf-settings { background: var(--color-surface); border-left: 1px solid var(--studio-border); display: flex; flex-direction: column; overflow: hidden; }
.conf-set-head { padding: 16px 15px 6px; flex: 0 0 auto; font-weight: 700; font-size: 15px; letter-spacing: -.012em; }
.conf-set-body { flex: 1; overflow-y: auto; padding: 12px 13px 20px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 16px), transparent 100%); }
.conf-set-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 11px; color: var(--color-text-muted); padding: 24px; }
.conf-set-empty p { font-size: 12px; font-weight: 500; line-height: 1.45; letter-spacing: .005em; max-width: 190px; margin: 0; }
.conf-set-empty strong { font-size: 13px; font-weight: 700; letter-spacing: -.005em; color: var(--color-text); }
.conf-set-empty__icon { opacity: .55; margin-bottom: 2px; }
.conf-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; background: var(--studio-canvas); border-radius: 9px; gap: 10px; margin-bottom: 6px; transition: background-color var(--conf-ease-color); }
.conf-toggle-row span { font-size: 12.5px; font-weight: 600; flex: 1; }

/* Library tabs (Widgets / Module) */
.conf-tabs { display: flex; gap: 4px; margin-top: 10px; padding: 3px; background: var(--studio-canvas); border-radius: 9px; }
.conf-tab { flex: 1; font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--color-text-muted); cursor: pointer; letter-spacing: .005em; transition: background-color var(--conf-ease-color), color var(--conf-ease-color), box-shadow var(--conf-ease-color), transform var(--conf-press); }
.conf-tab:hover:not([aria-selected="true"]) { color: var(--color-text); }
.conf-tab:active { transform: scale(.97); }
.conf-tab[aria-selected="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: 0 0 0 1px var(--studio-border), 0 1px 2px rgba(0,0,0,.12); }
.conf-tab:focus-visible,
.conf-w-slot:focus-visible,
.conf-btn:focus-visible,
.conf-publish:focus-visible,
.conf-variant__input:focus-visible + .conf-variant__tile { outline: 2px solid var(--color-text); outline-offset: 2px; }
.conf-lib-item[hidden], .conf-lib-section[hidden], .conf-lib-empty[hidden], .conf-lib-badge[hidden], .conf-lib-list[hidden], .conf-mod-panel[hidden], .conf-error[hidden], .conf-btn[hidden] { display: none; }

/* Module list */
.conf-mod-panel { flex: 1; overflow-y: auto; padding: 10px 8px; }
.conf-mod-note { font-size: 11.5px; line-height: 1.4; color: var(--color-text-muted); font-weight: 500; margin: 0 4px 10px; }
.conf-mod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.conf-mod-row { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 10px; border: 1.5px solid var(--studio-border); background: var(--color-surface); }
.conf-mod-text { flex: 1; min-width: 0; }

/* Topbar: draft/publish status, save state, errors */
.conf-canvas-topbar { gap: 12px; flex-wrap: wrap; }
.conf-topbar-left { display: flex; flex-direction: column; gap: 3px; }
.conf-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.conf-status { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.conf-status--default,
.conf-status--draft { background: var(--studio-canvas); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--studio-border); }
.conf-status--live { background: var(--brand); color: var(--brand-fg); }
.conf-status-sub, .conf-save-state { font-size: 11px; font-weight: 500; color: var(--color-text-muted); }
/* .4 made "Veröffentlichen" read as broken in light mode; .55 still reads
   as unavailable but keeps the label legible. */
.conf-publish { transition: opacity var(--conf-ease-color), transform var(--conf-press), background-color var(--conf-ease-color); }
.conf-publish:active:not(:disabled) { transform: scale(.97); }
.conf-publish:disabled { opacity: .55; cursor: not-allowed; }
.conf-note { width: calc(100% - 36px); margin: 10px 18px 0; padding: 8px 12px; border-radius: 9px; font-size: 12px; font-weight: 600; background: var(--color-surface); border: 1px solid var(--studio-border); color: var(--color-text); }
.conf-error { width: calc(100% - 36px); margin: 10px 18px 0; padding: 8px 12px; border-radius: 9px; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: color-mix(in srgb, var(--color-status-closed) 14%, var(--color-surface)); border: 1px solid var(--color-status-closed); color: var(--color-text); }
.conf-btn { font: inherit; font-size: 12px; font-weight: 600; color: var(--color-text); background: var(--studio-canvas); border: 1px solid var(--studio-border); border-radius: 8px; padding: 6px 10px; cursor: pointer; transition: background-color var(--conf-ease-color), border-color var(--conf-ease-color), opacity var(--conf-ease-color), transform var(--conf-press); }
.conf-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 7%, var(--studio-canvas)); border-color: color-mix(in srgb, var(--color-text) 22%, var(--studio-border)); }
.conf-btn:active:not(:disabled) { transform: scale(.97); }
.conf-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Settings panel: variant picker ("Widget-Design"), order, remove */
.conf-set-desc { font-size: 12px; color: var(--color-text-muted); font-weight: 500; margin: 0 0 12px; }
.conf-variants { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.conf-variants legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-text-muted); }
/* Per-widget switches (News, Bereiche, Schnellzugriff): same heading look as
   the variant picker, rows reuse the studio switch (.studio-form-toggle). */
.conf-switches { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.conf-set-label { margin-bottom: 2px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-text-muted); }
.conf-switch-row > span { font-size: 12.5px; font-weight: 600; }
.conf-switch-row .studio-form-toggle { cursor: pointer; }
.conf-switch-row .studio-form-toggle[aria-disabled="true"] { cursor: default; opacity: .55; }
.conf-switch-row .studio-form-toggle:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.conf-variants__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 7px; }
.conf-variant { position: relative; display: block; cursor: pointer; }
.conf-variant__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.conf-variant__input:disabled { cursor: not-allowed; }
.conf-variant__tile { display: block; overflow: hidden; border-radius: 9px; border: 1.5px solid var(--studio-border); background: var(--color-surface); transition: border-color var(--conf-ease-color), box-shadow var(--conf-ease-color), transform var(--conf-press); }
.conf-variant__input:hover:not(:disabled) + .conf-variant__tile { border-color: color-mix(in srgb, var(--color-text) 35%, var(--studio-border)); }
.conf-variant__input:active:not(:disabled) + .conf-variant__tile { transform: scale(.97); }
.conf-variant__input:checked + .conf-variant__tile { border-color: var(--color-text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-text) 14%, transparent); }
.conf-variant__thumb { display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 42px; padding: 7px 8px; background: var(--studio-canvas); border-bottom: 1px solid var(--studio-border); }
.conf-variant__bar { display: block; height: 5px; border-radius: 2px; background: color-mix(in srgb, var(--color-text) 28%, transparent); }
.conf-variant__thumb--rail { flex-direction: row; align-items: stretch; }
.conf-variant__thumb--rail .conf-variant__bar { height: auto; flex: 1; }
.conf-variant__thumb--grid { flex-flow: row wrap; align-content: center; }
.conf-variant__thumb--grid .conf-variant__bar { height: 11px; flex: 0 0 calc(50% - 2px); }
.conf-variant__thumb--grid .conf-variant__bar:nth-child(3) { display: none; }
.conf-variant__thumb--banner .conf-variant__bar:first-child { height: 100%; }
.conf-variant__thumb--banner .conf-variant__bar:nth-child(n+2),
.conf-variant__thumb--compact .conf-variant__bar:nth-child(n+2) { display: none; }
.conf-variant__thumb--feed .conf-variant__bar { height: 8px; border-radius: 3px; }
.conf-variant__thumb--feed .conf-variant__bar:nth-child(2) { width: 80%; }
.conf-variant__thumb--card .conf-variant__bar:first-child { height: 18px; }
.conf-variant__thumb--card .conf-variant__bar:nth-child(3) { width: 60%; }
.conf-variant__label { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 6px; font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
.conf-variant__input:checked + .conf-variant__tile .conf-variant__label { color: var(--color-text); }
.conf-variant__dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--color-text-muted); display: grid; place-items: center; }
.conf-variant__input:checked + .conf-variant__tile .conf-variant__dot { border-color: var(--color-text); }
.conf-variant__input:checked + .conf-variant__tile .conf-variant__dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--color-text); }
.conf-move { display: flex; gap: 6px; margin-top: 10px; }
.conf-move .conf-btn { flex: 1; }
.conf-remove { width: 100%; justify-content: center; margin-top: 10px; }
.conf-remove:disabled { opacity: .4; cursor: not-allowed; }

.conf-hero-target { cursor: pointer; }
.conf-layout.is-readonly .conf-hero-target { cursor: default; }
.conf-hero-target.is-sel { outline: 2px solid var(--color-text); outline-offset: -2px; }
.conf-hero-target:focus-visible { outline: 2px solid var(--color-text); outline-offset: -2px; }

/* Header tiles (SlotPicker in the settings panel when the header is selected):
   checkbox list with width badge, budget meter and order buttons. */
.conf-tiles { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.conf-tiles legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-text-muted); }
.conf-tiles__budget { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--color-text); }
.conf-tiles__meter { display: flex; gap: 4px; margin: 0 0 10px; }
.conf-tiles__unit { flex: 1; height: 6px; border-radius: 3px; background: var(--studio-border); transition: background-color var(--conf-ease-color); }
.conf-tiles__unit.is-used { background: var(--color-text); }
.conf-tiles__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.conf-tile { display: flex; align-items: center; gap: 6px; border-radius: 10px; border: 1.5px solid var(--studio-border); background: var(--color-surface); transition: border-color var(--conf-ease-color), box-shadow var(--conf-ease-color), background-color var(--conf-ease-color); }
.conf-tile.is-selected { border-color: var(--color-text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-text) 14%, transparent); }
.conf-tile.is-blocked, .conf-tile.is-off { background: var(--studio-canvas); }
.conf-tile.is-blocked .conf-tile__name, .conf-tile.is-off .conf-tile__name,
.conf-tile.is-blocked .conf-tile__desc, .conf-tile.is-off .conf-tile__desc { color: var(--color-text-muted); }
.conf-tile__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 6px 8px 9px; cursor: pointer; }
.conf-tile.is-blocked .conf-tile__main, .conf-tile.is-off .conf-tile__main { cursor: not-allowed; }
.conf-tile__check { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--color-text); }
.conf-tile__check:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.conf-tile__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.conf-tile__name { font-size: 13px; font-weight: 700; color: var(--color-text); }
.conf-tile__desc { font-size: 11px; font-weight: 500; color: var(--color-text-muted); }
.conf-tile__hint { font-size: 11px; font-weight: 700; color: var(--color-text); }
.conf-tile__width { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--studio-canvas); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--studio-border); }
.conf-tile__move { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; padding-right: 6px; }
.conf-tile__move .conf-btn { padding: 1px 8px; font-size: 11px; line-height: 1.3; }
.conf-tiles__note { margin: 8px 0 0; font-size: 11px; font-weight: 500; color: var(--color-text-muted); }

/* Motion preferences. Reduced motion keeps the colour/opacity changes
   (they carry state) and drops everything that moves or scales. */
@media (prefers-reduced-motion: reduce) {
  .conf-layout *,
  .conf-layout *::before,
  .conf-layout *::after { transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .conf-lib-item:has(.conf-lib-main:active), .conf-tab:active, .conf-btn:active, .conf-publish:active,
  .conf-variant__input:active + .conf-variant__tile { transform: none !important; }
  /* The thumb keeps its end positions (state), it just stops travelling/stretching. */
  .conf-switch:active .conf-switch__thumb { width: 20px !important; }
  .conf-lib-list, .conf-set-body { scroll-behavior: auto; }
  .conf-drop-zone { transition: background-color var(--conf-ease-color); }
}
@media (prefers-contrast: more) {
  .conf-w-slot:hover::after { border-color: var(--color-text); }
  .conf-btn, .conf-tile, .conf-variant__tile { border-color: var(--color-text-muted); }
  .conf-lib-item { box-shadow: inset 0 0 0 1px var(--color-text-muted); }
  .conf-switch { box-shadow: inset 0 0 0 1px var(--color-text-muted); }
}

/* Slot whose widget has no data yet (rendered blank by the server) */
.conf-w-blank { margin: 0 16px; padding: 16px; border: 1.5px dashed var(--studio-border); border-radius: 14px; font-size: 14px; font-weight: 500; text-align: center; color: var(--color-text-muted); }
.conf-layout.is-readonly .conf-w-slot, .conf-layout.is-readonly .conf-lib-item { cursor: default; }

/* Widget slots in the phone preview render the real club/widgets/*.html
   partials (same markup app.css already styles for the actual Club
   home), so no widget-specific CSS lives here anymore - only the
   chrome around them (slot selection outline, drop zones, above). */

/* courses.list */
.courses-list .kurse-row {
  color: inherit;
  text-decoration: none;
}

/* news.feed */
.news-feed__list { display: flex; flex-direction: column; gap: 8px; }
.news-feed__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-surface);
  border-radius: 16px;
  cursor: pointer;
}
.news-feed__photo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.news-feed__text { flex: 1; min-width: 0; }
.news-feed__date { display: block; margin-top: 2px; font-size: 12px; color: var(--color-text-muted); }

/* opening_hours */
.opening-hours {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--color-text);
}
.opening-hours--banner,
.opening-hours--compact {
  display: flex;
  align-items: center;
  gap: 10px;
}
.opening-hours--compact { padding: 10px 14px; font-size: 14px; }
.opening-hours__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-status-open);
}
.opening-hours__dot--closed { background: var(--color-status-closed); }
.opening-hours__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.opening-hours__main span,
.opening-hours__summary { color: var(--color-text-muted); font-size: 14px; }
.opening-hours__pill {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--color-status-open) 18%, var(--color-surface));
  color: var(--color-text);
}
.opening-hours__title { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.opening-hours__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}
.opening-hours__row strong { text-align: right; font-weight: 600; }
.opening-hours__row--today {
  background: color-mix(in srgb, var(--brand) 22%, var(--color-surface));
  font-weight: 700;
}

/* Header status tiles beyond the default pair (checkins, course_tip) and the
   column layouts for rows without a wide tile - tokens only, brand-fg follows
   the club colour in light and dark. */
.hero-widgets-row--cols-1 { grid-template-columns: minmax(0, 1fr); }
.hero-widgets-row--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-widgets-row--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hero-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.hero-tile__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.hero-tile__value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.hero-tile__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-tile__sub {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Primary-action targets (settings panel when "Hauptaktionen" is selected):
   two labelled selects, one per tile. */
.conf-targets { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.conf-targets legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-text-muted); }
.conf-targets__note { margin: 0 0 10px; font-size: 11px; font-weight: 500; color: var(--color-text-muted); }
.conf-target { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.conf-target__label { font-size: 12px; font-weight: 700; color: var(--color-text); }
.conf-target__select { width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--studio-border); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 13px; font-weight: 600; }
.conf-target__select:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.conf-target__select:disabled { background: var(--studio-canvas); color: var(--color-text-muted); cursor: not-allowed; }
.conf-target__hint { font-size: 11px; font-weight: 700; color: var(--color-text); }

/* ── Lead surface (claim flow + studio login) ─────────────────────────────
   Everything that looks the same with or without motion lives here; the
   motion layer is static/css/lead.css (only under html.lead-motion), so if
   that file or JS is missing the page is still the finished static page.
   Design: docs/archive/LEAD_PAGES_DESIGN.md. Regions below are owned by one work
   package each - edit only between your own markers, never reorder them. */

/* ==[ region: lead-foundation | owner: WP0 ]============================== */

/* Self-hosted Instrument Serif Italic (SIL OFL 1.1, see
   static/fonts/instrument-serif/). Latin subset only: it is used for one
   accent word per headline. */
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif/InstrumentSerif-Italic-latin.bc891bdd08ad.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* Scope class on <html> so the tokens also reach the html background. The
   lead pages are deliberately always dark: the lime ribbons only work on
   near-black, and this is sales material rather than themed app UI. This
   block is the only place in the lead section allowed to contain hex. */
.lead {
  color-scheme: dark;
  --lead-bg: #0b0c0a;
  --lead-bg-2: #121410;
  --lead-surface-solid: #16180f;
  --lead-glass: color-mix(in srgb, var(--lead-surface-solid) 64%, transparent);
  --lead-border: color-mix(in srgb, #ffffff 10%, transparent);
  --lead-border-strong: color-mix(in srgb, #ffffff 18%, transparent);
  --lead-text: #f2f3ee;
  --lead-text-muted: #a3a69b;
  --lead-accent: var(--color-accent);
  --lead-accent-fg: var(--color-accent-fg);
  --lead-teal: #0f3d3a;
  --lead-danger: #ff6961;
  --lead-radius-s: 12px;
  --lead-radius-m: 18px;
  --lead-radius-l: 28px;
  --lead-radius-xl: 40px;
  --lead-gutter: clamp(20px, 5vw, 64px);
  --lead-max: 1200px;
  --lead-section-gap: clamp(96px, 14vh, 180px);
  --lead-ease-out: cubic-bezier(.16, 1, .3, 1);
  --lead-ease-inout: cubic-bezier(.65, 0, .35, 1);
  --lead-dur-s: 240ms;
  --lead-dur-m: 600ms;
  --lead-dur-l: 900ms;
  --lead-font-serif: "Instrument Serif", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --lead-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --lead-h1: clamp(40px, 6.4vw, 88px);
  --lead-h2: clamp(32px, 4.4vw, 60px);
  --lead-body: clamp(16px, 1.15vw, 18px);
  --lead-mono-size: 12px;
  --lead-phone-w: clamp(240px, 24vw, 320px);
  background: var(--lead-bg);
  height: auto;
  min-height: 100%;
}

@media (max-width: 719px) {
  .lead { --lead-phone-w: min(72vw, 300px); }
}

/* Remaps the shared app tokens on <body>, a different element from :root,
   so the :root[data-theme] rules can't win by specificity and a light app
   setting changes nothing here. --studio-canvas/--studio-border are
   computed on :root from --color-text, so they must be redefined too. */
.lead body {
  --color-bg: var(--lead-bg);
  --color-surface: var(--lead-surface-solid);
  --color-text: var(--lead-text);
  --color-text-muted: var(--lead-text-muted);
  --color-danger: var(--lead-danger);
  --color-nav-border: var(--lead-border);
  --studio-canvas: color-mix(in srgb, var(--lead-text) 4%, var(--lead-bg));
  --studio-border: var(--lead-border);
  --brand: var(--lead-accent);
  --brand-fg: var(--lead-accent-fg);
  --brand-ink: var(--lead-accent);
  /* Transparent so the fixed ambient layer shows through. */
  background: transparent;
  height: auto;
  min-height: 100%;
  color: var(--lead-text);
}

.lead .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Stacking: ambient layer at 0, all content at 1. Never overflow:hidden on
   the page wrappers - clip keeps position:sticky and scroll timelines. */
.lead-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: clip;
  pointer-events: none;
}

.lead .ops-banner,
.lead .studio-auth,
.lead-page {
  position: relative;
  z-index: 1;
}

.lead-page { overflow-x: clip; }

.lead .ops-banner {
  background: var(--lead-glass);
  color: var(--lead-text);
  border-bottom: 1px solid var(--lead-border);
}

.lead .app-message {
  background: var(--lead-glass);
  border-color: var(--lead-border);
  color: var(--lead-text);
}

.lead .app-message--error {
  background: color-mix(in srgb, var(--lead-danger) 16%, var(--lead-surface-solid));
  border-color: color-mix(in srgb, var(--lead-danger) 55%, transparent);
  color: var(--lead-text);
}

/* Landing layout: full width, normal document flow. */
.lead-body {
  display: block;
  padding: 0;
  min-height: 100vh;
  font-size: var(--lead-body);
  line-height: 1.55;
}

/* Static background: three soft ribbons, a teal tint and a darkening veil.
   Plain gradients (no filter, no assets); lead.css breathes and scrolls
   them. `rotate` (not transform) so keyframes can animate transform freely. */
.lead-ambient__ribbon {
  position: absolute;
  width: 90vmax;
  height: 34vmax;
  border-radius: 50%;
}

.lead-ambient__ribbon--1 {
  top: -8vmax;
  left: -26vmax;
  rotate: -18deg;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lead-accent) 34%, transparent), transparent 72%);
}

.lead-ambient__ribbon--2 {
  top: 34%;
  right: -34vmax;
  rotate: 12deg;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lead-teal) 70%, transparent), transparent 72%);
}

.lead-ambient__ribbon--3 {
  bottom: -14vmax;
  left: 6%;
  rotate: -6deg;
  background: radial-gradient(closest-side, color-mix(in srgb, color-mix(in srgb, var(--lead-accent) 50%, var(--lead-teal)) 34%, transparent), transparent 72%);
}

.lead-ambient__tint,
.lead-ambient__veil {
  position: absolute;
  inset: 0;
}

.lead-ambient__tint {
  background: radial-gradient(at 70% 80%, var(--lead-teal), transparent 60%);
  opacity: 0;
}

.lead-ambient__veil {
  background: var(--lead-bg);
  opacity: 0;
}

/* Quiet pages (login, request, status) keep the ribbons calm. */
.lead--quiet .lead-ambient__veil { opacity: 0.3; }
.lead--quiet .lead-ambient__ribbon--3 { display: none; }

@media (max-width: 719px) {
  .lead-ambient__ribbon--3 { display: none; }
}

/* Type */
.lead-serif {
  font-family: var(--lead-font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.lead-kicker {
  margin: 0;
  font-family: var(--lead-font-mono);
  font-size: var(--lead-mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lead-text-muted);
}

.lead-h2,
.lead-hero__title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
}

.lead-hero__title { font-size: var(--lead-h1); }
.lead-h2 { font-size: var(--lead-h2); }

.lead-h3 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead-main p { margin: 0; }

/* Buttons and links */
.lead-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.lead-btn--primary {
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
}

.lead-btn--on-accent {
  background: var(--lead-accent-fg);
  color: var(--lead-accent);
}

.lead-link {
  color: var(--lead-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--lead-border-strong);
}

.lead-link:hover { text-decoration-color: currentColor; }

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

.lead-cta__panel :focus-visible,
.lead-moment__shape :focus-visible { outline-color: var(--lead-accent-fg); }

.lead-skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--lead-radius-s);
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  font-weight: 600;
}

.lead-skip:focus { top: 12px; }

/* Glass card (also the studio-auth card on quiet pages). */
.lead-glass {
  background: var(--lead-glass);
  border: 1px solid var(--lead-border);
  border-radius: var(--lead-radius-l);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lead-glass,
  .lead-nav { background: var(--lead-surface-solid); }
}

/* Form fields on the dark surface, incl. browser autofill, which would
   otherwise paint its own light yellow/blue background. */
.lead .studio-auth__card input::placeholder,
.lead .studio-auth__card textarea::placeholder { color: var(--lead-text-muted); }

.lead input:-webkit-autofill,
.lead textarea:-webkit-autofill,
.lead select:-webkit-autofill {
  -webkit-text-fill-color: var(--lead-text);
  caret-color: var(--lead-text);
  box-shadow: 0 0 0 1000px var(--lead-surface-solid) inset;
}

/* Nav and footer */
.lead-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--lead-bg) 62%, transparent);
  border-bottom: 1px solid var(--lead-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.lead-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--lead-max);
  margin: 0 auto;
  padding: 10px var(--lead-gutter);
}

.lead-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  color: var(--lead-text);
  text-decoration: none;
  font-weight: 700;
}

.lead-nav__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  font-size: 16px;
}

.lead-nav__sub {
  font-family: var(--lead-font-mono);
  font-size: var(--lead-mono-size);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lead-text-muted);
}

.lead-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--lead-text);
  font-size: 14px;
  white-space: nowrap;
}

/* The mono subtitle is the first thing to go on very narrow phones, so the
   brand and the status link each stay on one line at 360px. */
@media (max-width: 399px) {
  .lead-nav__sub { display: none; }
}

.lead-footer {
  margin-top: var(--lead-section-gap);
  border-top: 1px solid var(--lead-border);
}

.lead-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: var(--lead-max);
  margin: 0 auto;
  padding: 28px var(--lead-gutter) 40px;
  font-family: var(--lead-font-mono);
  font-size: var(--lead-mono-size);
  color: var(--lead-text-muted);
}

.lead-footer__inner p { margin: 0; }

/* Device frames and the screenshot skeleton (markup: apps/studio/templatetags/
   marketing.py). Screens are stacked; only .is-active is visible. */
.lead-device {
  position: relative;
  isolation: isolate;
  margin: 0;
}

.lead-device::after {
  content: "";
  position: absolute;
  inset: -14%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lead-accent) 18%, transparent), transparent);
  pointer-events: none;
}

.lead-device__bezel {
  position: relative;
  overflow: hidden;
  background: var(--lead-surface-solid);
  border: 1px solid var(--lead-border-strong);
}

/* Marks the picture as the demo studio, not the club of this page. */
.lead-device__caption {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  color: var(--lead-text-muted);
}

.lead-device--browser .lead-device__caption {
  padding: 0 0 10px;
  margin-top: 0;
  border-top: 1px solid var(--lead-border);
  padding-top: 10px;
}

.lead-device--phone {
  width: var(--lead-phone-w);
  margin-inline: auto;
}

.lead-device--phone .lead-device__bezel {
  aspect-ratio: 390 / 844;
  border-width: 6px;
  border-radius: var(--lead-radius-xl);
}

.lead-device--browser {
  width: 100%;
  border: 1px solid var(--lead-border-strong);
  border-radius: var(--lead-radius-m);
  background: var(--lead-surface-solid);
  overflow: hidden;
}

.lead-device--browser .lead-device__bezel {
  aspect-ratio: 1280 / 800;
  border: 0;
}

.lead-device__chrome {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--lead-border);
}

.lead-device__chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lead-border-strong);
}

.lead-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.lead-screen.is-active { opacity: 1; }

.lead-screen--skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 18px;
}

.lead-skel__bar {
  display: block;
  height: 14%;
  border-radius: var(--lead-radius-s);
  background: color-mix(in srgb, var(--lead-text) 7%, transparent);
}

.lead-skel__bar:first-child { height: 8%; width: 55%; }
.lead-skel__bar:nth-child(2) { height: 22%; }
.lead-skel__bar:last-child { width: 70%; }

/* Baseline static layout of the landing sections. The section owners
   (lead-landing, lead-members, lead-moment regions below) refine these. */
.lead-section {
  max-width: var(--lead-max);
  margin: 0 auto;
  padding: var(--lead-section-gap) var(--lead-gutter) 0;
}

.lead-hero__inner {
  display: grid;
  align-items: center;
}

.lead-hero__copy { max-width: 40rem; }

.lead-hero__sub {
  margin-top: 22px !important;
  max-width: 34rem;
  color: var(--lead-text-muted);
}

.lead-demand {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 32rem;
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: var(--lead-radius-m);
}

.lead-demand__value {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--lead-accent);
}

.lead-demand__label { font-size: 15px; color: var(--lead-text-muted); }

.lead-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 28px;
}

.lead-hero__micro {
  margin-top: 14px !important;
  font-family: var(--lead-font-mono);
  font-size: var(--lead-mono-size);
  color: var(--lead-text-muted);
}

.lead-hero__claimed { margin-top: 28px !important; font-size: 20px; }

.lead-heading { margin-bottom: clamp(32px, 5vw, 56px); }

.lead-members__layout { display: block; }
.lead-members__steps { display: grid; gap: 64px; }
.lead-members__step p { color: var(--lead-text-muted); max-width: 28rem; }
.lead-members__stage { display: none; }

.lead-dashboard__frame { max-width: 1000px; margin: 0 auto; }

.lead-bento {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.lead-bento__card { padding: clamp(22px, 3vw, 36px); }
.lead-bento__card p { color: var(--lead-text-muted); }

.lead-steps__body { position: relative; }

.lead-steps__line {
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--lead-border-strong);
  transform-origin: top;
}

.lead-steps__list {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-steps__item { position: relative; }

.lead-steps__item::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lead-accent);
}

.lead-steps__item p { color: var(--lead-text-muted); }

.lead-cta__panel {
  padding: clamp(48px, 8vw, 96px) var(--lead-gutter);
  border-radius: var(--lead-radius-l);
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  text-align: center;
}

.lead-cta__panel .lead-h2 { margin-bottom: 32px; }

/* Moment, static baseline: the travelling lime shape is a plain panel with
   the sentence inside, the card sits below with its own dock icon. */
.lead-moment {
  max-width: var(--lead-max);
  margin: 0 auto;
  padding: var(--lead-section-gap) var(--lead-gutter) 0;
}

.lead-moment__stage { display: grid; }

.lead-moment__shape {
  grid-area: 1 / 1;
  border-radius: var(--lead-radius-l);
  background: var(--lead-accent);
}

.lead-moment__line {
  grid-area: 1 / 1;
  align-self: center;
  z-index: 1;
  margin: 0;
  padding: clamp(48px, 8vw, 96px);
  color: var(--lead-accent-fg);
  font-size: var(--lead-h2);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-align: center;
  text-wrap: balance;
}

.lead-moment__glyph { display: none; }

.lead-moment__card {
  grid-area: 2 / 1;
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 16px;
  width: min(560px, 100%);
  margin: 24px auto 0;
  padding: 24px;
}

.lead-moment__card .lead-h3,
.lead-moment__card p { grid-column: 2; margin: 0; }
.lead-moment__card p { color: var(--lead-text-muted); }

.lead-dock__icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  font-size: 26px;
}

@media (min-width: 720px) {
  .lead-bento { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .lead-hero__inner { grid-template-columns: 1.1fr 0.9fr; }
}

/* Forced colours: drop the decoration, keep structure and focus visible. */
@media (forced-colors: active) {
  .lead-ambient { display: none; }
  .lead-glass,
  .lead-nav,
  .lead-device__bezel {
    background: Canvas;
    border: 1px solid CanvasText;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .lead-btn,
  .lead-skip,
  .studio-auth__submit {
    background: ButtonFace;
    color: ButtonText;
    border: 1px solid ButtonText;
  }
  .lead-moment__shape,
  .lead-cta__panel {
    forced-color-adjust: auto;
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
  }
  .lead-moment__line,
  .lead-cta__panel .lead-h2 { color: CanvasText; }
  .lead :focus-visible { outline: 2px solid Highlight; }
}

/* ==[ end: lead-foundation ]================================================ */


/* ==[ region: lead-auth | owner: WP1 ]==================================== */

/* Quiet lead pages: login, 2FA, claim request, claim status. Static on
   purpose (no lead.css, no lead.js): people log in daily and the request
   form is a task, not a pitch. The existing studio-auth__* classes stay
   (tests and the shared shell rely on them); this region only reskins them
   under .lead so the old light/dark studio look is untouched elsewhere. */
.lead--quiet .studio-body--auth { min-height: 100vh; min-height: 100svh; }

.lead .studio-auth__mark {
  border-radius: var(--lead-radius-s);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--lead-accent) 14%, transparent);
}

.lead .studio-auth__name {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lead .studio-auth__kicker {
  font-family: var(--lead-font-mono);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.lead .studio-auth__card {
  padding: clamp(22px, 5vw, 32px);
  /* Beats the old `border-radius: 18px` of the plain card. */
  border-radius: var(--lead-radius-l);
}

.lead .studio-auth__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lead .studio-auth__sub { font-size: 14px; line-height: 1.5; }

.lead .studio-auth__label {
  font-family: var(--lead-font-mono);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.lead .studio-auth__card input,
.lead .studio-auth__card textarea,
.lead .studio-auth__card select {
  min-height: var(--tap-min);
  border-color: var(--lead-border-strong);
  color: var(--lead-text);
  background: color-mix(in srgb, var(--lead-text) 5%, transparent);
  border-radius: var(--lead-radius-s);
}

.lead .studio-auth__card input:focus,
.lead .studio-auth__card textarea:focus,
.lead .studio-auth__card select:focus {
  border-color: var(--lead-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lead-accent) 28%, transparent);
}

/* Pill button like .lead-btn--primary, on the existing submit class. */
.lead .studio-auth__submit {
  min-height: var(--tap-min);
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  font-weight: 600;
}

.lead .studio-auth__submit:focus-visible {
  outline: 2px solid var(--lead-text);
  outline-offset: 3px;
}

.lead .studio-auth__error {
  border: 1px solid color-mix(in srgb, var(--lead-danger) 40%, transparent);
  background: color-mix(in srgb, var(--lead-danger) 14%, var(--lead-surface-solid));
  color: var(--lead-text);
}

.lead .studio-auth__foot a,
.lead .studio-auth__sub a,
.lead-link-button { color: var(--lead-text); }

/* The logout control is a <button> (POST) styled as a text link. */
.lead-link-button {
  display: block;
  margin: 16px auto 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--lead-border-strong);
  cursor: pointer;
}

.lead-link-button:hover { text-decoration-color: currentColor; }

/* Claim status: chip + detail list on the glass card. */
.lead-chip {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border: 1px solid var(--lead-border-strong);
  border-radius: 999px;
  font-family: var(--lead-font-mono);
  font-size: var(--lead-mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lead-text-muted);
}

.lead-chip--approved {
  border-color: color-mix(in srgb, var(--lead-accent) 55%, transparent);
  background: color-mix(in srgb, var(--lead-accent) 14%, transparent);
  color: var(--lead-accent);
}

.lead-chip--rejected {
  border-color: color-mix(in srgb, var(--lead-danger) 55%, transparent);
  background: color-mix(in srgb, var(--lead-danger) 14%, transparent);
  color: var(--lead-danger);
}

.lead .claim-status-detail,
.lead .claim-status-detail__row + .claim-status-detail__row { border-color: var(--lead-border); }

/* Claim request: aside beside the form from 1024px, stacked below. The body
   is the grid (the aside is a sibling of <main class="studio-auth">). */
.lead-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 32px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px var(--lead-gutter);
}

.lead-aside {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.lead-aside__title {
  margin: 12px 0 0;
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

.lead-trust {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.lead-trust__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-top: 1px solid var(--lead-border);
}

.lead-trust__title { font-weight: 600; }
.lead-trust__text { font-size: 14px; color: var(--lead-text-muted); }

.lead-request .studio-auth { margin: 0 auto; }

@media (min-width: 1024px) {
  .lead-request {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(48px, 7vw, 112px);
    max-width: var(--lead-max);
    margin: 0 auto;
  }
  .lead-aside { margin: 0 0 0 auto; }
  .lead-request .studio-auth { margin: 0 auto 0 0; max-width: 460px; }
}

/* ==[ end: lead-auth ]====================================================== */


/* ==[ region: lead-landing | owner: WP3 ]================================= */

/* Final static layout of hero, dashboard, steps and closing CTA. These look
   finished with no JS and no motion; lead.css (motion-landing) only adds
   entrance and scroll effects on top. Later than the foundation baseline,
   so equal-specificity rules here win. */

/* Hero: copy and phone stacked on small screens, side by side from 1024px. */
.lead-hero { padding-top: clamp(32px, 7vh, 88px); }

.lead-hero__inner { gap: clamp(40px, 8vw, 72px); }

.lead-hero__title { margin-top: 20px; }

.lead-hero__sub {
  font-size: var(--lead-body);
  line-height: 1.55;
}

.lead-hero__device {
  display: flex;
  justify-content: center;
  /* Keeps the phone out of the text column's way on narrow screens. */
  min-width: 0;
}

.lead-demand {
  width: fit-content;
  max-width: 100%;
}

.lead-demand__value {
  min-width: 1ch;
  text-align: center;
}

.lead-demand__label {
  line-height: 1.4;
  text-wrap: balance;
}

.lead-hero__actions .lead-btn { min-width: 12rem; }

.lead-hero__claimed {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.3;
  color: var(--lead-text);
}

/* Dashboard: browser frame, then the two benefit cards. */
.lead-dashboard__frame { width: 100%; }

.lead-bento { gap: clamp(14px, 2vw, 24px); margin-top: clamp(28px, 4vw, 48px); }

.lead-bento__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 11rem;
  justify-content: flex-end;
}

.lead-bento__card .lead-h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
}

.lead-bento__card p { max-width: 26rem; line-height: 1.5; }

/* Steps: a vertical line on the left with one dot per step. */
.lead-steps__body {
  position: relative;
  padding-left: 44px;
  max-width: 40rem;
}

.lead-steps__list { gap: clamp(32px, 5vw, 56px); }

.lead-steps__num { display: block; margin-bottom: 8px; }

.lead-steps__item .lead-h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
}

.lead-steps__item p { max-width: 30rem; line-height: 1.5; }

/* Closing CTA: one lime panel, room below it before the footer. */
.lead-cta { padding-bottom: clamp(48px, 8vh, 96px); }

.lead-cta__panel .lead-h2 {
  max-width: 18ch;
  margin-right: auto;
  margin-left: auto;
}

.lead-cta__panel .lead-btn { min-width: 14rem; }

@media (max-width: 479px) {
  .lead-hero__actions .lead-btn,
  .lead-cta__panel .lead-btn { width: 100%; }
  .lead-demand { padding: 16px 18px; gap: 14px; }
}

@media (min-width: 1024px) {
  .lead-hero {
    display: flex;
    align-items: center;
    min-height: min(calc(100svh - 72px), 860px);
    padding-bottom: 0;
  }
  .lead-hero__inner { width: 100%; }
  .lead-hero__device { justify-content: flex-end; }

  .lead-steps {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
  }
  .lead-steps .lead-heading { margin-bottom: 0; }
}

/* ==[ end: lead-landing ]=================================================== */


/* ==[ region: lead-members | owner: WP4b ]================================ */
/* Members section, static layout. Every member sees the screens inline, one
   phone per step. The sticky stage with crossfading screens is a motion
   enhancement that lead.css switches on (motion-members), so with no JS,
   reduced motion or a failed lead.css this layout is the finished page. */
.lead-members {
  /* Phone height from its width and the 390x844 screenshot ratio; the sticky
     offset in lead.css centres the stage with it. */
  --phone-h: calc(var(--lead-phone-w) * 844 / 390);
}

.lead-members__step {
  display: grid;
  gap: 28px;
}

.lead-members__inline-device { margin-top: 0; }

@media (min-width: 1024px) {
  .lead-members__step {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 48px;
  }
}

/* ==[ end: lead-members ]=================================================== */


/* ==[ region: lead-moment | owner: WP5 ]================================== */

/* Dock geometry of the lime moment (docs/archive/LEAD_PAGES_DESIGN.md, C). The
   travelling shape ends as a clip-path inset that must land exactly on the
   card's icon slot, so the card's position and the icon's offset inside it
   are expressed once, here, as stage-relative custom properties that both
   the card (top/left/width) and the motion keyframes (inset/translate)
   read. Percentages resolve against the stage in every consumer: the
   stage is both the card's containing block and the clip-path reference
   box, and the glyph wrapper is stage-sized. --card-edge is the glass
   card's 1px border, which the icon slot sits inside of; without it the
   dock would miss by a pixel. Motion-free pages never read these. */
.lead-moment__stage {
  --card-w: min(560px, calc(100% - 2 * var(--lead-gutter)));
  --card-top: calc(50% - 72px);
  --card-pad: 24px;
  --card-edge: 1px;
  --dock-size: 56px;
  --dock-t: calc(var(--card-top) + var(--card-edge) + var(--card-pad));
  --dock-l: calc((100% - var(--card-w)) / 2 + var(--card-edge) + var(--card-pad));
  --dock-r: calc(100% - var(--dock-l) - var(--dock-size));
  --dock-b: calc(100% - var(--dock-t) - var(--dock-size));
}

/* ==[ end: lead-moment ]==================================================== */

/* ── Kurse: session detail sheet (club_kurse) ── */
.kurse-row__link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.kurse-row__link .kurse-row__name,
.kurse-row__link .kurse-row__meta { display: block; }
.kurs-detail__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.kurs-detail__media img { width: 100%; height: 100%; object-fit: cover; }
.kurs-detail__media svg { width: 56px; height: 56px; }
.kurs-detail__title { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.kurs-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.kurs-detail__facts { margin: 0 0 16px; }
.kurs-detail__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--color-nav-border);
  font-size: 14px;
}
.kurs-detail__facts dt { color: var(--color-text-muted); }
.kurs-detail__facts dd { margin: 0; font-weight: 600; text-align: right; }
.kurs-detail__heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 16px 0 8px;
}
.kurs-detail__text { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.kurs-detail__action { margin-top: 20px; }
.kurs-detail__btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
}
.kurs-detail__btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-nav-border);
}
.kurs-detail__note { text-align: center; color: var(--color-text-muted); font-size: 14px; margin: 0; }

/* ── Studio: Personal Training (availability, offers, bookings) ── */
.pt-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.pt-tabs__tab {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--color-text-muted); background: var(--color-surface);
  border: 1px solid var(--studio-border); text-decoration: none;
}
.pt-tabs__tab.is-active { color: var(--brand-fg); background: var(--brand); border-color: var(--brand); }
.pt-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pt-picker .studio-form-label { margin: 0; }
.pt-day { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--studio-border); }
.pt-day:last-child { border-bottom: 0; }
.pt-day__name { flex: 0 0 96px; font-size: 14px; font-weight: 600; }
.pt-day__rules { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pt-rule { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 4px 0; }
.pt-rule.is-off { opacity: 0.55; }
.pt-rule__time { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-rule form { margin: 0; }
.pt-btn-ghost { color: var(--color-text); background: var(--studio-canvas); border: 1px solid var(--studio-border); }
.pt-hint { margin: 0 0 10px; }
.pt-weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pt-chip span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 36px;
  padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--studio-border);
}
.pt-chip input:checked + span { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.pt-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pt-timeoff-form { margin-top: 14px; }
.pt-actions { display: flex; gap: 8px; margin-top: 10px; }
.pt-actions form { margin: 0; }
.pt-card-off { opacity: 0.7; }
.pt-booking { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--studio-border); }
.pt-booking:last-child { border-bottom: 0; }
.pt-booking form { margin: 0; }
.pt-booking__when { flex: 0 0 64px; display: flex; flex-direction: column; font-size: 12px; color: var(--color-text-muted); }
.pt-booking__when strong { font-size: 16px; color: var(--color-text); font-variant-numeric: tabular-nums; }
.pt-booking__main { flex: 1; min-width: 0; font-size: 14px; }
.pt-booking--past { opacity: 0.8; }
.pt-status { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.pt-status--cancelled { color: #d64545; }
@media (max-width: 520px) {
  .pt-day { flex-direction: column; gap: 6px; }
  .pt-day__name { flex: none; }
  .pt-booking { flex-wrap: wrap; }
}

/* ── Club branding: uploaded logo in the member header ─────────── */
.club-logo { overflow: hidden; }
.club-logo__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.studio-brand__mark { overflow: hidden; }
.studio-brand__logo { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ==[ studio: Kurse (Stammdaten, Termin-Detail) ]=========================== */
.studio-field-error { margin: 4px 0 0; font-size: 12px; color: #d64545; }
.studio-course-image { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.studio-course-image img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--studio-border); }
.studio-course-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.studio-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; white-space: nowrap; border: 1px solid var(--studio-border); }
.studio-badge--ok { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--color-text); border-color: transparent; }
.studio-badge--muted { background: var(--studio-canvas); color: var(--color-text-muted); }
form .studio-form-grid .studio-select { width: 100%; }
a.studio-list__main { color: inherit; text-decoration: none; }
a.studio-list__main:hover { text-decoration: underline; }
/* ==[ end: studio kurse ]=================================================== */

/* ── Studio settings (branding + access) ───────────────────────── */
.ss-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 900px) { .ss-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ss-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.ss-color-row { display: flex; align-items: center; gap: 10px; }
.ss-color-picker { width: 44px; height: 36px; padding: 0; border: 1px solid var(--studio-border); border-radius: 8px; background: none; cursor: pointer; }
.ss-color-text { width: 120px; font-family: ui-monospace, monospace; }
.ss-error { margin: 6px 0 0; font-size: 12.5px; color: var(--color-danger); }
.ss-fieldset { border: 0; margin: 0 0 16px; padding: 0; }
/* Settings: stacked cards, a logo drop area, colour swatches and option tiles. */
.ss-stack { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.ss-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ss-actions { display: flex; justify-content: flex-start; }

.ss-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px dashed color-mix(in srgb, var(--color-text) 24%, transparent); border-radius: 14px; background: var(--studio-canvas); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.ss-drop:hover { border-color: var(--color-text); }
.ss-drop:focus-within { outline: 2px solid var(--color-text); outline-offset: 2px; }
.ss-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ss-drop__tile { width: 56px; height: 56px; border-radius: 14px; background: var(--color-surface); border: 1px solid var(--studio-border); display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; overflow: hidden; }
.ss-drop__tile img { width: 100%; height: 100%; object-fit: contain; }
.ss-drop__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ss-drop__text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-drop__text small { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }

.ss-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); transition: transform .12s ease, border-color .12s ease; }
.ss-swatch:hover { transform: scale(1.1); }
.ss-swatch.is-on { border-color: var(--color-text); outline: 2px solid var(--color-surface); outline-offset: -4px; }
.ss-swatch:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

.ss-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ss-tile { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--studio-border); border-radius: 14px; background: var(--studio-canvas); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.ss-tile:hover { border-color: color-mix(in srgb, var(--color-text) 36%, transparent); }
.ss-tile:has(input:checked) { border-color: var(--brand-ink, var(--brand)); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.ss-tile:has(input:focus-visible) { outline: 2px solid var(--color-text); outline-offset: 2px; }
.ss-tile input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 6px; border: 1.5px solid color-mix(in srgb, var(--color-text) 40%, transparent); background: transparent; display: grid; place-items: center; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.ss-tile input:checked { background: var(--brand); border-color: var(--brand); }
.ss-tile input:checked::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--brand-fg); border-bottom: 2px solid var(--brand-fg); transform: translateY(-1px) rotate(-45deg); }
.ss-tile__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ss-tile__text strong { font-size: 13.5px; }
.ss-tile__text small { font-size: 12px; color: color-mix(in srgb, var(--color-text) 74%, transparent); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .ss-drop, .ss-swatch, .ss-tile, .ss-tile input { transition: none; }
}
.ss-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }.ss-preview { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--studio-border); }
.ss-preview--light { background: #e8e8e0; color: #0a0a0a; }
.ss-preview--dark { background: #1c1c1e; color: #f2f2f7; }
.ss-preview__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.ss-preview__hero { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--p-brand); color: var(--p-fg); }
.ss-preview__logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--p-fg) 12%, transparent); overflow: hidden; font-size: 18px; flex: 0 0 auto; }
.ss-preview__logo img { width: 100%; height: 100%; object-fit: contain; }
.ss-preview__name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-preview__btn { text-align: center; padding: 9px 8px; border-radius: 10px; font-weight: 700; font-size: 12px; background: var(--p-brand); color: var(--p-fg); }
.ss-preview--light .ss-preview__ink { color: var(--p-ink, var(--p-fg)); font-weight: 700; font-size: 13px; }
.ss-preview--dark .ss-preview__ink { color: var(--p-brand); font-weight: 700; font-size: 13px; }
/* Brand as text on a light surface: club-specific (see club_branding). Falls
   back to --brand-fg when a page doesn't set --brand-ink-light. */
:root[data-theme="light"] { --brand-ink: var(--brand-ink-light, var(--brand-fg)); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --brand-ink: var(--brand-ink-light, var(--brand-fg)); }
}

/* ══ Personal Training: Buchungs-Flow + Meine Termine (club_trainer, .ptb-*) ══
   Nur Tokens (--brand, --color-*), keine festen Farben: folgt Hell/Dunkel und
   der Markenfarbe des Clubs. */
.ptb-step { padding: 16px 16px 32px; }
.ptb-step__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.ptb-step__eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.ptb-step__title { margin: 2px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.ptb-step__sub { margin: 4px 0 0; font-size: 14px; color: var(--color-text-muted); }
.ptb-back { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; margin: -8px 0 0 -10px; color: var(--color-text); }
.ptb-back svg { width: 22px; height: 22px; }
.ptb-free { color: var(--brand-ink); font-weight: 700; }
.ptb-hint { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--color-text-muted); }
.ptb-empty { margin: 24px 0; padding: 20px 16px; border-radius: 16px; background: var(--color-surface); text-align: center; font-size: 15px; line-height: 1.45; color: var(--color-text-muted); }

.ptb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ptb-offer { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px 16px; border-radius: 16px; background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.ptb-offer:active { opacity: 0.6; }
.ptb-offer__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ptb-offer__name { font-size: 16px; font-weight: 700; }
.ptb-offer__meta, .ptb-offer__desc { font-size: 13px; color: var(--color-text-muted); }
.ptb-offer__price { flex: 0 0 auto; font-size: 15px; font-weight: 700; }
.ptb-offer__price--free { color: var(--brand-ink); }

.ptb-days { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.ptb-days::-webkit-scrollbar { display: none; }
.ptb-day { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; min-height: 60px; border-radius: 14px; background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.ptb-day__wd { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.ptb-day__nr { font-size: 18px; font-weight: 700; }
.ptb-day--selected { background: var(--brand); color: var(--brand-fg); }
.ptb-day--selected .ptb-day__wd { color: inherit; opacity: 0.8; }

.ptb-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ptb-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 8px; border-radius: 12px; background: var(--color-surface); color: var(--color-text); text-decoration: none; border: 1px solid var(--color-nav-border); }
.ptb-slot:active { background: var(--brand); color: var(--brand-fg); }
.ptb-slot__time { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ptb-slot__who { font-size: 11px; color: var(--color-text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ptb-facts { margin: 0 0 14px; border-radius: 16px; background: var(--color-surface); padding: 4px 16px; }
.ptb-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--color-nav-border); font-size: 15px; }
.ptb-facts div:last-child { border-bottom: 0; }
.ptb-facts dt { color: var(--color-text-muted); }
.ptb-facts dd { margin: 0; font-weight: 600; text-align: right; }
.ptb-notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 14%, var(--color-surface)); font-size: 14px; line-height: 1.45; }
.ptb-form { display: flex; flex-direction: column; gap: 8px; }
.ptb-form__label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.ptb-form__note { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 1px solid var(--color-nav-border); background: var(--color-surface); color: var(--color-text); font-family: inherit; font-size: 16px; resize: vertical; }

.ptb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; font-family: inherit; font-size: 15px; font-weight: 700; background: var(--brand); color: var(--brand-fg); cursor: pointer; text-decoration: none; }
.ptb-btn:active { transform: scale(0.98); }
.ptb-btn--block { display: flex; width: 100%; box-sizing: border-box; margin-top: 12px; }
.ptb-btn--ghost { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-nav-border); min-height: 44px; }
.ptb-btn--danger { background: none; color: var(--color-danger); border: 1px solid var(--color-danger); min-height: 44px; }

.ptb-next { margin: 0; }
.ptb-next__label { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.ptb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ptb-chip { display: inline-flex; flex-direction: column; align-items: center; min-height: 44px; padding: 6px 12px; justify-content: center; border-radius: 12px; background: var(--color-bg); color: var(--color-text); text-decoration: none; border: 1px solid var(--color-nav-border); }
.ptb-chip:active { background: var(--brand); color: var(--brand-fg); }
.ptb-chip__day { font-size: 11px; color: var(--color-text-muted); }
.ptb-chip__time { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.staff-detail .ptb-next { margin-bottom: 16px; }
a.staff-detail__book-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
a.trainer-card__book { display: inline-flex; align-items: center; text-decoration: none; }
.trainer-card__none { font-size: 13px; color: var(--color-text-muted); }
a.trainer-any-card { text-decoration: none; box-sizing: border-box; }

.ptb-appt-link { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--color-surface); color: var(--color-text); text-decoration: none; min-height: 56px; }
.ptb-appt-link__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ptb-appt-link__title { font-size: 15px; font-weight: 700; }
.ptb-appt-link__meta { font-size: 13px; color: var(--color-text-muted); }
.ptb-appt-link__count { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--brand); color: var(--brand-fg); font-size: 12px; font-weight: 700; text-align: center; }
.ptb-appt-link__chev { width: 18px; height: 18px; color: var(--color-text-muted); }

.ptb-section { margin: 20px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-text-muted); }
.ptb-appt { margin-bottom: 10px; padding: 14px 16px; border-radius: 16px; background: var(--color-surface); }
.ptb-appt--past { opacity: 0.85; }
.ptb-appt__when { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.ptb-appt__title { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.ptb-appt__meta { margin: 2px 0 0; font-size: 13px; color: var(--color-text-muted); }
.ptb-appt__note { margin: 8px 0 0; font-size: 13px; font-style: italic; color: var(--color-text-muted); }
.ptb-appt__status--cancelled { color: var(--color-danger); }
.ptb-appt__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ptb-appt__actions form { margin: 0; }
.ptb-appt__locked { font-size: 12px; color: var(--color-text-muted); }

/* PT chips: the <label> wrapper must stay chrome-free, the <span> is the pill. */
label.pt-chip { display: inline-block; position: relative; background: none; border: 0; padding: 0; margin: 0; box-shadow: none; }

/* Studio course form: grid inputs fill their cell instead of overflowing the card. */
.studio-form-grid > .studio-form-row > .studio-text-input { width: 100%; min-width: 0; box-sizing: border-box; }

/* ── Release notes (apps/release_notes) ──
   Shared by the member sheet and the studio page. Colours come from the
   theme tokens only, so light and dark both work; the badge keeps
   --color-text on a tinted background for contrast. */
.relnotes__version {
  margin: -8px 0 8px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

.relnotes__heading {
  margin: 18px 2px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.relnotes__release {
  margin-bottom: 12px;
  padding: 4px 14px;
  background: var(--color-surface);
  border-radius: 14px;
}

.studio-card .relnotes__release { background: var(--color-bg); }

.relnotes__release--new {
  box-shadow: inset 3px 0 0 var(--brand);
}

.relnotes__release-id {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.relnotes__entries { list-style: none; margin: 0; padding: 0; }

.relnotes__entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-nav-border);
}

.relnotes__entry:last-child { border-bottom: none; }

.relnotes__badge {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text-muted) 22%, transparent);
}

.relnotes__badge--new { background: color-mix(in srgb, var(--color-status-open) 28%, transparent); }
.relnotes__badge--improved { background: color-mix(in srgb, var(--brand) 28%, transparent); }

.relnotes__body { min-width: 0; }
.relnotes__text { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.relnotes__module { font-size: 12px; color: var(--color-text-muted); }
.relnotes__module a { color: inherit; text-decoration: underline; }
.studio-card .relnotes__heading:first-child { margin-top: 0; }

/* ── App feedback (apps/app_feedback) ──
   Reuses .auth-form/.auth-field; only the pieces those do not cover. Theme
   tokens only. */
.app-feedback .auth-field textarea { min-height: 120px; resize: vertical; }

.app-feedback .app-feedback__check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
}

.app-feedback .app-feedback__check input {
  flex: 0 0 auto;
  min-height: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.app-feedback__privacy { margin: 0 2px; }

.app-feedback__thanks { text-align: center; padding: 8px 0 4px; }

.app-feedback__ticket {
  margin: 8px 0 0;
  font-size: 20px;
  color: var(--color-text);
}

.app-feedback__done {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  text-decoration: none;
}

.app-feedback--studio { max-width: 560px; }

/* ── Assistant (MCP) access: consent screen + Settings > KI-Assistenten ───
   docs/MCP_ACCESS_PLAN.md. Reuses the settings cards and auth sheet; only
   the pieces those do not have live here. Colors are theme tokens. */

.assist-consent { padding-bottom: 0; }
.assist-consent .auth-title { padding-bottom: 12px; }

.assist-check,
.assist-cross {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assist-check svg,
.assist-cross svg { width: 14px; height: 14px; }
.assist-check {
  background: color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand-ink);
}
.assist-cross {
  background: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  color: var(--color-text-muted);
}

.assist-origin {
  margin: 0 0 14px;
  padding: 4px 14px;
  background: var(--color-surface);
  border-radius: 14px;
}
.assist-origin > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-nav-border);
}
.assist-origin > div:last-child { border-bottom: none; }
.assist-origin dt {
  font-size: 12px;
  color: var(--color-text-muted);
}
.assist-origin dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.assist-warning {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  background: color-mix(in srgb, var(--color-danger) 14%, transparent);
}

.assist-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  bottom: 0;
  margin: 0 -16px;  /* .auth-page pads its sides by 16px; the bar spans the sheet */
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--color-bg);
  border-top: 1px solid var(--color-nav-border);
}
.assist-cancel {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
}
/* Inline action stack (Verlängern confirm): same buttons, not sticky. */
.assist-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assist-actions .assist-warning,
.assist-actions .settings-hint { margin: 0; }
.assist-actions .settings-hint { padding-top: 0; }

/* Code input in a card: label above, full width, themed (.auth-field styles it). */
.assist-field-card { padding: 14px; }
.assist-card + .assist-field-card { margin-top: 12px; }
.assist-code {
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-size: 20px;
  color-scheme: light dark;
}
.assist-code::placeholder { color: var(--color-text-muted); }

/* Opt-in row (admin write scope): label + hint left, the settings toggle right. */
.assist-optin {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: var(--tap-min);
  cursor: pointer;
}
.assist-optin__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.assist-optin__hint { font-size: 12px; color: var(--color-text-muted); }
.assist-card .settings-row__label { overflow-wrap: anywhere; line-height: 1.35; }
.assist-footnote { text-align: center; padding: 0 4px 14px; }

.assist-intro { padding: 0 4px; }

.assist-connection {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
}
.assist-connection__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.assist-connection__name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.assist-connection__actions { display: flex; gap: 10px; }
.assist-connection__actions > * { flex: 1; min-width: 0; margin: 0; }
.assist-connection__actions .assist-btn,
.assist-connection__actions .assist-revoke {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--tap-min);
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  text-decoration: none;
}
.assist-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.assist-chip {
  font-size: 12px;
  line-height: 1.3;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
}
.assist-connection__meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.assist-revoke {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 12px;
  color: var(--color-danger);
  background: transparent;
  border: 1.5px solid var(--color-danger);
  border-radius: 12px;
  cursor: pointer;
}
.assist-empty { color: var(--color-text-muted); }

.assist-url { gap: 10px; }
.assist-url__value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.assist-copy {
  padding: 0 14px;
  min-height: 44px;
  font-size: 14px;
}
.assist-steps { padding-left: 28px; }
.assist-steps li { padding-bottom: 6px; }

/* Provenance chip on routines an assistant created (Routine.source). */
.routine-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--color-text);
  background: color-mix(in srgb, var(--brand) 22%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  white-space: nowrap;
}

/* One-sentence beginner summary under an exercise's name in a routine row: normal
   sentence case (unlike .exercises-item__sub) and up to two lines. */
.exercises-item__summary {
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* One-sentence beginner summary under an exercise's name (detail sheet). */
.exercise-detail__summary {
  margin: 4px 0 12px;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.4;
}

/* ── Workout log: remove set, skip exercise, routine choices ─────────────── */
/* "− Satz" sits beside "+ Satz": deleting a set used to hide in the set-number
   menu, where nobody looked for it. */
.session-entry__set-actions {
  display: flex;
  gap: 8px;
}

.session-entry__set-actions > button {
  flex: 1;
  width: auto;
}

.session-entry__remove-set,
.session-entry__skip,
.session-entry__unskip {
  min-height: var(--tap-min);
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.session-entry__skip {
  display: block;
  width: 100%;
  font-weight: 600;
}

.session-entry--skipped .exercise-head {
  opacity: 0.6;
}

.session-entry__skipped-note {
  margin: 4px 0 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.4;
}

.session-entry__unskip {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-surface));
  color: var(--color-text);
}

.exercise-list__status--skipped {
  border-style: dashed;
}

.finish-sheet__routine {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--color-nav-border);
  border-radius: 12px;
}

.finish-sheet__routine[hidden] {
  display: none;
}

.finish-sheet__routine-title {
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.finish-sheet__routine-hint {
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.finish-sheet__routine-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap-min);
  font-size: 14px;
}

/* ── Workout log: swipe actions behind a set row ─────────────────────────── */
/* The row slides over two strips (Apple Mail style). `touch-action: pan-y`
   keeps the vertical page scroll with the browser and delivers the horizontal
   movement to session_page.js (wireSwipe). The strips are as wide as the
   revealed distance, so nothing needs an opaque row; hidden while closed, so
   they are neither visible nor tabbable. */
.session-set__swipe {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  touch-action: pan-y;
  --swipe-x: 0px;
}

.session-set__swipe .session-set__row {
  transform: translateX(var(--swipe-x));
  transition: transform 0.18s ease-out;
}

.session-set__swipe--dragging .session-set__row {
  transition: none;
}

.session-set__actions {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
  visibility: hidden;
}

.session-set__swipe[data-swipe-state] .session-set__actions {
  visibility: visible;
}

.session-set__actions--start {
  left: 0;
  width: max(var(--swipe-x), 0px);
}

.session-set__actions--end {
  right: 0;
  width: max(calc(var(--swipe-x) * -1), 0px);
}

.session-set__action {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  padding: 0 4px;
  background: color-mix(in srgb, var(--color-text) 18%, var(--color-surface));
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.session-set__action--brand {
  background: var(--brand);
  color: var(--brand-fg);
}

.session-set__action--danger {
  background: var(--color-danger);
  color: var(--color-bg);
}

@media (prefers-reduced-motion: reduce) {
  .session-set__swipe .session-set__row {
    transition: none;
  }
}

/* ==[ region: public-site ]=================================================
   Public web presence (apps/public_site, issue #212): shell, nav, footer and
   shared building blocks. Theme-aware through the app tokens; the start page
   and "Für Studios" add `.lead` on <html>, which remaps the same tokens to
   the always-dark lead palette (region lead-foundation), so nothing here
   needs a second dark variant. Page sections follow below in their own
   sub-regions. */

/* The app's html/body are a 430px phone column; the public site is full width. */
.public-html,
.public-body {
  max-width: none;
  height: auto;
}

.public-body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.lead .public-body { background: transparent; }

.public-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: clip;
}

.public-main { flex: 1 0 auto; }

.public-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 64px);
  box-sizing: border-box;
}

.public-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-weight: 700;
  text-decoration: none;
}

.public-skip:focus { top: 12px; }

/* Nav: translucent bar, brand left, actions right. The two content links
   drop out below 720px (footer and in-page teasers carry them there). */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--color-nav-border);
}

.public-nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 64px);
  box-sizing: border-box;
}

.public-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  color: var(--color-text);
  text-decoration: none;
}

.public-nav__mark {
  border-radius: 9px;
  display: block;
}

.public-nav__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.public-nav__links {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.public-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 12px;
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.public-nav__link:hover,
.public-nav__link[aria-current="page"] {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}

.public-nav__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 719px) {
  .public-nav__inner { gap: 8px; }
  .public-nav__links { display: none; }
  .public-nav__actions { margin-left: auto; }
  .public-nav__name { font-size: 17px; }
}

@media (max-width: 359px) {
  .public-nav__login { display: none; }
}

/* Buttons: one pill shape, primary = accent fill, ghost = outline. */
.public-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 200ms ease;
}

.public-btn--small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.public-btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  box-shadow: 0 8px 28px -10px color-mix(in srgb, var(--color-accent) 70%, transparent);
}

.public-btn--primary:hover { transform: translateY(-1px); }

.public-btn--ghost {
  border-color: color-mix(in srgb, var(--color-text) 22%, transparent);
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
}

.public-btn--ghost:hover { background: color-mix(in srgb, var(--color-text) 9%, transparent); }

.public-btn:focus-visible,
.public-nav__link:focus-visible,
.public-nav__brand:focus-visible,
.public-footer a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.public-preview {
  margin: 0;
  padding: 10px clamp(16px, 5vw, 64px);
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Type */
.public-kicker {
  margin: 0;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.public-h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.public-h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 54px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.public-h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.public-serif {
  font-family: "Instrument Serif", ui-serif, "Iowan Old Style", Palatino, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.public-lede {
  margin: 0;
  max-width: 38em;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.55;
  color: var(--color-text-muted);
  text-wrap: pretty;
}

.public-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-nav-border);
  background: var(--color-surface);
  font-size: 14px;
  font-weight: 600;
}

/* Placeholder pages (Ratgeber), the public sibling of the Food tab. */
.public-soon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-top: clamp(48px, 10vh, 120px);
  padding-bottom: clamp(64px, 12vh, 140px);
  max-width: 760px;
}

.public-soon__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.public-soon__note {
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* Footer */
.public-footer {
  margin-top: clamp(48px, 8vh, 96px);
  border-top: 1px solid var(--color-nav-border);
  background: color-mix(in srgb, var(--color-surface) 55%, var(--color-bg));
}

.lead .public-footer { background: color-mix(in srgb, var(--color-bg) 70%, transparent); }

.public-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px clamp(16px, 5vw, 64px) calc(40px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.public-footer__brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.public-footer__brand img { border-radius: 8px; }

.public-footer__name {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.public-footer__tagline {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.public-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 6vw, 72px);
}

.public-footer__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.public-footer__head {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.public-footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--color-text);
  text-decoration: none;
}

.public-footer__list a:hover { text-decoration: underline; }

/* ==[ region: public-home ]==================================================
   Start page (apps/public_site/templates/public_site/home.html, issue #215):
   the finished static look. It runs under `.lead` (always dark, lead tokens),
   reuses the lead primitives and adds only what the start page has of its
   own. Motion is static/css/home.css, under html.lead-motion only. */

.lead--home .public-nav { background: color-mix(in srgb, var(--lead-bg) 62%, transparent); }

.home-btn {
  min-height: 52px;
  padding: 0 28px;
  font-weight: 700;
}

.home-btn.lead-btn--primary {
  box-shadow: 0 10px 36px -12px color-mix(in srgb, var(--lead-accent) 80%, transparent);
}

.home-eyebrow {
  margin-bottom: 14px;
  color: var(--lead-accent);
}

.home-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--lead-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lead-accent) 22%, transparent);
  vertical-align: 1px;
}

/* Hero */
.home-hero { padding-top: clamp(40px, 9vh, 112px); }
.home-hero .lead-hero__inner { gap: clamp(48px, 6vw, 72px); }
.home-hero .lead-hero__kicker { margin-bottom: 22px; }
.home-hero .lead-hero__title { font-weight: 700; }
.home-hero__device { position: relative; }

/* Each sentence of the headline stays on one line, so it never breaks
   between "Dein" and "Studio". */
.home-line { white-space: nowrap; }

.home-float {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.home-float__card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 18px;
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--lead-bg) 90%, transparent);
  white-space: nowrap;
}

.home-float__card--1 { top: 16%; left: 0; }
.home-float__card--2 { top: 47%; right: 0; }
.home-float__card--3 { bottom: 9%; left: 3%; }

.home-float__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lead-text) 10%, transparent);
  color: var(--lead-accent);
}

.home-float__icon--accent {
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
}

.home-float__text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.3;
  color: var(--lead-text-muted);
}

.home-float__text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--lead-text);
}

@media (min-width: 1024px) {
  .home-float__card--1 { left: -4%; }
  .home-float__card--2 { right: -2%; }
}

@media (max-width: 400px) {
  .home-float__card { padding: 8px 12px 8px 8px; }
  .home-float__icon { width: 28px; height: 28px; }
  .home-float__text strong { font-size: 13px; }
}

/* Feature ribbon. Static: one centred, wrapping row; the clone only exists
   for the marquee in home.css. */
.home-ribbon {
  margin-top: clamp(64px, 10vh, 120px);
  border-block: 1px solid var(--lead-border);
  background: color-mix(in srgb, var(--lead-bg) 55%, transparent);
  overflow: clip;
}

.home-ribbon__track {
  max-width: var(--lead-max);
  margin: 0 auto;
  padding: 18px var(--lead-gutter);
}

.home-ribbon__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--lead-font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lead-text-muted);
}

.home-ribbon__list li::before {
  content: "✦";
  margin-right: 12px;
  color: var(--lead-accent);
}

.home-ribbon__list--clone { display: none; }

/* App features: the lead members section with a step number. */
.home-step__num {
  margin-bottom: 12px;
  color: var(--lead-accent);
}

.home-features .lead-members__copy .lead-h3 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-features .lead-members__copy p { font-size: clamp(16px, 1.2vw, 18px); }

/* Training bento */
.home-bento {
  display: grid;
  gap: 16px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
}

.home-tile .lead-h3 { font-weight: 700; }
.home-tile__copy p { color: var(--lead-text-muted); }

.home-art {
  margin: auto 0 0;
  font-size: 14px;
}

@media (min-width: 900px) {
  .home-bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-tile--wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 32px;
  }
  .home-tile--wide .home-art { margin: 0; }
}

/* Chart illustration */
.home-chart__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.home-chart__label {
  width: 100%;
  font-family: var(--lead-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lead-text-muted);
}

.home-chart__value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.home-chart__value small {
  font-size: 16px;
  font-weight: 600;
  color: var(--lead-text-muted);
}

.home-chart__delta {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lead-accent) 18%, transparent);
  color: var(--lead-accent);
  font-size: 13px;
  font-weight: 700;
}

.home-chart {
  display: block;
  width: 100%;
  height: 120px;
  overflow: visible;
}

.home-chart__grid {
  stroke: var(--lead-border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.home-chart__line {
  fill: none;
  stroke: var(--lead-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.home-chart__stop-a { stop-color: color-mix(in srgb, var(--lead-accent) 38%, transparent); }
.home-chart__stop-b { stop-color: transparent; }

.home-chart__dot {
  fill: var(--lead-accent);
  stroke: var(--lead-bg);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

/* Recovery bars: --v is the share that is ready again. */
.home-art--recovery {
  display: grid;
  gap: 12px;
}

.home-bar {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--lead-text-muted);
}

.home-bar b {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lead-text) 8%, transparent);
  overflow: hidden;
}

.home-bar b::after {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--v, 0) * 100%);
  border-radius: inherit;
  background: var(--lead-accent);
  transform-origin: left;
}

.home-bar--mid b::after { background: color-mix(in srgb, var(--lead-accent) 55%, var(--lead-text-muted)); }
.home-bar--low b::after { background: var(--lead-danger); }

/* Logged sets */
.home-art--sets {
  display: grid;
  gap: 8px;
}

.home-set {
  display: grid;
  grid-template-columns: 26px 1fr 22px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--lead-text) 5%, transparent);
  font-variant-numeric: tabular-nums;
}

.home-set b {
  font-family: var(--lead-font-mono);
  font-size: 12px;
  color: var(--lead-text-muted);
}

.home-set i {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--lead-border-strong);
  box-sizing: border-box;
}

.home-set.is-done i {
  border-color: var(--lead-accent);
  background: var(--lead-accent);
}

.home-set.is-done i::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid var(--lead-accent-fg);
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.home-offline {
  justify-self: start;
  margin-top: 4px;
  padding: 4px 10px;
  border: 1px dashed color-mix(in srgb, var(--lead-accent) 60%, transparent);
  border-radius: 999px;
  font-family: var(--lead-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lead-accent);
}

/* Exercise search */
.home-art--search { display: grid; gap: 2px; }

.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--lead-border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--lead-text) 6%, transparent);
  font-size: 15px;
  color: var(--lead-text);
}

.home-search svg { color: var(--lead-text-muted); }

.home-caret {
  width: 2px;
  height: 18px;
  margin-left: -8px;
  background: var(--lead-accent);
}

.home-result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--lead-border);
}

.home-result:last-child { border-bottom: 0; }
.home-result strong { font-weight: 600; }
.home-result span { color: var(--lead-text-muted); white-space: nowrap; }

@media (max-width: 480px) {
  .home-result { flex-direction: column; gap: 2px; }
}

/* Entdecken teaser with an illustrated map (no tiles, no third party). */
.home-discover__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.home-discover__text {
  margin-top: 20px !important;
  max-width: 32rem;
  color: var(--lead-text-muted);
}

.home-legend {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.home-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-pin-dot,
.home-pin {
  border-radius: 50%;
  box-sizing: border-box;
}

.home-pin-dot {
  width: 14px;
  height: 14px;
}

.home-pin-dot--partner,
.home-pin--partner {
  background: var(--lead-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lead-accent) 22%, transparent);
}

.home-pin-dot--claimed,
.home-pin--claimed {
  background: var(--lead-text);
}

.home-pin-dot--open,
.home-pin--open {
  border: 2px solid var(--lead-text-muted);
  background: var(--lead-bg);
}

.home-map {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--lead-border-strong);
  border-radius: var(--lead-radius-l);
  overflow: hidden;
  background: var(--lead-bg-2);
  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--lead-teal) 90%, transparent);
}

.home-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-map__land { fill: var(--lead-bg-2); }
.home-map__park { fill: color-mix(in srgb, var(--lead-teal) 55%, var(--lead-bg-2)); }

.home-map__water {
  fill: none;
  stroke: color-mix(in srgb, var(--lead-teal) 90%, var(--lead-text) 6%);
  stroke-width: 26;
  stroke-linecap: round;
}

.home-map__road {
  fill: none;
  stroke: color-mix(in srgb, var(--lead-text) 9%, transparent);
  stroke-width: 5;
}

.home-map__road--main {
  stroke: color-mix(in srgb, var(--lead-text) 15%, transparent);
  stroke-width: 11;
}

.home-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 18px;
  height: 18px;
  translate: -50% -50%;
}

.home-pin--claimed { border: 3px solid var(--lead-bg-2); }

.home-pin--active {
  width: 28px;
  height: 28px;
  border: 4px solid var(--lead-bg-2);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--lead-accent) 28%, transparent);
}

.home-map__sheet {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 300px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
}

.home-map__sheet strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-map__badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
  font-family: var(--lead-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-map__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lead-text-muted);
}

.home-open-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-status-open);
}

.home-map__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.home-map__chips span {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lead-text) 9%, transparent);
  font-size: 12px;
}

@media (max-width: 599px) {
  .home-map { aspect-ratio: 4 / 5; }
}

@media (min-width: 960px) {
  .home-discover__grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 72px;
  }
  .home-map__sheet { left: auto; right: 20px; bottom: 20px; }
}

/* Statement. Static: fully lit; home.css dims the words and home.js lights
   them while the line scrolls through. */
.home-say {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--lead-section-gap) var(--lead-gutter) 0;
}

.home-say__line {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 88px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
}

.home-say__w.lead-serif {
  font-weight: 400;
  color: var(--lead-accent);
}

/* For studios */
.home-studio__panel {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: clamp(24px, 4.5vw, 56px);
  border-radius: var(--lead-radius-xl);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--lead-teal) 70%, transparent), transparent 60%),
    var(--lead-glass);
}

.home-studio__copy p:not(.lead-kicker) {
  margin-top: 18px;
  max-width: 30rem;
  color: var(--lead-text-muted);
}

@media (min-width: 960px) {
  .home-studio__panel { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; }
}

/* FAQ */
.home-faq__list {
  max-width: 820px;
  border-top: 1px solid var(--lead-border);
}

.home-faq__item { border-bottom: 1px solid var(--lead-border); }

.home-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--tap-min);
  padding: 22px 0;
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.home-faq__item summary::-webkit-details-marker { display: none; }

.home-faq__icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--lead-border-strong);
}

.home-faq__icon::before,
.home-faq__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--lead-text);
  transition: rotate 240ms var(--lead-ease-out);
}

.home-faq__icon::after { rotate: 90deg; }
.home-faq__item[open] .home-faq__icon::after { rotate: 0deg; }

.home-faq__item p {
  max-width: 60ch;
  padding-bottom: 24px;
  color: var(--lead-text-muted);
}

/* Closing CTA */
.home-cta .lead-cta__panel { position: relative; overflow: hidden; }

.home-cta__mascot {
  display: block;
  margin: 0 auto 24px;
  border-radius: 26px;
  box-shadow: 0 0 0 4px var(--lead-accent-fg);
  rotate: -6deg;
}

.home-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.home-cta__login {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--lead-accent-fg);
  font-weight: 600;
  text-underline-offset: 4px;
}

@media (forced-colors: active) {
  .home-pin,
  .home-pin-dot,
  .home-bar b::after,
  .home-set i { forced-color-adjust: none; border: 2px solid CanvasText; }
  .home-map__svg { display: none; }
  .home-map,
  .home-studio__panel { border: 1px solid CanvasText; }
}


/* ==[ region: public-studios ]==============================================
   "Für Studios" (/fuer-studios/, issue #216). The page is the claim landing's
   lead sections (regions lead-*); this region only styles the studio search
   that replaces the claim button in the closing lime panel: dark ink on
   lime, every colour from the lead tokens. */

.public-finder__panel .lead-h2 { margin-bottom: clamp(24px, 3vw, 36px); }

/* Two classes deep so `.lead-main p { margin: 0 }` can't reset the foot. */
.public-finder__panel .public-finder__form,
.public-finder__panel .public-finder__body,
.public-finder__panel .public-finder__foot {
  max-width: 36rem;
  margin-inline: auto;
}

/* One dark pill holding field and button, like a native search bar. */
.public-finder__form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--lead-accent-fg);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--lead-accent-fg) 80%, transparent);
}

.public-finder__form:focus-within {
  outline: 3px solid color-mix(in srgb, var(--lead-accent-fg) 45%, transparent);
  outline-offset: 3px;
}

.public-finder__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap-min);
  padding: 0 8px 0 18px;
  border: 0;
  background: transparent;
  color: var(--lead-text);
  font: inherit;
  font-size: 17px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.public-finder__input::placeholder { color: var(--lead-text-muted); }

/* The pill is dark, so the button flips back to lime (lead-btn--on-accent
   would vanish against it). Width resets the CTA panel's big-button sizing
   (region lead-landing), which would push the field out of the pill. */
.lead-cta__panel .public-finder__submit.lead-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 0 22px;
  background: var(--lead-accent);
  color: var(--lead-accent-fg);
}

.public-finder__form .public-finder__submit:focus-visible { outline-color: var(--lead-accent); }

.public-finder__body {
  margin-top: 20px;
  text-align: left;
}

.public-finder__note {
  font-size: 15px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--lead-accent-fg) 72%, var(--lead-accent));
  text-align: center;
}

.public-finder__empty {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--lead-radius-m);
  border: 1px dashed color-mix(in srgb, var(--lead-accent-fg) 30%, transparent);
  text-align: center;
}

.public-finder__empty-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.public-finder__list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.public-finder__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 64px;
  padding: 12px 14px 12px 20px;
  box-sizing: border-box;
  border-radius: var(--lead-radius-m);
  border: 1px solid color-mix(in srgb, var(--lead-accent-fg) 14%, transparent);
  background: color-mix(in srgb, var(--lead-accent-fg) 7%, transparent);
  color: var(--lead-accent-fg);
  text-decoration: none;
  transition: background-color var(--lead-dur-s) ease, transform var(--lead-dur-s) var(--lead-ease-out);
}

.public-finder__row:hover {
  background: color-mix(in srgb, var(--lead-accent-fg) 13%, transparent);
  transform: translateY(-1px);
}

.public-finder__row:focus-visible { outline: 3px solid var(--lead-accent-fg); outline-offset: 2px; }

/* Basis 0 keeps the claim pill beside the name on a phone; the longer
   "bereits auf Ventrax" line still wraps below it. */
.public-finder__text {
  display: grid;
  flex: 1 1 0;
  min-width: 7rem;
}

.public-finder__name {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.public-finder__city,
.public-finder__action,
.public-finder__foot {
  font-size: 14px;
  color: color-mix(in srgb, var(--lead-accent-fg) 70%, var(--lead-accent));
}

.public-finder__action { font-weight: 600; }

.public-finder__action--claim {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--lead-accent-fg);
  color: var(--lead-accent);
  white-space: nowrap;
}

.public-finder__panel .public-finder__foot { margin-top: 28px; }

.public-finder__foot a {
  color: var(--lead-accent-fg);
  font-weight: 600;
  text-underline-offset: 3px;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .public-finder__row { transition: none; }
  .public-finder__row:hover { transform: none; }
}

@media (forced-colors: active) {
  .public-finder__form,
  .public-finder__row,
  .public-finder__action--claim {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
}

/* ==[ end: public-studios ]================================================= */

/* ==[ region: public-club ]=================================================
   Public studio profile /clubs/<slug>/ (apps/public_site, issue #212): the
   studio's own web presence. Theme-aware through the app tokens (no `lead`
   class). The club's brand colour arrives as --brand/--brand-fg/
   --brand-ink-light (club/_header_brand_vars.html); it is used as a fill with
   --brand-fg on top, mixed into surfaces, or as text through --pclub-ink,
   which is mixed towards the text colour so a dark brand stays legible on
   the dark theme and a light one on the light theme. The hero over a cover
   photo is always light-on-dark (a scrim, not the theme, sets its contrast). */

.pclub {
  --pclub-ink: color-mix(in srgb, var(--brand-ink-light) 82%, var(--color-text));
  --pclub-tint: color-mix(in srgb, var(--brand) 14%, var(--color-surface));
  --pclub-radius: 28px;   /* D: was 22px */
  --pclub-shadow: 0 18px 50px -28px color-mix(in srgb, var(--color-text) 45%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pclub {
    --pclub-ink: color-mix(in srgb, var(--brand) 70%, var(--color-text));
    --pclub-tint: color-mix(in srgb, var(--brand) 16%, var(--color-surface));
  }
}

:root[data-theme="dark"] .pclub {
  --pclub-ink: color-mix(in srgb, var(--brand) 70%, var(--color-text));
  --pclub-tint: color-mix(in srgb, var(--brand) 16%, var(--color-surface));
}

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

.pclub-icon { flex: none; }

/* Hero. Without a photo: a brand-colour stage (two soft glows and a ring);
   with one: the photo, darkened from the bottom for legible white text. */
.pclub-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(440px, 64vh, 660px);
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 92% 8%, color-mix(in srgb, var(--brand) 62%, var(--color-bg)) 0%, transparent 62%),
    radial-gradient(60% 70% at -5% 105%, color-mix(in srgb, var(--brand) 34%, var(--color-bg)) 0%, transparent 70%),
    var(--color-bg);
}

.pclub-hero:not(.pclub-hero--photo)::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -18vmax;
  right: -14vmax;
  width: 52vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(28px, 5vmax, 72px) solid color-mix(in srgb, var(--brand) 18%, transparent);
}

.pclub-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pclub-hero__shade { display: none; }

.pclub-hero--photo {
  color: rgb(255 255 255);
  min-height: clamp(480px, 74vh, 760px);
}

.pclub-hero--photo .pclub-hero__shade {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgb(0 0 0 / 0.82) 0%, rgb(0 0 0 / 0.45) 42%, rgb(0 0 0 / 0.08) 78%),
    linear-gradient(90deg, rgb(0 0 0 / 0.35), transparent 60%);
}

.pclub-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-top: clamp(96px, 16vh, 160px);
  padding-bottom: clamp(72px, 10vh, 104px);
}

.pclub-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  border: 1px solid var(--color-nav-border);
  font-size: 13px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pclub-hero--photo .pclub-label {
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.25);
}

.pclub-hero__id {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 24px);
  min-width: 0;
}

.pclub-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(64px, 9vw, 88px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 24px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-bg) 85%, transparent), 0 16px 40px -16px rgb(0 0 0 / 0.5);
}

.pclub-logo--image { background: var(--color-surface); }

.pclub-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pclub-title {
  margin: 0;
  min-width: 0;
  font-size: clamp(40px, 7.4vw, 92px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.pclub-today-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.pclub-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-status-open);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-status-open) 25%, transparent);
}

.pclub-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.pclub-btn--brand {
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 12px 32px -14px color-mix(in srgb, var(--brand) 85%, transparent);
}

.pclub-btn--brand:hover { transform: translateY(-1px); }

.pclub-btn--glass {
  border-color: color-mix(in srgb, currentColor 32%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent);
  color: inherit;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pclub-btn--small {
  min-height: var(--tap-min);
  padding: 0 18px;
  font-size: 15px;
}

.pclub-hero__address {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 15px;
  opacity: 0.85;
}

/* At a glance: cards overlapping the hero's lower edge. */
.pclub-glance {
  position: relative;
  z-index: 2;
  margin-top: -44px;
}

.pclub-glance__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-glance__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--color-nav-border);
  border-radius: var(--pclub-radius);
  background: var(--color-surface);
  box-shadow: var(--pclub-shadow);
}

.pclub-glance__icon,
.pclub-amenity__icon,
.pclub-contact__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--pclub-tint);
  color: var(--pclub-ink);
}

.pclub-glance__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.pclub-glance__text strong {
  font-size: 15px;
  color: var(--color-text);
}

/* Phones: two compact columns instead of a tall stack of four cards. */
@media (max-width: 559px) {
  .pclub-glance__list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pclub-glance__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }
  .pclub-glance__icon { width: 38px; height: 38px; border-radius: 12px; }
  .pclub-glance__text { font-size: 13px; }
}

/* Body rhythm and section heads */
.pclub-body {
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 9vw, 112px);
  padding-top: clamp(56px, 8vw, 96px);
}

.pclub-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pclub-ink);
}

.pclub-h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.pclub-section__head { margin-bottom: clamp(22px, 3vw, 32px); }

.pclub-sub {
  margin: 24px 0 12px;
  color: var(--color-text-muted);
}

/* About and photo mosaic */
.pclub-about {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.pclub-prose {
  margin-top: 20px;
  max-width: 60ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.65;
  color: var(--color-text-muted);
}

.pclub-prose p { margin: 0 0 1em; }
.pclub-prose p:last-child { margin-bottom: 0; }

.pclub-mini-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.pclub-mini-chips li {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--pclub-tint);
  color: var(--pclub-ink);
  font-size: 14px;
  font-weight: 700;
}

.pclub-mosaic {
  display: grid;
  gap: 12px;
}

.pclub-mosaic--2 { grid-template-columns: 1fr 1fr; }

.pclub-mosaic--3 {
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.pclub-mosaic--3 .pclub-mosaic__item:first-child { grid-row: span 2; }

.pclub-mosaic__item,
.pclub-gallery a {
  display: block;
  overflow: hidden;
  border-radius: var(--pclub-radius);
  background: var(--pclub-tint);
}

.pclub-mosaic__item { aspect-ratio: 4 / 3; }
.pclub-mosaic--2 .pclub-mosaic__item { aspect-ratio: 3 / 4; }
.pclub-mosaic--3 .pclub-mosaic__item { aspect-ratio: auto; min-height: 150px; }

.pclub-mosaic__item img,
.pclub-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.16, 1, .3, 1);
}

.pclub-mosaic__item:hover img,
.pclub-gallery a:hover img { transform: scale(1.04); }

@media (min-width: 900px) {
  .pclub-about--photos { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .pclub-mosaic--3 { min-height: 420px; }
}

/* Gallery */
.pclub-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-gallery a { aspect-ratio: 4 / 3; }

/* Courses: a snap row on phones, a grid from tablet up. */
.pclub-courses {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 280px);
  gap: 14px;
  margin: 0 calc(-1 * clamp(16px, 5vw, 64px));
  padding: 4px clamp(16px, 5vw, 64px) 14px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(16px, 5vw, 64px);
}

.pclub-course {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-nav-border);
  border-radius: var(--pclub-radius);
  background: var(--color-surface);
  scroll-snap-align: start;
}

.pclub-course__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--brand) 70%, transparent), transparent 60%),
    var(--pclub-tint);
  color: var(--pclub-ink);
  font-size: 56px;
  font-weight: 800;
}

.pclub-course__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pclub-course__date {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.62);
  color: rgb(255 255 255);
  font-size: 12px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.pclub-course__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 18px;
}

.pclub-course__name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pclub-course__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.pclub-course__price {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.pclub-course__price--incl { color: var(--pclub-ink); }

@media (min-width: 720px) {
  .pclub-courses {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

/* Amenities */
.pclub-amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-amenity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--color-nav-border);
  border-radius: var(--pclub-radius);
  background: var(--color-surface);
  font-weight: 700;
}

.pclub-amenity--muted { color: var(--color-text-muted); }
.pclub-amenity--muted .pclub-amenity__icon { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: inherit; }

/* Visit: hours and the place card */
.pclub-visit__grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 820px) {
  .pclub-visit__grid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
}

.pclub-card {
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--color-nav-border);
  border-radius: var(--pclub-radius);
  background: var(--color-surface);
}

.pclub-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
}

.pclub-card__title .pclub-icon { color: var(--pclub-ink); }

.pclub-hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.pclub-hours th,
.pclub-hours td {
  padding: 11px 10px;
  border-top: 1px solid var(--color-nav-border);
  vertical-align: top;
}

.pclub-hours tr:first-child th,
.pclub-hours tr:first-child td { border-top: 0; }

.pclub-hours th {
  text-align: left;
  font-weight: 600;
}

.pclub-hours td { text-align: right; }

.pclub-hours td span { display: block; }

.pclub-hours tr.is-today th,
.pclub-hours tr.is-today td {
  background: var(--pclub-tint);
  font-weight: 700;
}

.pclub-hours tr.is-today th { border-radius: 12px 0 0 12px; }
.pclub-hours tr.is-today td { border-radius: 0 12px 12px 0; }

.pclub-today {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.pclub-card--place {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background:
    radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    var(--color-surface);
}

.pclub-place__address {
  margin: 0 0 22px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.pclub-card--place .public-btn { margin-top: auto; }

/* Access and partner programmes */
.pclub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-nav-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 15px;
  font-weight: 600;
}

.pclub-chip .pclub-icon { color: var(--pclub-ink); }

.pclub-providers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-provider {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--color-nav-border);
  border-radius: 18px;
  background: var(--color-surface);
}

.pclub-provider__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: rgb(255 255 255);
  font-weight: 800;
}

.pclub-provider span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pclub-provider small {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Contact tiles */
.pclub-contact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pclub-contact a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--color-nav-border);
  border-radius: var(--pclub-radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, transform 160ms ease;
}

.pclub-contact a:hover {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--color-nav-border));
  transform: translateY(-1px);
}

.pclub-contact a > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pclub-contact small {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Ventrax app panel in the studio's colour */
.pclub-join {
  position: relative;
  display: grid;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: clamp(32px, 5vw, 64px);
  border-radius: 32px;
  background:
    radial-gradient(80% 120% at 100% 0%, color-mix(in srgb, var(--brand-fg) 14%, transparent), transparent 60%),
    var(--brand);
  color: var(--brand-fg);
}

.pclub-join__kicker {
  color: inherit;
  opacity: 0.75;
}

.pclub-join__title {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.pclub-join__text {
  margin: 14px 0 22px;
  max-width: 34rem;
  font-size: 17px;
  line-height: 1.55;
  opacity: 0.85;
}

.pclub-btn--on-brand {
  background: var(--brand-fg);
  color: var(--brand);
}

.pclub-join__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: inherit;
  font-weight: 700;
  text-underline-offset: 4px;
}

.pclub-join__mark {
  display: none;
  place-items: center;
  justify-self: end;
  width: 168px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 44px;
  background: var(--brand-fg);
  color: var(--brand);
  font-size: 84px;
  font-weight: 800;
  rotate: 6deg;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.55);
}

.pclub-join__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 820px) {
  .pclub-join { grid-template-columns: minmax(0, 1fr) auto; }
  .pclub-join__mark { display: grid; }
}

.pclub-disclaimer {
  margin: -48px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.pclub-btn--brand:focus-visible,
.pclub-btn--glass:focus-visible,
.pclub-contact a:focus-visible,
.pclub-mosaic__item:focus-visible,
.pclub-gallery a:focus-visible,
.pclub-join a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .pclub-mosaic__item img,
  .pclub-gallery img,
  .pclub-contact a { transition: none; }
}

@media (forced-colors: active) {
  .pclub-hero__shade,
  .pclub-hero::before { display: none; }
  .pclub-today,
  .pclub-provider__badge { forced-color-adjust: none; }
}

/* ── Habit tracker (apps/habits, docs/HABITS_PLAN.md) ─────────────
   Every habit carries its own colour as --habit (inline style from the
   model's fixed palette, theme-invariant like the Settings badges); the
   grid mixes its empty/partial tints from it against transparent, so the
   same palette reads on the light and the dark surface. */
:root {
  --habit-freeze: #7cc8f2; /* ice: a day a streak freeze covered */
  --habit-cell-gap: 3px;
  --habit-year-cell: 13px;
}

.habits-title {
  display: flex;
  align-items: center;
  margin: 0;
  font-weight: 700;
}

.habits-add {
  flex-shrink: 0;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-fg);
}

.habits-add svg { width: 22px; height: 22px; }

.habits-today {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.habits-today__text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.habits-today__label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.habits-today__value {
  font-size: 15px;
  font-weight: 700;
}

.habits-today__bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  overflow: hidden;
}

.habits-today__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.3s ease;
}

.habits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 12px 14px 14px;
}

.habit-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.habit-card__open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.habit-card__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--habit) 18%, transparent);
  color: var(--habit);
}

.habit-icon { width: 22px; height: 22px; }
.habit-card__icon .habit-icon { width: 26px; height: 26px; } /* filled pictograms need the room */

.habit-card__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.habit-card__name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-card__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-streak {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--habit);
}

.habit-streak__icon { width: 16px; height: 16px; }

.habit-streak__freeze {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  color: color-mix(in srgb, var(--habit-freeze) 70%, var(--color-text));
}

.habit-check-form { flex-shrink: 0; }

/* The check button doubles as a progress ring for counter habits:
   --pct (0..100) fills a conic gradient behind the inner disc. */
.habit-check {
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--habit);
  background: color-mix(in srgb, var(--habit) 16%, transparent);
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.habit-check--partial {
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    conic-gradient(var(--habit) calc(var(--pct) * 1%), color-mix(in srgb, var(--habit) 18%, transparent) 0) border-box;
  border: 3px solid transparent;
}

.habit-check--done {
  background: var(--habit);
  color: var(--color-accent-fg);
}

.habit-check:active { transform: scale(0.9); }
@media (prefers-reduced-motion: no-preference) {
  .habit-check--pop { animation: habit-pop 0.25s ease; }
}

@keyframes habit-pop {
  50% { transform: scale(0.86); }
}

.habit-check__icon { width: 22px; height: 22px; stroke-width: 2.6; }

.habit-check__count {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.habit-card--rest .habit-card__icon { opacity: 0.7; }

/* GitHub-style contribution grid: weeks are columns, Mon..Sun rows. */
.habit-grid {
  display: grid;
  grid-template-rows: repeat(7, auto);
  grid-template-columns: repeat(var(--weeks), 1fr);
  grid-auto-flow: column;
  gap: var(--habit-cell-gap);
}

.habit-cell {
  display: block;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--habit) 13%, transparent);
}

.habit-cell--done { background: var(--habit); }
.habit-cell--partial { background: color-mix(in srgb, var(--habit) 50%, transparent); }
.habit-cell--frozen {
  /* Striped ice, so a covered day never reads as a done day of a blue habit. */
  background: repeating-linear-gradient(135deg, var(--habit-freeze) 0 2px, color-mix(in srgb, var(--habit-freeze) 25%, transparent) 2px 4px);
}
.habit-cell--off { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.habit-cell--future { background: transparent; }

/* Detail sheet */
.habit-detail__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}

.habit-detail__head .habit-card__text { flex: 1; }

.habit-detail__name {
  font-size: 17px;
  font-weight: 700;
}

.habit-detail__edit {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
  padding: 10px 4px;
}

.habit-kpis { margin-bottom: 12px; }

.habit-freeze-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.habit-freeze-note__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  color: color-mix(in srgb, var(--habit-freeze) 70%, var(--color-text));
  background: color-mix(in srgb, var(--habit-freeze) 16%, transparent);
}

.habit-year {
  display: flex;
  gap: 6px;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 12px;
}

.habit-year__days {
  display: grid;
  grid-template-rows: repeat(7, var(--habit-year-cell));
  gap: var(--habit-cell-gap);
  font-size: 9px;
  line-height: var(--habit-year-cell);
  color: var(--color-text-muted);
}

.habit-year__scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.habit-grid--year {
  grid-template-rows: repeat(7, var(--habit-year-cell));
  grid-template-columns: none;
  grid-auto-columns: var(--habit-year-cell);
  width: max-content;
}

.habit-grid--year .habit-cell { cursor: pointer; }
.habit-year__hint { margin-top: 8px; }

/* Create / edit form */
.habit-form .field-label { display: block; margin-top: 16px; }
.habit-form > .field-label:first-of-type { margin-top: 0; }

.habit-fieldset {
  border: none;
  padding: 0;
  margin: 18px 0 0;
}

.habit-fieldset > .field-label { margin-top: 0; padding: 0; }

.habit-input {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
}

.habit-form__error {
  font-size: 13px;
  color: var(--color-danger);
  margin-top: 6px;
}

.habit-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.habit-icon-pick,
.habit-color-pick,
.habit-days {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.habit-days { grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }

.habit-icon-pick__item,
.habit-color-pick__item,
.habit-days__item {
  position: relative;
  cursor: pointer;
}

.habit-icon-pick__item input,
.habit-color-pick__item input,
.habit-days__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.habit-icon-pick__item > span:first-of-type {
  display: grid;
  place-items: center;
  height: var(--tap-min);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.habit-icon-pick__item input:checked + span {
  color: var(--brand-fg);
  background: var(--brand);
}

.habit-color-pick__item {
  height: 36px;
  border-radius: 10px;
  background: var(--habit);
}

.habit-color-pick__item:has(input:checked) {
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--habit);
}

.habit-days__item span {
  display: grid;
  place-items: center;
  height: var(--tap-min);
  border-radius: 12px;
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.habit-days__item input:checked + span {
  background: var(--brand);
  color: var(--brand-fg);
}

.habit-icon-pick__item input:focus-visible + span,
.habit-days__item input:focus-visible + span,
.habit-color-pick__item:has(input:focus-visible) {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

.habit-target {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.habit-target__btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.habit-target__input {
  width: 64px;
  height: var(--tap-min);
  border: none;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.habit-form .exercise-detail__plan-btn { margin-top: 20px; margin-bottom: 8px; }

.habit-delete {
  width: 100%;
  border: none;
  background: none;
  color: var(--color-danger);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
}

/* Empty state: a faint sample grid as the illustration. */
.habits-empty {
  text-align: center;
  padding: 32px 8px;
}

.habits-empty__grid {
  display: grid;
  grid-template-columns: repeat(7, 18px);
  gap: 4px;
  justify-content: center;
  margin-bottom: 20px;
  --habit: var(--brand);
}

.habits-empty__grid span {
  aspect-ratio: 1;
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
}

.habits-empty__grid span:nth-child(3n+1),
.habits-empty__grid span:nth-child(7n+5) { background: var(--brand); }

.habits-empty__title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }

.habits-empty__text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text-muted);
  max-width: 320px;
  margin: 0 auto 20px;
}

.habits-empty__cta { display: block; text-decoration: none; text-align: center; }

/* Training hub entry tile for the habit tracker. */
.habits-tile__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.habits-tile__ring {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--color-surface) 70%, transparent 72%),
    conic-gradient(var(--brand) calc(var(--pct) * 1%), color-mix(in srgb, var(--color-text) 10%, transparent) 0);
}

/* Habit tracker, phase 2: perfect-day badge, auto-ticked habits, archive,
   routine link and reminder fields. */
.habits-today { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
.habits-today__bar { grid-column: 1 / -1; }
.habits-today__text { margin-bottom: 10px; flex-direction: column; align-items: flex-start; gap: 2px; } /* date above the count: side by side both wrapped on a phone */

.habits-perfect {
  grid-row: 1;
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--habit-perfect) 18%, transparent);
  color: color-mix(in srgb, var(--habit-perfect) 70%, var(--color-text));
  font-size: 14px;
  font-weight: 800;
}
.habits-perfect .habit-streak__icon { fill: var(--habit-perfect); stroke: var(--habit-perfect); }
.habits-perfect--zero { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text-muted); }
.habits-perfect--zero .habit-streak__icon { fill: none; stroke: currentColor; }

.habits-friends {
  flex-shrink: 0;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  margin-right: 8px;
}
.habits-friends svg { width: 22px; height: 22px; }

.habit-card__desc--auto { color: color-mix(in srgb, var(--habit) 75%, var(--color-text)); font-weight: 600; }
.habit-check:disabled { cursor: default; }

.habits-archive { margin-top: 20px; }
.habits-archive summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 10px 2px;
}
.habits-archive__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--color-surface);
  opacity: 0.85;
}
.habits-archive__name { flex: 1; color: var(--color-text); text-decoration: none; font-weight: 600; }

.habit-segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--color-surface);
  margin-bottom: 8px;
}
.habit-segment__item { flex: 1; position: relative; }
.habit-segment__item input { position: absolute; opacity: 0; inset: 0; }
.habit-segment__item span {
  display: block;
  padding: 9px 4px;
  border-radius: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.habit-segment__item input:checked + span { background: var(--brand); color: var(--brand-fg); }
.habit-segment__item input:focus-visible + span { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.habit-routine-select { margin-bottom: 8px; }

.habit-remind { display: flex; gap: 8px; margin-bottom: 6px; }
.habit-remind__input { flex: 1; }
.habit-remind__clear {
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.habit-archive {
  width: 100%;
  border: none;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
}

/* ── Friends (apps/friends, docs/FRIENDS_PLAN.md) ──────────────────
   The activity ring: one circle split into three arcs (training, habits,
   active days; geometry in services.ring_arcs). The ring colours are fixed
   decorative accents (theme-invariant like the habit palette); the tracks
   are a neutral tint so both brightnesses work. */
:root {
  --habit-perfect: #f5b014;
  --ring-training: #ff6a3d;
  --ring-habits: #17b897;
  --ring-active: #5b7cfa;
}

.friend-rings { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.friend-rings--small { width: 40px; height: 40px; }
.friend-rings > svg { display: block; width: 100%; height: 100%; transform: rotate(-150deg); }
.friend-ring__track, .friend-ring__fill { fill: none; stroke-width: 12; stroke-linecap: round; }
.friend-ring__track { stroke: color-mix(in srgb, var(--color-text) 10%, transparent); }
.friend-ring__fill { stroke: var(--ring); }
.friend-ring--training { --ring: var(--ring-training); }
.friend-ring--habits { --ring: var(--ring-habits); }
.friend-ring--active { --ring: var(--ring-active); }
.friend-rings__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.friend-rings__center strong { font-size: 22px; font-weight: 800; margin-top: 1px; }
.friend-rings__center small { font-size: 10px; font-weight: 600; color: var(--color-text-muted); margin-top: 2px; }
.friend-rings__flame { width: 20px; height: 20px; fill: var(--habit-perfect); stroke: var(--habit-perfect); }
.friend-rings__center--none { opacity: 0.45; }
.friend-rings__center--none .friend-rings__flame { fill: none; stroke: var(--color-text-muted); }

.friend-me {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--color-surface);
}
.friend-me--sheet { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.friend-me__side { flex: 1; min-width: 0; }
.friend-me__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.friend-me__title { font-size: 17px; font-weight: 800; }

.friend-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.friend-legend__item { display: flex; flex-direction: column; }
.friend-legend__label { font-size: 12px; font-weight: 700; color: var(--ring); }
.friend-legend__item--training { --ring: color-mix(in srgb, var(--ring-training) 80%, var(--color-text)); }
.friend-legend__item--habits { --ring: color-mix(in srgb, var(--ring-habits) 70%, var(--color-text)); }
.friend-legend__item--active { --ring: color-mix(in srgb, var(--ring-active) 75%, var(--color-text)); }
.friend-legend__value { font-size: 17px; font-weight: 800; }
.friend-legend__value small { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }

.friend-invite {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ring-training) 16%, transparent), color-mix(in srgb, var(--ring-active) 16%, transparent)),
    var(--color-surface);
}
.friend-invite__text { display: flex; flex-direction: column; gap: 4px; }
.friend-invite__title { font-size: 17px; font-weight: 800; }
.friend-invite__sub { font-size: 14px; line-height: 1.4; color: var(--color-text-muted); }
.friend-invite__btn { margin: 0; text-align: center; text-decoration: none; }

.friends-heading { font-size: 17px; font-weight: 800; margin: 8px 2px 10px; display: flex; align-items: center; gap: 8px; }
.friends-heading__count {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  color: var(--color-text-muted);
}
.friends-empty { font-size: 14px; line-height: 1.45; color: var(--color-text-muted); margin: 0 2px 20px; }

.friend-list, .friend-feed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.friend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--color-surface);
}
.friend-row__open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.friend-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friend-row__name { font-weight: 700; }
.friend-row__sub { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.friend-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  font-weight: 800;
}
.friend-avatar img, .friend-avatar svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend-avatar--large { width: 64px; height: 64px; font-size: 24px; }

/* "Freund hinzufügen": the invite as a QR code on a white card (scanners
   need dark-on-light in both themes), or as a link to send. */
.friend-add { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4px; }
.friend-add__title { font-size: 22px; font-weight: 800; margin: 12px 0 16px; }
.friend-add__qr { padding: 12px; border-radius: 20px; background: #fff; line-height: 0; }
.friend-add__qr img { width: min(220px, 62vw); height: auto; image-rendering: pixelated; }
.friend-add__hint { font-size: 16px; font-weight: 700; margin: 14px 0 0; }
.friend-add__or {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  margin: 18px 0;
  font-size: 14px;
  color: var(--color-text-muted);
}
.friend-add__or::before, .friend-add__or::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--color-text) 15%, transparent); }
.friend-add__link {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  color: var(--brand-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.friend-add__link svg { width: 20px; height: 20px; }
.friend-add .friend-renew { align-self: stretch; margin-top: 16px; }
.friend-add .habit-archive { font-size: 14px; color: var(--color-text-muted); }

.friend-nudge {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.friend-nudge--sent { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text-muted); cursor: default; }

.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--color-surface);
}
.feed-item__body { flex: 1; min-width: 0; }
.feed-item__title { margin: 0 0 2px; font-size: 14px; line-height: 1.35; }
.feed-item__meta { margin: 0; font-size: 12px; color: var(--color-text-muted); }
.feed-kudos {
  flex-shrink: 0;
  min-width: 56px;
  min-height: 36px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.feed-kudos--given { background: color-mix(in srgb, var(--habit-perfect) 28%, transparent); }
.feed-kudos--own { cursor: default; }
.feed-kudos--none { opacity: 0.5; }
.feed-kudos--pop { animation: habit-pop 0.35s ease; }

.friend-share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--color-surface);
  margin-bottom: 8px;
}
.friend-share__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.friend-share__title { font-weight: 700; }
.habit-share { margin-top: 16px; }

.friend-sheet__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.friend-sheet__name { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.friend-sheet .friend-nudge-form { margin-bottom: 16px; }
.friend-sheet .friend-nudge { width: 100%; min-height: var(--tap-min); font-size: 15px; }

.friend-invite-page { text-align: center; padding-top: 48px; }
.friend-invite-page .friend-avatar { margin: 0 auto 16px; }
.friend-invite-page__cta { width: 100%; }
.friend-nudge--compact { width: var(--tap-min); height: var(--tap-min); padding: 0; font-size: 18px; }
.friend-row__streak { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--color-text); }
.friend-row__streak .habit-streak__icon { width: 13px; height: 13px; }

/* Access refused by check_access (club_zugang): same pill, danger tint. */
.zg-card__status--denied { background: color-mix(in srgb, var(--color-status-closed) 18%, transparent); }
.zg-card__status--denied .zg-card__dot { background: var(--color-status-closed); }

/* Membership system (studio): member without a plan - neutral badge. */
.studio-status-badge--none { background: var(--studio-canvas); color: var(--color-text-muted); }
.studio-status-badge--none .studio-status-badge__dot { background: var(--color-text-muted); }
a.studio-table__name { color: inherit; text-decoration: none; }
a.studio-table__name:hover { text-decoration: underline; }

/* Tarif editor: one time-window row = weekday chips + from/to. */
.studio-plan-window { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--studio-border); }
.studio-plan-window:first-of-type { border-top: 0; }
.studio-plan-window__days { display: flex; flex-wrap: wrap; gap: 4px; margin-right: 6px; }
.studio-day-chip { position: relative; }
.studio-day-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.studio-day-chip span { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--studio-canvas); color: var(--color-text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.studio-day-chip input:checked + span { background: var(--brand); color: var(--brand-fg); }
.studio-day-chip input:focus-visible + span { outline: 2px solid var(--color-text); outline-offset: 1px; }

/* Member detail (studio): two columns on wide screens, one on narrow. */
.studio-member-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .studio-member-grid { grid-template-columns: minmax(0, 1fr); } }
.studio-access-card { border-left: 4px solid var(--studio-ok-text); }
.studio-access-card--denied { border-left-color: var(--studio-bad-text); }
.studio-access-card--warn { border-left-color: var(--studio-warn-text); }
.studio-access-card__state { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.studio-event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.studio-event-list li { font-size: 12px; display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; background: var(--studio-canvas); border-radius: 9px; }
.studio-details > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 6px 0; }

/* Member contract facts (club_mitgliedschaft): label left, value right; rows hide when empty. */
.member-facts { margin: 0 0 10px; display: flex; flex-direction: column; }
.member-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-nav-border); font-size: 14px; }
.member-facts > div:last-child { border-bottom: 0; }
.member-facts dt { color: var(--color-text-muted); }
.member-facts dd { margin: 0; font-weight: 600; text-align: right; }
.member-perks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.member-contract-note { font-size: 13px; line-height: 1.4; color: var(--color-text-muted); margin: 8px 0 0; }
.member-contract-note--alert { color: var(--color-danger); font-weight: 600; margin: 0 0 10px; }
.membership-status.membership-status--off, :root .membership-status.membership-status--off { background: color-mix(in srgb, var(--color-danger) 15%, transparent); color: var(--color-danger); }

/* Studio member detail, "Konto" card (epic #156 T6): the connect QR sits
   on the same fixed white card as the 2FA QR (.auth-qr-wrap), so it scans
   in dark mode too; the link below wraps instead of widening the column. */
.studio-connect__qr { margin: 4px 0 10px; }
.studio-connect__link { display: block; word-break: break-all; font-size: 12px; color: var(--color-text-muted); margin: 0 0 10px; }
.studio-connect__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-connect__actions form { margin: 0; }

/* Member CSV import (epic #156, T7). */
.studio-import__upload { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.studio-import__problems { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.studio-import__table { overflow-x: auto; margin-bottom: 12px; }
.studio-import__skip td { opacity: .5; text-decoration: line-through; }

/* ── Setup flow, invite pages, club empty state, partner plans ───────
   One block for the sign-up-to-set-up path (apps/onboarding,
   profile/invite_*.html, club/_no_club.html) and the partner-programme
   status line they share with the access page and the Entdecken sheet. */

/* Studio-branded stage on base_auth.html (`stage_club`). */
.auth-stage--club { padding-bottom: 4px; }
.auth-stage__club-logo {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
  border-radius: 24px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 36px;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 35%, transparent);
}
.auth-stage__club-logo img { width: 100%; height: 100%; object-fit: cover; }

.auth-page--setup { padding-top: 24px; }
.auth-page--setup .auth-title { padding-bottom: 10px; }
.auth-page--setup .zg-providers { margin-bottom: 16px; }

.setup-steps {
  display: flex;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.setup-steps__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}
/* Connector to the previous step, drawn behind the dots. */
.setup-steps__item + .setup-steps__item::before {
  content: "";
  position: absolute;
  top: 13px;
  right: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  border-radius: 1px;
  background: var(--color-nav-border);
}
.setup-steps__item--done + .setup-steps__item::before { background: var(--brand-ink); }
.setup-steps__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-nav-border);
  font-variant-numeric: tabular-nums;
}
.setup-steps__dot svg { width: 14px; height: 14px; }
.setup-steps__item--done .setup-steps__dot,
.setup-steps__item--current .setup-steps__dot {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-fg);
}
.setup-steps__item--current { color: var(--color-text); }
.setup-steps__item--current .setup-steps__dot {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}

.setup-next { margin-top: 4px; width: 100%; }
.setup-secondary { display: block; margin: 18px auto 0; min-height: var(--tap-min); }
.setup-summary {
  list-style: none;
  margin: 0 0 20px;
  padding: 4px 16px;
  border-radius: 14px;
  background: var(--color-surface);
}
.setup-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-nav-border);
  font-size: 14px;
}
.setup-summary__row:last-child { border-bottom: 0; }
.setup-summary__label { color: var(--color-text-muted); }
.setup-summary__value { font-weight: 600; text-align: right; overflow-wrap: anywhere; color: var(--color-text-muted); }
.setup-summary__row--ok .setup-summary__value { color: var(--color-text); }
.setup-list-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.setup-club-row { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* "Einrichtung abschließen" / open invitation rows on the club tab. */
.setup-resume,
.noclub-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap-min);
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--brand);
  color: var(--brand-fg);
  text-decoration: none;
  font-size: 15px;
}
.club-page > .setup-resume { margin-bottom: 12px; }
.setup-resume svg { width: 20px; height: 20px; flex-shrink: 0; }
.setup-resume__sub { display: block; font-size: 13px; opacity: 0.8; margin-top: 2px; }
.noclub-invite__cta {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--brand-fg);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.noclub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 24px;
  border-radius: 20px;
  background: var(--color-surface);
  text-align: center;
}
.noclub-hero__art { width: 120px; height: 84px; margin-bottom: 14px; }
.noclub-hero__wall { fill: color-mix(in srgb, var(--color-text) 7%, transparent); }
.noclub-hero__roof { stroke: var(--color-text-muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.noclub-hero__door { fill: var(--brand); }
.noclub-hero__title { font-size: 20px; font-weight: 700; }
.noclub-hero__text { margin-top: 6px; max-width: 300px; font-size: 14px; line-height: 1.45; color: var(--color-text-muted); }
.noclub { display: flex; flex-direction: column; gap: 12px; }
.noclub-title { font-size: 17px; font-weight: 700; margin: 10px 2px -2px; }
.noclub-ways { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--color-surface); overflow: hidden; }
.noclub-ways > li + li { border-top: 1px solid var(--color-nav-border); }
.noclub-way {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}
.noclub-way__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand-ink);
}
.noclub-way__icon svg { width: 22px; height: 22px; }
.noclub-way__text { flex: 1; min-width: 0; font-size: 15px; }
.noclub-way__text span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--color-text-muted); }
.noclub-way__chevron { flex-shrink: 0; width: 18px; height: 18px; color: var(--color-text-muted); }
.noclub-club { color: inherit; text-decoration: none; }
.noclub-club__city { font-weight: 400; color: var(--color-text-muted); }
.noclub-empty { font-size: 13px; color: var(--color-text-muted); margin: 0 2px; }

/* Partner-programme status line (club_zugang/_programme_status.html). */
.pp-state { font-size: 12px; color: var(--color-text-muted); }
.pp-state--ok { color: color-mix(in srgb, var(--color-status-open) 55%, var(--color-text)); font-weight: 600; }
.pp-state--low { color: var(--color-danger); font-weight: 600; }
.zg-provider__btn { display: inline-flex; align-items: center; text-decoration: none; }
.zg-provider__btn--brand { border-color: var(--brand); background: var(--brand); color: var(--brand-fg); }
.zg-providers--spaced { margin-top: 12px; }
.zg-provider__details > summary { list-style: none; cursor: pointer; }
.zg-provider__details > summary .zg-provider__text > span { display: block; }
.zg-provider__details > summary::-webkit-details-marker { display: none; }
.zg-provider__details .zg-provider__form { display: flex; flex-direction: column; gap: 12px; padding: 14px 0 4px; }
.zg-provider__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zg-provider__actions .zg-provider__remove { margin-top: 0; min-height: var(--tap-min); }
.gym-programmes { margin: 16px 0; }
.gym-programmes__title { font-size: 13px; font-weight: 600; color: var(--color-text-muted); margin-bottom: 8px; }
.gym-programmes .zg-providers { background: var(--color-bg); }

/* Studio settings: lowest accepted plan per programme. */
.ss-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.ss-tier { display: flex; flex-direction: column; gap: 6px; }
.ss-fieldset .studio-form-card__hint { margin-top: 12px; }

/* ── Chat (apps/chat) ───────────────────────────────────────────────────
   One set of rules for the member app and the studio (.chat-page--studio /
   .chat-thread--studio only widen the column). Surfaces follow the theme
   tokens; own bubbles and primary buttons use the club's --brand. */
.chat-icon { width: 22px; height: 22px; flex-shrink: 0; }

.chat-page { padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.chat-page--studio { padding: 0; max-width: 760px; }

/* Large title like iOS: one bold word, the add button sits on its baseline. */
.chat-head { display: flex; align-items: flex-end; gap: 12px; padding: 8px 4px 0; }
.chat-head__text { flex: 1; min-width: 0; }
.chat-head__title { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.chat-head__sub { font-size: 13px; line-height: 1.35; color: var(--color-text-muted); margin-top: 4px; }
/* 44 px tap area around a 36 px tinted circle. */
.chat-head__new {
  flex-shrink: 0;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-ink);
  -webkit-tap-highlight-color: transparent;
}
.chat-head__new::before {
  content: "";
  grid-area: 1 / 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 26%, transparent);
  transition: transform 0.12s ease-out;
}
.chat-head__new .chat-icon { grid-area: 1 / 1; position: relative; width: 20px; height: 20px; stroke-width: 2.4; }
.chat-head__new:active::before { transform: scale(0.9); }

/* Inset grouped list: one rounded surface, hairlines inset to the text. */
.chat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--color-surface);
  overflow: hidden;
}
.chat-list > li { position: relative; }
.chat-list > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 78px;
  right: 0;
  height: 1px;
  transform: scaleY(0.5);
  background: color-mix(in srgb, var(--color-text) 16%, transparent);
  pointer-events: none;
}
.chat-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Feedback on press, not on release. */
.chat-row:active { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.chat-row:focus-visible, .chat-option:focus-visible, .chat-btn:focus-visible, .chat-composer__btn:focus-visible,
.chat-head__new:focus-visible, .chat-bar__back:focus-visible, .chat-bar__more:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.chat-row .friend-avatar { width: 48px; height: 48px; }
.chat-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-row__top, .chat-row__bottom { display: flex; align-items: center; gap: 8px; }
.chat-row__name { flex: 1; min-width: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row__time { font-size: 13px; color: var(--color-text-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.chat-row__preview { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row--unread .chat-row__preview { color: var(--color-text); font-weight: 600; }
.chat-row--unread .chat-row__time { color: var(--brand-ink); font-weight: 700; }

.chat-badge {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  font-weight: 800;
}
.chat-badge--nav { margin-left: 6px; min-width: 20px; height: 20px; font-size: 11px; }
.studio-nav__item--active .chat-badge--nav { background: var(--brand-fg); color: var(--brand); }

/* Unread count badge (chat header button, partials/chat_button.html). */
.nav-icon-wrap { position: relative; }
.nav-badge {
  position: absolute;
  top: -3px;
  left: calc(50% + 6px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--color-bg);
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    var(--color-surface);
}
.chat-empty__art { font-size: 40px; line-height: 1; }
.chat-empty__title { font-size: 19px; font-weight: 800; }
.chat-empty__sub { font-size: 14px; line-height: 1.45; color: var(--color-text-muted); max-width: 34ch; margin-bottom: 8px; }

.chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.chat-btn--soft { background: color-mix(in srgb, var(--color-text) 9%, transparent); color: var(--color-text); }
.chat-btn--danger { color: var(--color-danger); }
.chat-btn--wide { width: 100%; }

/* A settings-style row: icon tile, title, chevron. */
.chat-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 20px;
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.chat-link-card:active { background: color-mix(in srgb, var(--color-text) 7%, var(--color-surface)); }
.chat-link-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
.chat-link-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 16px; }
.chat-link-card__text strong { font-weight: 650; letter-spacing: -0.01em; }
.chat-link-card__text span { font-size: 13px; color: var(--color-text-muted); }
.chat-link-card .chat-icon { color: color-mix(in srgb, var(--color-text) 30%, transparent); width: 16px; height: 16px; stroke-width: 2.4; }
/* Thread: header, scrolling log and composer fill the screen; the bottom
   nav gives its place to the composer. */
.page-content:has(> .chat-thread) { display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
.app-shell:has(.chat-thread) .bottom-nav { display: none; }
.studio-canvas:has(> .chat-thread) { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

.chat-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-thread--studio { width: 100%; max-width: 820px; margin: 0 auto; border-inline: 1px solid var(--studio-border); }

.chat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top, 0px)) 10px 10px;
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--color-nav-border);
}
.chat-bar__back, .chat-bar__more {
  width: var(--tap-min);
  height: var(--tap-min);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text);
}
.chat-bar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-bar__name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-bar__sub { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-log__empty { margin: auto; padding: 24px; text-align: center; font-size: 14px; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 8px; }
.chat-log__hint { font-size: 12px; max-width: 32ch; }
.chat-older { align-self: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--brand-ink); min-height: var(--tap-min); display: inline-flex; align-items: center; }

.chat-day { align-self: center; margin: 10px 0 6px; }
.chat-day span {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text-muted);
}

.chat-msg { max-width: 82%; display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; gap: 2px; margin-bottom: 4px; }
.chat-msg--mine { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  padding: 9px 13px;
  border-radius: 18px 18px 18px 6px;
  background: var(--color-surface);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.chat-msg--mine .chat-bubble { border-radius: 18px 18px 6px 18px; background: var(--brand); color: var(--brand-fg); }
.chat-msg__meta { font-size: 11px; color: var(--color-text-muted); padding: 0 4px; display: inline-flex; align-items: center; gap: 4px; }
/* One tick = sent, two (brand) = read by the other side. */
.chat-msg__tick::after { content: "✓"; }
.chat-msg.is-read .chat-msg__tick::after { content: "✓✓"; letter-spacing: -0.3em; color: var(--brand-ink); font-weight: 800; }

.chat-nudge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: color-mix(in srgb, var(--ring-training, var(--brand)) 20%, var(--color-surface));
}
.chat-nudge__hand { font-size: 20px; }

.chat-card {
  min-width: min(260px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-text) 9%, transparent);
}
.chat-card--ask { border-color: color-mix(in srgb, var(--brand) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.chat-card__kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--color-text-muted); }
.chat-card__kicker .chat-icon { width: 16px; height: 16px; }
.chat-card__title { font-size: 16px; line-height: 1.25; }
.chat-card__meta { font-size: 13px; color: var(--color-text-muted); }
.chat-card__note { font-size: 14px; line-height: 1.4; margin-top: 4px; overflow-wrap: anywhere; }
.chat-card__gone { font-size: 14px; color: var(--color-text-muted); }
.chat-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chat-card__actions .chat-btn { min-height: var(--tap-min); padding: 0 14px; font-size: 14px; border-radius: 12px; }
.chat-state { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--color-text) 9%, transparent); color: var(--color-text-muted); }
.chat-state--ok { background: color-mix(in srgb, var(--color-status-open) 20%, transparent); color: color-mix(in srgb, var(--color-status-open) 60%, var(--color-text)); }
.chat-state--off { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 12%, transparent); }

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px max(10px, env(safe-area-inset-bottom, 0px));
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--color-nav-border);
}
.chat-composer__input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-min);
  max-height: 132px;
  resize: none;
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  border-radius: 22px;
  padding: 11px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 16px;   /* below 16px iOS zooms the page on focus */
  line-height: 1.3;
}
.chat-composer__input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chat-composer__btn {
  flex-shrink: 0;
  width: var(--tap-min);
  height: var(--tap-min);
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--color-text) 9%, transparent);
  color: var(--color-text);
  font-size: 20px;
  cursor: pointer;
}
.chat-composer__send { background: var(--brand); color: var(--brand-fg); }
.chat-error { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, var(--color-bg)); }
.chat-closed { margin: 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom, 0px)); font-size: 14px; text-align: center; color: var(--color-text-muted); border-top: 0.5px solid var(--color-nav-border); }

/* Sheets and flow steps */
.chat-sheet { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; padding-bottom: 8px; }
.chat-page--step .chat-sheet { padding: 0; }
.chat-sheet__title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.chat-sheet__subtitle { font-size: 16px; font-weight: 800; }
.chat-sheet__hint { font-size: 14px; line-height: 1.45; color: var(--color-text-muted); }
.chat-sheet__links { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-step-back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap-min); color: var(--color-text); font-weight: 600; text-decoration: none; align-self: flex-start; }
.chat-list--pick form { display: contents; }

.chat-options { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.chat-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
}
.chat-option__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand-ink); flex-shrink: 0; }
.chat-option__text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
.chat-option__text span { font-size: 13px; color: var(--color-text-muted); }
.chat-option > .chat-icon { width: 18px; height: 18px; color: var(--color-text-muted); }

.chat-pick { display: flex; flex-direction: column; gap: 8px; }
.chat-pick__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--color-surface);
  cursor: pointer;
}
.chat-pick__row:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand); }
.chat-pick__row input { accent-color: var(--brand-ink); width: 18px; height: 18px; flex-shrink: 0; }
.chat-pick__name { flex: 1; min-width: 0; font-weight: 600; }
.chat-pick__name small { display: block; font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--color-text-muted); }
.chat-pick__meta { font-size: 13px; color: var(--color-text-muted); flex-shrink: 0; }
.chat-search { display: flex; gap: 8px; }
.chat-search__input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-min);
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 16px;
}
.chat-seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.chat-seg__item { flex: 1; text-align: center; cursor: pointer; }
.chat-seg__item input { position: absolute; opacity: 0; pointer-events: none; }
.chat-seg__item span { display: block; padding: 9px 4px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.chat-seg__item input:checked + span { background: var(--color-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.chat-seg__item input:focus-visible + span { outline: 2px solid var(--brand); }
.chat-menu-block { display: flex; flex-direction: column; gap: 8px; }

.chat-routine { list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: ex; }
.chat-routine__row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--color-surface); counter-increment: ex; }
.chat-routine__row::before { content: counter(ex); font-size: 12px; font-weight: 800; color: var(--color-text-muted); width: 16px; }
.chat-routine__name { flex: 1; min-width: 0; font-weight: 600; }
.chat-routine__meta { font-size: 13px; color: var(--color-text-muted); flex-shrink: 0; }

@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: no-preference) {
  .chat-log .chat-msg:last-child { animation: chat-in 220ms cubic-bezier(.16, 1, .3, 1); }
}
.chat-composer__input { scrollbar-width: none; }
.chat-composer__input::-webkit-scrollbar { display: none; }

/* The Ventrax mascot inside a brand-mark tile (studio login, lead nav). */
.brand-mark-img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.studio-auth__mark, .lead-nav__mark { overflow: hidden; }

/* Friends block of the training summary (friends/_after_training.html). */
.after-training__link { display: flex; align-items: center; justify-content: center; margin-top: 8px; text-decoration: none; box-sizing: border-box; }
.after-training__primary { background: var(--brand); color: var(--brand-fg); }
.after-training__state { margin: 8px 0; font-size: 14px; font-weight: 600; color: var(--color-text); }
.after-training__sub { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--color-text-muted); }
.after-training__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.after-training__row { display: flex; align-items: center; gap: 10px; }
.after-training__row .friend-avatar { width: 36px; height: 36px; }
.after-training__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.after-training__row .friend-nudge { min-height: var(--tap-min); }
.friend-sheet__chat { margin-bottom: 8px; }
.friends-chat-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--color-text); font-size: 14px; font-weight: 700; text-decoration: none; }

/* ==[ region: redesign-d | foundation ]===================================== */
/* Shared pieces of redesign D (design canvas "Ventrax D", docs/notes/
   redesign-d.md): display face, entrance and press motion, the tab-page
   header with its round icon buttons, and the soft brand shimmer. Pages opt
   in with these classes; nothing here restyles an existing component. */

/* Self-hosted Bricolage Grotesque, variable weight 500-800 and optical size
   (SIL OFL 1.1, see static/fonts/bricolage-grotesque/). Titles and big
   numbers only; body text stays the system font. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque/bricolage-grotesque-latin.ad33cbc6d232.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;
}

.d-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

/* Entrance: content rises in once, staggered by --i (set inline per item,
   70ms apart). Only opacity/transform, so it never shifts layout. */
.d-in {
  animation: d-in 0.62s var(--ease-out-soft) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes d-in { from { opacity: 0; transform: translateY(16px) scale(0.975); } }
@keyframes d-pop { from { opacity: 0; transform: scale(0.5); } }
@keyframes d-grow { from { transform: scaleY(0.06); } }
@keyframes d-breath { to { transform: translate(-22px, 14px) scale(1.18); } }

/* Press: shrinks quickly, springs back slowly. */
.d-tap { transition: transform 0.38s var(--ease-spring); }
.d-tap:active { transform: scale(0.955); transition-duration: 0.07s; }

/* Card surface used by the redesigned screens. */
.d-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-card);
}

/* Soft brand-coloured glow drifting in a card corner - the signature of D.
   Decorative only (aria-hidden), dimmer in dark mode via --shimmer-opacity. */
.d-shimmer {
  position: absolute;
  right: -70px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand), transparent);
  opacity: var(--shimmer-opacity);
  pointer-events: none;
  animation: d-breath 7s ease-in-out infinite alternate;
}

/* Header of a top-level tab page: big display title, round actions right. */
.tab-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 4px;
}
/* Sub-page variant: sits inside a padded content column, smaller title
   next to the round back button. */
.tab-header--sub { padding: calc(env(safe-area-inset-top) + 12px) 0 12px; }
.tab-header--sub .tab-header__title { font-size: 24px; }
.tab-header__title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Round 44pt icon button (chat, search, back) on the page background. */
.circle-btn {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--color-surface);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.circle-btn svg { width: 20px; height: 20px; }
.circle-btn .nav-badge {
  top: -2px;
  left: auto;
  right: -2px;
  animation: d-pop 0.45s var(--ease-out-soft) 0.4s backwards;
}

@media (prefers-reduced-motion: reduce) {
  .d-in, .d-shimmer, .nav-item.active::before, .circle-btn .nav-badge { animation: none; }
  .d-tap, .nav-item { transition: none; }
}

/* Redesign D: the older back links (settings pages, detail pages, PT booking
   steps) take the same 44px surface circle as .circle-btn, so every back
   affordance in the app looks alike. */
.settings-back,
.ptb-back {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 50%;
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.settings-back svg,
.ptb-back svg { width: 20px; height: 20px; }

/* Redesign D: the running workout. The header carries the title in the
   display face and the elapsed time as a pill; the set table sits in a
   surface-2 box with its value boxes on the card surface, so the numbers
   read as tappable fields; a ticked set pops its brand check. */
.session-topbar {
  gap: 8px;
  min-height: 48px;
}

.session-topbar .session-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.session-topbar .session-menu {
  margin-left: 0;
}

.session-clock {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.session-clock[hidden] {
  display: none;
}

.session-clock svg {
  width: 14px;
  height: 14px;
}

.session-entry {
  border-radius: var(--radius-card);
  padding: 16px 14px 8px;
}

.session-entry__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.session-entry__sets {
  background: var(--color-surface-2);
  border-radius: 20px;
  padding: 8px 8px 4px;
}

.session-entry__sets--live .session-set__input {
  min-height: 48px;
  border-radius: 14px;
  background: var(--color-surface);
  font-family: var(--font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.session-set__phase--btn::before {
  inset: 5px 1px;
  border-radius: 11px;
  background: var(--color-surface);
}

.session-set__toggle {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.session-set__toggle--on {
  background: var(--brand);
  color: var(--brand-fg);
}

/* Only the tick pops, never the button: scaling the button would shrink its
   tap target below 44 px for the length of the animation. */
.session-set__toggle--pop svg {
  animation: set-check-pop 0.45s var(--ease-out-soft);
}

@keyframes set-check-pop {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.25); }
}

.session-overview {
  border-radius: var(--radius-tile);
}

.session-add-exercise {
  border-radius: var(--radius-tile);
}

.session-finish-btn {
  border-radius: 26px;
}

@media (prefers-reduced-motion: reduce) {
  .session-set__toggle--pop svg { animation: none; }
}

/* ── Plan page (redesign D, training_plan/plan.html) ─────────── */

.plan-week {
  margin-bottom: 8px;
}

.plan-week__label {
  margin: 0;
  padding: 12px 16px 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.plan-section-label--d {
  margin: 20px 4px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.plan-list {
  padding: 4px 0;
}

.plan-row {
  position: relative; /* above the card's shimmer */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 14px;
}

.plan-row + .plan-row {
  border-top: 1px solid var(--color-nav-border);
}

.plan-row__link {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.plan-row .routine-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--color-surface-2);
  color: var(--color-text);
}

.plan-row .routine-icon svg {
  width: 20px;
  height: 20px;
}

.plan-row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.plan-row__title {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-row__sub {
  font-size: 13px;
  color: var(--color-text-muted);
}

.plan-row__start {
  flex: none;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 0 13px;
  border-radius: 22px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.plan-row__start svg {
  width: 14px;
  height: 14px;
}

/* Empty state: one dashed card that creates the first routine. */
.plan-empty {
  box-sizing: border-box;
  width: 100%;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px dashed var(--color-idle);
  border-radius: var(--radius-card);
  background: none;
  color: var(--color-text);
  font-family: inherit;
  cursor: pointer;
}

.plan-empty__title {
  font-size: 16px;
  font-weight: 600;
}

.plan-empty__sub {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Redesign D: routine edit page. The exercises sit in one card with hairline
   separators (like the plan list) instead of a stack of separate tiles; a
   superset keeps its brand bar, drawn inside the card on the left edge. */
.routine-edit .routine-name-input {
  font-family: var(--font-display);
  font-size: 22px;
  border-radius: var(--radius-tile);
  padding: 10px 16px;
}
.routine-edit .settings-card { border-radius: var(--radius-tile); }
.routine-list {
  gap: 0;
  padding: 4px 0;
}
.routine-list .routine-row {
  position: relative;
  background: none;
  border-radius: 0;
  padding: 10px 14px;
}
.routine-list .routine-row + .routine-row,
.routine-list .superset-label + .routine-row:not(.routine-row--in-superset) {
  border-top: 1px solid var(--color-nav-border);
}
.routine-list .superset-label {
  padding: 10px 16px 0;
  margin: 0;
  border-top: 1px solid var(--color-nav-border);
}
.routine-list .superset-label:first-child { border-top: 0; }
.routine-list .routine-row--in-superset { border-left: 0; }
.routine-list .routine-row--in-superset::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.routine-list .exercises-item__thumb { border-radius: 14px; }
.routine-list .exercises-item__summary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.routine-edit .muscle-map-card { margin-top: 14px; }
.routine-add {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 1.5px dashed var(--color-idle);
  border-radius: var(--radius-tile);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.routine-add svg { width: 18px; height: 18px; }
.routine-actions {
  display: flex;
  gap: 10px;
  margin: 20px 0 8px;
}
.routine-actions .routine-delete-btn {
  flex: 1;
  min-height: 52px;
  padding: 0 12px;
  border-radius: var(--radius-tile);
}
.routine-start {
  flex: 1;
  min-height: 52px;
  border-radius: var(--radius-tile);
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.routine-start svg { width: 16px; height: 16px; }

/* Redesign D: Statistiken. The hero turns from a brand-filled slab into a
   surface card with the drifting shimmer (like the club tiles); headline
   numbers take the display face, gains read in the "good" green, and the
   cards share the D radius and stagger in. */
.stats-page .stats-hero-card {
  padding: 18px;
  border-radius: var(--radius-card);
  color: var(--color-text);
  background: var(--color-surface);
}
.stats-hero-card > :not(.d-shimmer) { position: relative; }
.stats-hero-card .settings-segmented { background: var(--color-surface-2); border-radius: 18px; padding: 3px; }
.stats-hero-card .settings-segmented__option { color: var(--color-text-muted); border-radius: 15px; }
.stats-hero-card .settings-segmented__option--active { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 4px var(--color-shadow); }
.stats-hero-card__title { font-family: var(--font-display); }
.stats-hero-card__big { font-size: 44px; font-weight: 700; letter-spacing: -0.035em; }
.stats-hero-card__sub { color: var(--color-text-muted); font-size: 14px; }
.stats-hero-card .stats-lift { padding: 0; background: none; font-size: 15px; }
.stats-hero-card .stats-lift__name { font-weight: 400; }
.stats-hero-card .stats-lift__val { color: var(--color-text-muted); }
.stats-hero-card .stats-lift__val b { color: var(--color-text); font-weight: 600; }
.stats-hero-card .stats-delta { background: none; padding: 0; font-size: 15px; font-weight: 600; color: var(--color-good); }
.stats-hero-card .stats-delta--down { color: var(--color-text-muted); }
.stats-hero-facts { gap: 10px; }
.stats-hero-facts div { padding: 12px 14px; border-radius: var(--radius-tile); background: var(--color-surface-2); }
.stats-hero-facts dt { font-size: 13px; font-weight: 400; color: var(--color-text-muted); }
.stats-hero-facts dd { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.stats-hero-card .stats-share {
  border-radius: var(--radius-tile);
  min-height: 52px;
  color: var(--brand-fg);
  background: var(--brand);
}
.stats-page .stats-card { padding: 16px; border-radius: var(--radius-card); }
.stats-page .stats-card__title { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; }
.stats-page .stats-card__sub { font-size: 13px; }
.stats-page .stats-readout__value { font-family: var(--font-display); font-weight: 700; }
.stats-page > .stats-hero-card,
.stats-page > .stats-card { animation: d-in 0.62s var(--ease-out-soft) backwards; }
.stats-page > :nth-child(3) { animation-delay: 70ms; }
.stats-page > :nth-child(4) { animation-delay: 140ms; }
.stats-page > :nth-child(5) { animation-delay: 210ms; }
.stats-page > :nth-child(n + 6) { animation-delay: 280ms; }
@media (prefers-reduced-motion: reduce) {
  .stats-page > .stats-hero-card, .stats-page > .stats-card { animation: none; }
}

/* ── Redesign D: training summary (history_detail ?fresh=1) ────────────────
   A hero card for the moment of finishing (tick pops in, display title, day
   and time, comparison with last time), then the four figures as tiles and
   the rest as cards - the "Abschluss" screen of the design canvas. */
.session-summary__hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 24px 18px 20px;
  text-align: center;
  background: var(--color-surface);
}

.session-summary__hero > :not(.d-shimmer) {
  position: relative;
}

.session-summary__hero .d-shimmer {
  left: 50%;
  right: auto;
  top: -170px;
  width: 380px;
  height: 380px;
  margin-left: -190px;
}

.session-summary__badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  background: var(--brand);
  color: var(--brand-fg);
  animation: d-pop 0.6s var(--ease-spring) 0.1s both;
}

.session-summary__badge svg {
  width: 32px;
  height: 32px;
}

.session-summary__hero .session-summary__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.session-summary__hero .history-when {
  margin: 0;
}

.session-summary__hero .session-summary__compare {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.session-summary__hero .session-summary__compare--up {
  color: var(--color-good);
}

.session-summary__stats {
  gap: 10px;
}

.session-summary__stat {
  padding: 12px 14px;
  border-radius: var(--radius-tile);
  animation: d-in 0.5s var(--ease-out-soft) both;
}

.session-summary__stat:nth-child(2) { animation-delay: 60ms; }
.session-summary__stat:nth-child(3) { animation-delay: 120ms; }
.session-summary__stat:nth-child(4) { animation-delay: 180ms; }

.session-summary__stat dt {
  font-size: 13px;
}

.session-summary__stat dd {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.session-summary__stat--quiet dd {
  font-size: 22px;
}

.session-summary__card {
  margin-bottom: 10px;
  padding: 16px;
  border-radius: var(--radius-card);
}

.session-summary__card-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.session-summary__btn,
.session-summary__input {
  border-radius: var(--radius-tile);
}

.session-summary__btn--secondary {
  background: var(--color-surface-2);
}

.session-summary__card .session-summary__input {
  background: var(--color-surface-2);
}

.session-summary__done {
  min-height: 52px;
  border-radius: var(--radius-tile);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .session-summary__badge,
  .session-summary__stat { animation: none; }
}
/* ── end: Redesign D training summary ─────────────────────────────────────── */

/* ── Redesign D: "Training läuft bereits" (sheet and page) ─────────────────── */
.active-session-conflict {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.active-session-conflict__title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.active-session-conflict__text {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.active-session-conflict__open {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 16px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}

.active-session-conflict__play {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--brand-fg);
}

.active-session-conflict__play svg {
  width: 20px;
  height: 20px;
}

.active-session-conflict__name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.active-session-conflict__label {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.active-session-conflict__discard {
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-tile);
  background: var(--color-surface-2);
  color: var(--color-danger);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.active-session-conflict__cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
/* ── end: Redesign D active-session conflict ─────────────────────────────── */

/* ── Redesign D: Food diary ──────────────────────────────────────────────
   Tab title like Club and Training, the day as a switcher pill below it,
   the protein card with shimmer, display numbers and one brand button
   ("Essen eintragen"), meals as cards with display-face titles. */
.food-day {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 2px;
  border-radius: 24px;
  background: var(--color-surface);
}

.food-day__nav {
  flex: none;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text);
}

.food-day__nav svg { width: 20px; height: 20px; }
.food-day__nav--off { visibility: hidden; }

.food-day__label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 15px;
  color: var(--color-text-muted);
}

.food-day__label b {
  color: var(--color-text);
  font-weight: 700;
}

.food-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
}

.food-hero > :not(.d-shimmer) {
  position: relative;
}

.food-hero .d-shimmer {
  left: -90px;
  right: auto;
  top: -110px;
  width: 280px;
  height: 280px;
}

.food-ring__value {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.food-hero__label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
}

.food-hero__status {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.02em;
}

.food-kcal__value {
  font-family: var(--font-display);
}

.food-kcal .food-bar span {
  background: var(--color-text);
}

.food-hero__add {
  grid-column: 1 / -1;
  margin-top: 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 25px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.food-hero__add svg { width: 18px; height: 18px; }

.food-meal {
  border-radius: var(--radius-card);
  padding: 4px 8px 8px 16px;
}

.food-meal__title {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.food-entry__protein {
  font-family: var(--font-display);
}

@media (prefers-reduced-motion: reduce) {
  .food-page .d-in { animation: none; }
}
/* Add sheet: search as a pill, the two shortcuts as tiles, lists on cards
   (canvas "Essen eintragen"). */
.food-sheet .food-search {
  height: 48px;
  border-radius: 24px;
  padding: 0 16px;
  background: var(--color-surface);
}

.food-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.food-tile {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.food-tile svg { width: 22px; height: 22px; }

/* ── Barcode scanner sheet (food/_barcode.html) ── */
.food-barcode__view {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  border-radius: var(--radius-tile);
  overflow: hidden;
  background: var(--color-surface);
}
.food-barcode__view[hidden] { display: none; }
.food-barcode__view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.food-barcode__frame {
  position: absolute;
  inset: 30% 12%;
  border: 3px solid var(--brand);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .35);
}
.food-barcode__cam {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap-min);
  margin-bottom: 12px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.food-barcode__cam[hidden] { display: none; }
.food-barcode__msg {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
}
.food-barcode__msg p { margin: 0; }
.food-barcode__own {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  margin-top: 4px;
  font-weight: 600;
  color: var(--color-text);
}
.food-barcode__row { display: flex; gap: 8px; }
.food-barcode__row .habit-input { flex: 1; min-width: 0; }
.food-barcode__go {
  min-height: var(--tap-min);
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-fg);
  font: inherit;
  font-weight: 600;
}
.food-barcode__credit { margin: 16px 0 0; font-size: 12px; line-height: 1.45; color: var(--color-text-muted); text-align: center; }

.food-panel {
  margin-top: 12px;
  padding: 4px 4px 4px 16px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
}

.food-panel[hidden] { display: none; }
.food-panel__label { margin: 10px 0 2px; }

/* Goals and setup: the page title and the protein goal in the display face. */
.food-title,
.food-goalcard__value {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.food-goalcard { border-radius: var(--radius-card); }

/* ── end: Redesign D Food diary ─────────────────────────────────────────── */

/* ── Redesign D: Profil tab ──────────────────────────────────────────────
   Hero card (avatar + name), three training numbers as tiles, grouped row
   cards with icon tiles (canvas "Profil"). */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 16px 24px;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.profile-hero > :not(.d-shimmer) { position: relative; }

.profile-hero .profile-avatar {
  flex: none;
  width: 68px;
  height: 68px;
  margin: 0;
  font-size: 24px;
}

.profile-hero__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-hero .profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.profile-stat b {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.profile-stat span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--color-text-muted);
}

.profile-group { padding: 4px 0; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px;
  color: var(--color-text);
  text-decoration: none;
}

.profile-row__icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--color-surface-2);
}

.profile-row__icon svg { width: 20px; height: 20px; }

.profile-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-row__title { font-size: 16px; font-weight: 600; }
.profile-row__sub { font-size: 13px; color: var(--color-text-muted); }

.profile-row__chev {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.profile-logout {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 25px;
  background: var(--color-surface);
  color: var(--color-danger);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.profile-logout svg { width: 20px; height: 20px; }
/* ── end: Redesign D Profil tab ────────────────────────────────────────── */

/* ── Redesign D: Einstellungen ───────────────────────────────────────────
   Display-face title, cards with the card radius, the segmented controls as
   pills on surface-2 (canvas "Einstellungen"). The coloured row badges stay:
   they are the accepted theme-invariant accent (CLAUDE.md). */
.settings-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.025em;
}

.settings-card { border-radius: var(--radius-card); }
.settings-row { min-height: 52px; padding: 10px 16px; }

.settings-section__label {
  padding: 0 6px 8px;
  font-size: 13px;
}

.settings-segmented {
  background: var(--color-surface-2);
  border-radius: 999px;
  padding: 3px;
}

.settings-segmented__option {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  transition: background-color 0.2s var(--ease-out-soft), color 0.2s var(--ease-out-soft);
}

.settings-segmented__option--active {
  box-shadow: 0 1px 3px var(--color-shadow);
}

/* The language switch is a real button: keep the 44px tap target. */
button.settings-segmented__option { min-height: var(--tap-min); }
/* ── end: Redesign D Einstellungen ─────────────────────────────────────── */

/* ── Redesign D: Entdecken ───────────────────────────────────────────────
   Search and filter float as frosted pills over the map, the selected pin
   turns dark with a spring, and the studio sheet takes the display face and
   pill buttons (canvas "Entdecken"). */
.discover-searchbar {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  gap: 10px;
}

.discover-searchbar__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--color-text-muted);
  pointer-events: none;
}

.discover-searchbar__input,
.discover-searchbar__filter-btn {
  height: 48px;
  border: none;
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0 0 1px var(--color-nav-border), 0 6px 18px var(--color-shadow);
}

.discover-searchbar__input {
  border-radius: 24px;
  padding-left: 42px;
  font-size: 16px;
}

.discover-searchbar__filter-btn {
  width: 48px;
  border-radius: 50%;
}

.discover-searchbar__filter-btn--active {
  background: var(--brand);
  color: var(--brand-fg);
}

.gym-pin {
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: transform 0.35s var(--ease-spring), background-color 0.2s ease, color 0.2s ease;
}

.gym-pin--selected {
  transform: scale(1.18);
  background: var(--color-text);
  color: var(--color-bg);
}

.sheet { border-radius: 28px 28px 0 0; }

.gym-detail { padding: 4px 20px 20px; }

.gym-detail__title {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.gym-detail__subline { font-size: 15px; }

.gym-detail__actions .exercise-detail__plan-btn,
.gym-detail__actions .btn-outline {
  min-height: 52px;
  border-radius: 26px;
}

.gym-detail__actions .btn-outline {
  justify-content: center;
  border: none;
  background: var(--color-surface-2);
}

.gym-detail .exercise-tag {
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--color-surface-2);
  font-size: 14px;
  font-weight: 500;
}

.gym-upsell-box,
.gym-recommend-cta { border-radius: var(--radius-tile); }
/* ── end: Redesign D Entdecken ─────────────────────────────────────────── */

/* Mitgliedschaften sheet: the profile rows on surface cards, studio rows are
   POST buttons (switch the Club tab), so they reset the button look. */
.memberships-sheet { padding-bottom: 24px; }
.memberships-sheet__label { margin: 16px 6px 6px; }
.memberships-sheet__group {
  border-radius: var(--radius-tile);
  background: var(--color-surface);
}
.memberships-sheet button.profile-row {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.memberships-sheet .profile-row__icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.memberships-sheet__empty {
  margin: 0;
  padding: 14px 16px 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------------
   Redesign D: "Mein Training" club widget (club/widgets/my_training_*)
   ------------------------------------------------------------------ */
.my-training {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.my-training__text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.my-training__label,
.my-training__meta,
.my-streak__text span {
  font-size: 14px;
  color: var(--color-text-muted);
}

.my-training__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.my-training__cta {
  position: relative;
  align-self: flex-start;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-radius: 25px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.my-training__cta--quiet {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.my-training__cta svg { width: 16px; height: 16px; }

.my-streak {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  color: var(--color-text);
  text-decoration: none;
}

.my-streak__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-streak__flame {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand);
  color: var(--brand-fg);
}

.my-streak__flame svg { width: 24px; height: 24px; }

.my-streak__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.my-streak__text b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.my-streak__week {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-streak__week li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.my-streak__week li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid var(--color-surface-2);
  border-radius: 50%;
}

.my-streak__week li.is-done > span {
  border: 0;
  background: var(--brand);
  color: var(--brand-fg);
}

.my-streak__week li.is-today { color: var(--color-text); font-weight: 700; }
.my-streak__week li.is-today:not(.is-done) > span { border-color: var(--brand); }
.my-streak__week svg { width: 14px; height: 14px; }

/* Redesign D: courses variant "next" (club/widgets/courses_next.html) */
.course-next {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  color: var(--color-text);
  text-decoration: none;
}

.course-next__text,
.course-next__fill {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.course-next__fill { flex: 1; gap: 5px; min-width: 0; }
.course-next__muted { font-size: 14px; color: var(--color-text-muted); }

.course-next__time {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.course-next__name { font-size: 18px; font-weight: 600; }

.course-next__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-next__bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  background: var(--color-surface-2);
  overflow: hidden;
}

.course-next__bar span { border-radius: 3px; background: var(--color-text); }

.course-next__cta {
  flex: none;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  border-radius: 23px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 15px;
  font-weight: 600;
}

.course-next__cta--quiet { background: var(--color-surface-2); color: var(--color-text); }

/* Redesign D: membership variant "card" (club/widgets/membership_card.html) */
.wallet-card {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
  box-sizing: border-box;
  border-radius: var(--radius-card);
  background: var(--brand);
  color: var(--brand-fg);
  text-decoration: none;
}

.wallet-card__glow {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-fg) 10%, transparent);
  pointer-events: none;
}

.wallet-card__top,
.wallet-card__bottom { position: relative; display: flex; }
.wallet-card__top { align-items: center; justify-content: space-between; gap: 10px; }
.wallet-card__bottom { flex-direction: column; align-items: flex-start; gap: 2px; }
.wallet-card__club { font-size: 15px; font-weight: 700; }

.wallet-card__plan {
  padding: 4px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-fg) 12%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.wallet-card__meta { font-size: 12px; opacity: 0.7; }

.wallet-card__name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ── Redesign D: Studio shell ─────────────────────────────────────────────
   Canvas "Studio-Dashboard": the sidebar sits on the page background in both
   themes (no longer a dark column), the active entry is a raised surface
   pill with an icon, and the content is one large rounded panel one step
   darker than the cards, so cards read as raised without borders. Topbar
   actions become pills and round buttons. */
:root {
  --studio-sidebar-bg: var(--color-bg);
  --studio-sidebar-fg: var(--color-text);
  --studio-sidebar-muted: var(--color-text-muted);
  /* A step off the page background in both themes (surface-2 would sit
     above the cards in dark mode, where it is lighter than surface). */
  --studio-canvas: color-mix(in srgb, var(--color-text) 5%, var(--color-bg));
  --studio-radius-panel: 24px;
}
/* Dark: the cards are the lighter layer, so the panel goes nearly to the
   page background to keep them raised. */
:root[data-theme="dark"] { --studio-canvas: color-mix(in srgb, var(--color-text) 2%, var(--color-bg)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --studio-canvas: color-mix(in srgb, var(--color-text) 2%, var(--color-bg)); }
}

.studio-body { background: var(--color-bg); }
.studio-nav { --studio-scroll-thumb: color-mix(in srgb, var(--color-text) 22%, transparent); --studio-scroll-thumb-hover: color-mix(in srgb, var(--color-text) 42%, transparent); }

.studio-topbar {
  background: transparent;
  border-bottom: 0;
  padding: 12px 16px 8px 20px;
}

.studio-brand__mark { width: 40px; height: 40px; border-radius: 13px; overflow: hidden; }
.studio-brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.studio-topbar .studio-icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  transition: transform 0.38s var(--ease-spring);
}
.studio-topbar .studio-icon-btn:active { transform: scale(0.94); transition-duration: 0.07s; }
@media (min-width: 1101px) { .studio-topbar .studio-nav-toggle { display: none; } }

.studio-topbar .studio-logout__btn {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}
.studio-topbar .studio-logout__btn svg { color: var(--color-text-muted); }
.studio-topbar .studio-avatar { width: var(--tap-min); height: var(--tap-min); font-size: 15px; }

.studio-nav { flex-basis: 232px; padding: 8px 12px 16px; }
@media (min-width: 721px) {
  .studio-nav { height: calc(100vh - 64px); top: 64px; }
}
.studio-nav__group { margin-bottom: 10px; }
.studio-nav__group-label { padding: 8px 12px 4px; letter-spacing: 0.06em; }

.studio-nav__item {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  transition: background-color 0.2s var(--ease-out-soft), color 0.2s var(--ease-out-soft);
}
.studio-nav__icon { display: flex; flex: none; }
.studio-nav__label { flex: 1; min-width: 0; }
a.studio-nav__item:hover { background: color-mix(in srgb, var(--color-surface) 70%, transparent); color: var(--color-text); }

.studio-nav__item--active,
a.studio-nav__item--active:hover {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: 0 1px 3px var(--color-shadow);
}
.studio-nav__item--active .studio-nav__icon { color: var(--color-text); }
.studio-nav__item--soon { opacity: 0.5; }

.studio-canvas {
  margin: 0 12px 12px 0;
  padding: 26px 30px 48px;
  border-radius: 28px;
  background: var(--studio-canvas);
}
@media (max-width: 720px) {
  .studio-canvas { margin: 0 8px 8px; padding: 20px 16px 40px; border-radius: 22px; }
}

.studio-page-head__title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.studio-card,
.studio-stat,
.studio-kpi-card {
  border: 0;
  border-radius: var(--studio-radius-panel);
}

.studio-card__title,
.studio-kpi-card__value,
.studio-stat__value {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.studio-card__title { font-size: 19px; }
.studio-kpi-card__value,
.studio-stat__value { font-size: 36px; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }

.studio-kpi-card--link { transition: transform 0.38s var(--ease-spring), box-shadow 0.2s var(--ease-out-soft); }
.studio-kpi-card--link:hover { box-shadow: 0 4px 16px var(--color-shadow); }
.studio-kpi-card--link:active { transform: scale(0.97); transition-duration: 0.07s; }
.studio-list__row { border-bottom-color: var(--color-surface-2); }
/* Dashboard (studio/overview.html) */
.studio-overview { margin: -26px -30px; padding: 26px 30px 48px; }
.studio-overview-main { gap: 16px; }
.studio-overview-main { container-type: inline-size; }
/* Four across when the main column has room, else 2 x 2 - never 3 + 1. */
.studio-kpi-grid { gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 600px) { .studio-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.studio-kpi-card { position: relative; overflow: hidden; padding: 16px 18px; gap: 2px; }
.studio-kpi-card__label { font-size: 13px; font-weight: 500; }
.studio-kpi-card__value { margin: 2px 0; }
.studio-kpi-card__hint { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.studio-kpi-card__hint--up { color: var(--color-good); }
.studio-kpi-card__hint--down { color: var(--color-danger); }
.studio-kpi-card > * { position: relative; }
.studio-kpi-card > .d-shimmer { position: absolute; right: -120px; top: -150px; }
.studio-kpi-card__icon { border-radius: 10px; }
.studio-card__title:has(+ .studio-card__sub) { margin-bottom: 1px; }
.studio-card__sub { margin: 0 0 12px; font-size: 13px; color: var(--color-text-muted); }

.studio-visits__chart {
  height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 20px;
}
.studio-visits__col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.studio-visits__bar {
  width: 100%;
  height: var(--h);
  border-radius: 6px;
  background: var(--color-surface-2);
  transform-origin: bottom;
  animation: d-grow 0.7s var(--ease-out-soft) backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.studio-visits__bar--now { background: var(--brand); }
.studio-visits__tick {
  position: absolute;
  left: 0;
  bottom: -20px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.studio-overview-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}
.studio-overview-pair > .studio-card { margin-bottom: 0; }
.studio-card__head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.studio-card__more {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  margin: -12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
}
.studio-card__more:hover { color: var(--color-text); }
.studio-visits__empty { display: flex; align-items: center; gap: 14px; padding: 6px 0 4px; }
.studio-visits__empty p { margin: 0; font-size: 14px; color: var(--color-text-muted); }
.studio-visits__empty-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.studio-course-row__fill { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.studio-course-row__meter { width: 52px; height: 4px; border-radius: 2px; background: var(--color-surface-2); overflow: hidden; }
.studio-course-row__meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.studio-course-row__meter.is-full > span { background: var(--color-text); }

.studio-course-row,
.studio-member-row { align-items: center; }
.studio-course-row__time {
  flex: none;
  width: 52px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.studio-course-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.studio-course-row__body .studio-list__main { font-weight: 600; }
.studio-course-row__fill { flex: none; font-size: 14px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.studio-member-row__avatar {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--color-surface-2);
  font-weight: 700;
}

/* Setup checklist: one panel, round checks, no boxed phases (canvas "Studio vervollständigen"). */
.studio-setup-sidebar { border: 0; border-radius: var(--studio-radius-panel); }
.studio-setup-sidebar__head { border-bottom: 0; padding: 16px 20px 2px; }
.studio-setup-sidebar__title,
.studio-setup-sidebar__pct { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.02em; }
.studio-setup-sidebar__body { padding: 8px 12px 16px; gap: 10px; }
.studio-setup-progress { margin: 0 8px 4px; height: 6px; background: var(--color-surface-2); }
.studio-setup-phase { border: 0; border-radius: 0; background: none; }
.studio-setup-phase__head { background: none; border-bottom: 0; padding: 8px; }
.studio-setup-phase__icon { border: 0; border-radius: 50%; background: var(--color-surface-2); }
.studio-setup-item { border-top: 0; border-radius: 16px; padding: 8px; min-height: 44px; }
.studio-setup-item--done { background: none; }
.studio-setup-item__box { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--color-surface-2); background: none; }
.studio-setup-item--done .studio-setup-item__box { border: 0; }
.studio-setup-sidebar .studio-btn-sm { min-height: 32px; display: inline-flex; align-items: center; border-radius: 999px; padding: 0 14px; text-decoration: none; }
.studio-setup-cta { border-radius: 20px; background: var(--color-surface-2); color: var(--color-text); margin-top: 4px; }
.studio-setup-cta__kicker { opacity: 1; color: var(--color-text-muted); }
.studio-setup-cta__btn { border-radius: 17px; }
/* Konfigurator (studio/konfigurator.html): the three columns float as panels
   on the rounded canvas instead of bleeding to its edges (canvas
   "Studio-Konfigurator"). The canvas stops scrolling and hands its height to
   the layout, so library and settings scroll on their own as before. */
/* 64px topbar + the canvas' 12px bottom margin. */
.studio-canvas:has(> .conf-layout) { display: flex; flex-direction: column; height: calc(100dvh - 76px); box-sizing: border-box; padding: 14px; overflow: hidden; }
.conf-layout { flex: 1; min-height: 0; height: auto; margin: 0; gap: 14px; grid-template-columns: 290px minmax(0, 1fr) 290px; }
@media (max-width: 1180px) { .conf-layout { grid-template-columns: 240px minmax(0, 1fr) 250px; } }
@media (max-width: 1000px) { .conf-layout { grid-template-columns: 212px minmax(0, 1fr) 210px; gap: 10px; } }
.conf-lib,
.conf-settings { border: 0; border-radius: var(--studio-radius-panel); }
.conf-canvas { background: none; }
.conf-lib-head { padding: 18px 16px 6px; }
.conf-lib-title,
.conf-set-head { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.conf-set-head { padding: 18px 20px 6px; }
.conf-lib-sub { font-size: 12px; margin-top: 2px; }
.conf-tabs { margin-top: 12px; padding: 3px; gap: 0; border-radius: 16px; background: var(--color-surface-2); }
.conf-tab { min-height: 38px; border-radius: 13px; font-size: 14px; font-weight: 600; }
.conf-tab[aria-selected="true"] { box-shadow: 0 1px 3px var(--color-shadow); }
.conf-lib-search { height: 40px; margin-top: 10px; padding: 0 14px; border-radius: 14px; background: var(--color-surface-2); font-size: 14px; }
.conf-lib-list { padding: 8px 8px 20px; gap: 2px; }
.conf-lib-section { padding: 14px 10px 4px; font-size: 11px; letter-spacing: 0.06em; }
.conf-lib-item { border-radius: 16px; background: none; box-shadow: none; }
.conf-lib-item:hover:not(.is-soon) { background: var(--color-surface-2); box-shadow: none; }
.conf-lib-item.is-selected,
.conf-lib-item.is-selected:hover { box-shadow: inset 0 0 0 2px var(--color-text); }
.conf-lib-main { min-height: var(--tap-min); padding: 6px 4px 6px 8px; border-radius: 16px; }
.conf-lib-icon { width: 34px; height: 34px; border-radius: 12px; background: var(--color-surface-2); }
.conf-lib-item:hover .conf-lib-icon,
.conf-lib-item.is-selected .conf-lib-icon { background: var(--color-surface-2); }
.conf-lib-item.is-active .conf-lib-icon { background: var(--brand); color: var(--brand-fg); }
.conf-lib-name { font-size: 14px; font-weight: 600; }
.conf-lib-desc { font-size: 12px; }
.conf-lib-badge { padding: 4px 9px; font-size: 11px; font-weight: 600; }
.conf-lib-badge.on,
.conf-lib-badge.soon { background: var(--color-surface-2); box-shadow: none; }
.conf-lib-empty { background: var(--color-surface-2); border-radius: 16px; }
/* Same iOS switch as the member settings: neutral track, white thumb. */
.conf-switch { width: 44px; height: 26px; background: var(--color-surface-2); }
.conf-switch__thumb { width: 22px; height: 22px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.35s var(--ease-spring), width 0.2s var(--ease-out-soft); }
.conf-switch[aria-checked="true"] .conf-switch__thumb { transform: translateX(18px); background: #fff; }
.conf-switch[aria-checked="true"]:active:not(:disabled) .conf-switch__thumb { transform: translateX(14px); }
.conf-switch:active:not(:disabled) .conf-switch__thumb { width: 26px; }
.conf-canvas-topbar { padding: 4px 6px 0; }
.conf-canvas-label { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.conf-hint { font-size: 12px; }
.conf-status { padding: 5px 11px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.conf-status--default,
.conf-status--draft { background: var(--color-surface); box-shadow: none; }
.conf-status-sub,
.conf-save-state { font-size: 12px; }
.conf-publish { min-height: var(--tap-min); padding: 0 20px; border-radius: 999px; font-size: 14px; }
.conf-phone { border-radius: 44px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 22%, transparent), 0 30px 60px -20px var(--color-shadow); }
.conf-phone-screen { border-radius: 36px; }
.conf-set-body { padding: 10px 16px 20px; }
.conf-toggle-row { min-height: var(--tap-min); padding: 6px 12px; border-radius: 14px; background: var(--color-surface-2); }
.conf-toggle-row span { font-size: 14px; }
/* Konfigurator settings panel: section labels as in the member settings,
   soft wells instead of outlined boxes, round buttons, red text for remove. */
.conf-set-desc { font-size: 13px; margin-bottom: 16px; }
.conf-variants legend,
.conf-targets legend,
.conf-set-label { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--color-text); }
.conf-variants__grid { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.conf-variant__tile { border: 0; border-radius: 16px; background: var(--color-surface-2); }
.conf-variant__thumb { background: none; border-bottom: 0; height: 46px; padding: 10px 10px 4px; }
.conf-variant__input:hover:not(:disabled) + .conf-variant__tile { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-text) 25%, transparent); }
.conf-variant__input:checked + .conf-variant__tile { box-shadow: inset 0 0 0 2px var(--color-text); }
.conf-variant__label { min-height: 32px; padding: 4px 8px 8px; font-size: 12px; font-weight: 600; }
.conf-targets__note { font-size: 12px; }
.conf-target__select { min-height: var(--tap-min); border: 0; border-radius: 14px; background: var(--color-surface-2); font-size: 14px; }
.conf-move { gap: 8px; }
.conf-btn { min-height: var(--tap-min); padding: 0 14px; border: 0; border-radius: 999px; background: var(--color-surface-2); font-size: 14px; }
.conf-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-surface-2)); }
.conf-remove.studio-btn-sm--danger { min-height: var(--tap-min); border-radius: 999px; background: var(--color-surface-2); color: var(--color-danger); font-size: 14px; }

/* Studio list/form pages in D (Mitglieder, Check-in, Statistiken,
   Einstellungen): the shared primitives those pages are built from get the
   same soft surfaces as the dashboard - pills instead of boxed buttons, wells
   instead of hairline borders, display-font numbers. Restyled here rather
   than per page so every studio page that reuses them follows along. */
.studio-toolbar { border-bottom: 0; padding: 4px 0 2px; gap: 10px; }
.studio-toolbar__search input {
  height: 40px; border: 0; border-radius: 999px; padding-left: 36px;
  font-size: 14px; background: var(--color-surface);
  box-shadow: 0 1px 2px var(--color-shadow);
}
.studio-toolbar__search svg { left: 14px; }
.studio-toolbar__search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.studio-filter-tabs { gap: 6px; }
.studio-filter-tab {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--color-surface);
  transition: background-color .2s var(--ease-out-soft), color .2s var(--ease-out-soft);
}
.studio-filter-tab:hover { color: var(--color-text); }
.studio-filter-tab--on, .studio-filter-tab--on:hover { background: var(--color-text); color: var(--color-bg); }
.studio-btn {
  height: 40px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--color-surface); color: var(--color-text); border: 0;
  text-decoration: none; box-shadow: 0 1px 2px var(--color-shadow);
  transition: transform .2s var(--ease-spring), opacity .2s ease;
}
.studio-btn:active { transform: scale(.97); }
.studio-btn--ghost { border: 0; background: var(--color-surface); }
.studio-btn--brand { background: var(--brand); color: var(--brand-fg); box-shadow: none; }
.studio-btn-sm {
  min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13.5px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.studio-btn-sm--danger { background: var(--color-surface-2); color: var(--color-danger); }
.studio-text-input, .studio-select { border: 0; border-radius: 12px; background: var(--color-surface-2); padding: 8px 12px; }
.studio-text-input:focus-visible, .studio-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.studio-card--nudge { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 55%, transparent); }

/* Tables: no row rules, rows separate by a soft hover well. */
.studio-table thead th { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 14px 14px 6px; }
.studio-table td { border-top: 0; padding: 11px 14px; font-size: 13.5px; }
.studio-table tbody tr + tr td { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-text) 6%, transparent); }
.studio-table tbody tr:hover td { background: var(--color-surface-2); box-shadow: none; }
.studio-table tbody tr:hover + tr td { box-shadow: none; }
.studio-table__meta { font-size: 12px; }
.studio-table__time { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.studio-table__more {
  display: block; padding: 14px; text-align: center; font-size: 13.5px; font-weight: 600;
  color: var(--color-text-muted); text-decoration: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-text) 6%, transparent);
}
.studio-table__more:hover { color: var(--color-text); }
.studio-status-badge { padding: 3px 10px; font-size: 12px; font-weight: 600; }

/* Check-in: the lookup is the desk's main control, so it is large. */
.studio-lookup { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.studio-lookup__input.studio-text-input {
  flex: 1 1 220px; max-width: 360px; min-height: 52px; border-radius: 16px; padding: 0 18px;
  font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: 0.02em;
}
.studio-lookup__btn.studio-btn-sm { min-height: 52px; padding: 0 24px; font-size: 15px; }
.studio-access-card { border-left: 0; }
.studio-access-card__state { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.studio-access-card__state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--color-good); flex: 0 0 auto; }
.studio-access-card--warn .studio-access-card__state::before { background: var(--studio-warn-text); }
.studio-access-card--denied .studio-access-card__state::before { background: var(--color-danger); }
.studio-access-card--well { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: var(--color-surface-2); }

/* Statistiken */
.studio-stats-kpi, .studio-chart-card { border: 0; border-radius: var(--studio-radius-panel); }
.studio-stats-kpi { padding: 18px 20px; gap: 6px; }
.studio-stats-kpi--accent { background: var(--color-surface); }
.studio-stats-kpi__label,
.studio-stats-kpi--accent .studio-stats-kpi__label { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--color-text-muted); }
.studio-stats-kpi__value,
.studio-stats-kpi--accent .studio-stats-kpi__value { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text); }
.studio-stats-kpi__sub,
.studio-stats-kpi--accent .studio-stats-kpi__sub { font-size: 12.5px; color: var(--color-text-muted); }
.studio-stats-kpi__trend { border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.studio-stats-kpi__row { flex-wrap: wrap; gap: 4px 6px; }
.studio-stats-kpi__trend { white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.studio-chart-card__head { border-bottom: 0; padding: 20px 22px 4px; }
.studio-chart-card__title { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; }
.studio-chart-card__sub { font-size: 13px; }
.studio-chart-card__body { padding: 14px 22px 22px; }
.studio-heatmap { gap: 4px; }
.studio-heatmap__day, .studio-heatmap__slot { font-size: 11px; font-weight: 600; }
.studio-heatmap__cell { height: 22px; border-radius: 6px; }
.studio-heatmap__swatch { border-radius: 4px; }
.studio-course-bar { gap: 7px; }
.studio-course-bar__name { font-size: 14px; }
.studio-course-bar__frac { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.studio-course-bar__track { height: 10px; border-radius: 999px; background: var(--color-surface-2); }
.studio-course-bar__fill { border-radius: 999px; transition: width .6s var(--ease-out-soft); }

/* Einstellungen / Branding */
.studio-form-card { border: 0; border-radius: var(--studio-radius-panel); padding: 22px 24px; }
.studio-form-card__title { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.02em; }
.studio-form-card .studio-text-input, .studio-form-card .studio-select { min-height: 44px; border-radius: 12px; background: var(--color-surface-2); }
.ss-tile { border: 0; border-radius: 16px; background: var(--color-surface-2); transition: box-shadow .2s var(--ease-out-soft), background-color .2s ease; }
.ss-tile:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 18%, transparent); }
.ss-tile:has(input:checked) { background: var(--color-surface-2); box-shadow: inset 0 0 0 2px var(--brand-ink, var(--brand)); }
.ss-tile input { border-radius: 50%; }
.ss-swatches { gap: 10px; }
.ss-swatch { width: 44px; height: 44px; transition: transform .25s var(--ease-spring), border-color .15s ease; }
.ss-swatch:active { transform: scale(.94); }
.ss-drop { border: 0; border-radius: 18px; background: var(--color-surface-2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 10%, transparent); }
.ss-drop:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 30%, transparent); }
.ss-drop__tile { border: 0; border-radius: 16px; box-shadow: 0 1px 2px var(--color-shadow); }
.ss-preview { border-radius: 20px; }

/* Remaining studio pages (Kurse, Team, Feedback, Trainer, Profil, ...): the
   last old controls - link-style filter tabs, brand-filled buttons repeated
   on every table row, raw checkboxes and file inputs. */
a.studio-filter-tab { display: inline-flex; align-items: center; text-decoration: none; }
.studio-table .studio-btn-sm:not(.studio-btn-sm--danger) { background: var(--color-surface-2); color: var(--color-text); }
.studio-day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-day-chip span { min-width: 44px; height: 36px; padding: 0 10px; border-radius: 999px; background: var(--color-surface-2); font-size: 13px; transition: background-color .2s var(--ease-out-soft), color .2s var(--ease-out-soft); }
.studio-html input[type="checkbox"] { accent-color: var(--brand); }
.studio-html input[type="file"]::file-selector-button {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--color-text);
  border: 0; border-radius: 999px; padding: 8px 16px; margin-right: 12px;
  background: var(--color-surface); box-shadow: 0 1px 2px var(--color-shadow); cursor: pointer;
}
.studio-back-link { display: inline-block; padding: 10px 0; font-size: 14px; font-weight: 600; text-decoration: none; }
/* ── end: Redesign D Studio shell ──────────────────────────────────────── */

/* ── Redesign D: signed-out pages and setup flow ──────────────────────────
   Login, register, recovery, invites, password reset, 2FA code and the
   onboarding steps share the auth-* classes, so they are restyled here in
   one place. Following the canvas "Anmelden" screen: display-face titles,
   each field one soft surface tile with its label inside (no boxed form
   card), focus as a brand ring on the tile, pill buttons. The animated logo
   stage above stays as it was. */
.auth-stage__name { font-family: var(--font-display); letter-spacing: -0.035em; }
.auth-title {
  font-family: var(--font-display); font-size: 32px; line-height: 1.08;
  letter-spacing: -0.03em; padding-bottom: 20px;
}
.auth-title:has(+ .auth-note) { padding-bottom: 8px; }
.auth-note { font-size: 15px; }
.auth-page { padding-top: 32px; }
.auth-form { background: transparent; padding: 0; gap: 8px; border-radius: 0; }
.auth-field {
  gap: 2px; padding: 10px 16px 8px; border-radius: 18px;
  background: var(--color-surface);
  transition: box-shadow .2s var(--ease-out-soft);
}
.auth-field:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.auth-field label { font-size: 12px; }
.auth-field input,
.auth-field textarea,
.auth-field select {
  min-height: 30px; padding: 2px 0; border: 0; border-radius: 0; background: transparent;
}
.auth-field input:focus,
.auth-field textarea:focus,
.auth-field select:focus { outline: none; }
.auth-field input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--brand); }
.auth-field .auth-errors { margin: 4px 0 2px; padding: 0; }
.auth-form > .auth-errors {
  margin: 0; padding: 12px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface));
}
.auth-submit {
  min-height: 56px; margin-top: 8px; border-radius: 999px; font-weight: 600;
  transition: transform .2s var(--ease-spring);
}
.auth-submit:active { transform: scale(.97); }
.auth-switch a { display: inline-block; padding: 12px 0; font-size: 15px; }
.auth-switch a strong { font-weight: 600; }
.invite-member-card { border: 0; border-radius: 18px; }
.auth-qr-wrap { border-radius: 22px; }
.setup-summary { border: 0; border-radius: 22px; }
.auth-page--setup .zg-providers { border-radius: 22px; }
.auth-page--setup .zg-provider { border-bottom-color: color-mix(in srgb, var(--color-text) 7%, transparent); }
/* ── end: Redesign D signed-out pages ───────────────────────────────────── */

/* ── Redesign D: habits, friends and chat ─────────────────────────────
   Same language as the training and studio pages: 24px panels, headings
   in the display font, form labels in sentence case instead of small
   caps, chips and steppers as round pills. Only radii, type and fills
   change; layout and behaviour stay as they were. */
.habit-card,
.feed-item,
.friend-me,
.friend-invite,
.friend-row,
.chat-list,
.chat-link-card { border-radius: 24px; }

.friends-heading,
.habits-title,
.chat-head__title,
.chat-empty__title,
.friend-me__title,
.friend-invite__title,
.habit-card__name {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.friends-heading { font-size: 20px; margin-top: 18px; }

/* Habit form: labels read like the D sign-up fields, inputs are tiles. */
.habit-form .field-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 22px;
}
.habit-input { border-radius: 18px; padding: 15px 16px; }
.habit-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.habit-icon-pick__item > span:first-of-type { border-radius: 16px; }
.habit-color-pick__item { height: 40px; border-radius: 999px; }
.habit-days__item span { border-radius: 999px; }
.habit-target__btn,
.habit-target__input { border-radius: 999px; }
/* ── end: Redesign D habits, friends and chat ── */

/* ── Redesign D: public pages ──────────────────────────────────────────────
   The start page and "Für Studios" were always dark (the lead palette). In D
   they follow the theme like the app: `.public-html.lead` points the lead
   tokens back at the app tokens, so every lead/home rule above switches with
   light/dark without a colour-scheme query of its own (html computes them
   from its own --color-*, body's remap in lead-foundation then inherits the
   resolved values - no cycle). The claim landing has no `.public-html`, so it
   keeps the dark lead look. Accent lime stays a fill, never text on paper. */
.public-html.lead {
  color-scheme: light dark;
  --lead-bg: var(--color-bg);
  --lead-bg-2: var(--color-surface-2);
  --lead-surface-solid: var(--color-surface);
  --lead-glass: var(--color-surface);
  --lead-border: var(--color-nav-border);
  --lead-border-strong: color-mix(in srgb, var(--color-text) 14%, transparent);
  --lead-text: var(--color-text);
  --lead-text-muted: var(--color-text-muted);
  --lead-teal: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface-2));
  --lead-danger: var(--color-danger);
  --lead-radius-l: 32px;
  --lead-radius-xl: 44px;
  --pub-ink: var(--color-accent-fg);
  /* No mono labels in D: the small print uses the text face. */
  --lead-font-mono: var(--font);
}

.public-html.lead .home-ribbon__list li { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; }

/* Lime used as text (eyebrows, step numbers, chart deltas) reads on dark
   only; on paper it becomes the text colour, the lime stays on fills. */
.public-html.lead .home-eyebrow,
.public-html.lead .home-step__num,
.public-html.lead .home-float__icon,
.public-html.lead .home-offline,
.public-html.lead .home-chart__delta,
.public-html.lead .home-ribbon__list li::before,
.public-html.lead .lead-demand__value,
.public-html.lead .public-finder__action--claim { color: var(--color-text); }

/* Headlines in the display face. */
.public-html.lead .lead-hero__title,
.public-html.lead .lead-h2,
.public-html.lead .lead-h3,
.public-html.lead .home-faq__item summary,
.public-html.lead .home-say__line {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.public-html.lead .lead-h2 { line-height: 1.02; }

/* No serif italics: the accent word is plain, the hero's "Eine App." gets
   the lime marker (box-decoration-break keeps it intact across a wrap). */
.public-html.lead .lead-serif {
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
  letter-spacing: inherit;
}

.public-html.lead .home-mark {
  padding: 0 .14em;
  border-radius: .28em;
  background: var(--color-accent);
  color: var(--pub-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.public-html.lead .home-say__w.lead-serif { color: inherit; text-decoration: underline 0.12em var(--color-accent); text-underline-offset: 0.12em; }

/* Eyebrows: small surface chips instead of mono caps. */
.public-html.lead .lead-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--color-surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
}

.public-html.lead .home-step__num.lead-kicker { background: var(--color-surface-2); }

/* Surface tiles: no glass, no border, soft shadow. */
.public-html.lead .lead-glass {
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 0 var(--color-nav-border), 0 18px 40px -24px var(--color-shadow);
}

.public-html.lead .home-float__card { box-shadow: 0 14px 34px -10px var(--color-shadow), 0 0 0 1px var(--color-nav-border); }

.public-html.lead .home-studio__panel { background: var(--color-surface); }

.public-html.lead .home-map { box-shadow: 0 30px 60px -36px var(--color-shadow); }

.public-html.lead .home-ribbon { background: transparent; }

/* Device frames: a dark bezel in both themes, like a real phone. */
.public-html.lead .lead-device--phone .lead-device__bezel {
  border-color: var(--color-accent-fg);
  box-shadow: 0 40px 80px -30px var(--color-shadow);
}

/* Buttons: primary is a dark pill (light text in light, light pill in dark);
   lime stays the CTA panel's fill, where the button turns ink. */
.public-html.lead .lead-btn--primary,
.public-html .public-btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
  box-shadow: none;
}

.public-html.lead .lead-btn--ghost { background: var(--color-surface); border-color: transparent; }

.public-html.lead .lead-cta__panel .lead-btn--on-accent,
.public-html.lead .lead-cta__panel .lead-btn--primary {
  background: var(--color-accent-fg);
  color: var(--color-accent);
}

.public-html.lead .lead-cta__panel { border-radius: var(--lead-radius-xl); }

.public-html.lead .lead-cta__panel .lead-kicker { background: color-mix(in srgb, var(--color-accent-fg) 10%, transparent); color: var(--color-accent-fg); }

/* Floating pill nav on every public page. */
.public-html .public-nav {
  top: 12px;
  margin: 12px clamp(12px, 4vw, 40px) 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-nav-bg);
  box-shadow: 0 0 0 1px var(--color-nav-border), 0 10px 30px -12px var(--color-shadow);
}

.public-html .public-nav__inner { min-height: 60px; padding: 0 10px 0 20px; }

.public-html .public-nav__name { font-family: var(--font-display); letter-spacing: -0.02em; }

.public-html .public-nav__link[aria-current="page"] { background: var(--color-surface-2); border-radius: 999px; }

/* Club page: it was theme-aware already; D adds the display face, the
   bigger radius, chip eyebrows and borderless surface cards. */
.pclub-title,
.pclub-h2,
.pclub-card__title,
.pclub-join__title { font-family: var(--font-display); }

.pclub-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
}

.pclub-card {
  border: 0;
  border-radius: 32px;
  box-shadow: 0 1px 0 var(--color-nav-border), 0 18px 40px -24px var(--color-shadow);
}

.pclub-join { border-radius: 44px; }
/* ── end: Redesign D public pages ── */

/* ── Legal pages: Impressum, Datenschutz (issue #211) ──
   A readable text column; sections are surface cards like the rest of D.
   The kicker and h1 get the D treatment here for every plain public page
   (Ratgeber too), not only the lead-based ones. */
.public-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--color-surface);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
}

.public-h1, .public-h2, .public-h3 { font-family: var(--font-display); }

.public-legal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  padding-block: clamp(48px, 8vh, 96px);
}

.public-legal .public-h1 { margin-bottom: 8px; }

.public-legal__section {
  padding: clamp(20px, 3vw, 28px);
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-nav-border);
  font-size: 16px;
  line-height: 1.6;
}

.public-legal__section h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.02em;
}

.public-legal__section p { margin: 0 0 10px; }
.public-legal__section p:last-child { margin-bottom: 0; }
.public-legal__section ul { margin: 0; padding-left: 20px; }
.public-legal__section li + li { margin-top: 6px; }
.public-legal__section a, .public-legal__more a { color: var(--color-text); text-underline-offset: 3px; }

.public-legal__list { margin: 0; }
.public-legal__list dt { margin-top: 14px; font-weight: 700; }
.public-legal__list dt:first-child { margin-top: 0; }
.public-legal__list dd { margin: 2px 0 0; color: var(--color-text-muted); }

.public-legal__draft {
  margin: 0;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--color-surface-2);
  font-size: 15px;
}

.public-legal__missing { color: var(--color-text-muted); font-style: italic; }

.public-legal__more { margin: 8px 0 0; font-weight: 600; }
/* ── end: legal pages ── */

.studio-nav__legal { margin: auto 0 0; padding: 16px 12px 8px; font-size: 12px; color: var(--color-text-muted); }
.studio-nav__legal a { color: inherit; }
.studio-nav-collapsed .studio-nav__legal { display: none; }

.studio-nav__legal { margin: auto 0 0; padding: 16px 12px 8px; font-size: 12px; color: var(--color-text-muted); }
.studio-nav__legal a { color: inherit; }
.studio-nav-collapsed .studio-nav__legal { display: none; }
.auth-legal { margin: 24px 0 0; text-align: center; font-size: 13px; color: var(--color-text-muted); }
.auth-legal a { color: inherit; }
