/* =============================================
   vbClub Training — общие стили
   ============================================= */

/* CSS variables defined in theme.css (loaded before this file).
   See: assets/css/theme.css → canonical --t-* tokens + bridge to --primary, --bg, etc.
   Source of truth: config/theme.php */

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

html { font-size: 16px; }

/* Mobile editable-control baseline.
   iOS Safari auto-zooms on focus when a form control's computed font-size
   is < 16px; Android Chrome (esp. with Force-enable-zoom on, or older
   builds that bend `maximum-scale`) shows similar zoom-on-focus. The
   canonical fix is to guarantee ≥16px on every text-entry control on
   mobile, regardless of how local module/page CSS sized it. We use
   `!important` here intentionally — and ONLY on font-size, ONLY inside
   the mobile media query, ONLY for editable controls — because this is a
   platform-wide a11y invariant; individual components are free to control
   padding, width, layout, but must not undercut the focus-zoom guard.
   Checkbox/radio/range/hidden carry no text and are excluded. */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  textarea,
  select {
    font-size: 16px !important;
  }
  /* Cap textarea height so it cannot consume the whole mobile viewport.
     Android Chrome routes one-finger gestures that start inside text
     controls to caret/select/inner-scroll behavior; a screen-tall textarea
     becomes a "scroll trap" and forces users into two-finger page scroll.
     Opt-up via `.vb-textarea--large` modifier or per-screen --textarea-max-h.
     See docs/claude/design-system.md (textarea section). */
  textarea {
    max-height: var(--textarea-max-h, min(40vh, 320px));
    overflow-y: auto;
  }
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
textarea,
select { font-size: 16px; }

/* ============================================================
   Form-control primitives — `.vb-field`, `.vb-input`, `.vb-textarea`,
   `.vb-select`, `.vb-label`, `.vb-help`, `.vb-error`.
   Mobile-first. Token-based. Composable with existing local classes.
   INVARIANT: editable controls MUST stay at 16px+ to prevent mobile
   browser auto-zoom on focus (see baseline rule above).
   ============================================================ */
.vb-field {
    display: grid;
    gap: 6px;
    width: 100%;
}
.vb-field--compact { gap: 4px; }

.vb-label {
    font-size: var(--t-text-13, 13px);
    font-weight: 600;
    color: var(--t-text-muted);
    line-height: 1.3;
}

.vb-input,
.vb-textarea,
.vb-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    color: var(--t-text);
    background: var(--t-card);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-sm);
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.vb-input,
.vb-select {
    min-height: 44px;
    padding: 10px 12px;
}

.vb-textarea {
    min-height: 96px;
    padding: 10px 12px;
    resize: vertical;
    font-family: var(--t-font, inherit);
    /* Cap default height so a long note never visually consumes the whole
       viewport on mobile — Android Chrome consumes one-finger gestures that
       start inside text controls (caret/select/inner scroll), which makes a
       full-screen textarea a "scroll trap". Override per-screen with the
       --large modifier when a bigger compose surface is intended. See
       docs/claude/design-system.md (textarea section). */
    max-height: var(--textarea-max-h, min(40vh, 320px));
    overflow-y: auto;
}

/* Opt-up: when a screen genuinely needs a tall compose surface. */
.vb-textarea--large { --textarea-max-h: 60vh; }

.vb-input:focus,
.vb-textarea:focus,
.vb-select:focus {
    outline: none;
    border-color: var(--t-primary);
    box-shadow: 0 0 0 3px rgba(var(--t-primary-rgb, 91,63,168), 0.18);
}

.vb-input:disabled,
.vb-textarea:disabled,
.vb-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vb-help {
    font-size: var(--t-text-13, 13px);
    line-height: 1.35;
    color: var(--t-text-muted);
}

.vb-error {
    font-size: var(--t-text-13, 13px);
    line-height: 1.35;
    color: var(--t-danger);
}

.vb-field--compact .vb-input,
.vb-field--compact .vb-select { min-height: 40px; padding: 8px 10px; }
.vb-field--compact .vb-textarea { min-height: 72px; padding: 8px 10px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ============================================================
   Nav — ЗАЩИЩЁННЫЙ КОМПОНЕНТ
   Не менять без необходимости. Правила с !important — это
   защита от случайного переопределения модулями и страницами.
   ============================================================ */
.nav {
    background: var(--primary);
    padding: 0 16px;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    isolation: isolate; /* собственный stacking context */
}
.nav__inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap !important; /* ЗАПРЕТ wrapping на десктопе */
    height: 56px;
}
.nav__logo {
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
}
.nav__logo span { color: var(--accent); }

/* Desktop: links in a row */
.nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav__link {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav__link:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }
.nav__link--cta {
    background: var(--accent);
    color: var(--primary);
    font-weight: 700;
}
.nav__link--cta:hover { background: var(--accent-dark); color: var(--primary); }
.nav__link--admin { color: var(--accent); }
.nav__link--logout { color: rgba(255,255,255,0.6); }

/* Hamburger button — СКРЫТ на десктопе (!important = защита) */
.nav__burger {
    display: none !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.nav__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    transition: transform 0.22s, opacity 0.22s;
    transform-origin: center;
}
/* Animate to X when open */
.nav__burger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger--open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__burger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Main container ---- */
.main { flex: 1; padding: 24px 16px 48px; }
.container {
    max-width: 520px;
    margin: 0 auto;
}
.container--wide { max-width: 700px; }

/* ---- Card ---- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    border: 1px solid var(--border);
}

/* ---- Page title ---- */
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ---- Forms ---- */
.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.label--muted { font-weight: 400; color: var(--text-muted); }

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,63,168,0.15);
}
.input::placeholder { color: var(--text-muted); opacity: 0.7; }
.input--error { border-color: var(--danger); }

.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235B3FA8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

.hint { font-size: 0.78rem; color: var(--text-muted); }
.error-msg { font-size: 0.82rem; color: var(--danger); }

/* ---- Section divider in forms ---- */
.form-section {
    border-top: 1.5px solid var(--border);
    padding-top: 16px;
    margin-top: 4px;
}
.form-section__title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ---- Checkbox ---- */
.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}
.checkbox-wrap span {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.checkbox-wrap a { color: var(--primary); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
    border: none;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn--primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 14px rgba(91,63,168,0.3);
}
.btn--primary:hover { background: var(--primary-dark); }

.btn--accent {
    background: var(--accent);
    color: var(--primary);
    width: 100%;
    box-shadow: 0 4px 14px rgba(245,200,0,0.3);
}
.btn--accent:hover { background: var(--accent-dark); }

.btn--ghost {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--border);
}
.btn--ghost:hover { border-color: var(--primary); background: var(--bg); }

.btn--sm { padding: 8px 16px; font-size: 0.875rem; }
.btn--danger { background: var(--danger); color: #fff; }

/* ---- Alert ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert--error   { background: #fff0f0; color: var(--danger);  border: 1px solid #fca5a5; }
.alert--success { background: #fffbe6; color: var(--success); border: 1px solid #fce680; }
.alert--info    { background: #f0f4ff; color: var(--primary); border: 1px solid #c7d2fe; }

/* ---- Password input wrapper with show/hide toggle ----
   Reusable utility: works with .input (auth, admin) and .pf-input (profile).
   JS auto-binds via assets/js/password-toggle.js. */
.input-wrap { position: relative; }
.input-wrap .input,
.input-wrap .pf-input { padding-right: 44px; }
.input-wrap__toggle {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 36px; height: 36px;
    background: transparent; border: 0; cursor: pointer;
    color: var(--t-text-muted);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: color 0.15s, background 0.15s;
}
.input-wrap__toggle:hover { color: var(--t-primary); background: var(--t-primary-tint); }
.input-wrap__toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--t-primary-rgb), 0.25);
}

/* ---- Tip / Memo (жёлтая плашка-подсказка) ---- */
.tip {
    background: #FFFBEA;
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4a3600;
}

/* ---- Auth pages ---- */
.auth-page { display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px 48px; }
.auth-page .card { width: 100%; max-width: 440px; }

.auth-page .page-title { font-size: 1.4rem; }

.auth-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 8px 0;
}
.auth-divider a { font-weight: 600; }

/* ---- Dashboard ---- */
.programs-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.program-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: var(--text);
}
.program-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.program-card__name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}
.program-card__desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.program-card__arrow { color: var(--primary); font-size: 1.25rem; flex-shrink: 0; }
.program-card--accent {
    border-color: var(--accent);
    background: #FFFBEA;
}
.program-card--accent:hover {
    border-color: var(--accent-dark);
    box-shadow: 0 2px 16px rgba(245,200,0,0.2);
}
.program-card--accent .program-card__name { color: #4a3600; }
.program-card--accent .program-card__desc { color: #7a5e00; }
.program-card--accent .program-card__arrow { color: #d4a900; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 0;
    font-size: 0.95rem;
}
.empty-state__icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ---- Profile ---- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    flex-shrink: 0;
}
.profile-name { font-size: 1.1rem; font-weight: 700; }
.profile-email { font-size: 0.85rem; color: var(--text-muted); }

/* ---- КБЖУ summary in profile ---- */
.kbju-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.kbju-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}
.kbju-tile__val { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.kbju-tile__label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Footer ---- */
.footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 16px;
    margin-top: auto;
}
.footer__inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer__links { display: flex; gap: 16px; }
.footer__links a { color: var(--text-muted); }
.footer__links a:hover { color: var(--primary); }

/* ---- Cookie banner ---- */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.cookie-banner__text a { color: var(--accent); }
.cookie-banner__btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 7px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ---- Legal pages ---- */
.legal-page .container { max-width: 680px; padding-top: 32px; }
.legal-page h1 { color: var(--primary); margin-bottom: 12px; }
.placeholder-notice {
    color: var(--text-muted);
    font-style: italic;
    padding: 24px 0;
}
.btn-back { color: var(--primary); font-weight: 600; display: inline-block; margin-top: 8px; }

/* ---- Verified badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}
.badge--success { background: #fff5c2; color: var(--success); }
.badge--warn    { background: #fef9c3; color: #854d0e; }
.badge--muted   { background: var(--bg, #f3f4f6); color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .field--row { grid-template-columns: 1fr; }
    .card { padding: 20px 16px; }
    .kbju-preview { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Mobile nav (hamburger) — ЗАЩИЩЁННЫЕ правила
   !important гарантирует, что модули не сломают бургер.
   ============================================================ */
@media (max-width: 720px) {
    .nav__inner {
        flex-wrap: wrap !important; /* разрешить wrap ТОЛЬКО на мобильном */
        height: auto !important;
        padding: 8px 0;
        align-items: center;
    }
    .nav__logo {
        font-size: 1.1rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nav__burger {
        display: flex !important; /* ПОКАЗАТЬ бургер на мобильном */
    }
    /* Скрыть ссылки по умолчанию на мобильном */
    .nav__links {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
        padding: 8px 0 12px;
        order: 3;
    }
    /* Показать при клике на бургер */
    .nav__links--open {
        display: flex !important;
    }
    .nav__link {
        font-size: 0.95rem;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        text-align: left;
    }
    .nav__link--logout {
        margin-top: 4px;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 12px;
    }
    /* No-JS fallback: если JS не работает, ссылки видны */
    .nav__links:target {
        display: flex !important;
    }
}

/* ── Theme Picker (profile.php) ───────────────────────────── */

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.theme-card {
  position: relative;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.theme-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.theme-card--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,63,168,0.15);
}

.theme-card__check {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}
.theme-card--active .theme-card__check {
  display: block;
}

.theme-card__preview {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.06);
}
.theme-card__preview--light {
  background: linear-gradient(135deg, #f5f3ff 0%, #fff 50%, #5B3FA8 100%);
}
.theme-card__preview--dark {
  background: linear-gradient(135deg, #100d1c 0%, #1a1630 50%, #5B3FA8 100%);
}
.theme-card__preview--violet {
  background: linear-gradient(135deg, #0e0920 0%, #3d2878 40%, #F5C800 100%);
  box-shadow: inset 0 0 20px rgba(91,63,168,0.3);
  border-color: rgba(123,92,200,0.3);
}

.theme-card__name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.theme-card__desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ──────────────────────────────────────────────────────────────────────
 * Day-count badge — used on catalog cards, program hero, quiz cards.
 * Single source of truth; rendered via day_badge_html() in PHP.
 * ────────────────────────────────────────────────────────────────────── */
.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}
.day-badge__icon {
  font-size: 0.9rem;
  line-height: 1;
}
.day-badge__num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.day-badge__suffix {
  font-weight: 600;
  opacity: 0.85;
}

/* ──────────────────────────────────────────────────────────────────────
 * Shared program summary (icon + tag + name + desc + day badge).
 * Rendered via program_summary_html() in includes/components/program_summary.php.
 * Used inside library.php catalog cards and quiz.php recommendation cards.
 * Outer frames (accordion header, primary card chrome, secondary anchor)
 * keep their own interactive contracts; this only owns the repeated head.
 * ────────────────────────────────────────────────────────────────────── */
.program-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.program-summary__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-radius: 10px;
}
.program-summary__body { flex: 1 1 auto; min-width: 0; }
.program-summary__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.program-summary__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.program-summary__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.program-summary__desc--clamp1 { -webkit-line-clamp: 1; }
.program-summary__desc--clamp2 { -webkit-line-clamp: 2; }
.program-summary__meta { margin-top: 6px; }
.program-summary__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  align-self: center;
}
.program-summary__chevron--down { font-size: 0.85rem; }

.program-summary--primary { align-items: flex-start; gap: 14px; }
.program-summary--primary .program-summary__icon {
  width: 48px;
  height: 48px;
  font-size: 2rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.program-summary--primary .program-summary__name { font-size: 1.05rem; }
.program-summary--primary .program-summary__desc { font-size: 0.86rem; line-height: 1.5; }

.program-summary--compact { align-items: center; gap: 10px; }
.program-summary--compact .program-summary__icon {
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  background: transparent;
  border-radius: 8px;
}
.program-summary--compact .program-summary__name { font-size: 0.9rem; font-weight: 600; }
.program-summary--compact .program-summary__meta { margin-top: 2px; }

/* ──────────────────────────────────────────────────────────────────────
 * Personal-program CTA banner — used on training dashboard & library
 * through individual_program_cta_block() in config/personal_program_cta.php.
 * Styles live here (not inline) so the block renders identically from
 * any surface that requires it.
 * ────────────────────────────────────────────────────────────────────── */
.pp-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--primary);
  background: linear-gradient(135deg, rgba(91,63,168,0.06) 0%, rgba(91,63,168,0.02) 100%);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.pp-banner:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(91,63,168,0.12); }
.pp-banner__icon { font-size: 1.8rem; flex-shrink: 0; }
.pp-banner__body { flex: 1; min-width: 0; }
.pp-banner__title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.pp-banner__text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.pp-banner__arrow { font-size: 1.2rem; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.pp-banner--locked {
  border-color: var(--border);
  background: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.01) 100%);
  opacity: 0.85;
}
.pp-banner--locked:hover { opacity: 1; border-color: var(--primary); }

/* ──────────────────────────────────────────────────────────────────────
 * Hero — dashboard signature card (morning check-in + program + rest).
 * Matches design system: inyourbody-design-system/project/ (Hero.jsx,
 * index_v2_dark_expanded CSS). All colors through tokens — never hex/rgba
 * inline. Themed via --t-hero-* in assets/css/theme.css.
 * ────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
  padding: 22px 20px 20px;
  border: 1.5px solid var(--t-hero-border);
  border-radius: var(--kit-hero-radius, 20px);
  background: var(--t-hero-bg);
  color: var(--t-hero-text);
  box-shadow: var(--t-hero-glow);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 260px; height: 260px;
  background: var(--t-hero-halo);
  pointer-events: none;
}
.hero__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 1;
}
.hero__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--t-hero-icon-bg);
  color: var(--t-hero-icon-fg);
  box-shadow: inset 0 1px 0 var(--t-hero-inset-highlight);
}
.hero__stat {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--t-hero-icon-bg);
  box-shadow: inset 0 1px 0 var(--t-hero-inset-highlight);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hero__stat-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--t-hero-stripe);
  transition: height 0.4s ease;
}
.hero__stat-text {
  position: relative;
  font-family: var(--t-font-display);
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--t-hero-text);
  mix-blend-mode: normal;
}
.hero__text { position: relative; z-index: 1; }
.hero__title {
  margin: 0;
  font-family: var(--t-font-display);
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--t-hero-text);
}
.hero__title--sm { font-size: 20px; }
.hero__sub {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--t-hero-text-muted);
}
.hero__cta {
  margin-top: auto;
  position: relative; z-index: 1;
  width: 100%;
  min-height: 56px;
  padding: 16px 24px;
  background: var(--t-cta-bg);
  color: var(--t-cta-fg);
  border: 0;
  border-radius: 999px;
  font-family: var(--t-font);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--t-cta-glow), var(--t-cta-inset);
  transition: transform 0.08s ease, box-shadow 0.18s ease;
}
.hero__cta:active {
  transform: scale(0.985);
  box-shadow: var(--t-cta-glow), var(--t-cta-inset);
}

/* Check-in variant — ritual surface: greeting → weight → steps → state. */
.hero--checkin {
  padding: 22px 20px 18px;
  gap: 14px;
}
.hero--checkin .hero__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t-hero-text-muted);
  margin: 0;
}
.hero--checkin .hero__title {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}
.hero--checkin .hero__title strong {
  color: var(--t-cta-bg);
  font-weight: 800;
}
.hero__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.hero__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  background: var(--t-hero-field-bg);
  border: 1px solid var(--t-hero-field-border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.hero__field:hover,
.hero__field:focus-within {
  border-color: var(--t-hero-field-filled-border);
}
.hero__field--filled {
  background: var(--t-hero-field-filled-bg);
  border-color: var(--t-hero-field-filled-border);
}
.hero__field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--t-hero-text-muted);
}
.hero__field-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--t-font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--t-hero-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.hero__field-value .unit {
  font-family: var(--t-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--t-hero-text-muted);
  letter-spacing: 0;
}
.hero__field-placeholder {
  font-family: var(--t-font);
  font-size: 15px;
  font-weight: 500;
  color: var(--t-hero-placeholder);
}
.hero__field--full { grid-column: 1 / -1; }
.hero__moods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.hero__mood {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px;
  padding: 0;
  background: var(--t-hero-mood-bg);
  border: 1px solid var(--t-hero-mood-border);
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.2,.7,.1,1),
              background 0.18s ease,
              border-color 0.18s ease;
}
.hero__mood.is-on {
  background: var(--t-hero-mood-on-bg);
  border-color: var(--t-hero-mood-on-border);
  transform: scale(1.06);
}
