/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}
img { max-width: 100%; }

/* === THEME (lys) === */
:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-text: #ffffff;
    --danger: #dc2626;
    --danger-hover: #b91c1c;

    --ok: #16a34a;
    --ok-bg: #dcfce7;
    --missed: #dc2626;
    --missed-bg: #fee2e2;

    --heat-base: #fde68a;
    --heat-high: #b91c1c;
    --heat-blue-base: #dbeafe;
    --heat-blue-high: #1e40af;

    --radius: 8px;
    --shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
    --header-h: 64px;
}

[data-colorblind="1"] {
    --ok: #2563eb;
    --ok-bg: #dbeafe;
    --missed: #ea580c;
    --missed-bg: #ffedd5;
    --heat-base: #e0f2fe;
    --heat-high: #0c4a6e;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #1e293b;
        --surface-2: #334155;
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --border: #334155;
        --ok-bg: #14532d;
        --missed-bg: #7f1d1d;
        --heat-base: #334155;
    }
    [data-colorblind="1"] {
        --ok-bg: #1e3a8a;
        --missed-bg: #7c2d12;
    }
}

/* === LAYOUT - HEADER === */
.app-header {
    position: sticky;
    top: 0;
    height: var(--header-h);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: var(--primary-text);
    display: flex;
    align-items: stretch;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
}
.menu-btn {
    background: transparent;
    border: none;
    color: var(--primary-text);
    padding: 0 14px;
    cursor: pointer;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
    border-radius: 0;
}
.menu-btn:hover { background: rgba(255,255,255,0.12); }
.menu-btn:active { background: rgba(255,255,255,0.2); transform: scale(0.94); }

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 8px;
    gap: 6px;
}
.header-nav::-webkit-scrollbar { display: none; }

.header-nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    flex: 1 1 0;
    min-width: 56px;
    max-width: 110px;
    height: 100%;
    line-height: 1;
    gap: 3px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 1px 2px rgba(0,0,0,0.08);
    -webkit-tap-highlight-color: transparent;
}
.header-nav-link::before {
    /* subtil glans-effekt fra topp */
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.10), transparent);
    pointer-events: none;
    border-radius: 14px 14px 0 0;
}
.header-nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: white !important;
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 4px 8px rgba(0,0,0,0.15);
}
.header-nav-link:active {
    transform: translateY(0) scale(0.96);
    background: rgba(255, 255, 255, 0.22);
    transition: all 0.08s ease;
}
.header-nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 6px rgba(0,0,0,0.18);
}
.header-nav-link.active::after {
    /* lite "prikk" under aktivt ikon */
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}
.header-nav-icon {
    font-size: 1.45em;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.header-nav-label {
    font-size: 0.7em;
    letter-spacing: 0.3px;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.app-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: env(safe-area-inset-bottom);
}

/* === SIDEMENY === */
.side-menu {
    position: fixed;
    inset: 0;
    z-index: 100;
    visibility: hidden;
    pointer-events: none;
}
.side-menu.open { visibility: visible; pointer-events: auto; }
.menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
}
.side-menu.open .menu-overlay { opacity: 1; }
.menu-content {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 85%;
    max-width: 320px;
    background: var(--surface);
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.side-menu.open .menu-content { transform: translateX(0); }
.menu-user {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.menu-link {
    display: block;
    padding: 14px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 1.05em;
}
.menu-link:hover { background: var(--surface-2); }
.menu-link-sub { padding-left: 28px; font-size: 0.9em; color: var(--text-muted); }
.menu-link-danger { color: var(--danger); margin-top: 12px; }

/* === TYPOGRAFI === */
h1 { font-size: 1.5em; margin: 0 0 12px; }
h2 { font-size: 1.2em; margin: 0 0 8px; }
h3 { font-size: 1.05em; margin: 0 0 6px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

/* === CARDS === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

/* === FORMS === */
.stack > * + * { margin-top: 12px; }
label { display: block; font-weight: 500; }
label .muted, label small { font-weight: normal; display: block; }
.input {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    -webkit-appearance: none;
    appearance: none;
}
.input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}
textarea.input { resize: vertical; min-height: 60px; }
.input-sm { width: auto; max-width: 120px; display: inline-block; padding: 8px; }
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    padding: 8px 0;
    cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.check-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: normal;
}
.check-card:has(input:checked) { border-color: var(--primary); background: var(--surface); }
.check-card input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.check-card small { display: block; color: var(--text-muted); }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    min-height: 44px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--ok); color: white; border-color: var(--ok); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.btn-block { width: 100%; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.inline { display: inline-block; }
.hidden { display: none !important; }

/* === HOLD-KNAPP (samme styling som vanlig knapp - overlay erstatter intern fill) === */
.hold-btn {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.hold-btn:disabled { opacity: 0.6; cursor: wait; }

/* === HOLD-OVERLAY (på toppen av hele siden) === */
.hold-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1500;
    display: none;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.hold-overlay.active { display: block; }
.hold-overlay-bar {
    position: absolute;
    top: 30%;
    left: 5%;
    right: 5%;
    height: 14px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.3);
}
.hold-overlay-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--ok) 0%, #22c55e 100%);
    border-radius: 7px;
    transition: width linear;
}

/* === TOAST === */
.toast-container {
    position: fixed;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    max-width: 90%;
}
.toast {
    background: rgba(15, 23, 42, 0.92);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 0.95em;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    animation: toast-in 0.2s ease;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
}
.toast-error { background: rgba(220, 38, 38, 0.95); }
.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-10px); }
}

/* === FLASH === */
.flash-container { margin-bottom: 12px; }
.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow);
}
.flash-success { border-left-color: var(--ok); }
.flash-danger { border-left-color: var(--danger); }
.flash-info { border-left-color: var(--primary); }

/* === AUTH === */
.auth-page {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.auth-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}
.auth-card.wide { max-width: 560px; }
.auth-card h1 { text-align: center; margin-bottom: 4px; }
.auth-card .muted { text-align: center; margin-bottom: 16px; }
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 0.9em;
    flex-wrap: wrap;
    gap: 8px;
}
.auth-links a { color: var(--primary); text-decoration: none; }

/* === TILES === */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    min-height: 100px;
}
.tile-icon { font-size: 2em; }
.tile-body strong { display: block; margin-bottom: 2px; }
.tile-stat { font-size: 1.3em; font-weight: 600; }
.tile-stat-card {
    background: var(--surface);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.tile-stat-card strong { font-size: 1.5em; display: block; margin-top: 4px; }

/* === MEDICINES === */
.med-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.2s;
}
.med-card.is-given { opacity: 0.6; }
.med-info { flex: 1; min-width: 0; }
.med-info strong { display: block; font-size: 1.05em; }
.med-time { margin-top: 4px; font-size: 0.9em; color: var(--text-muted); }
.countdown { margin-left: 6px; font-weight: 500; color: var(--primary); }
.countdown.overdue { color: var(--danger); }
.med-actions { flex-shrink: 0; }
.status { padding: 6px 12px; border-radius: var(--radius); font-size: 0.9em; }
.status-ok { background: var(--ok-bg); color: var(--ok); }

.weekday-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 8px;
}
.weekday-check {
    padding: 8px 4px;
    text-align: center;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.85em;
    cursor: pointer;
    margin: 0;
}
.weekday-check:has(input:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.weekday-check input { display: none; }
.time-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.time-row:last-child { border-bottom: none; }

/* === KOMPAKT DAGENS-OPPSUMMERING (stomi/mat) === */
.day-summary {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    align-items: baseline;
}
.day-summary > .muted.small {
    font-weight: 500;
    flex-shrink: 0;
}
.day-summary-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: nowrap;
}
.day-summary-item small {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 500;
}
.day-summary-item strong {
    font-size: 1.1em;
    font-weight: 600;
}

/* === LOG LISTS === */
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
    min-width: 0;
}
.log-list li:last-child { border-bottom: none; }
.log-amount {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-amount-compact { font-size: 0.92em; }
.log-time {
    color: var(--text-muted);
    font-size: 0.78em;
    white-space: nowrap;
    flex-shrink: 0;
}
.kind-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    flex-shrink: 0;
    font-size: 0.95em;
}
.log-delete-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    min-height: 30px;
    font-size: 12px;
    font-weight: 600;
}

/* === PROGRESS === */
.progress {
    height: 12px;
    background: var(--surface-2);
    border-radius: 6px;
    overflow: hidden;
    margin: 4px 0;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}
.log-block { padding: 6px 0; }
.log-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.log-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}
.log-form .input { flex: 1; min-width: 100px; }
.log-form .btn { flex: 1; min-width: 140px; }
.log-form.stack { flex-direction: column; }
.log-form.stack .btn, .log-form.stack .input { flex: none; }

/* === STATS - PERIODE === */
.period-selector { margin-bottom: 16px; }
.period-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow-x: auto;
}
.period-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9em;
    min-width: 80px;
}
.period-tab.active { background: var(--primary); color: white; }
.period-custom {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}
.period-custom label { font-size: 0.85em; }
.period-custom .input { width: auto; min-width: 130px; }

/* === STATS - MED CAL === */
.med-cal {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}
.med-cal-day {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 8px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.med-cal-date {
    font-weight: 500;
    font-size: 0.9em;
}
.med-cal-date small { display: block; font-weight: normal; }
.med-cal-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.med-cal-pill {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
}
.med-cal-pill.given { background: var(--ok-bg); color: var(--ok); }
.med-cal-pill.missed { background: var(--missed-bg); color: var(--missed); }
.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
    margin-left: 8px;
}
.swatch-given { background: var(--ok-bg); }
.swatch-missed { background: var(--missed-bg); }

/* === STATS - HEATMAP === */
.heat-cal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 4px;
    margin-top: 8px;
}
.heat-cell {
    padding: 8px 6px;
    border-radius: var(--radius);
    text-align: center;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: color-mix(in srgb, var(--heat-base) calc(100% - var(--heat)), var(--heat-high) var(--heat));
}
.heat-cal-blue .heat-cell {
    background: color-mix(in srgb, var(--heat-blue-base) calc(100% - var(--heat)), var(--heat-blue-high) var(--heat));
}
.heat-cell small { font-size: 0.75em; color: var(--text-muted); }
.heat-cell strong { font-size: 1.05em; }
.heat-cell .unit { font-size: 0.7em; color: var(--text-muted); }

/* === THREAD LIST === */
.thread-list { list-style: none; padding: 0; margin: 0; }
.thread-list li { border-bottom: 1px solid var(--border); }
.thread-list li:last-child { border-bottom: none; }
.thread-list a {
    display: block;
    padding: 12px 0;
    color: var(--text);
    text-decoration: none;
}
.thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.85em;
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 999px;
    font-size: 0.8em;
    color: var(--text-muted);
}
.badge-bug { background: #fee2e2; color: #991b1b; }
.badge-feature { background: #dbeafe; color: #1e40af; }
.badge-muted { background: var(--border); }

.messages { margin: 16px 0; }
.message {
    background: var(--surface);
    padding: 12px 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    border-left: 3px solid var(--border);
}
.message-admin { border-left-color: var(--primary); background: #f0f9ff; }
@media (prefers-color-scheme: dark) { .message-admin { background: #0c4a6e33; } }
.message-mine { border-left-color: var(--ok); }
.message-head {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.message-body { line-height: 1.5; word-wrap: break-word; }

/* === TABLE === */
.table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.table th, .table td {
    text-align: left; padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th { color: var(--text-muted); font-weight: 500; font-size: 0.85em; }

.summary-list { list-style: none; padding: 0; margin: 8px 0; }
.summary-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.summary-list li:last-child { border-bottom: none; }

.empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
}
.empty p { margin-bottom: 12px; }

/* === INSTALL MODAL === */
.install-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.install-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.install-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.install-modal-content {
    position: relative;
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.2s;
}
.install-modal.active .install-modal-content {
    transform: translateY(0);
}
.install-modal h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
}
.install-modal-body p { margin: 8px 0; }
.install-modal-body ol li { margin-bottom: 10px; }

/* === RESPONSIVE === */
@media (max-width: 380px) {
    .header-nav { padding: 5px 5px; gap: 4px; }
    .header-nav-link { min-width: 50px; padding: 4px 6px; border-radius: 12px; }
    .header-nav-icon { font-size: 1.3em; }
    .header-nav-label { font-size: 0.65em; }
    .menu-btn { min-width: 42px; padding: 0 10px; }
}
@media (min-width: 640px) {
    .app-main { padding: 20px; }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .header-nav-label { font-size: 0.78em; }
}
