/* ============================================================
   DailyAI — Mobile Dark UI + Tinder Swipe
   Page: #111113 | Cards: #1e1e22 | Accent: #2dd4a0
   ============================================================ */

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

:root {
    --bg: #111113;
    --card: #1e1e22;
    --pill: #2a2a2e;
    --accent: #2dd4a0;
    --accent-red: #ef4444;
    --text: #ffffff;
    --text2: #b0b0b8;
    --text3: #7a7a85;
    --text4: #ababab;
    --font: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body, button, input, select, textarea {
    font-family: var(--font);
}

body {
    background: #0a0a0b; color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
    min-height: 100vh; min-height: 100dvh;
    letter-spacing: 0.01em;
}
.app-shell {
    max-width: 430px; margin: 0 auto; background: var(--bg);
    min-height: 100vh; min-height: 100dvh;
    position: relative; overflow-x: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed; top: 0; left: 0; z-index: 301;
    width: 280px; max-width: 80vw; height: 100vh; height: 100dvh;
    background: #18181c; overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar.show { transform: translateX(0); }
@media (min-width: 431px) {
    .sidebar { left: calc(50% - 215px); }
}

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo-wrap { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.sidebar-logo-text { font-size: 18px; font-weight: 800; display: block; }
.sidebar-logo-sub { font-size: 10px; color: var(--text3); font-weight: 500; display: block; letter-spacing: 0.03em; }
.sidebar-close {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: rgba(255,255,255,0.06); color: var(--text3);
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.sidebar-nav { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 16px; border: none; background: none;
    color: var(--text4); font-family: var(--font); font-size: 15px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); }
.sidebar-item.active { color: var(--accent); background: rgba(45,212,160,0.06); }
.sidebar-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-badge {
    margin-left: auto; font-size: 12px; font-weight: 700;
    background: rgba(45,212,160,0.15); color: var(--accent);
    padding: 2px 8px; border-radius: 10px; min-width: 24px; text-align: center;
}

.sidebar-section { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-section-title {
    font-size: 12px; font-weight: 700; color: var(--text3);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.sidebar-desc { font-size: 13px; color: var(--text4); line-height: 1.5; margin-bottom: 8px; }
.sidebar-sub-count {
    font-size: 12px; font-weight: 600; color: var(--accent);
    background: rgba(45,212,160,0.08); border: 1px solid rgba(45,212,160,0.15);
    padding: 5px 10px; border-radius: 8px; margin-bottom: 8px; text-align: center;
}
.sidebar-country-select {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
    color: var(--text); font-family: var(--font); font-size: 14px;
    outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a85' stroke-width='2.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.sidebar-country-select:focus { border-color: var(--accent); }
.sidebar-country-select option { background: #1e1e22; color: var(--text); }

.sort-group { display: flex; gap: 6px; }
.sort-option {
    flex: 1; padding: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
    background: none; color: var(--text4); font-family: var(--font);
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.sort-option:hover { border-color: rgba(255,255,255,0.15); }
.sort-option.active { background: rgba(45,212,160,0.1); border-color: var(--accent); color: var(--accent); }

.sidebar-subscribe { display: flex; flex-direction: column; gap: 8px; }
.sidebar-action-btn {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(45,212,160,0.35);
    background: rgba(45,212,160,0.09);
    color: var(--accent);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.sidebar-action-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}
.sidebar-email {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
    color: var(--text); font-family: var(--font); font-size: 14px; outline: none;
}
.sidebar-email:focus { border-color: var(--accent); }
.sidebar-email::placeholder { color: var(--text3); }
.sidebar-sub-btn {
    padding: 10px; border-radius: 10px; border: none;
    background: var(--accent); color: #000; font-family: var(--font);
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.sidebar-sub-btn:active { transform: scale(0.97); }
.sidebar-sub-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sidebar-note { font-size: 12px; color: var(--accent); margin-top: 4px; }

.sidebar-footer {
    margin-top: auto; padding: 16px;
    font-size: 12px; color: var(--text3); line-height: 1.5;
}
.sidebar-streak { margin-top: 4px; color: var(--accent); font-weight: 600; }

/* ========== TOP BAR ========== */
.top-bar {
    position: sticky; top: 0; z-index: 50;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    display: flex; align-items: center; justify-content: space-between;
    padding-left: 14px; padding-right: 14px; background: var(--bg);
}
.top-bar-center { text-align: center; }
.top-bar-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1.2; }
.top-bar-country { font-size: 11px; color: var(--text3); font-weight: 500; }
.top-bar-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text); cursor: pointer;
    border-radius: 50%; transition: background 0.15s;
}
.top-bar-btn:active { background: rgba(255,255,255,0.06); }
.top-bar-btn.has-saved svg { fill: var(--accent); stroke: var(--accent); }
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.mode-toggle {
    height: 28px; padding: 0 10px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12); background: none;
    color: var(--text3); font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    font-family: var(--font);
}
.mode-toggle:active { transform: scale(0.95); }
.mode-toggle.active { background: rgba(45,212,160,0.1); border-color: var(--accent); color: var(--accent); }

/* ========== FILTER TABS ========== */
.filter-tabs {
    position: sticky; top: 52px; z-index: 49;
    background: var(--bg); padding: 0 0 12px 0;
}
.filter-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding: 0 16px;
    scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-pill {
    height: 32px; padding: 0 14px; border-radius: 999px; border: none;
    font-family: var(--font); font-size: 14px; cursor: pointer;
    white-space: nowrap; flex-shrink: 0; transition: all 0.2s ease;
    background: var(--pill); color: var(--text4); font-weight: 400;
}
.filter-pill.active { background: var(--accent); color: #000; font-weight: 600; }
.filter-pill:active { transform: scale(0.95); }

/* ========== SWIPE CONTAINER (Tinder) ========== */
.swipe-container {
    position: relative; z-index: 10;
    height: calc(100vh - 96px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; padding: 8px 0 0;
    overflow: hidden;
}
.swipe-stack {
    position: relative; width: 100%; flex: 1;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 0 12px;
}

/* ========== SCROLL FEED (InShorts mode) ========== */
.scroll-feed {
    height: calc(100vh - 96px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
    overflow-y: auto; scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 0 12px;
}
.scroll-feed::-webkit-scrollbar { display: none; }
.scroll-card {
    scroll-snap-align: start;
    min-height: clamp(280px, 46vh, 420px);
    background: var(--card); border-radius: 18px;
    overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin-bottom: 14px; display: flex; flex-direction: column;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.scroll-card .card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.scroll-card .card-summary { -webkit-line-clamp: 13; margin-bottom: 12px; }
.scroll-card .card-footer { margin-top: auto; }
.scroll-card .card-headline { -webkit-line-clamp: 3; }

/* Individual swipe card */
.swipe-card {
    position: absolute; width: calc(100% - 24px);
    min-height: clamp(340px, 62vh, 560px);
    background: var(--card); border-radius: 18px;
    overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    cursor: grab; user-select: none; touch-action: pan-y;
    will-change: transform;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.swipe-card:active { cursor: grabbing; }
.swipe-card.animating {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

/* Stacked behind cards */
.swipe-card:nth-child(2) { transform: scale(0.94) translateY(30px); opacity: 0.82; z-index: 1; }
.swipe-card:nth-child(3) { transform: scale(0.88) translateY(56px); opacity: 0.45; z-index: 0; }
.swipe-card:nth-child(n+4) { transform: scale(0.85) translateY(30px); opacity: 0; z-index: -1; pointer-events: none; }
.swipe-card:first-child { z-index: 5; }

/* Swipe overlay labels */
.swipe-label {
    position: absolute; top: 20px; padding: 8px 16px;
    border-radius: 10px; font-size: 16px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.06em;
    pointer-events: none; opacity: 0; transition: opacity 0.15s;
    z-index: 10;
}
.swipe-label-save { right: 20px; border: 3px solid var(--accent); color: var(--accent); }
.swipe-label-skip { left: 20px; border: 3px solid var(--accent-red); color: var(--accent-red); }

/* Card image */
.card-image { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-image-placeholder {
    width: 100%; height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

/* Card content */
.card-body { padding: 14px; }
.card-headline {
    font-size: 18px; font-weight: 700; color: var(--text);
    line-height: 1.3; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
    font-size: 14px; font-weight: 400; color: var(--text2);
    line-height: 1.5; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-why {
    background: rgba(45, 212, 160, 0.08); border-left: 3px solid var(--accent);
    padding: 8px 10px; border-radius: 0 8px 8px 0; margin-bottom: 10px;
    font-size: 12px; color: var(--accent); font-style: italic; line-height: 1.4;
}
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-source { display: flex; align-items: center; gap: 8px; }
.card-source-left { display: flex; align-items: center; gap: 8px; }
.card-source-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; }
.card-source-name { font-size: 13px; font-weight: 500; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.card-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
    line-height: 1.25;
}
.card-time-relative { font-size: 12px; color: var(--text3); }
.card-time-exact { font-size: 10px; color: #90909c; max-width: 145px; }

/* Swipe hints */
.swipe-hints {
    position: absolute;
    bottom: calc(85px + env(safe-area-inset-bottom, 0px)); width: 100%;
    display: flex; justify-content: space-between;
    padding: 0 40px; pointer-events: none; z-index: 10;
}
.hint-left { color: #ef4444; font-size: 12px; font-weight: 600; opacity: 0.8; }
.hint-right { color: var(--accent); font-size: 12px; font-weight: 600; opacity: 0.8; }

/* Empty state */
.swipe-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 8px; padding: 40px 20px; text-align: center;
}
.empty-emoji { font-size: 48px; }
.empty-title { font-size: 18px; font-weight: 700; }
.empty-sub { font-size: 14px; color: var(--text3); }
.reload-btn {
    margin-top: 12px; height: 36px; padding: 0 20px; border-radius: 999px;
    border: 1px solid var(--accent); background: none; color: var(--accent);
    font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
}
.reload-btn:active { transform: scale(0.95); }

/* ========== LIST FEED (Saved articles) ========== */
.feed { padding: 8px 0 20px; }
.feed-card {
    width: calc(100% - 24px); margin: 0 12px 14px;
    background: var(--card); border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    animation: cardIn 0.3s ease both;
}
.feed-card:active { transform: scale(0.98); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.feed-card .card-body { padding: 14px; }

/* ========== BOTTOM SHEET ========== */
.sheet-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.55);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sheet-backdrop.show { opacity: 1; visibility: visible; }
.sheet-backdrop.focused {
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.bottom-sheet {
    position: fixed; bottom: 0; left: 50%; z-index: 201;
    width: 100%; max-width: 430px;
    transform: translateX(-50%) translateY(100%);
    background: var(--card); border-radius: 20px 20px 0 0;
    max-height: 85vh;
    transition: transform 0.3s ease;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.bottom-sheet.show { transform: translateX(-50%) translateY(0); }
.bottom-sheet.expanded {
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
}
.bottom-sheet.expanded .sheet-content {
    height: 100%;
    padding: 0;
}
.sheet-handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: #3a3a40; margin: 10px auto 0;
}
.sheet-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 18px 14px;
}
.sheet-headline-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.sheet-headline { font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--text); margin-bottom: 0; }
.sheet-summary { font-size: 15px; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.sheet-brief { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 14px; white-space: pre-line; }
.sheet-brief-wrap {
    flex: 1;
    min-height: 160px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 14px;
}
.bottom-sheet.expanded .sheet-brief-wrap {
    min-height: 0;
    max-height: none;
    flex: 1;
    height: 100%;
    margin: 0;
    padding: calc(54px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.bottom-sheet.expanded .sheet-handle,
.bottom-sheet.expanded .sheet-summary,
.bottom-sheet.expanded .sheet-why,
.bottom-sheet.expanded .sheet-meta,
.bottom-sheet.expanded .sheet-actions {
    display: none;
}
.bottom-sheet.expanded .sheet-headline {
    display: none;
}
.bottom-sheet.expanded .sheet-headline-row {
    position: absolute;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 10px;
    left: auto;
    margin: 0;
    z-index: 6;
    pointer-events: none;
}
.bottom-sheet.expanded .sheet-expand-inline {
    pointer-events: auto;
    background: rgba(0,0,0,0.45);
    border-color: rgba(255,255,255,0.25);
}
.sheet-brief-wrap::-webkit-scrollbar { width: 8px; }
.sheet-brief-wrap::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}
.sheet-brief-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(45,212,160,0.85), rgba(45,212,160,0.45));
    border-radius: 10px;
}
.sheet-brief-wrap { scrollbar-width: thin; scrollbar-color: rgba(45,212,160,0.85) rgba(255,255,255,0.06); }
.sheet-brief-loading {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 2px 10px;
}
.sheet-brief-loading .line {
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, #23242a 25%, #2c2d35 50%, #23242a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
}
.sheet-brief-loading .line.w95 { width: 95%; }
.sheet-brief-loading .line.w88 { width: 88%; }
.sheet-brief-loading .line.w90 { width: 90%; }
.sheet-brief-loading .line.w80 { width: 80%; }
.sheet-brief-loading .line.w92 { width: 92%; }
.sheet-why {
    background: rgba(45, 212, 160, 0.08); border-left: 3px solid var(--accent);
    padding: 10px 12px; border-radius: 0 10px 10px 0; margin-bottom: 14px;
    font-size: 13px; color: var(--accent); font-style: italic; line-height: 1.5;
}
.sheet-meta { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.sheet-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(30,30,34,0.96), rgba(30,30,34,1));
}
.sheet-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 24px; border-radius: 12px;
    background: var(--accent); color: #000;
    font-size: 15px; font-weight: 700; text-decoration: none;
}
.sheet-link:active { transform: scale(0.97); }
.sheet-expand-btn {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.14);
    width: 48px;
    min-width: 48px;
    justify-content: center;
    padding: 0;
}
.sheet-expand-inline {
    height: 36px;
    width: 36px;
    min-width: 36px;
    border-radius: 9px;
}
.sheet-expand-icon {
    font-size: 20px;
    line-height: 1;
}
.focus-mode #topBar,
.focus-mode #filterTabs,
.focus-mode #swipeContainer,
.focus-mode #scrollFeed,
.focus-mode #feed {
    filter: blur(3px);
    transform: scale(0.995);
}
.save-feedback {
    width: 100%;
    margin-top: 2px;
    font-size: 12px;
    color: var(--accent);
}

/* ========== TOAST ========== */
.toast {
    position: fixed; bottom: 80px; left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--card); color: var(--text);
    padding: 12px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 400; pointer-events: none;
    opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ========== GENERIC MODAL ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 450;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.modal-backdrop.show {
    animation: fadeIn 0.2s ease-out;
}
.modal-card {
    width: min(100%, 360px);
    background: linear-gradient(180deg, #1f2024, #17181c);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
    transform: translateY(10px) scale(0.98);
    opacity: 0;
}
.modal-backdrop.show .modal-card {
    animation: modalPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.modal-body {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.5;
    margin-bottom: 14px;
}
.modal-actions {
    display: flex;
    gap: 10px;
}
.modal-list {
    margin: 0 0 14px;
    padding-left: 18px;
    color: var(--text2);
    font-size: 13px;
    line-height: 1.5;
}
.modal-list li {
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(4px);
    animation: listItemIn 0.3s ease forwards;
}
@keyframes modalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes listItemIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    border: none;
}
.modal-btn-primary {
    background: var(--accent);
    color: #000;
}
.modal-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text2);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ===== STREAK BADGE ===== */
.streak-badge {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,0.06); border: 1px solid var(--accent);
    color: #fff; font-size: 11px; font-weight: 600;
    padding: 8px 16px; border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: none; z-index: 400;
    opacity: 0; transition: opacity 0.5s ease;
    animation: badgeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.5s;
}
.streak-badge.visible { opacity: 1; }
.streak-badge.fade-out { opacity: 0; transition: opacity 1s ease; }
@keyframes badgeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ========== GLOBAL LOADER ========== */
.boot-loader {
    position: fixed;
    inset: 0;
    z-index: 650;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.14), transparent 44%),
                radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.12), transparent 42%),
                rgba(10, 10, 13, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.boot-loader.visible {
    display: flex;
}

.boot-loader-spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--accent);
    animation: bootSpin 0.8s linear infinite;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
}

.boot-loader-text {
    color: var(--text2);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

@keyframes bootSpin {
    to { transform: rotate(360deg); }
}

/* ========== SKELETON ========== */
.skeleton-card {
    width: calc(100% - 24px); margin: 0 auto;
    background: var(--card); border-radius: 18px; overflow: hidden;
}
.skeleton-image {
    width: 100%; height: 200px;
    background: linear-gradient(90deg, #1e1e22 25%, #2a2a30 50%, #1e1e22 75%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skeleton-body { padding: 14px; }
.skeleton-line {
    height: 14px; border-radius: 6px; margin-bottom: 10px;
    background: linear-gradient(90deg, #1e1e22 25%, #2a2a30 50%, #1e1e22 75%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; height: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== SCROLLBAR ========== */
.feed::-webkit-scrollbar { display: none; }
.feed { scrollbar-width: none; }

/* ========== ONBOARDING OVERLAY ========== */
.onboarding-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.85);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 20px; padding: 24px; text-align: center;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.onboarding-overlay.hide {
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.onboard-hand {
    font-size: 42px;
    margin-bottom: 6px;
    animation: swipeHand 2s ease-in-out infinite;
}
@keyframes swipeHand {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-40px) rotate(-10deg); }
    50% { transform: translateX(0) rotate(0); }
    75% { transform: translateX(40px) rotate(10deg); }
}
.onboard-panel {
    width: min(100%, 360px);
    background: linear-gradient(180deg, rgba(26,26,30,0.96), rgba(20,20,24,0.98));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 18px 16px 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}
.onboard-title { font-size: 22px; font-weight: 800; color: #fff; }
.onboard-desc { font-size: 14px; color: var(--text2); line-height: 1.5; margin-top: 6px; }
.onboard-feature-list {
    margin: 14px 0 8px;
    padding: 0;
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.onboard-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text2);
    line-height: 1.45;
}
.onboard-feature-icon {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
}
.onboard-cache-note {
    margin: 4px 0 12px;
    font-size: 12px;
    color: var(--accent);
}
.onboard-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.onboard-btn {
    padding: 14px; border-radius: 14px; border: none;
    font-family: var(--font); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: transform 0.15s;
}
.onboard-btn:active { transform: scale(0.96); }
.onboard-btn-primary { background: var(--accent); color: #000; }
.onboard-btn-secondary { background: rgba(255,255,255,0.08); color: var(--text2); }

/* ========== DESKTOP ========== */
@media (min-width: 431px) {
    body { background: #0a0a0b; }
    .app-shell {
        box-shadow: 0 0 80px rgba(0,0,0,0.5);
        border-left: 1px solid #1a1a1e; border-right: 1px solid #1a1a1e;
    }
}
