/* ========================================
   LifeCare — Apple-Inspired Design System
   ======================================== */

:root {
    --bg: #F5F5F7;
    --card-bg: #FFFFFF;
    --primary: #007AFF;
    --primary-hover: #0066D6;
    --green: #34C759;
    --red: #FF3B30;
    --label: #1C1C1E;
    --secondary-label: #3A3A3C;
    --tertiary-label: #8E8E93;
    --quaternary-label: #C7C7CC;
    --separator: #E8E8ED;
    --fill: #F2F2F7;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bottom-nav-height: 82px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--label);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

.main-content {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 20px);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Auth Pages */
.auth-page {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 430px;
    padding: 20px;
}

/* Profile Picker */
.profile-picker {
    text-align: center;
    padding: 60px 20px 40px;
}

.picker-header {
    margin-bottom: 48px;
}

.app-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo .logo-icon {
    display: grid;
    grid-template: 1fr / 1fr;
    place-items: center;
    width: 84px;
    height: 84px;
    margin-bottom: 16px;
    color: #FF3B30;
}

.app-logo .logo-icon > svg,
.app-logo .logo-icon > span {
    grid-area: 1 / 1;
}

.app-logo .logo-icon > svg {
    fill: #FF3B30;
    stroke: #FF3B30;
    z-index: 1;
}

.logo-ambient {
    animation: heartGlow 1.2s ease-in-out infinite;
    pointer-events: none;
}

.logo-ambient svg {
    display: block;
    fill: none;
    stroke: #FF3B30;
    stroke-width: 1.5;
}

@keyframes heartGlow {
    0% { opacity: 0.5; transform: scale(1); }
    12% { opacity: 0; transform: scale(2.4); }
    12.1% { opacity: 0; transform: scale(1); }
    28% { opacity: 0; transform: scale(1); }
    32% { opacity: 0.35; transform: scale(1); }
    44% { opacity: 0; transform: scale(1.8); }
    44.1% { opacity: 0; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}

.picker-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--label);
}

.picker-subtitle {
    font-size: 17px;
    color: var(--tertiary-label);
    margin-top: 8px;
}

.picker-profiles {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.5s ease both;
    animation-delay: var(--delay, 0s);
    min-width: 140px;
}

.profile-card:hover, .profile-card:active {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    border-radius: 50%;
}

.avatar-placeholder.large {
    width: 100px;
    height: 100px;
    font-size: 40px;
}

.profile-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--label);
}

.profile-tap {
    font-size: 13px;
    color: var(--tertiary-label);
}

/* PIN Screen */
.pin-screen {
    text-align: center;
    padding: 40px 20px;
}

.pin-header {
    margin-bottom: 32px;
}

.pin-back {
    text-decoration: none;
    color: var(--primary);
    font-size: 15px;
    display: inline-block;
    margin-bottom: 24px;
}

.pin-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
}

.pin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pin-greeting {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pin-instruction {
    font-size: 15px;
    color: var(--tertiary-label);
}

.pin-dots {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 8px;
}

.pin-dot {
    font-size: 28px;
    color: var(--quaternary-label);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-dot.filled {
    color: var(--primary);
}

.pin-error {
    color: var(--red);
    font-size: 14px;
    margin-bottom: 16px;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.pin-key {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--fill);
    font-size: 28px;
    font-weight: 500;
    color: var(--label);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.pin-key:active {
    background: var(--quaternary-label);
}

.pin-key.delete {
    font-size: 20px;
    background: transparent;
}

.pin-key.delete:active {
    background: var(--fill);
}

/* Home Screen */
.home-screen {
    padding: 28px 20px 0;
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.admin-badge {
    position: absolute; top: 12px; right: 16px;
    width: 36px; height: 36px; border-radius: 50%;
    background: #E53935; display: flex; align-items: center;
    justify-content: center; opacity: 0.55; z-index: 10;
    box-shadow: 0 2px 8px rgba(229,57,53,0.25);
    transition: opacity 0.2s, transform 0.2s;
}
.admin-badge:hover { opacity: 1; transform: scale(1.08); }
.admin-badge svg { stroke: #fff; stroke-width: 2.5; }

.greeting-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--tertiary-label);
    margin-bottom: 2px;
}

.greeting-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.header-date {
    font-size: 13px;
    color: var(--tertiary-label);
    white-space: nowrap;
    padding-top: 6px;
}

/* Health Score Card */
.health-score-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 28px;
    cursor: pointer;
    transition: transform 0.2s;
}

.health-score-card:active {
    transform: scale(0.98);
}

.gauge-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    stroke: var(--separator);
}

.gauge-fill {
    transition: stroke-dashoffset 1.5s ease;
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: block;
    line-height: 1;
}

.gauge-label {
    font-size: 12px;
    color: var(--tertiary-label);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-message {
    font-size: 14px;
    color: var(--tertiary-label);
    line-height: 1.4;
}

/* Streak Card */
.streak-card {
    background: linear-gradient(135deg, #FF6B3520 0%, #FF950020 100%);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: default;
}

.streak-icon {
    color: #FF6B35;
    display: flex;
}

.streak-count {
    font-size: 24px;
    font-weight: 800;
    display: block;
    line-height: 1.2;
}

.streak-label {
    font-size: 13px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 2px;
}

/* Insight Card */
.insight-card {
    background: linear-gradient(135deg, #007AFF10 0%, #5856D610 100%);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insight-icon {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.insight-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--secondary-label);
}

/* Sections */
.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 0 4px;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.summary-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 9px 9px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    min-height: 74px;
    cursor: pointer;
    transition: transform 0.15s;
}

.summary-item:active {
    transform: scale(0.97);
}

.summary-bmi-target {
    font-size: 11px;
    color: var(--secondary-label, #8E8E93);
    padding: 2px 16px 8px;
    margin: -8px 0 0;
}

.summary-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.summary-label {
    font-size: 11px;
    color: var(--tertiary-label);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

.summary-value {
    font-size: 16px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.summary-sub {
    font-size: 10px;
    color: var(--secondary-label);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 1px;
    line-height: 1.25;
}

.summary-sub-good {
    color: var(--green);
}

.summary-sub-warn {
    color: var(--red);
}

.summary-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 4px;
}

.badge-green { background: #34C75920; color: var(--green); }
.badge-blue { background: #007AFF20; color: var(--primary); }
.badge-red { background: #FF3B3020; color: var(--red); }

/* Coach Card */
.coach-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}

.coach-card:active {
    transform: scale(0.98);
}

.coach-card.featured {
    cursor: default;
}

.coach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.coach-header .section-title {
    margin-bottom: 0;
}

.coach-summary {
    font-size: 15px;
    color: var(--secondary-label);
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 0 2px;
}

.coach-teaser {
    padding: 14px 16px;
}

.coach-teaser .coach-header {
    margin-bottom: 4px;
}

.coach-teaser .section-title {
    font-size: 16px;
    margin-bottom: 0;
}

.coach-temporal {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 3px;
}

.coach-teaser .coach-summary {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 0;
    padding: 0;
}

.coach-cta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    margin-top: 8px;
}

.chevron {
    font-size: 22px;
    color: var(--quaternary-label);
    font-weight: 300;
}

.coach-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coach-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.coach-icon {
    font-size: 22px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.coach-content {
    flex: 1;
    min-width: 0;
}

.coach-label {
    font-size: 13px;
    color: var(--tertiary-label);
    display: block;
}

.coach-value {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.coach-detail {
    font-size: 12px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 1px;
}

.coach-great .coach-value { color: var(--green); }
.coach-good .coach-value { color: var(--primary); }
.coach-warning .coach-value { color: var(--red); }
.coach-missing .coach-value { color: var(--tertiary-label); }

/* Exercise Recommendation Box (AI) */
.exercise-rec-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow);
}

.exercise-rec-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft, #E5F2FF);
    color: var(--primary);
}

.exercise-rec-content {
    flex: 1;
    min-width: 0;
}

.exercise-rec-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--primary);
}

.exercise-rec-suggested {
    display: block;
    font-size: 11px;
    color: var(--tertiary-label);
    margin-top: 1px;
}

.exercise-rec-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--label);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-rec-meta {
    display: block;
    margin-top: 2px;
}

.exercise-rec-meta-inner {
    font-size: 12px;
    color: var(--secondary-label);
}

.exercise-rec-reason {
    display: block;
    font-size: 11px;
    color: var(--tertiary-label);
    margin-top: 4px;
    line-height: 1.4;
}

.exercise-rec-cta {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.exercise-rec-cta .chevron {
    color: var(--primary);
}

@media (max-width: 340px) {
    .exercise-rec-box {
        padding: 12px;
        gap: 10px;
    }
    .exercise-rec-icon {
        width: 36px;
        height: 36px;
    }
    .exercise-rec-name {
        font-size: 15px;
    }
}

/* Score Row */
.coach-score-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.mini-gauge {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.mini-gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.coach-status {
    font-size: 18px;
    font-weight: 700;
}

.divider {
    height: 1px;
    background: var(--separator);
    margin: 16px 0;
}

/* AI Insights */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--separator);
}
.insight-icon {
    font-size: 22px;
    line-height: 1.4;
    flex-shrink: 0;
}
.insight-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--label);
    font-weight: 400;
}

/* Goals List */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s;
}

.goal-item:active {
    transform: scale(0.98);
}

.goal-icon {
    font-size: 22px;
}

.goal-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.goal-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.goal-sub {
    font-size: 12px;
    color: var(--tertiary-label);
    font-weight: 500;
}

.goals-done {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow);
}

.goals-done-icon {
    color: #FFB300;
    flex-shrink: 0;
}

.goals-done-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.goals-done-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--label);
}

.goals-done-sub {
    font-size: 13px;
    color: var(--tertiary-label);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 6px 0 calc(6px + var(--safe-bottom));
    z-index: 100;
    height: var(--bottom-nav-height);
}

.nav-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    min-width: 56px;
    color: var(--tertiary-label);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon svg {
    stroke: var(--primary);
}

.nav-icon svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
}

.nav-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.1px;
    margin-top: 1px;
}

.nav-spacer {
    width: 56px;
    visibility: hidden;
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    border: none;
    box-shadow: 0 6px 24px rgba(0,122,255,0.35);
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease;
}

.fab:active {
    transform: translateX(-50%) scale(0.92);
    box-shadow: 0 3px 12px rgba(0,122,255,0.25);
}

.fab:hover {
    transform: translateX(-50%) scale(1.04);
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.summary-icon svg,
.coach-icon svg,
.goal-icon svg,
.settings-icon svg,
.weekly-icon svg,
.logo-icon svg,
.install-logo svg,
.empty-icon svg,
.add-icon svg,
.streak-icon svg,
.insight-icon svg {
    display: block;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    max-height: 85vh;
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 201;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    padding-bottom: calc(20px + var(--safe-bottom));
}

.bottom-sheet.active {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 5px;
    background: var(--quaternary-label);
    border-radius: 3px;
    margin: 8px auto 4px;
}

.sheet-header {
    padding: 8px 20px 16px;
}

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

.sheet-date-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.sheet-date-row:active {
    background: var(--separator);
}

.sheet-date-icon {
    display: flex;
    opacity: 0.6;
    line-height: 1;
    pointer-events: none;
}

.sheet-date-text {
    font-weight: 500;
    pointer-events: none;
}

#sheetDatePicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.sheet-subtitle {
    font-size: 14px;
    color: var(--tertiary-label);
    margin-top: 4px;
}

.sheet-body {
    padding: 0 20px;
}

/* Add Grid */
.add-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px 8px;
    padding-bottom: 16px;
}

.add-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s;
}

.add-item:active {
    transform: scale(0.92);
}

.add-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bg-red { background: #FF3B3020; }
.bg-blue { background: #007AFF20; }
.bg-green { background: #34C75920; }

.add-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--secondary-label);
    text-align: center;
}

/* Input Sheet */
.input-sheet .sheet-body {
    padding-bottom: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tertiary-label);
    display: block;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--separator);
    border-radius: 12px;
    font-size: 17px;
    font-family: var(--font);
    color: var(--label);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--quaternary-label);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238E8E93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.apple-date {
    appearance: none;
    -webkit-appearance: none;
    padding: 14px 16px;
    font-size: 17px;
    font-family: var(--font);
    color: var(--label);
    background: var(--card-bg);
    border: 1.5px solid var(--separator);
    border-radius: 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    min-height: 50px;
}

.apple-date:focus {
    border-color: var(--primary);
}

.apple-date::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    padding: 4px;
    cursor: pointer;
}

.apple-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.quick-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-option {
    padding: 10px 18px;
    border: 1.5px solid var(--separator);
    border-radius: 12px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-label);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}

.quick-option:active {
    transform: scale(0.95);
}

.quick-option.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quick-option.quick-input-edit {
    padding: 10px 12px;
    min-width: 70px;
    text-align: center;
    -moz-appearance: textfield;
    outline: none;
}
.quick-option.quick-input-edit:focus {
    border-color: var(--primary);
}
.quick-option.quick-input-edit::-webkit-inner-spin-button,
.quick-option.quick-input-edit::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quick-option-input {
    width: 90px;
    padding: 10px 12px;
    border: 1.5px solid var(--separator);
    border-radius: 12px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--label);
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.quick-option-input::-webkit-inner-spin-button,
.quick-option-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quick-option-input:focus {
    border-color: var(--primary);
}

.quick-option-input::placeholder {
    color: var(--quaternary-label);
    font-size: 12px;
}

.btn-add-manual {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--separator);
    border-radius: 12px;
    background: none;
    color: var(--primary);
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.2s;
    margin: 8px 0;
}
.btn-add-manual:hover {
    background: var(--fill);
}
.manual-food-form {
    padding: 12px;
    background: var(--fill);
    border-radius: 12px;
    margin-bottom: 8px;
}
.input-row-search {
    display: flex;
    gap: 8px;
    align-items: center;
}
.btn-search-inet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: var(--fill);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
    cursor: pointer;
}
.btn-search-inet:hover {
    background: var(--separator);
}
.btn-search-inet:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-save-food {
    background: var(--primary);
    color: white;
}
.btn-save-food:hover {
    background: var(--primary-hover);
}
.btn-saved {
    background: #34C759;
    color: white;
    opacity: 1;
}
.nutrition-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.nutrition-result-item {
    padding: 10px 12px;
    border: 1px solid var(--separator);
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.nutrition-result-item:hover {
    background: var(--fill);
}
.nr-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--label);
}
.nr-info {
    font-size: 12px;
    color: var(--secondary-label);
    margin-top: 2px;
}
.nr-source {
    font-size: 11px;
    color: var(--tertiary-label);
    margin-top: 1px;
}
.nutrition-empty {
    font-size: 13px;
    color: var(--secondary-label);
    padding: 12px;
    text-align: center;
}
.input-row {
    display: flex;
    gap: 10px;
}
.input-row .input-group {
    flex: 1;
}

.btn-save {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.btn-save:active {
    background: var(--primary-hover);
    transform: scale(0.98);
}

/* Search Results */
.search-results {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--separator);
    border-radius: 12px;
    margin-top: 8px;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--separator);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: var(--fill);
}

.search-result-item .food-name {
    font-weight: 500;
}

.search-result-item .food-info {
    font-size: 12px;
    color: var(--tertiary-label);
}

/* Progress Screen */
.progress-screen {
    padding: 28px 20px 0;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    flex: 1;
}

.page-subtitle {
    font-size: 14px;
    color: var(--tertiary-label);
    width: 100%;
    margin-top: -12px;
}

.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-size: 15px;
    font-weight: 500;
}

.add-btn-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--fill);
    border-radius: 12px;
    padding: 4px;
}

.progress-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--tertiary-label);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.progress-tab.active {
    background: var(--card-bg);
    color: var(--label);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.progress-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-card {
    background: linear-gradient(135deg,#E8F4FD,#D0EBFA);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
}

.progress-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #007AFF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.progress-text {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1D1D1F;
}

.progress-card .chevron {
    font-size: 20px;
    color: #007AFF;
    flex-shrink: 0;
}

.pg-track {
    margin-top: 12px;
    height: 6px;
    background: rgba(0,122,255,0.15);
    border-radius: 3px;
    overflow: hidden;
}

.pg-fill {
    height: 100%;
    background: #007AFF;
    border-radius: 3px;
    transition: width 0.5s;
}

.pg-caption {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #007AFF;
}

.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.chart-range {
    font-size: 12px;
    color: var(--tertiary-label);
}

/* AI Screen */
.ai-screen {
    padding: 28px 20px 0;
}

.weekly-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.weekly-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.weekly-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.weekly-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
}

.weekly-label {
    font-size: 12px;
    color: var(--tertiary-label);
}

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

.history-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--tertiary-label);
    padding: 8px 4px 4px;
}

.history-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.history-content {
    font-size: 14px;
    line-height: 1.6;
}

/* Profile Screen */
.profile-screen {
    padding: 20px 20px 0;
}
.profile-screen.compact {
    padding-bottom: 0;
}

/* Profile Card */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.profile-avatar-col .profile-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0;
}

.profile-avatar-col .profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-col .avatar-gradient {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-col .avatar-initial {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.profile-info-col {
    flex: 1;
    min-width: 0;
}

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

.profile-status {
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
    margin-top: 1px;
}

.profile-mission {
    font-size: 12px;
    color: var(--tertiary-label);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Goal Card */
.goal-card {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    color: #fff;
}

.goal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}

.goal-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.goal-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.goal-metrics {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.goal-metric-label {
    font-size: 11px;
    opacity: 0.7;
    display: block;
}

.goal-metric-value {
    font-size: 16px;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.goal-progress-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.goal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.goal-progress-label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}
.goal-progress-pct {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.goal-progress-track.thick {
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    overflow: hidden;
}
.goal-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 5px;
    transition: width 0.5s ease;
}
.goal-progress-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

/* Goals Row */
.goals-row {
    margin-bottom: 16px;
}

.goals-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-label);
}

.goals-edit {
    font-size: 13px;
    color: var(--primary);
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
}

/* AI Health Story */
.health-story {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--separator);
}
.story-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--tertiary-label);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.story-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--label);
    font-weight: 400;
}

/* Fade in animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(12px);
}

/* Journey Mini Card */
.journey-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--separator);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--separator);
}
.journey-mini-item {
    background: var(--card-bg);
    padding: 14px 16px;
    text-align: center;
}
.journey-mini-label {
    display: block;
    font-size: 11px;
    color: var(--tertiary-label);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.journey-mini-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--label);
}

/* Achievements Page */
.achievements-screen {
    padding: 0 16px 100px;
}
.achievements-screen .page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 56px 0 16px;
}
.achievements-screen .btn-back {
    display: flex;
    color: var(--primary);
    text-decoration: none;
}
.achievements-screen .page-title {
    flex: 1;
    font-size: 26px;
    font-weight: 800;
    color: var(--label);
}
.ach-progress {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary-label);
}
.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.achievement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--separator);
    transition: all 0.2s;
}
.achievement-card.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}
.achievement-card.earned {
    opacity: 1;
    filter: none;
}
.ach-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ach-info {
    flex: 1;
    min-width: 0;
}
.ach-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--label);
}
.ach-desc {
    font-size: 12px;
    color: var(--tertiary-label);
    margin-top: 2px;
}
.ach-badge {
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--label);
    border-bottom: 1px solid var(--separator);
    transition: background 0.1s;
    min-height: 52px;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: var(--fill);
}

.settings-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.settings-icon svg {
    display: block;
}

.settings-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.settings-chevron {
    font-size: 18px;
    color: var(--quaternary-label);
    font-weight: 300;
}

.settings-toggle {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
}

/* Stats Banner (Progress) */
.stats-banner {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.stat-pill {
    flex: 1;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.stat-pill-value {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.stat-pill-label {
    font-size: 10px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 2px;
}

/* Achievement Row (Progress) */
.achieve-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.achieve-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    background: var(--fill);
    color: var(--secondary-label);
}

.achieve-pill svg {
    display: block;
}

/* Data List Screen */
.data-screen {
    padding: 28px 20px 0;
}

.water-progress-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 16px;
}

.water-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.water-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.water-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
}

.water-label {
    font-size: 11px;
    color: var(--tertiary-label);
}

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

.data-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.1s;
}

.data-card:active {
    transform: scale(0.98);
}

.data-main {
    flex: 1;
}

.data-value {
    font-size: 15px;
    font-weight: 600;
    display: block;
}

.data-value small {
    font-weight: 400;
    font-size: 12px;
    color: var(--tertiary-label);
}

.data-label {
    font-size: 12px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 1px;
}

.data-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.data-date {
    font-size: 11px;
    color: var(--quaternary-label);
}

.data-delete {
    background: none;
    border: none;
    color: var(--red);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
}

.file-link {
    font-size: 16px;
    text-decoration: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--tertiary-label);
}

/* Error Screen */
.error-screen {
    text-align: center;
    padding: 80px 20px;
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--separator);
    line-height: 1;
}

.error-title {
    font-size: 22px;
    margin: 16px 0 8px;
}

.error-text {
    font-size: 15px;
    color: var(--tertiary-label);
    margin-bottom: 24px;
}

.btn-back-home {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
}

/* Install Screen */
.install-screen {
    padding: 40px 20px;
    text-align: center;
}

.install-header {
    margin-bottom: 32px;
}

.install-logo {
    font-size: 64px;
    margin-bottom: 12px;
}

.install-header h1 {
    font-size: 28px;
    font-weight: 800;
}

.install-header p {
    color: var(--tertiary-label);
    font-size: 15px;
}

.install-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: left;
}

.install-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.check-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--separator);
}

.check-status {
    font-weight: 600;
}

.check-status.pass { color: var(--green); }
.check-status.fail { color: var(--red); }

.install-error {
    background: #FF3B3010;
    color: var(--red);
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-install {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.btn-install:disabled {
    opacity: 0.6;
}

.install-success {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.install-success a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Profile - About Card */
.profile-about-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-about-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-about-info {
    flex: 1;
}

.profile-status {
    font-size: 13px;
    color: var(--green);
    font-weight: 500;
}

.profile-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-gradient {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initial {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.avatar-gradient.avatar-gb { background: linear-gradient(145deg, #34C759, #007AFF); }
.avatar-g-0 { background: linear-gradient(135deg, #007AFF, #5856D6); }
.avatar-g-1 { background: linear-gradient(135deg, #34C759, #30B0C7); }
.avatar-g-2 { background: linear-gradient(135deg, #FF9500, #FF3B30); }
.avatar-g-3 { background: linear-gradient(135deg, #AF52DE, #5856D6); }
.avatar-g-4 { background: linear-gradient(135deg, #FF2D55, #AF52DE); }
.avatar-g-5 { background: linear-gradient(135deg, #30B0C7, #007AFF); }
.avatar-g-6 { background: linear-gradient(135deg, #FF9500, #FF2D55); }
.avatar-g-7 { background: linear-gradient(135deg, #5856D6, #34C759); }

.profile-about-bio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bio-label {
    font-size: 13px;
    color: var(--tertiary-label);
}

.bio-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--label);
    text-align: right;
    max-width: 60%;
}

/* Live Goals Card */
.live-goals-card {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    color: #fff;
}

.live-goals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.live-goals-title {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.9;
}

.live-goals-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.live-goals-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-goal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-goal-label {
    font-size: 14px;
    opacity: 0.9;
}

.live-goal-label svg {
    vertical-align: middle;
    margin-right: 4px;
}

.live-goal-value {
    font-size: 17px;
    font-weight: 700;
}

.live-goal-progress {
    margin-top: 8px;
}

.live-goal-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.progress-track {
    height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Section header with action */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 4px;
}

.section-header .section-title {
    margin-bottom: 0;
    padding: 0;
}

.section-action {
    font-size: 13px;
    color: var(--primary);
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Health Goals Chips */
.health-goals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.health-goal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    background: var(--fill);
    border: 1px solid var(--separator);
    color: var(--tertiary-label);
    cursor: default;
    transition: all 0.25s ease;
}

.health-goal-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.health-goal-chip.active .chip-icon svg {
    stroke: #fff;
}

.health-goal-chip:not(.active) .chip-icon svg {
    stroke: var(--tertiary-label);
}

.chip-icon {
    display: flex;
    line-height: 1;
}

.chip-check {
    font-size: 12px;
    font-weight: 700;
    margin-left: 2px;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-mini-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
}

.stat-mini-label {
    font-size: 11px;
    color: var(--tertiary-label);
    margin-top: 2px;
    display: block;
}

.subsection-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0 4px;
    color: var(--secondary-label);
}

/* Achievement Grid */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.achievement-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.achievement-card.locked {
    opacity: 0.4;
}

.achievement-icon {
    font-size: 24px;
    margin-bottom: 6px;
    line-height: 1;
}

.achievement-label {
    font-size: 11px;
    font-weight: 600;
    display: block;
    color: var(--secondary-label);
}

.achievement-desc {
    font-size: 10px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 2px;
}

/* Journey Card */
.journey-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
}

.journey-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.journey-stat {
    text-align: center;
}

.journey-stat-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
    color: var(--primary);
}

.journey-stat-label {
    font-size: 10px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 2px;
}

.journey-footer {
    font-size: 12px;
    color: var(--tertiary-label);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.journey-arrow {
    font-size: 16px;
    transition: transform 0.2s;
    display: inline-block;
}

/* Journey Mini (for AI Coach) */
.journey-mini-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.journey-mini {
    text-align: center;
}

.journey-mini-value {
    font-size: 18px;
    font-weight: 700;
    display: block;
    color: var(--primary);
}

.journey-mini-label {
    font-size: 9px;
    color: var(--tertiary-label);
    display: block;
    margin-top: 2px;
}

/* Timeline */
.timeline {
    padding: 4px 0;
}

.timeline-item {
    display: flex;
    gap: 14px;
    min-height: 60px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-dot svg {
    stroke: #fff;
}

.timeline-dot-goal {
    background: var(--green);
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: var(--separator);
    margin: 2px 0;
}

.timeline-content {
    flex: 1;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-date {
    font-size: 11px;
    color: var(--tertiary-label);
    font-weight: 500;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
}

.timeline-title-goal {
    color: var(--green);
}

.timeline-subtitle {
    font-size: 12px;
    color: var(--tertiary-label);
}

/* iOS Toggle */
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e9e9ea;
    border-radius: 31px;
    transition: background 0.2s;
    cursor: pointer;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.ios-toggle input:checked + .toggle-track {
    background: var(--green);
}

.ios-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

/* Goals Swal Grid */
.goals-swal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    text-align: left;
}

.goals-swal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid var(--separator);
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.goals-swal-item.sel {
    border-color: var(--primary);
    background: #007AFF10;
}

.goals-swal-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--quaternary-label);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.goals-swal-item.sel .goals-swal-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Bottom spacer */
.bottom-spacer {
    height: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive - wider screens */
@media (min-width: 431px) {
    .app-container {
        border-left: 1px solid var(--separator);
        border-right: 1px solid var(--separator);
    }
}

@media (max-width: 430px) {
    .add-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .add-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
