:root {
    --primary: #2563eb;
    --primary-light: #eaf2ff;
    --primary-dark: #1d4ed8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #f1f5f9;
    --border-subtle: #e2e8f0;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --orange: #f97316;
    --orange-bg: #fff7ed;
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.dark-mode {
    --bg-main: #0b1120;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-subtle: #475569;
    --primary-light: rgba(37, 99, 235, 0.2);
}

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

body {
    font-family: var(--font);
    background-color: #e2e8f0;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

/* Mobile Frame Simulation */
.mobile-frame {
    width: 100%;
    max-width: 430px;
    height: 900px;
    max-height: 94vh;
    background-color: var(--bg-main);
    border-radius: 40px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25), 0 0 0 10px #1e293b;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    body {
        padding: 0;
        background-color: var(--bg-main);
    }
    .mobile-frame {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 20;
    background-color: transparent;
}

.status-bar-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* App Header */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    position: relative;
}

.screen-header .back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
}

.screen-header .screen-title {
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.screen-header .header-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 18px;
    padding: 6px;
}

/* Main Scrollable View Area */
.app-view-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 18px 80px;
    scrollbar-width: none;
}
.app-view-container::-webkit-scrollbar {
    display: none;
}

/* Screen visibility */
.app-screen {
    display: none;
    animation: fadeIn 0.22s ease-in-out;
}
.app-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    height: 100%;
    overflow-y: auto;
}

.brand-logo-container {
    display: flex;
    justify-content: center;
    margin: 10px auto 14px;
}
.brand-pawcare-logo {
    width: 145px;
    height: 145px;
    object-fit: contain;
    border-radius: 30px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    padding: 6px;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.brand-pawcare-logo:hover {
    transform: scale(1.06) rotate(1.5deg);
}

.brand-paw-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 16px;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

.welcome-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
}

.welcome-illustration {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.hero-img {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 24px;
    object-fit: cover;
}

.auth-box {
    width: 100%;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: auto;
}

.demo-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--primary-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

/* Form Styles */
.form-group {
    margin-bottom: 14px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
}
.btn-block {
    width: 100%;
}
.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger-bg);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Tab Pills */
.tab-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-pills::-webkit-scrollbar {
    display: none;
}
.tab-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.tab-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px 8px;
    z-index: 30;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    gap: 4px;
}
.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}
.nav-item.active {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Home Screen Components */
.user-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    margin-bottom: 16px;
}
.user-greeting h2 {
    font-size: 20px;
    font-weight: 800;
}
.user-greeting p {
    font-size: 12px;
    color: var(--text-secondary);
}
.bell-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: var(--text-primary);
}
.bell-icon-btn .badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

/* Pet Switcher Horizontal Bar */
.pet-switcher-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}
.pet-avatar-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.pet-avatar-pill img,
.pet-avatar-pill .avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}
.pet-avatar-pill.active img {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.pet-avatar-pill.active {
    color: var(--primary);
}
.pet-avatar-pill .add-pet-btn-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px dashed var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Hero Pet Card */
.pet-hero-card {
    background: linear-gradient(135deg, #fef3c7 0%, #dbeafe 100%);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
body.dark-mode .pet-hero-card {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a8a 100%);
}
.pet-hero-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: var(--shadow-sm);
}
.pet-hero-info {
    flex-grow: 1;
}
.pet-hero-info h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}
.pet-hero-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.btn-view-profile {
    padding: 6px 14px;
    font-size: 12px;
    background: #ffffff;
    color: var(--text-primary);
    border-radius: 20px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    display: inline-block;
    cursor: pointer;
    border: none;
}
body.dark-mode .btn-view-profile {
    background: var(--bg-card);
    color: #ffffff;
}

/* Category Grid Shortcuts */
.category-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.cat-shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}
.cat-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Today's Schedule List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-title {
    font-size: 16px;
    font-weight: 700;
}
.section-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.schedule-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.1s;
}
.schedule-item:active {
    transform: scale(0.98);
}
.schedule-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}
.schedule-info {
    flex-grow: 1;
}
.schedule-info h4 {
    font-size: 14px;
    font-weight: 700;
}
.schedule-info p {
    font-size: 11px;
    color: var(--text-secondary);
}
.checkbox-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    transition: all 0.2s;
}
.checkbox-circle.completed {
    background: var(--success);
    border-color: var(--success);
}

/* Pet Profile Vitals */
.profile-avatar-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}
.profile-avatar-large img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-card);
    box-shadow: var(--shadow-md);
}
.profile-vitals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.vital-box {
    background: var(--bg-card);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.vital-box .vital-icon {
    font-size: 22px;
}
.vital-box .vital-label {
    font-size: 11px;
    color: var(--text-secondary);
}
.vital-box .vital-val {
    font-size: 14px;
    font-weight: 700;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.action-box {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.15s;
}
.action-box:hover {
    transform: translateY(-2px);
}
.action-box .action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Vaccination upcoming card */
.upcoming-alert-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 4px solid var(--danger);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.badge-danger-pill {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}
.badge-success-pill {
    background: var(--success-bg);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Weight Line Chart SVG */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}
.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
}
.chart-badge {
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.chart-svg {
    width: 100%;
    height: 140px;
}

/* Photo Gallery 2-Column Grid */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.gallery-item {
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* Notes Cards */
.note-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}
.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.note-card-header h4 {
    font-size: 14px;
    font-weight: 700;
}
.note-card-header span {
    font-size: 11px;
    color: var(--text-muted);
}
.note-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* More / Settings Menu */
.settings-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.settings-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}
.settings-item:last-child {
    border-bottom: none;
}
.settings-item .settings-icon {
    margin-right: 14px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.settings-item .settings-title {
    flex-grow: 1;
}
.settings-item .settings-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

/* Dark Mode Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-subtle);
    transition: 0.3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Interactive Modal / Bottom Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-sheet {
    background: var(--bg-card);
    width: 100%;
    max-width: 430px;
    border-radius: 28px 28px 0 0;
    padding: 24px 20px 32px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.modal-title {
    font-size: 18px;
    font-weight: 800;
}
.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Pet Multi-Select Chips for Modals */
.pet-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 14px;
}
.pet-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.pet-select-chip:hover {
    border-color: var(--primary);
}
.pet-select-chip.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.pet-select-chip img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}
.pet-select-chip .chip-check {
    font-size: 11px;
    font-weight: 800;
}

/* Modal form helpers */
.form-help-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 12px;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

/* Home Screen Banner Slider */
.home-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 22px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    background: #0f172a;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.home-slider-track {
    display: flex;
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}
.home-slider-slide {
    min-width: 100%;
    width: 100%;
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.home-slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.home-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: all 0.2s ease;
    opacity: 0.9;
}
.home-slider-arrow:hover {
    background: #ffffff;
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}
.home-slider-arrow.prev {
    left: 8px;
}
.home-slider-arrow.next {
    right: 8px;
}
.home-slider-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.38);
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.home-slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.25s ease;
}
.home-slider-dot.active {
    width: 18px;
    border-radius: 10px;
    background: #ffffff;
}

/* ========================================== */
/* PET VIDEO REELS & HD MOMENTS               */
/* ========================================== */
.pet-reels-container {
    margin-bottom: 22px;
}
.pet-reels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.pet-reels-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pet-reels-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.2px;
}
.pet-reels-badge-hd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #f97316);
    padding: 2px 7px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}
.pet-reels-badge-hd-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
    animation: reelPulse 1.4s infinite;
}
.pet-reels-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.pet-reels-link:hover {
    opacity: 0.8;
}
.pet-reels-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 10px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pet-reels-carousel::-webkit-scrollbar {
    display: none;
}
.pet-reel-card {
    flex: 0 0 160px;
    width: 160px;
    height: 275px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    background: #0f172a;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease;
    transform: translateZ(0);
}
.pet-reel-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
.pet-reel-card:active {
    transform: scale(0.98);
}
.pet-reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
    pointer-events: none;
    transform: translateZ(0);
}
.reel-badge-top {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.4px;
    z-index: 2;
}
.reel-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
    animation: reelPulse 1.4s infinite;
}
@keyframes reelPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}
.reel-sound-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}
.reel-sound-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}
.reel-expand-btn {
    position: absolute;
    top: 44px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}
.reel-expand-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}
.reel-info-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 10px 10px 10px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0.88) 100%);
    color: #ffffff;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
.reel-info-gradient h4 {
    font-size: 12.5px;
    font-weight: 700;
    margin: 0 0 3px 0;
    line-height: 1.25;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.reel-info-gradient p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reel-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
    z-index: 3;
}
.pet-reel-card.paused .reel-play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========================================== */
/* FULLSCREEN HD REEL VIEWER MODAL            */
/* ========================================== */
.reel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0;
    margin: 0;
}
.reel-modal-overlay.active {
    display: flex;
}
.reel-modal-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #000000;
}
@media (min-width: 480px) {
    .reel-modal-container {
        border-radius: 24px;
        box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
        height: 94vh;
        max-height: 820px;
    }
}
.reel-modal-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
    display: block;
    cursor: pointer;
}
.reel-modal-header {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}
.reel-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.reel-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}
.reel-modal-petinfo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
    background: rgba(0, 0, 0, 0.45);
    padding: 5px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.reel-modal-petinfo span.hd-tag {
    font-size: 9px;
    font-weight: 800;
    background: #ef4444;
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}
.reel-modal-sound {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.reel-modal-sound:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}
.reel-modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 18px 20px 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 30%, rgba(0, 0, 0, 0.92) 100%);
    color: #ffffff;
    z-index: 10;
    pointer-events: none;
}
.reel-modal-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}
.reel-modal-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.reel-modal-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}
.reel-modal-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: translateY(-50%) scale(1.08);
}
.reel-modal-nav-arrow.prev { left: 12px; }
.reel-modal-nav-arrow.next { right: 12px; }
.reel-modal-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.28);
    z-index: 11;
}
.reel-modal-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.1s linear;
}

/* ========================================== */
/* FAVORITE TREATS & PANTRY CARDS             */
/* ========================================== */
.treats-pantry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.treat-card {
    background: var(--bg-card, #ffffff);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.treat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}
.treat-img-wrap {
    width: 100%;
    height: 165px;
    background: #f8fafc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    padding: 8px;
}
.treat-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}
.treat-card:hover .treat-img-wrap img {
    transform: scale(1.06);
}
.treat-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}
.treat-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 3px 0;
    line-height: 1.25;
}
.treat-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.3;
}
.treat-action-btn {
    margin-top: auto;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 10px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
.treat-action-btn:hover {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
}

/* Treat Modal Preview Lightbox */
.treat-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
}
.treat-lightbox-modal.active {
    display: flex;
}
.treat-lightbox-content {
    background: #ffffff;
    border-radius: 24px;
    max-width: 390px;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    animation: treatModalZoom 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes treatModalZoom {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.treat-lightbox-img-wrap {
    background: #f8fafc;
    width: 100%;
    height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}
.treat-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}
.treat-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
}
.treat-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.08);
}
.treat-lightbox-body {
    padding: 18px 20px 20px 20px;
}
.treat-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.treat-lightbox-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    margin: 0;
}
.treat-lightbox-tag {
    font-size: 11px;
    font-weight: 800;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    padding: 3px 8px;
    border-radius: 12px;
}
.treat-lightbox-desc {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    line-height: 1.45;
    margin: 0 0 16px 0;
}

/* ========================================== */
/* MEMORIES INFINITE AUTO-SCROLL MARQUEE      */
/* ========================================== */
.memories-marquee-section {
    margin-top: 10px;
    margin-bottom: 26px;
    overflow: hidden;
}
.memories-header {
    margin-bottom: 14px;
    padding: 0 2px;
}
.memories-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.2px;
}
.memories-subtitle {
    font-size: 11.5px;
    color: var(--text-muted, #64748b);
    margin: 0;
    line-height: 1.35;
}
.memories-marquee-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Smooth gradient edge fading */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000000 6%, #000000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000000 6%, #000000 94%, transparent 100%);
}
.memories-marquee-row {
    display: flex;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.memories-marquee-track {
    display: flex;
    gap: 10px;
    width: max-content;
    will-change: transform;
}
/* Line 1: Left to Right */
.memories-track-ltr {
    animation: scrollLeftToRight 26s linear infinite;
}
/* Line 2: Right to Left */
.memories-track-rtl {
    animation: scrollRightToLeft 26s linear infinite;
}
.memories-marquee-wrapper:hover .memories-marquee-track,
.memories-marquee-wrapper:active .memories-marquee-track {
    animation-play-state: paused;
}
@keyframes scrollLeftToRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}
@keyframes scrollRightToLeft {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}
.memories-photo-card {
    flex: 0 0 150px;
    width: 150px;
    height: 105px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.memories-photo-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    z-index: 5;
}
.memories-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.3s ease;
}
.memories-photo-card:hover img {
    transform: scale(1.08);
}
.memories-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 8px 6px 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
}

/* ========================================== */
/* APP-WIDE CLICK ANIMATIONS & TACTILE RIPPLE */
/* ========================================== */

/* 1. Global Click Ripple Wave Element */
.app-click-ripple {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0.15) 55%, transparent 75%);
    border: 2px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
    transform: translate(-50%, -50%) scale(0.2);
    pointer-events: none;
    z-index: 99999999;
    animation: clickRippleBurst 0.45s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
}

@keyframes clickRippleBurst {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 1;
    }
    50% {
        opacity: 0.75;
    }
    100% {
        transform: translate(-50%, -50%) scale(3.4);
        opacity: 0;
    }
}

/* 2. Tactile Press-Down Spring Effect on Every Interactive Element */
button,
.btn,
.nav-item,
.cat-shortcut-item,
.pet-avatar-pill,
.tab-pill,
.action-box,
.vital-box,
.settings-item,
.pet-select-chip,
.back-btn,
.bell-icon-btn,
.header-action-btn,
.modal-close-btn,
.home-slider-arrow,
.home-slider-dot,
.treat-card,
.treat-action-btn,
.memories-photo-card,
.pet-reel-card,
.schedule-item,
.btn-view-profile,
.add-pet-btn-circle,
.reel-sound-btn,
.reel-expand-btn,
[onclick] {
    transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.16s ease, opacity 0.16s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

button:active,
.btn:active,
.nav-item:active,
.cat-shortcut-item:active,
.pet-avatar-pill:active,
.tab-pill:active,
.action-box:active,
.vital-box:active,
.settings-item:active,
.pet-select-chip:active,
.back-btn:active,
.bell-icon-btn:active,
.header-action-btn:active,
.modal-close-btn:active,
.home-slider-arrow:active,
.home-slider-dot:active,
.treat-card:active,
.treat-action-btn:active,
.memories-photo-card:active,
.pet-reel-card:active,
.schedule-item:active,
.btn-view-profile:active,
.add-pet-btn-circle:active,
.reel-sound-btn:active,
.reel-expand-btn:active,
[onclick]:active {
    transform: scale(0.93) !important;
    opacity: 0.86 !important;
}

/* Protect non-clickable elements */
.expense-data-card,
.expense-data-card:active {
    transform: none !important;
    cursor: default !important;
    opacity: 1 !important;
}

/* ========================================== */
/* PET STORIES TRAY & VIEWER                  */
/* ========================================== */
.pet-stories-container {
    margin-top: 4px;
    margin-bottom: 22px;
}
.pet-stories-tray {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 10px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.pet-stories-tray::-webkit-scrollbar {
    display: none;
}
.story-bubble-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}
.story-bubble-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 2.5px;
    background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    animation: storyGradientShift 4s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.28);
    position: relative;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.story-bubble-item:hover .story-bubble-ring {
    transform: scale(1.08);
}
.story-bubble-item:active .story-bubble-ring {
    transform: scale(0.95);
}
.story-bubble-ring.seen {
    background: #cbd5e1;
    box-shadow: none;
    animation: none;
}
@keyframes storyGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.story-bubble-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
    background: #f1f5f9;
    display: block;
}
.story-bubble-add {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px dashed #94a3b8;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary, #2563eb);
    font-size: 22px;
    font-weight: 700;
    position: relative;
    transition: all 0.2s ease;
}
.story-bubble-add:hover {
    border-color: var(--primary, #2563eb);
    background: #eff6ff;
    transform: scale(1.05);
}
.story-bubble-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    letter-spacing: -0.1px;
}

/* ========================================== */
/* FULLSCREEN INSTAGRAM-STYLE STORY VIEWER    */
/* ========================================== */
.story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    user-select: none;
    -webkit-user-select: none;
}
.story-viewer-modal.active {
    display: flex;
}
.story-viewer-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: #090d16;
}
@media (min-width: 480px) {
    .story-viewer-container {
        border-radius: 26px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.92);
        height: 94vh;
        max-height: 850px;
    }
}
/* Blurred Backdrop Glow from Story Image */
.story-backdrop-blur {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    filter: blur(35px) brightness(0.4);
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
}
/* Top Segmented Progress Bars */
.story-progress-segments {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 5px;
    z-index: 25;
}
.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    overflow: hidden;
}
.story-progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}
.story-progress-fill.filled {
    width: 100%;
}
/* Story Header */
.story-viewer-header {
    position: absolute;
    top: 24px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 25;
}
.story-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.story-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.story-author-name {
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.story-time-ago {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}
.story-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.story-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
/* Main Story Content & Card Wrap */
.story-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 72px 16px 185px 16px;
    box-sizing: border-box;
}
.story-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75);
    display: block;
    animation: storyZoomIn 9.5s linear forwards;
}
@keyframes storyZoomIn {
    0% { transform: scale(0.98); }
    100% { transform: scale(1.02); }
}
/* Touch Zones for tap left/right */
.story-touch-prev {
    position: absolute;
    top: 70px;
    bottom: 180px;
    left: 0;
    width: 35%;
    z-index: 15;
    cursor: pointer;
}
.story-touch-next {
    position: absolute;
    top: 70px;
    bottom: 180px;
    right: 0;
    width: 65%;
    z-index: 15;
    cursor: pointer;
}
/* Bottom Story Tribute Card */
.story-viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px 16px 14px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 20%, rgba(0, 0, 0, 0.95) 100%);
    color: #ffffff;
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.story-tribute-sheet {
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 13px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.story-tribute-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.story-tribute-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: -0.2px;
}
.story-tribute-body {
    max-height: 100px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.story-tribute-body::-webkit-scrollbar {
    width: 4px;
}
.story-tribute-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}
.story-tribute-text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    font-weight: 450;
    color: rgba(255, 255, 255, 0.92);
}
.story-heart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}
.story-heart-btn:active {
    transform: scale(1.3);
}
.story-heart-btn.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}
.floating-heart {
    position: absolute;
    bottom: 30px;
    right: 25px;
    font-size: 24px;
    pointer-events: none;
    animation: floatHeartUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    z-index: 30;
}
@keyframes floatHeartUp {
    0% { transform: translateY(0) scale(0.8); opacity: 1; }
    50% { transform: translateY(-40px) scale(1.3) rotate(-15deg); opacity: 0.9; }
    100% { transform: translateY(-90px) scale(1) rotate(15deg); opacity: 0; }
}






