:root {
    --tf-primary: #1E4B70;
    --tf-primary-dark: #163a57;
    --tf-primary-light: #1E4B70;
    --tf-bg: #f9fafb;
    --tf-surface: #ffffff;
    --tf-surface-muted: #f3f4f6;
    --tf-border: #e5e7eb;
    --tf-text: #111827;
    --tf-text-muted: #6b7280;
    --tf-text-soft: #9ca3af;
    --tf-accent: #1E4B70;
}

* { box-sizing: border-box; }

.hidden {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--tf-bg);
    color: var(--tf-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tf-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tf-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0));
    background: var(--tf-surface);
    border-bottom: 1px solid var(--tf-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.tf-back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--tf-surface-muted);
    color: var(--tf-primary);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.tf-header-title {
    flex: 1;
    font-size: 18px;
    font-weight: 800;
    color: var(--tf-text);
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-session-timer {
    font-size: 16px;
    font-weight: 800;
    color: var(--tf-primary);
    padding: 6px 10px;
    background: var(--tf-surface-muted);
    border-radius: 10px;
}

.tf-loader {
    text-align: center;
    padding: 48px 20px;
    color: var(--tf-text-muted);
}

.tf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--tf-border);
    border-top-color: var(--tf-primary);
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes tf-spin { to { transform: rotate(360deg); } }

/* Plan Overview */
.po-page .po-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.po-top {
    flex: 0 0 auto;
    background: var(--tf-bg);
    color: var(--tf-text);
    padding: 8px 16px 16px;
}

.po-tabs {
    display: flex;
    gap: 8px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 5px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.po-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--tf-text-muted);
    font-size: 13px;
    font-weight: 700;
    padding: 12px 8px;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.po-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #1E4B70 0%, #2563eb 100%);
    box-shadow: 0 4px 14px rgba(30, 75, 112, 0.28);
}

.po-days-panel {
    min-height: 0;
    overflow: visible;
    padding: 14px 0 0;
}

.po-days-panel.compact-list {
    max-height: 44vh;
    overflow-y: auto;
    padding-top: 12px;
}

.po-current-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(145deg, #0f2f4a 0%, #1E4B70 45%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(30, 75, 112, 0.28);
}

.po-hero-glow {
    position: absolute;
    top: -30%;
    right: -15%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.po-hero-body {
    position: relative;
    z-index: 1;
    padding: 18px 18px 16px;
}

.po-hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.po-day-badge {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    backdrop-filter: blur(6px);
}

.po-day-badge-lbl {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.po-day-badge-num {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    margin-top: 2px;
}

.po-current-info {
    flex: 1;
    min-width: 0;
}

.po-hero-photo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.po-hero-photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.12);
}

.po-current-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 4px;
}

.po-current-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.25;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.po-current-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    border: none;
    border-radius: 14px;
    background: #fff;
    color: var(--tf-primary);
    font-size: 15px;
    font-weight: 800;
    padding: 14px 18px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.po-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--tf-primary);
    color: #fff;
    font-size: 11px;
}

.po-current-cta:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.po-day-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    color: var(--tf-text);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.po-day-card:active { background: var(--tf-surface-muted); }

.po-day-card.compact {
    padding: 12px 14px;
    margin-bottom: 8px;
}

.po-day-img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--tf-surface-muted);
    flex-shrink: 0;
}

.po-day-img.hero-thumb {
    width: 52px;
    height: 52px;
}

.po-day-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--tf-text);
}

.po-day-meta {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 3px;
    font-weight: 600;
}

.po-day-meta.done {
    color: #059669;
}

.po-more-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tf-text-soft);
    margin: 14px 0 8px;
}

.po-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--tf-text-muted);
    font-size: 14px;
    background: var(--tf-surface);
    border: 1px dashed var(--tf-border);
    border-radius: 16px;
}

.po-start-btn {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: var(--tf-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.po-start-btn.hidden { display: none; }

.po-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0));
    position: relative;
    background: linear-gradient(180deg, var(--tf-bg) 0%, #eef2f7 100%);
}

.po-stats-gated {
    position: relative;
    flex: 0 0 auto;
}

.po-stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.po-stats-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--tf-text-muted);
    text-transform: uppercase;
}

.po-share-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--tf-border);
    background: var(--tf-surface);
    border-radius: 12px;
    color: var(--tf-primary);
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.po-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 14px;
    padding: 5px;
}

.po-toggle-btn {
    flex: 1;
    padding: 12px 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--tf-text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.po-toggle-btn.active {
    background: linear-gradient(135deg, #1E4B70 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(30, 75, 112, 0.22);
}

.po-progress-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.po-progress-card.clickable { cursor: pointer; }
.po-progress-card.clickable:active { background: var(--tf-surface-muted); }

.po-progress-visual {
    display: flex;
    align-items: center;
    gap: 18px;
}

.po-ring {
    position: relative;
    flex-shrink: 0;
}

.po-ring--lg {
    width: 88px;
    height: 88px;
}

.po-ring--lg svg {
    width: 88px;
    height: 88px;
    transform: rotate(-90deg);
    display: block;
}

.po-ring-bg { stroke: #e8eef4; }
.po-ring-fg {
    stroke: url(#poRingGradient);
    stroke: #1E4B70;
    transition: stroke-dashoffset 0.5s ease;
}

.po-ring-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: var(--tf-primary);
}

.po-progress-details {
    flex: 1;
    min-width: 0;
}

.po-stat-title {
    font-size: 12px;
    color: var(--tf-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.po-stat-main {
    font-size: 20px;
    font-weight: 900;
    color: var(--tf-text);
    margin-top: 4px;
    line-height: 1.2;
}

.po-progress-track {
    height: 8px;
    background: #e8eef4;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.po-progress-track-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1E4B70 0%, #38bdf8 100%);
    transition: width 0.5s ease;
}

.po-stat-hint {
    font-size: 11px;
    color: var(--tf-text-soft);
    margin-top: 8px;
}

.po-analysis-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.po-analysis-card.clickable-performance { cursor: pointer; }

.po-analysis-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1E4B70;
    background: rgba(30, 75, 112, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.po-analysis-status {
    font-size: 17px;
    font-weight: 900;
    color: var(--tf-primary);
    line-height: 1.25;
}

.po-analysis-desc {
    font-size: 13px;
    color: var(--tf-text-muted);
    margin-top: 6px;
    line-height: 1.45;
}

.po-metric-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.po-metric-tile {
    border-radius: 18px;
    padding: 18px 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.po-metric-tile--time {
    background: linear-gradient(145deg, #1e3a5f 0%, #1E4B70 55%, #3b82f6 100%);
    color: #fff;
}

.po-metric-tile--kcal {
    background: linear-gradient(145deg, #9a3412 0%, #ea580c 55%, #fb923c 100%);
    color: #fff;
}

.po-metric-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: auto;
    opacity: 0.95;
}

.po-metric-val {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.1;
    margin-top: 8px;
}

.po-metric-lbl {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.88;
    margin-top: 4px;
}

.po-volume-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    min-height: 110px;
}

.po-volume-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.po-volume-icon {
    font-size: 36px;
    line-height: 1;
}

.po-volume-copy {
    flex: 1;
    min-width: 0;
}

.po-volume-val {
    font-size: 24px;
    font-weight: 900;
    color: var(--tf-text);
    line-height: 1.15;
}

.po-volume-desc {
    font-size: 13px;
    color: var(--tf-text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.po-paywall {
    position: absolute;
    inset: 0;
    background: rgba(249, 250, 251, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    z-index: 10;
    border-radius: 16px;
    pointer-events: auto;
}

.po-paywall.hidden { display: none; }

.po-paywall-icon { font-size: 36px; margin-bottom: 8px; }

.po-paywall-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--tf-text);
}

.po-paywall-text {
    font-size: 13px;
    color: var(--tf-text-muted);
    margin-top: 6px;
    max-width: 260px;
}

.po-paywall-btn {
    margin-top: 16px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: var(--tf-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.po-stats-dimmed { opacity: 0.25; pointer-events: none; }

.po-card.clickable-performance { cursor: pointer; }
.po-card.clickable-performance:active { background: var(--tf-surface-muted); }

/* Workout Detail */
.wd-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 100px;
}

.wd-exercise {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.wd-exercise:active { background: var(--tf-surface-muted); }

.wd-ex-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--tf-surface-muted);
    flex-shrink: 0;
}

.wd-ex-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tf-text);
}

.wd-ex-detail {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 3px;
}

.wd-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    background: var(--tf-surface);
    border-top: 1px solid var(--tf-border);
}

.wd-start-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: var(--tf-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.wd-start-btn.repeat {
    background: #546E7A;
}

.tf-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tf-dialog-backdrop.hidden { display: none; }

.tf-dialog {
    background: var(--tf-surface);
    border-radius: 16px;
    padding: 20px;
    max-width: 340px;
    width: 100%;
}

.tf-dialog h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.tf-dialog p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--tf-text-muted);
    line-height: 1.45;
}

.tf-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-dialog-actions button {
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.tf-dialog-primary { background: var(--tf-primary); color: #fff; }
.tf-dialog-danger { background: #fee2e2; color: #b91c1c; }
.tf-dialog-muted { background: var(--tf-bg); color: var(--tf-text-muted); }

/* Performance Analysis */
.pa-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 32px;
}

.pa-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.pa-status {
    font-size: 18px;
    font-weight: 900;
    color: var(--tf-primary);
}

.pa-recommendation {
    font-size: 14px;
    color: var(--tf-text-muted);
    margin-top: 6px;
    line-height: 1.45;
}

.pa-divider {
    height: 1px;
    background: var(--tf-border);
    margin: 14px 0;
}

.pa-level-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--tf-text);
}

.pa-level-desc {
    font-size: 13px;
    color: var(--tf-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.pa-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tf-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pa-info-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--tf-border);
    border-radius: 8px;
    background: var(--tf-surface-muted);
    color: var(--tf-primary);
    font-size: 14px;
    cursor: pointer;
}

.pa-chart {
    margin-top: 16px;
    min-height: 120px;
}

.pa-bar-row {
    display: grid;
    grid-template-columns: 88px 1fr 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.pa-bar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--tf-text);
    line-height: 1.2;
}

.pa-bar-track {
    height: 22px;
    background: var(--tf-surface-muted);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tf-border);
}

.pa-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tf-primary), var(--tf-primary-light));
    border-radius: 7px;
    min-width: 4px;
    transition: width 0.6s ease;
}

.pa-bar-val {
    font-size: 11px;
    font-weight: 800;
    color: var(--tf-primary);
    text-align: right;
}

.pa-hint-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.pa-hint-card.hidden { display: none; }

.pa-hint-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    color: #b45309;
}

.pa-hint-details {
    display: none;
    margin-top: 8px;
    padding-left: 34px;
    font-size: 11px;
    color: #92400e;
    line-height: 1.5;
    white-space: pre-line;
}

.pa-hint-card.open .pa-hint-details { display: block; }
.pa-hint-card.open .pa-hint-arrow { transform: rotate(180deg); }

.pa-level-def {
    margin-bottom: 10px;
}

.pa-level-def strong {
    display: block;
    font-size: 13px;
    color: var(--tf-text);
}

.pa-level-def span {
    font-size: 12px;
    color: var(--tf-text-muted);
    line-height: 1.35;
}

.pa-form-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tf-primary);
    margin-top: 16px;
    margin-bottom: 8px;
}

.pa-select {
    width: 100%;
    padding: 14px 12px;
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    background: var(--tf-surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--tf-text);
}

.pa-apply-btn {
    width: 100%;
    margin-top: 12px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: var(--tf-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.pa-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pa-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pa-sheet-backdrop.hidden { display: none; }

.pa-sheet {
    background: var(--tf-surface);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
}

.pa-sheet h3 {
    margin: 0 0 12px;
    font-size: 17px;
}

.pa-sheet-content {
    font-size: 14px;
    color: var(--tf-text-muted);
    line-height: 1.5;
    white-space: pre-line;
}

.pa-sheet-close {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--tf-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.po-card.clickable-performance { cursor: pointer; }
.po-card.clickable-performance:active { background: var(--tf-surface-muted); }

/* All Plans */
.ap-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
}

.ap-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tf-text-muted);
    margin-bottom: 10px;
}

.ap-user-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
}

.ap-user-plan.active-plan {
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 1px rgba(30, 75, 112, 0.15);
}

.ap-user-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--tf-surface-muted);
    color: var(--tf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ap-user-body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.ap-user-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--tf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-user-desc {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-active-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--tf-primary);
    padding: 3px 8px;
    border-radius: 999px;
}

.ap-plan-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.ap-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    background: var(--tf-surface);
    color: var(--tf-text-muted);
    font-size: 14px;
    cursor: pointer;
}

.ap-icon-btn.danger { color: #dc2626; border-color: #fecaca; }

.ap-activate-btn {
    border: none;
    background: var(--tf-surface-muted);
    color: var(--tf-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.ap-empty {
    text-align: center;
    padding: 20px 12px;
    color: var(--tf-text-muted);
    font-size: 14px;
    background: var(--tf-surface);
    border: 1px dashed var(--tf-border);
    border-radius: 14px;
    margin-bottom: 20px;
}

.ap-cat-card {
    position: relative;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    min-height: 88px;
    margin-bottom: 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.ap-cat-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.ap-cat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.2));
}

.ap-cat-title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    padding: 28px 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.ap-cat-premium-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(0,0,0,0.45);
    color: #fde68a;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
}

.ap-cat-lock {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(255,255,255,0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--tf-primary);
    font-size: 12px;
    font-weight: 800;
}

.ap-cat-lock.hidden { display: none; }

.ap-library-plan {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 14px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0;
    position: relative;
}

.ap-library-plan:active { background: var(--tf-surface-muted); }

.ap-library-media {
    position: relative;
    overflow: hidden;
}

.ap-library-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--tf-surface-muted);
    display: block;
}

.ap-library-img--placeholder {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.ap-premium-ribbon {
    position: absolute;
    top: 16px;
    right: -36px;
    z-index: 3;
    display: block;
    width: 150px;
    padding: 8px 0;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 55%, #b45309 100%);
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.45);
    transform: rotate(45deg);
    pointer-events: none;
}

.ap-premium-ribbon--hero {
    top: 18px;
    right: -40px;
    font-size: 12px;
    padding: 9px 0;
    width: 170px;
}

.ap-library-body { padding: 14px; }

.ap-library-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--tf-text);
    margin-bottom: 8px;
    line-height: 1.35;
}

.ap-library-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ap-chip {
    font-size: 10px;
    font-weight: 800;
    color: var(--tf-primary);
    background: var(--tf-surface-muted);
    padding: 4px 10px;
    border-radius: 999px;
}

.ap-chip.muted {
    color: var(--tf-text-muted);
    background: var(--tf-bg);
}

/* Plan preview detail */
.ap-preview-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ap-preview-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ap-preview-hero-wrap {
    position: relative;
    overflow: hidden;
}

.ap-preview-hero {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--tf-surface-muted);
}

.ap-preview-hero--placeholder {
    background: linear-gradient(135deg, #1E4B70 0%, #2563eb 100%);
}

.ap-preview-body {
    padding: 18px 16px 12px;
}

.ap-preview-desc {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--tf-text-muted);
}

.ap-preview-desc--empty {
    font-style: italic;
    opacity: 0.85;
}

.ap-preview-keyfacts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ap-preview-keyfact {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.ap-preview-keyfact--wide {
    grid-column: 1 / -1;
}

.ap-preview-keyfact__value {
    display: block;
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--tf-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.ap-preview-keyfact__value--small {
    font-size: 1rem;
    font-weight: 800;
}

.ap-preview-keyfact__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tf-text-muted);
    line-height: 1.3;
}

.ap-template-premium-hint {
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-template-premium-hint.hidden { display: none; }

.ap-template-premium-hint strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ap-template-premium-hint__cta {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 4px;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #1E4B70, #2563eb);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.pa-apply-btn.ap-add-locked {
    background: linear-gradient(135deg, #b45309, #d97706);
}

.ap-template-desc {
    font-size: 15px;
    color: var(--tf-text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.ap-footer-btn {
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    background: var(--tf-surface);
    border-top: 1px solid var(--tf-border);
    z-index: 10;
}

.ap-level-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 16px;
}

.ap-level-option {
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    background: var(--tf-surface);
    cursor: pointer;
}

.ap-level-option.selected {
    border-color: var(--tf-primary);
    background: var(--tf-surface-muted);
}

.ap-level-option strong {
    display: block;
    font-size: 14px;
    color: var(--tf-text);
}

.ap-level-option span {
    display: block;
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 2px;
}

/* --- Ernährung: Tagesempfehlungen & Tagesanalyse --- */
.tf-header-hantel {
    font-size: 13px;
    font-weight: 800;
    color: #f59e0b;
    white-space: nowrap;
}

.nu-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 16px 12px;
    background: var(--tf-surface);
    border-bottom: 1px solid var(--tf-border);
}

.nu-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 12px;
    background: var(--tf-surface-muted);
    color: var(--tf-text-muted);
    font-weight: 800;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.nu-tab.active {
    background: var(--tf-primary);
    color: #fff;
}

.nu-cat-tabs {
    display: flex;
    gap: 6px;
    padding: 0 16px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nu-cat-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid var(--tf-border);
    border-radius: 999px;
    background: var(--tf-surface);
    color: var(--tf-text-muted);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.nu-cat-tab.active {
    border-color: var(--tf-primary);
    background: var(--tf-primary);
    color: #fff;
}

.nu-intro {
    margin: 0 16px 16px;
    padding: 28px 20px;
    text-align: center;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 20px;
}

.nu-intro-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.nu-intro h2 {
    font-size: 18px;
    font-weight: 900;
    color: var(--tf-text);
    margin: 0 0 8px;
}

.nu-intro p {
    font-size: 14px;
    color: var(--tf-text-muted);
    line-height: 1.5;
    margin: 0 0 8px;
}

.nu-intro-hint {
    font-size: 12px !important;
    color: #f59e0b !important;
    font-weight: 700;
}

.nu-primary-btn,
.nu-secondary-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.nu-primary-btn {
    background: var(--tf-primary);
    color: #fff;
}

.nu-secondary-btn {
    margin: 0 16px 24px;
    width: calc(100% - 32px);
    background: var(--tf-surface-muted);
    color: var(--tf-text);
    border: 1px solid var(--tf-border);
}

.nu-loading {
    text-align: center;
    padding: 40px 16px;
    color: var(--tf-text-muted);
}

.nu-meals {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nu-meal-card {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 20px;
    color: #fff;
}

.nu-meal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.nu-meal-cat {
    font-size: 11px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 0.05em;
}

.nu-meal-action {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.nu-meal-title {
    font-size: 18px;
    font-weight: 900;
    margin: 0 0 8px;
}

.nu-meal-macros {
    font-size: 12px;
    font-weight: 700;
    color: #4caf50;
    margin: 0 0 16px;
}

.nu-meal-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin: 12px 0 4px;
    font-weight: 700;
}

.nu-meal-ing {
    font-size: 14px;
    margin: 2px 0;
}

.nu-meal-prep {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
    margin: 4px 0 0;
}

.nu-fav-cat {
    font-size: 16px;
    font-weight: 900;
    color: #ffd700;
    margin: 16px 0 8px;
}

.nu-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--tf-text-muted);
}

.nu-empty-hint {
    font-size: 13px;
    margin-top: 8px;
}

.nu-date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 16px;
    gap: 12px;
}

.nu-date-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    background: var(--tf-surface);
    font-size: 20px;
    cursor: pointer;
    color: var(--tf-text);
}

.nu-date-label {
    flex: 1;
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    color: var(--tf-primary);
}

.nu-analysis-card {
    margin: 0 16px 12px;
    padding: 16px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
}

.nu-analysis-card h3 {
    font-size: 14px;
    font-weight: 900;
    color: var(--tf-primary);
    margin: 0 0 8px;
}

.nu-analysis-card p {
    font-size: 14px;
    color: var(--tf-text);
    line-height: 1.55;
    margin: 0;
    white-space: pre-wrap;
}

.nu-analysis-main {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0f8 100%);
    border-color: rgba(30, 75, 112, 0.2);
}

.nu-history-period {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.nu-chart-wrap {
    margin: 0 16px 24px;
    height: 260px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 12px;
}

.nu-toast {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 12px 20px;
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Plan builder entry (all-plans) */
.ap-builder-entry {
    margin-bottom: 14px;
}

.ap-builder-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--tf-border);
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 70%);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 8px 24px rgba(30, 75, 112, 0.08);
}

.ap-builder-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #1E4B70;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ap-builder-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ap-builder-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--tf-text);
}

.ap-builder-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--tf-text-muted);
}

.ap-builder-arrow {
    font-size: 18px;
    font-weight: 800;
    color: var(--tf-primary);
}

/* Plan builder page */
.pb-page .pb-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
}

.pb-save-btn {
    border: none;
    background: var(--tf-surface-muted);
    color: var(--tf-primary);
    font-size: 13px;
    font-weight: 800;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.pb-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.pb-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--tf-primary);
}

.pb-level-desc {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--tf-text-muted);
}

.pb-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--tf-text-muted);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-input,
.pb-textarea {
    width: 100%;
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--tf-text);
    background: #fff;
    margin-bottom: 12px;
}

.pb-textarea {
    resize: vertical;
    min-height: 84px;
}

.pb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.pb-section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.pb-text-btn {
    border: none;
    background: transparent;
    color: var(--tf-primary);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.pb-hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--tf-text-muted);
}

.pb-days-list {
    display: grid;
    gap: 10px;
}

.pb-day-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--tf-border);
    border-radius: 14px;
    padding: 12px;
    background: var(--tf-surface-muted);
}

.pb-day-main {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 10px;
    cursor: pointer;
}

.pb-day-order {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    color: var(--tf-primary);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pb-day-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--tf-text);
}

.pb-day-meta {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 2px;
}

.pb-day-actions {
    display: flex;
    gap: 6px;
}

.pb-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.pb-empty {
    text-align: center;
    padding: 18px 12px;
    font-size: 13px;
    color: var(--tf-text-muted);
    border: 1px dashed var(--tf-border);
    border-radius: 14px;
}

.pb-footer-actions {
    padding: 8px 0 12px;
}

.pb-primary-btn,
.pb-secondary-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.pb-primary-btn {
    background: var(--tf-primary);
    color: #fff;
}

.pb-secondary-btn {
    background: var(--tf-surface-muted);
    color: var(--tf-text);
}

.pb-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pb-sheet.hidden {
    display: none !important;
}

.pb-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.pb-sheet-panel {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0));
    max-height: 78vh;
    overflow-y: auto;
}

.pb-sheet-panel--tall {
    max-height: 88vh;
}

.pb-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
    margin: 0 auto 12px;
}

.pb-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.pb-sheet-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.pb-sheet-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: var(--tf-surface-muted);
    font-size: 20px;
    cursor: pointer;
}

.pb-sheet-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.pb-add-ex-btn {
    width: 100%;
    border: 1px dashed var(--tf-primary);
    background: #eff6ff;
    color: var(--tf-primary);
    border-radius: 12px;
    padding: 12px;
    font-weight: 800;
    margin-bottom: 12px;
    cursor: pointer;
}

.pb-ex-list,
.pb-picker-list {
    display: grid;
    gap: 8px;
}

.pb-ex-item,
.pb-picker-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.pb-ex-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tf-surface-muted);
}

.pb-ex-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pb-ex-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--tf-text);
}

.pb-ex-detail {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 2px;
}

.pb-ex-selected-name {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--tf-primary);
}

.pb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pb-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.pb-toggle-btn {
    border: 1px solid var(--tf-border);
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.pb-toggle-btn.is-active {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: #fff;
}

.pb-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Plan builder wizard */
.pb-wizard-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: linear-gradient(180deg, #f0f6fb 0%, #fff 28%);
}

.pb-wizard-header {
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 8px;
}

.pb-wizard-header-copy {
    flex: 1;
    min-width: 0;
}

.pb-wizard-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--tf-text-muted);
}

.pb-wizard-header-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    flex-shrink: 0;
}

.pb-header-btn {
    border: none;
    background: var(--tf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.pb-header-btn--ghost {
    background: transparent;
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.25);
}

.pb-wizard-host {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pb-wizard-progress {
    padding: 0 16px 10px;
}

.pb-wizard-progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(30, 75, 112, 0.12);
    overflow: hidden;
}

.pb-wizard-progress-fill {
    height: 100%;
    width: 20%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1E4B70, #3b82f6);
    transition: width 0.35s ease;
}

.pb-wizard-progress-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 12px;
}

.pb-wizard-slide {
    display: none;
    animation: pbSlideIn 0.4s ease;
}

.pb-wizard-slide.is-active {
    display: block;
}

@keyframes pbSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pb-hero {
    border-radius: 20px;
    padding: 22px 18px;
    margin-bottom: 14px;
    color: #fff;
    box-shadow: 0 10px 28px rgba(30, 75, 112, 0.18);
}

.pb-hero--blue {
    background: linear-gradient(135deg, #1E4B70 0%, #2563eb 100%);
}

.pb-hero--purple {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

.pb-hero--green {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
}

.pb-hero--orange {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
}

.pb-hero--teal {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.pb-hero-emoji {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.pb-hero-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.2;
}

.pb-hero-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.92;
}

.pb-slide-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.pb-wizard-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--tf-border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
}

.pb-wizard-footer.hidden {
    display: none;
}

.pb-wizard-footer .pb-primary-btn,
.pb-wizard-footer .pb-secondary-btn {
    flex: 1;
}

.pb-ex-list--inline {
    margin-top: 12px;
}

.pb-saved-day-preview {
    margin-bottom: 14px;
}

.pb-saved-day-card {
    background: linear-gradient(135deg, rgba(30, 75, 112, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(30, 75, 112, 0.12);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.pb-saved-day-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tf-primary);
    margin-bottom: 6px;
}

.pb-saved-day-name {
    font-size: 18px;
    font-weight: 900;
    color: var(--tf-primary);
}

.pb-saved-day-meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--tf-text-muted);
    font-weight: 600;
}

.pb-plan-days-overview {
    margin-bottom: 16px;
}

.pb-overview-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-overview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pb-overview-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--tf-surface-muted);
    font-size: 12px;
    font-weight: 700;
    color: var(--tf-primary);
}

.pb-choice-grid {
    display: grid;
    gap: 10px;
}

.pb-choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 16px;
    background: var(--tf-surface);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pb-choice-card:active {
    transform: scale(0.98);
}

.pb-choice-card--primary {
    border-color: rgba(30, 75, 112, 0.25);
    background: linear-gradient(135deg, rgba(30, 75, 112, 0.06), rgba(37, 99, 235, 0.08));
}

.pb-choice-icon {
    font-size: 1.4rem;
}

.pb-choice-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--tf-primary);
}

.pb-choice-desc {
    font-size: 13px;
    color: var(--tf-text-muted);
    line-height: 1.4;
}
