/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    --fasting-primary: #FF6B35;
    --fasting-secondary: #9B59B6;
    --fasting-gradient: linear-gradient(135deg, #FF6B35 0%, #E74C3C 50%, #9B59B6 100%);
    --fasting-glow: 0 0 30px rgba(255, 107, 53, 0.4);
    --eating-primary: #27AE60;
    --eating-secondary: #2ECC71;
    --eating-gradient: linear-gradient(135deg, #27AE60 0%, #2ECC71 100%);
    --eating-glow: 0 0 30px rgba(39, 174, 96, 0.4);
    --bg: #F5F6FA;
    --bg-card: #FFFFFF;
    --bg-input: #F0F2F5;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-muted: #BDC3C7;
    --border: #E9ECEF;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #27AE60;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height: 64px;
}

[data-theme="dark"] {
    --bg: #0D1117;
    --bg-card: #161B22;
    --bg-input: #21262D;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --border: #30363D;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--fasting-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ── Loading Screen ────────────────────────────────────────────────────── */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg);
    gap: 16px;
}
.loading-logo { font-size: 64px; animation: pulse-logo 2s ease-in-out infinite; }
.loading-text {
    font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
    background: var(--fasting-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.loading-spinner {
    width: 32px; height: 32px; border: 3px solid var(--border);
    border-top-color: var(--fasting-primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-logo { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.loading-screen.hidden { opacity: 0; pointer-events: none; transition: opacity 0.3s; }

/* ── App Shell ─────────────────────────────────────────────────────────── */
.app-header {
    position: sticky; top: 0; z-index: 50;
    padding: calc(12px + var(--safe-top)) 20px 12px;
    background: var(--bg); display: flex; align-items: center; justify-content: space-between;
}
.app-header-title {
    font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
    background: var(--fasting-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.app-header-actions { display: flex; gap: 8px; align-items: center; }

.theme-toggle {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; background: var(--bg-card); box-shadow: var(--shadow);
    transition: var(--transition);
}
.theme-toggle:active { transform: scale(0.9); }

/* ── Bottom Nav ────────────────────────────────────────────────────────── */
.app-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--bg-card); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05); z-index: 100;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--text-muted); font-size: 10px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase; transition: var(--transition);
    position: relative;
}
.nav-item .nav-icon { font-size: 22px; transition: var(--transition); }
.nav-item.active { color: var(--fasting-primary); }
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px; background: var(--fasting-gradient); border-radius: 0 0 3px 3px;
}

/* ── Views ─────────────────────────────────────────────────────────────── */
.view {
    display: none; padding: 0 16px 16px;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
    min-height: calc(100vh - 60px); animation: fadeIn 0.25s ease;
}
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.view-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Auth Views ────────────────────────────────────────────────────────── */
.auth-container {
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 40px 24px;
}
.auth-logo { font-size: 56px; margin-bottom: 8px; }
.auth-title {
    font-size: 32px; font-weight: 800; margin-bottom: 4px;
    background: var(--fasting-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 15px; }
.auth-form { width: 100%; max-width: 360px; }
.auth-footer { margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { font-weight: 600; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%; padding: 14px 16px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 16px; background: var(--bg-input);
    color: var(--text-primary); transition: border-color 0.2s; outline: none;
}
.form-input:focus { border-color: var(--fasting-primary); }
.form-input::placeholder { color: var(--text-muted); }
.form-select {
    width: 100%; padding: 14px 16px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 16px; background: var(--bg-input);
    color: var(--text-primary); appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237F8C8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 14px; color: var(--text-secondary);
}
.form-check input[type="checkbox"] {
    width: 20px; height: 20px; accent-color: var(--fasting-primary);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px; border-radius: var(--radius-sm); font-size: 15px;
    font-weight: 700; transition: var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    width: 100%; background: var(--fasting-gradient); color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}
.btn-primary:disabled { opacity: 0.6; pointer-events: none; }
.btn-secondary {
    background: var(--bg-card); color: var(--text-primary);
    border: 2px solid var(--border);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--eating-gradient); color: #fff; }
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-icon {
    width: 44px; height: 44px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 16px; transition: var(--transition);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }

/* ── Timer View ────────────────────────────────────────────────────────── */
.timer-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 0 24px; gap: 20px;
}
.timer-protocol-badge {
    font-size: 13px; font-weight: 700; letter-spacing: 1px;
    background: var(--fasting-gradient); color: #fff;
    padding: 6px 20px; border-radius: 20px;
}
.timer-ring { position: relative; width: 260px; height: 260px; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring__bg { fill: none; stroke: var(--border); stroke-width: 10; }
.timer-ring__progress {
    fill: none; stroke-width: 10; stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.timer-ring__inner {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center;
}
.timer-state { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-secondary); font-weight: 600; }
.timer-time {
    font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums;
    line-height: 1.1; margin: 4px 0;
    background: var(--fasting-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.timer-time.eating {
    background: var(--eating-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.timer-time.overtime {
    background: var(--eating-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    animation: overtime-pulse 2s ease-in-out infinite;
}
@keyframes overtime-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.timer-elapsed { font-size: 13px; color: var(--text-secondary); }

.timer-actions { display: flex; gap: 16px; align-items: center; }
.timer-btn-start {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--fasting-gradient); border: none; font-size: 28px;
    color: #fff; box-shadow: var(--fasting-glow); transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.timer-btn-start:active { transform: scale(0.92); }
.timer-btn-start.stop { background: var(--eating-gradient); box-shadow: var(--eating-glow); }

.timer-btn-secondary {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-card); border: 2px solid var(--border);
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.timer-btn-secondary:active { transform: scale(0.9); }

.timer-info { width: 100%; max-width: 360px; }
.timer-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.timer-info-row:last-child { border-bottom: none; }
.timer-info-label { color: var(--text-secondary); }
.timer-info-value { font-weight: 700; }

/* ── Streak Badge ──────────────────────────────────────────────────────── */
.streak-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #FF6B35, #FF8C00);
    color: #fff; padding: 8px 20px; border-radius: 30px;
    font-weight: 800; font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}
.streak-badge.zero { background: var(--bg-card); color: var(--text-muted); box-shadow: var(--shadow); }

/* ── Stats Grid ────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px;
    text-align: center; box-shadow: var(--shadow);
}
.stat-value {
    font-size: 28px; font-weight: 800; line-height: 1.1;
    background: var(--fasting-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-value.green {
    background: var(--eating-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-value.red { -webkit-text-fill-color: var(--danger); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ── Calendar ──────────────────────────────────────────────────────────── */
.calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.calendar-day-label {
    text-align: center; font-size: 11px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day {
    aspect-ratio: 1; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    transition: var(--transition); position: relative;
}
.calendar-day.empty { visibility: hidden; }
.calendar-day.completed { background: var(--success); color: #fff; }
.calendar-day.completed_early { background: var(--warning); color: #fff; }
.calendar-day.failed { background: var(--danger); color: #fff; }
.calendar-day.active { background: var(--fasting-primary); color: #fff; animation: pulse-ring 2s infinite; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--fasting-primary); }
@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255, 107, 53, 0); }
}

/* ── Weight View ───────────────────────────────────────────────────────── */
.weight-input-group {
    display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px;
}
.weight-input-group .form-group { margin-bottom: 0; }
.weight-input-group .btn { width: 100%; }

.weight-trend { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.weight-trend .arrow-up { color: var(--danger); }
.weight-trend .arrow-down { color: var(--success); }

.chart-container { position: relative; height: 220px; margin: 16px 0; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* ── Food Guide ────────────────────────────────────────────────────────── */
.food-section { margin-bottom: 24px; }
.food-section-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.food-section-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.food-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.food-item {
    background: var(--bg-card); border-radius: var(--radius-xs); padding: 14px 12px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 4px; box-shadow: var(--shadow); transition: var(--transition);
}
.food-item:active { transform: scale(0.97); }
.food-item.good { border-left: 4px solid var(--success); }
.food-item.bad { border-left: 4px solid var(--danger); }
.food-emoji { font-size: 32px; }
.food-name { font-size: 13px; font-weight: 700; }
.food-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.3; }

.protocol-card {
    background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px;
    box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer;
    transition: var(--transition); border: 2px solid transparent;
}
.protocol-card.active { border-color: var(--fasting-primary); }
.protocol-card:active { transform: scale(0.98); }
.protocol-name { font-size: 20px; font-weight: 800; }
.protocol-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.protocol-hours {
    font-size: 12px; font-weight: 700; color: var(--fasting-primary);
    margin-top: 6px;
}

/* ── Profile View ──────────────────────────────────────────────────────── */
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--fasting-gradient); display: flex;
    align-items: center; justify-content: center;
    font-size: 36px; font-weight: 800; color: #fff;
    margin: 0 auto 16px;
}
.profile-name { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.profile-email { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

.settings-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }
.settings-label { font-size: 15px; font-weight: 600; }
.settings-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Toggle Switch */
.toggle {
    position: relative; width: 52px; height: 28px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--border);
    border-radius: 28px; cursor: pointer; transition: var(--transition);
}
.toggle-slider::before {
    content: ''; position: absolute; left: 3px; top: 3px;
    width: 22px; height: 22px; border-radius: 50%; background: #fff;
    transition: var(--transition); box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--fasting-primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(24px); }

/* ── History List ──────────────────────────────────────────────────────── */
.history-list { list-style: none; }
.history-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.history-dot.completed { background: var(--success); }
.history-dot.completed_early { background: var(--warning); }
.history-dot.failed { background: var(--danger); }
.history-dot.active { background: var(--fasting-primary); }
.history-info { flex: 1; min-width: 0; }
.history-date { font-size: 14px; font-weight: 600; }
.history-detail { font-size: 12px; color: var(--text-secondary); }
.history-duration { font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed; bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 50%; transform: translateX(-50%); z-index: 9998;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    background: var(--text-primary); color: var(--bg); padding: 12px 24px;
    border-radius: 30px; font-size: 14px; font-weight: 600;
    opacity: 0; transform: translateY(10px) scale(0.95);
    transition: all 0.3s; max-width: 340px; text-align: center;
    pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }

/* ── PWA Install Banner ────────────────────────────────────────────────── */
.install-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    padding: 0 12px calc(12px + var(--safe-bottom));
    animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.install-banner-content {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-card); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
}
.install-banner-icon { font-size: 32px; flex-shrink: 0; }
.install-banner-text {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.install-banner-text strong { font-size: 15px; }
.install-banner-text span { font-size: 12px; color: var(--text-secondary); }
.install-banner-btn {
    flex-shrink: 0; padding: 10px 20px; border-radius: var(--radius-xs);
    background: var(--fasting-gradient); color: #fff;
    font-size: 14px; font-weight: 700; border: none; cursor: pointer;
}
.install-banner-btn:active { transform: scale(0.95); }
.install-banner-close {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--text-muted); background: none; border: none;
    cursor: pointer;
}

/* ── Confetti ──────────────────────────────────────────────────────────── */
#confetti-canvas {
    position: fixed; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; display: none;
}
#confetti-canvas.active { display: block; }

/* ── Skeleton Loading ──────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 16px; margin-bottom: 12px; }
.skeleton-circle { width: 60px; height: 60px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

/* ── Modal / Bottom Sheet ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 200; display: flex; align-items: flex-end;
    justify-content: center; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-sheet {
    background: var(--bg-card); border-radius: 24px 24px 0 0;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-handle {
    width: 36px; height: 4px; background: var(--border);
    border-radius: 2px; margin: 0 auto 20px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 48px 24px;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.empty-text { font-size: 14px; color: var(--text-secondary); max-width: 280px; margin: 0 auto 20px; }

/* ── Progress Bar ──────────────────────────────────────────────────────── */
.progress-bar {
    height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 4px; transition: width 0.5s ease;
    background: var(--fasting-gradient);
}
.progress-fill.green { background: var(--eating-gradient); }

/* ── Utility ───────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; }
.tab-btn {
    flex: 1; padding: 10px; border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    transition: var(--transition); text-align: center;
}
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
    .timer-ring { width: 300px; height: 300px; }
    .timer-time { font-size: 52px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .food-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    body { max-width: 480px; margin: 0 auto; box-shadow: var(--shadow-lg); min-height: 100vh; }
    .app-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
    #toast-container { max-width: 480px; }
}
