/* ============================================================
   HANGWALL - NIGHT-FRIENDLY OBSIDIAN & GOLD THEME
   ============================================================ */

:root {
    /* Night Mode (Default) - Dark Slate / Midnight Charcoal */
    --bg-dark: #090D16;         /* Deepest Midnight Base */
    --bg-card: #131B2A;         /* Rich Dark Obsidian Card Surface */
    --bg-glass: rgba(13, 19, 32, 0.94);
    --border-glass: #263346;    /* Soft Muted Dark Slate Border */
    
    --primary: #F97316;         /* Vibrant Copper Amber Glow */
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.25);
    
    --accent-navy: #38bdf8;      /* Sky Blue Accent */
    --accent-bronze: #f97316;    /* Warm Copper Amber */
    --accent-amber: #fb923c;     /* Amber Glow */
    --accent-sage: #34d399;      /* Emerald Sage */
    --accent-sky: #38bdf8;       /* Sky Blue */
    
    --text-main: #F1F5F9;       /* High-Contrast Crisp Off-White */
    --text-muted: #94A3B8;      /* Muted Soft Metallic Grey */
    --text-dim: #64748B;        /* Slate Dimmed Text */
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Light Theme Mode Overrides */
[data-theme="light"] {
    --bg-dark: #f4efe9;         /* Main Warm Sand Beige Background */
    --bg-card: #ffffff;         /* Crisp Warm White Cards */
    --bg-glass: rgba(244, 239, 233, 0.94);
    --border-glass: #e2d7c9;    /* Soft Beige Border */
    
    --primary: #9A4C1C;         /* Warm Copper Ore */
    --primary-hover: #7a3b15;
    --primary-glow: rgba(154, 76, 28, 0.15);
    
    --accent-navy: #1E293B;      /* Midnight Navy Blue */
    --accent-bronze: #9A4C1C;    /* Warm Copper */
    --accent-amber: #c2410c;     /* Deep Amber */
    --accent-sage: #047857;      /* Soft Forest Sage */
    --accent-sky: #1E293B;       /* Midnight Navy */
    
    --text-main: #2b1a0e;       /* Dark Espresso Charcoal */
    --text-muted: #6b5748;      /* Soft Warm Brownish Grey */
    --text-dim: #8c7868;        /* Muted Warm Grey */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #05080e;
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
}

#app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: var(--app-height, 100dvh);
    height: 100dvh;
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    background-color: var(--bg-dark);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* ============================================================
   BOTTOM NAVIGATION BAR (Replaces Top Ribbon)
   ============================================================ */
.bottom-navbar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    min-height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    z-index: 1000;
    width: 100%;
    flex-shrink: 0;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .bottom-navbar {
    background: #f7f4f0;
    border-top: 1px solid #e8e2d8;
    box-shadow: 0 -2px 10px rgba(70, 45, 25, 0.06);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px 0 4px 0;
    transition: color 0.16s ease, transform 0.12s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

[data-theme="light"] .bottom-nav-item {
    color: #6b635b;
}

.bottom-nav-item:hover {
    color: var(--text-main);
}

[data-theme="light"] .bottom-nav-item:hover {
    color: #1a1612;
}

/* Active Bottom Nav Item (matches reference: warm terracotta/amber) */
.bottom-nav-item.active {
    color: var(--primary) !important;
}

.bottom-nav-item.active .bottom-nav-label {
    font-weight: 700;
    color: var(--primary) !important;
}

.bottom-nav-item.active .bottom-nav-icon-wrap i,
.bottom-nav-item.active .bottom-nav-icon-wrap svg {
    color: var(--primary) !important;
    fill: var(--primary) !important;
}

/* Subtle tap pulse */
.bottom-nav-item:active,
.bottom-nav-item.btn-pressed {
    transform: scale(0.92);
}

.bottom-nav-icon-wrap {
    position: relative;
    font-size: 1.18rem;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bottom-nav-icon-wrap svg {
    width: 20px;
    height: 20px;
}

.bottom-nav-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1;
    transition: color 0.16s ease;
}

/* Circular Initials Avatar for Logged In User */
.user-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* Active filter indicator badge */
#active-filter-badge {
    position: absolute;
    top: -2px;
    right: -7px;
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary-glow);
}

#bookmark-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   PAGE NAVIGATOR BAR
   ============================================================ */
#page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #eae2d6;
    border-bottom: 1px solid var(--border-glass);
    z-index: 90;
}

.page-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

#page-chips {
    display: flex;
    gap: 6px;
}

.page-chip {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.page-chip:hover, .page-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ============================================================
   DRAWERS (Search & Filter)
   ============================================================ */
.drawer {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-glass);
    padding: 16px;
    z-index: 95;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hidden {
    display: none !important;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    gap: 10px;
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 0.9rem;
}

#btn-clear-search {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Filter Drawer - Full Page Screen Overlay */
#filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg-card);
    z-index: 2000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: 16px 20px 12px 20px;
    animation: fadeInFull 0.2s ease-out;
    overflow: hidden;
}

@keyframes fadeInFull {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--primary);
}

#btn-close-filter, #btn-close-share {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
}

.filter-sections {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
}

.filter-group {
    margin-bottom: 2px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 700;
}

.drawer-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-glass);
    flex-shrink: 0;
    background: var(--bg-card);
    z-index: 10;
}

.drawer-actions .btn-secondary,
.drawer-actions .btn-primary {
    height: 42px;
    font-size: 0.88rem;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px var(--primary-glow);
    transition: background 0.2s ease;
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    flex: 1;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover { background: var(--primary-hover); }

/* ============================================================
   SWIPER CONTAINER & BEIGE CARDS
   ============================================================ */
#main-feed-screen {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

#swiper-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 6px 12px;
    gap: 24px;
}

#swiper-container::-webkit-scrollbar {
    display: none;
}

/* Floating Navigation Arrows (Left & Right) */
.peek-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 60;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .peek-nav-btn:hover {
        transform: translateY(-50%) scale(1.08);
        border-color: rgba(249, 115, 22, 0.55);
        color: #ffffff;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    }
}

.peek-nav-btn:active,
.peek-nav-btn.arrow-clicked {
    background: #ea580c !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.18) !important;
    box-shadow: 0 0 16px rgba(234, 88, 12, 0.85), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.peek-nav-prev {
    left: 8px;
}

.peek-nav-next {
    right: 8px;
}

[data-theme="light"] .peek-nav-btn {
    background: rgba(154, 76, 28, 0.14);
    border: 1px solid rgba(154, 76, 28, 0.28);
    color: #9a4c1c;
    box-shadow: 0 2px 8px rgba(70, 45, 25, 0.08);
}

@media (hover: hover) and (pointer: fine) {
    [data-theme="light"] .peek-nav-btn:hover {
        transform: translateY(-50%) scale(1.08);
        border-color: rgba(154, 76, 28, 0.45);
        color: #9a4c1c;
        box-shadow: 0 3px 10px rgba(70, 45, 25, 0.12);
    }
}

[data-theme="light"] .peek-nav-btn:active,
[data-theme="light"] .peek-nav-btn.arrow-clicked {
    background: #9a4c1c !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.18) !important;
    box-shadow: 0 0 16px rgba(154, 76, 28, 0.70), 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

/* Loading Spinner */
#loading-spinner {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(92, 58, 33, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Single Inshorts Card - Clean Centered 100% Full Width Frame */
.news-card {
    height: calc(100% - 2px);
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 24px rgba(70, 45, 25, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 0;
}

.card-header-wrapper {
    position: relative;
    width: 100%;
    height: 110px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.15) 100%);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
}

[data-theme="light"] .card-header-wrapper {
    background: linear-gradient(180deg, #ffffff 0%, #f7f3ed 100%);
}

.card-header-image {
    max-width: 88%;
    max-height: 75px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    align-self: center;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.25));
    transition: transform 0.2s ease;
}

.card-header-monogram {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-dark);
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 2.5px solid var(--primary);
}

.card-company-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    line-height: 1.2;
}

.card-company-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 0 !important;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

.company-price-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 5px;
    letter-spacing: 0.2px;
    line-height: 1.2;
    transform: translateY(-0.5px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.company-price-pill:hover {
    transform: translateY(-1px);
}

.company-price-pill.price-up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.company-price-pill.price-down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.company-price-pill.price-flat {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.card-body {
    flex: 1;
    min-height: 0;
    margin-top: -12px;
    border-radius: 14px 14px 0 0;
    background: var(--bg-card);
    position: relative;
    z-index: 5;
    padding: 14px 18px 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden !important;
}

.card-body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.card-top-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 4px;
}

.card-headline {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.32;
    color: var(--text-main);
    margin-bottom: 8px;
    display: block;
    overflow: visible;
    word-wrap: break-word;
    flex-shrink: 0;
}

.card-summary {
    font-size: 0.96rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 4px;
    word-wrap: break-word;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.card-summary::-webkit-scrollbar {
    display: none;
    width: 0;
}

[data-theme="light"] .card-summary {
    color: var(--text-muted);
}

/* Multi-line Bullet Points with Clean Hanging Indent */
.summary-bullet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-bullet-item {
    position: relative;
    padding-left: 1.25rem;
    margin: 0;
    line-height: 1.48;
    color: var(--text-muted);
    font-size: 0.95rem;
    word-wrap: break-word;
    text-align: left;
}

.summary-bullet-item::before {
    content: "•";
    position: absolute;
    left: 0.2rem;
    top: -0.05rem;
    color: var(--primary);
    font-size: 1.15rem;
    line-height: 1.48;
}

[data-theme="light"] .summary-bullet-item {
    color: var(--text-muted);
}

.modal-content .summary-bullet-item {
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.5;
}

.summary-paragraph {
    margin: 0;
    line-height: 1.5;
    color: var(--text-muted);
    white-space: pre-line;
}

.modal-content .summary-paragraph {
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.5;
}

.card-bottom-content {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 4px;
}

/* Multi-Tag Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.tag-pill i {
    color: inherit;
}

.tag-pill:empty {
    display: none !important;
}

.tag-pill.commodity,
.tag-pill.category,
.tag-pill.location,
.tag-pill.marketcap {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .tag-pill,
[data-theme="light"] .tag-pill.commodity,
[data-theme="light"] .tag-pill.category,
[data-theme="light"] .tag-pill.location,
[data-theme="light"] .tag-pill.marketcap {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.tag-pill.price-sensitive {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-weight: 800;
}

/* Card Feedback Thumbs Up / Down Row (Centered above time & source) */
.card-feedback-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.feedback-prompt-label {
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.btn-feedback {
    background: rgba(92, 58, 33, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 18px;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-feedback:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.btn-thumbs-up.active {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-thumbs-down.active {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.card-meta-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.card-counter-inline {
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--text-dim);
    line-height: 1.25;
}



/* Card Action Bar */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-glass);
}

.btn-read-full {
    flex: 1 1 auto;
    background: rgba(92, 58, 33, 0.08);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-read-full:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-select-all-chips, .btn-select-all-filter {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-all-chips:hover, .btn-select-all-filter:hover {
    background: var(--primary);
    color: #ffffff;
}

.filter-label-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.filter-label-header label {
    margin-bottom: 0 !important;
}

.nav-instruction-banner {
    background: rgba(249, 115, 22, 0.08);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.nav-instruction-banner i {
    color: var(--primary);
    font-size: 1rem;
}

.btn-icon-action {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-icon-action.bookmarked {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.btn-icon-action:not(.bookmarked) {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
}

.btn-icon-action:focus:not(.bookmarked) {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    outline: none;
}

@media (hover: hover) {
    .btn-icon-action:not(.bookmarked):hover {
        background: rgba(154, 76, 28, 0.08);
        color: var(--primary);
        border-color: var(--primary);
    }
}

/* ============================================================
   TOP NAVBAR CARD COUNTER BADGE
   ============================================================ */
#card-counter {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(154, 76, 28, 0.08);
    border: 1px solid rgba(154, 76, 28, 0.2);
    border-radius: 12px;
    padding: 3px 9px;
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.3px;
    margin-right: 2px;
}

#floating-controls {
    display: none !important;
}

/* ============================================================
   MODALS (Reader & Share)
   ============================================================ */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 20, 10, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 85vh;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 20px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

#btn-close-modal {
    position: absolute;
    top: 16px;
    right: 18px;
    background: var(--bg-dark);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
}

#modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-right: 36px;
    margin-bottom: 8px;
}

.modal-date-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

#modal-body hr {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin-bottom: 14px;
}

#modal-html-content {
    flex: 1;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-main);
    padding-right: 6px;
}

#modal-html-content p {
    margin-bottom: 12px;
}

.modal-footer {
    display: flex;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-glass);
}

/* Share Modal Drawer */
.share-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    animation: slideUp 0.25s ease-out;
}

.share-headline-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: var(--bg-dark);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease;
}

.share-btn:active {
    transform: scale(0.97);
}

.share-btn.whatsapp { background: #25D366; color: #000; }
.share-btn.teams { background: #6264A7; color: #fff; }
.share-btn.linkedin { background: #0A66C2; color: #fff; }
.share-btn.twitter { background: #14171A; color: #fff; }
.share-btn.copy { background: var(--bg-dark); color: var(--text-main); border: 1px solid var(--border-glass); grid-column: span 2; }

/* Toast */
.toast {
    position: absolute;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   AUTH & PREFERENCES MODALS
   ============================================================ */
.auth-modal-content, .prefs-modal-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 28px 24px 32px 24px;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s ease-out;
    border: 1px solid var(--border-glass);
}

.btn-modal-close, .modal-close-btn {
    position: absolute;
    top: 18px; right: 18px;
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.15));
    color: var(--text-main);
    width: 34px; height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 20;
    transition: all 0.2s ease;
}

.btn-modal-close:hover, .modal-close-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-icon-circle {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #fbf0e4;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 12px auto;
    box-shadow: 0 4px 12px rgba(140, 83, 43, 0.15);
}

.auth-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

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

.auth-form label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: var(--bg-dark);
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border 0.2s ease;
}

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

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.auth-secondary-actions {
    text-align: center;
    margin-top: 14px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dev-banner {
    background: #1e1b18;
    color: #ffd6a5;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #4a3424;
}

.dev-banner i {
    font-size: 1.3rem;
    color: #ff9f1c;
}

.chip-group-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.chip-toggle {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-toggle:hover {
    background: #f4efe8;
    color: var(--text-main);
}

.chip-toggle.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(140, 83, 43, 0.25);
}

.account-type-badge {
    display: inline-block;
    background: #fdf3e7;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 6px;
    border: 1px solid #f5dfca;
}

/* Story-Style Tap Navigation Ripple Effect */
.tap-navigation-ripple {
    position: fixed;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(140, 83, 43, 0.32);
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.6);
    animation: tapRippleAnim 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 9999;
}

.tap-navigation-ripple.right {
    background: rgba(140, 83, 43, 0.35);
}

.tap-navigation-ripple.left {
    background: rgba(80, 80, 80, 0.35);
}

@keyframes tapRippleAnim {
    0% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.4);
    }
}

/* ============================================================
   CAUGHT UP / READ COMPLETION CARD STYLES
   ============================================================ */
.caught-up-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 36px 24px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .caught-up-card {
    background: #ffffff !important;
    color: #2b1a0e !important;
}

.caught-up-icon-wrapper {
    margin-bottom: 18px;
}

.caught-up-badge-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
    animation: popBadge 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBadge {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.caught-up-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main) !important;
    margin-bottom: 10px;
}

.caught-up-desc {
    font-size: 0.9rem;
    color: var(--text-muted) !important;
    max-width: 320px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.btn-reset-history {
    flex: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 24px !important;
    height: 44px !important;
    max-width: 260px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 22px !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3) !important;
    transition: all 0.2s ease !important;
    margin: 0 auto !important;
}

.btn-reset-history:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(140, 83, 43, 0.35) !important;
}

/* ============================================================
   APP SCREENS LAYOUT & SWITCHER
   ============================================================ */
.app-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    position: relative;
    opacity: 1;
    transition: opacity 0.25s ease-in-out;
}

.app-screen.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   SCREEN 1: APP OPENING PAGE (SPLASH SCREEN)
   ============================================================ */
#opening-splash-screen {
    background: linear-gradient(180deg, rgba(9, 13, 22, 0.68) 0%, rgba(9, 13, 22, 0.86) 100%), url('mining_background.jpg') center/cover no-repeat;
    height: 100vh;
    height: 100dvh;
    min-height: 100%;
    overflow-y: auto;
    padding: 24px 20px 32px 20px;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] #opening-splash-screen {
    background: linear-gradient(rgba(244, 239, 233, 0.85), rgba(244, 239, 233, 0.94)), url('mining_background.jpg') center/cover no-repeat;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 440px;
    width: 100%;
    margin: auto 0;
}

/* Official Hangwall Brand Logo Hero */
.splash-logo-hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
}

.splash-brand-svg-logo {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 4px 12px rgba(249, 115, 22, 0.4));
    transition: transform 0.3s ease;
}

.splash-brand-svg-logo:hover {
    transform: scale(1.08);
}

.splash-logo-glow {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px var(--primary-glow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.splash-logo-glow:hover {
    transform: scale(1.08);
    box-shadow: 0 0 45px rgba(249, 115, 22, 0.4);
}

.splash-hero-svg {
    width: 54px;
    height: 54px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.splash-hero-brand-text {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    margin-top: 4px;
}

.splash-hero-brand-text .draw-blue,
.splash-hero-brand-text .hang-blue {
    color: var(--accent-sky);
}

.splash-hero-brand-text .highlight {
    color: var(--primary);
}

.splash-tag-sub {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.splash-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 12px;
}

.splash-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 24px;
    padding: 0 8px;
}

.splash-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 28px;
}

.feature-chip {
    background: rgba(23, 28, 38, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.feature-chip i {
    color: var(--primary);
    font-size: 0.95rem;
}

.splash-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.btn-hero {
    height: 52px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.splash-footer-note {
    font-size: 0.78rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.splash-footer-note i {
    color: var(--primary);
}

/* ============================================================
   SCREEN 2: DEDICATED PREFERENCES PAGE
   ============================================================ */
#dedicated-preferences-screen {
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    overflow: hidden;
    position: relative;
}

.prefs-sticky-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    margin: 0;
    z-index: 500;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.screen-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
}

.screen-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-icon-nav {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
}

.btn-icon-nav:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-text-nav {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.prefs-screen-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.prefs-lead-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.pref-card-group {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pref-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pref-group-header i {
    color: var(--primary);
    font-size: 1.1rem;
}

.pref-group-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.pref-group-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: -6px;
}

/* Chip Group Multi Selection */
.chip-group-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chip-toggle {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="light"] .chip-toggle {
    background: rgba(0, 0, 0, 0.04);
}

.chip-toggle:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.chip-toggle.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Setting Rows */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-glass);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 65%;
}

.setting-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.setting-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.setting-select {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.btn-setting-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-setting-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-setting-danger:hover {
    background: rgba(239, 68, 68, 0.22);
}

.btn-lg {
    height: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
}

/* Floating Sticky Search Drawer */
#search-drawer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 14px;
    z-index: 1001;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Mobile Screen Optimization (< 600px) */
@media (max-width: 600px) {
    .bottom-navbar {
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        min-height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav-label {
        font-size: 0.64rem;
    }

    .bottom-nav-icon-wrap {
        font-size: 1.12rem;
    }

    .card-header-wrapper {
        height: 115px;
        padding: 12px 18px;
    }

    .card-header-image {
        max-height: 82px;
    }

    .card-header-monogram {
        width: 66px;
        height: 66px;
        font-size: 1.55rem;
    }

    .card-body {
        padding: 14px 15px 12px 15px;
    }

    .card-company-name {
        font-size: 1.05rem;
        margin-bottom: 0;
    }

    .tag-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .card-headline {
        font-size: 1.08rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .card-summary {
        font-size: 0.95rem;
        line-height: 1.48;
    }

    .summary-bullet-item {
        font-size: 0.92rem;
        line-height: 1.42;
        padding-left: 1.15rem;
    }

    .summary-bullet-list {
        gap: 5px;
    }
}



/* ============================================================
   PWA Install Banner & iOS Install Guide Modal
   ============================================================ */

.pwa-install-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 12px;
    right: 12px;
    max-width: 480px;
    margin: 0 auto;
    z-index: 9999;
    background: rgba(28, 24, 20, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(243, 112, 33, 0.15);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: pwaBannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes pwaBannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pwa-banner-app-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.pwa-banner-details {
    min-width: 0;
    flex: 1;
}

.pwa-banner-app-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.94rem;
    color: #FFFFFF !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.pwa-banner-tagline {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-pwa-install {
    background: #F37021;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.35);
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-pwa-install:hover,
.btn-pwa-install:active {
    background: #d85c12;
    transform: scale(0.98);
}

.btn-pwa-dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: none;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.btn-pwa-dismiss:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* iOS PWA Install Bottom Sheet Modal */
.ios-install-content {
    max-width: 420px;
    padding: 20px;
    border-radius: 20px;
    background: var(--bg-card, #25201b);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ios-install-app-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 16px;
}

.ios-preview-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.ios-preview-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main, #ffffff);
}

.ios-preview-sub {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
}

.ios-install-intro {
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 14px;
    line-height: 1.4;
}

.ios-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ios-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-main, #ffffff);
    line-height: 1.4;
}

.ios-step-number {
    width: 24px;
    height: 24px;
    background: #F37021;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.ios-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #F37021;
    font-size: 0.85rem;
    vertical-align: middle;
    margin: 0 4px;
}
