/* ==========================================================================
   Daily Planner - stylesheet
   Mobile-first, vanilla CSS. Organized in sections:
   1. Reset & tokens   2. Layout shell & nav   3. Buttons & forms
   4. Modals / bottom sheets   5. Timeline   6. Stats & overdue
   7. Categories & tasks pages   8. Toasts   9. Responsive (tablet/desktop)
   ========================================================================== */

/* ---------- 1. Reset & tokens ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }

:root {
    --color-bg: #f6f7fb;
    --color-surface: #ffffff;
    --color-surface-alt: #f1f3f9;
    --color-border: #e4e7f0;
    --color-text: #12141c;
    --color-text-muted: #6b7085;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-soft: #eef0fd;
    --color-danger: #e11d48;
    --color-danger-soft: #fdeaef;
    --color-success: #15803d;

    --status-not-started: #94a3b8;
    --status-in-progress: #2563eb;
    --status-completed: #16a34a;
    --status-skipped: #6b7085;
    --status-overdue: #e11d48;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    --shadow-sm: 0 1px 3px rgba(18, 20, 28, 0.06);
    --shadow-md: 0 6px 20px rgba(18, 20, 28, 0.10);
    --shadow-lg: 0 16px 40px rgba(18, 20, 28, 0.20);

    --slot-height: 56px;
    --bottom-nav-height: 68px;
    --topbar-height: 56px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #0d0f16;
        --color-surface: #161923;
        --color-surface-alt: #1e2230;
        --color-border: #2a2f3f;
        --color-text: #eef0f8;
        --color-text-muted: #9aa0b4;
        --color-primary: #818cf8;
        --color-primary-hover: #a5b4fc;
        --color-primary-soft: #232544;
        --color-danger: #fb7185;
        --color-danger-soft: #3a1c26;
    }
}

:root[data-theme="dark"] {
    --color-bg: #0d0f16;
    --color-surface: #161923;
    --color-surface-alt: #1e2230;
    --color-border: #2a2f3f;
    --color-text: #eef0f8;
    --color-text-muted: #9aa0b4;
    --color-primary: #818cf8;
    --color-primary-hover: #a5b4fc;
    --color-primary-soft: #232544;
    --color-danger: #fb7185;
    --color-danger-soft: #3a1c26;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.45;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-2) var(--space-4);
    z-index: 200;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

button {
    background: none;
    border: none;
    cursor: pointer;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ---------- 2. Layout shell & nav ---------- */

.app-shell {
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-5));
    position: relative;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.app-topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.app-main {
    padding: var(--space-4) var(--space-4) var(--space-6);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: var(--bottom-nav-height);
    display: flex;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 -4px 16px rgba(18, 20, 28, 0.05);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    min-height: 48px;
}
.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-icon { font-size: 1.3rem; line-height: 1; }
.bottom-nav-icon[data-icon="today"]::before { content: "📅"; }
.bottom-nav-icon[data-icon="tasks"]::before { content: "✅"; }
.bottom-nav-icon[data-icon="categories"]::before { content: "🎨"; }
.bottom-nav-icon[data-icon="settings"]::before { content: "⚙️"; }

/* ---------- Date navigation ---------- */

.date-nav {
    position: sticky;
    top: var(--topbar-height);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-bg);
    padding: var(--space-3) 0;
}
.icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 1.1rem;
}
.icon-btn:active { background: var(--color-surface-alt); }

.date-nav-current {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.date-nav-day { font-weight: 700; font-size: 1.05rem; }
.date-nav-relative { font-size: 0.8rem; color: var(--color-primary); font-weight: 600; min-height: 1.1em; }
.date-picker-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.quick-actions {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-2);
}
.chip-btn {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 40px;
}
.chip-btn-danger { color: var(--color-danger); }

/* ---------- 3. Buttons & forms ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:active { background: var(--color-primary-hover); }
.btn-ghost { background: var(--color-surface-alt); color: var(--color-text); }
.btn-danger-ghost { background: var(--color-danger-soft); color: var(--color-danger); }
.btn-block { width: 100%; margin-top: var(--space-3); }

.form-field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.form-field label { font-weight: 600; font-size: 0.88rem; }
.form-row { display: flex; gap: var(--space-3); }
.form-row .form-field { flex: 1; }

input[type="text"], input[type="time"], input[type="date"], input[type="number"],
select, textarea {
    min-height: 48px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    width: 100%;
}
textarea { min-height: 72px; resize: vertical; }

.color-field-row { display: flex; align-items: center; gap: var(--space-3); }
input[type="color"] {
    width: 52px;
    height: 48px;
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}
.color-hex-input { flex: 1; }

.field-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: var(--space-2); }
.field-label { font-weight: 600; font-size: 0.88rem; display: block; margin-bottom: var(--space-2); }

.radio-row { display: flex; gap: var(--space-4); }
.radio-option { display: flex; align-items: center; gap: var(--space-2); font-size: 0.92rem; }
.radio-option input { width: 20px; height: 20px; }

.form-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: var(--space-3);
}

.duration-presets { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.preset-btn {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--color-surface-alt);
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 36px;
}
.end-time-readout { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-3); }

.modal-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    justify-content: flex-end;
    margin-top: var(--space-4);
}
.modal-actions .btn-danger-ghost { margin-right: auto; }

.status-quick-controls {
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
}
.status-btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.status-btn {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 40px;
}
.status-btn-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.actual-times-readout { font-size: 0.8rem; color: var(--color-text-muted); margin-top: var(--space-2); }

/* FAB */
.fab {
    position: fixed;
    right: var(--space-5);
    bottom: calc(var(--bottom-nav-height) + var(--space-4));
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    box-shadow: var(--shadow-lg);
    z-index: 25;
    max-width: calc(640px - var(--space-5) * 2);
}
.fab:active { background: var(--color-primary-hover); }

/* ---------- 4. Modals / bottom sheets ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(12, 13, 20, 0.5);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-backdrop.modal-open-visible { opacity: 1; }

.modal-sheet {
    background: var(--color-surface);
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-3) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom, 0));
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
}
.modal-backdrop.modal-open-visible .modal-sheet { transform: translateY(0); }

.modal-handle {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    margin: var(--space-2) auto var(--space-3);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}
.modal-title { font-size: 1.2rem; font-weight: 700; }

body.modal-open { overflow: hidden; }

/* ---------- 5. Timeline ---------- */

.timeline-section { margin-top: var(--space-5); }
.timeline-grid { display: flex; }
.timeline-labels {
    position: relative;
    width: 56px;
    flex-shrink: 0;
}
.timeline-label {
    position: absolute;
    left: 0;
    right: var(--space-2);
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: right;
}
.timeline-track {
    position: relative;
    flex: 1;
    border-left: 1px solid var(--color-border);
    margin-left: var(--space-2);
}
.timeline-slot {
    position: absolute;
    left: 0;
    right: 0;
    border-bottom: 1px dashed var(--color-border);
    background: var(--color-surface);
}
.timeline-slot:active { background: var(--color-surface-alt); }
.timeline-slot-current { background: var(--color-primary-soft); }

.schedule-card {
    position: absolute;
    left: var(--space-2);
    right: 0;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}
.schedule-card-time { font-size: 0.68rem; opacity: 0.85; font-weight: 600; }
.schedule-card-name { font-size: 0.88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-card-badge {
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.schedule-card.status-in_progress { border-color: var(--status-in-progress); }
.schedule-card.status-completed { border-color: var(--status-completed); }
.schedule-card.status-skipped { opacity: 0.55; border-style: dashed; }
.schedule-card.status-skipped .schedule-card-name { text-decoration: line-through; }
.schedule-card.status-overdue { border-color: var(--status-overdue); animation: overdue-pulse 2.4s ease-in-out infinite; }

@keyframes overdue-pulse {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.25); }
}

.current-time-line {
    position: absolute;
    left: -6px;
    right: 0;
    height: 2px;
    background: var(--color-danger);
    z-index: 5;
}
.current-time-dot {
    position: absolute;
    left: -3px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-danger);
}
.current-time-label {
    position: absolute;
    right: 4px;
    top: -18px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-danger);
    background: var(--color-surface);
    padding: 0 4px;
    border-radius: var(--radius-sm);
}

/* ---------- 6. Stats & overdue ---------- */

.section-heading { font-size: 1.05rem; font-weight: 700; margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.section-subheading { font-size: 0.9rem; font-weight: 700; color: var(--color-text-muted); margin: var(--space-4) 0 var(--space-2); text-transform: uppercase; letter-spacing: 0.03em; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot-overdue { background: var(--status-overdue); }

.overdue-section {
    background: var(--color-danger-soft);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}
.overdue-heading { color: var(--color-danger); margin-bottom: var(--space-3); }
.overdue-list { display: flex; flex-direction: column; gap: var(--space-3); }
.overdue-item {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}
.overdue-item-swatch { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.overdue-item-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.overdue-item-name { font-weight: 700; }
.overdue-item-time { font-size: 0.8rem; color: var(--color-text-muted); }
.overdue-item-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 100%; margin-top: var(--space-2); }
.mini-btn {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 34px;
}
.mini-btn-ghost { background: var(--color-surface-alt); color: var(--color-text-muted); }

.stats-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}
.progress-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.progress-card {
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    text-align: center;
}
.progress-card-value { display: block; font-size: 1.15rem; font-weight: 800; }
.progress-card-label { display: block; font-size: 0.65rem; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; }
.progress-card-completed .progress-card-value { color: var(--status-completed); }
.progress-card-in_progress .progress-card-value { color: var(--status-in-progress); }
.progress-card-overdue .progress-card-value { color: var(--status-overdue); }
.progress-card-skipped .progress-card-value { color: var(--status-skipped); }

.completion-bar-wrap { margin-bottom: var(--space-2); }
.completion-bar-track {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-surface-alt);
    overflow: hidden;
    margin-bottom: var(--space-2);
}
.completion-bar-fill { height: 100%; background: var(--color-success); transition: width 0.3s ease; }
.completion-rate-label { font-size: 0.82rem; color: var(--color-text-muted); font-weight: 600; }

.category-stats-list { display: flex; flex-direction: column; gap: var(--space-3); }
.category-stats-empty { color: var(--color-text-muted); font-size: 0.85rem; }
.category-stat-row { display: grid; grid-template-columns: 100px 1fr 64px; align-items: center; gap: var(--space-2); }
.category-stat-label { display: flex; align-items: center; gap: var(--space-2); font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-stat-bar-track { height: 8px; border-radius: var(--radius-full); background: var(--color-surface-alt); overflow: hidden; }
.category-stat-bar-fill { display: block; height: 100%; border-radius: var(--radius-full); }
.category-stat-value { font-size: 0.78rem; color: var(--color-text-muted); text-align: right; }

.unplanned-summary { font-size: 0.8rem; color: var(--color-text-muted); margin-top: var(--space-3); }

.empty-state {
    text-align: center;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-4);
    margin-bottom: var(--space-5);
}
.empty-state-title { font-weight: 700; font-size: 1.05rem; margin-bottom: var(--space-1); }
.empty-state-text { color: var(--color-text-muted); font-size: 0.88rem; margin-bottom: var(--space-4); }

/* ---------- 7. Categories & tasks pages ---------- */

.page-intro { margin-bottom: var(--space-4); }
.page-intro-text { color: var(--color-text-muted); font-size: 0.88rem; }

.categories-list { display: flex; flex-direction: column; gap: var(--space-3); }
.category-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    text-align: left;
    min-height: 56px;
}
.category-swatch { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.category-swatch-sm { width: 12px; height: 12px; }
.category-card-body { flex: 1; display: flex; flex-direction: column; }
.category-card-name { font-weight: 700; }
.category-card-meta { font-size: 0.8rem; color: var(--color-text-muted); }
.category-card-chevron { color: var(--color-text-muted); font-size: 1.3rem; }

.task-group { margin-bottom: var(--space-5); }
.task-group-heading { display: flex; align-items: center; gap: var(--space-2); font-size: 0.95rem; font-weight: 700; margin-bottom: var(--space-2); }
.task-group-list { display: flex; flex-direction: column; gap: var(--space-2); }
.task-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    text-align: left;
    min-height: 52px;
}
.task-row-body { flex: 1; display: flex; flex-direction: column; }
.task-row-name { font-weight: 600; }
.task-row-desc { font-size: 0.8rem; color: var(--color-text-muted); }
.task-row-chevron { color: var(--color-text-muted); font-size: 1.3rem; }

.settings-form { max-width: 480px; }
.settings-group {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

/* ---------- 8. Toasts ---------- */

.toast-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--space-3));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    z-index: 200;
    pointer-events: none;
    padding: 0 var(--space-4);
}
.toast {
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 420px;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--color-danger); color: #fff; }
.toast-success { background: var(--color-success); color: #fff; }

/* ---------- 9. Responsive (tablet / desktop) ---------- */

@media (min-width: 720px) {
    .app-shell { max-width: 880px; }
    .app-main { padding: var(--space-5) var(--space-6) var(--space-6); }
    .progress-cards { grid-template-columns: repeat(4, 1fr); }
    .fab { right: calc((100vw - 880px) / 2 + var(--space-5)); }
}

@media (min-width: 720px) and (max-width: 1000px) {
    .fab { right: var(--space-5); }
}

@media (min-width: 1000px) {
    .app-shell { max-width: 1040px; }
    .modal-backdrop { align-items: center; justify-content: center; }
    .modal-sheet {
        max-width: 480px;
        border-radius: var(--radius-lg);
        transform: translateY(16px);
    }
    .modal-backdrop.modal-open-visible .modal-sheet { transform: translateY(0); }
    .modal-handle { display: none; }
    .category-stat-row { grid-template-columns: 140px 1fr 72px; }
}

/* ---------- 10. PWA (install, offline, standalone) ---------- */

[data-view][hidden] { display: none !important; }

.offline-banner {
    display: none;
    position: sticky;
    top: var(--topbar-height);
    z-index: 18;
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    padding: var(--space-2) var(--space-4);
}
body.is-offline .offline-banner { display: block; }

.install-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-primary-soft);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.install-banner[hidden] { display: none; }
.install-banner-body { flex: 1; }
.install-banner-title { font-weight: 700; font-size: 0.92rem; }
.install-banner-text { font-size: 0.8rem; color: var(--color-text-muted); }
.install-banner .btn { min-height: 40px; padding: var(--space-2) var(--space-4); font-size: 0.85rem; }

.pwa-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

@media (display-mode: standalone) {
    .app-topbar { padding-top: env(safe-area-inset-top, 0); height: calc(var(--topbar-height) + env(safe-area-inset-top, 0)); }
}
