﻿/* =============================================================================
   SHARED UI STYLES - Multi-Project CSS Framework
   =============================================================================

   Naming Convention: "su-" prefix (Shared UI)

   RESPONSIVE STRATEGY (clamp vs media queries):
   - clamp(): Used for fluid typography, spacing, and continuous scaling
   - Media queries: Used for layout changes, show/hide, user preferences

   CROSS-PLATFORM (Web + MAUI Hybrid):
   - Uses 100dvh for proper mobile viewport handling
   - Safe-area insets for iPhone notches and Android cutouts
   - Hover effects gated behind @media (hover: hover)
   - Reduced motion support for accessibility

   ============================================================================= */

/* =============================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================= */
:root {
    /* Safe Area Insets */
    --su-safe-top: env(safe-area-inset-top, 0px);
    --su-safe-bottom: env(safe-area-inset-bottom, 0px);
    --su-safe-left: env(safe-area-inset-left, 0px);
    --su-safe-right: env(safe-area-inset-right, 0px);
    /* Spacing Scale */
    --su-space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --su-space-sm: clamp(0.5rem, 1vw, 0.75rem);
    --su-space-md: clamp(0.75rem, 1.5vw, 1rem);
    --su-space-lg: clamp(1rem, 2vw, 1.5rem);
    --su-space-xl: clamp(1.5rem, 3vw, 2rem);
    /* Typography Scale */
    --su-text-xs: clamp(0.625rem, 0.5vw + 0.5rem, 0.75rem);
    --su-text-sm: clamp(0.75rem, 0.5vw + 0.625rem, 0.875rem);
    --su-text-base: clamp(0.875rem, 0.5vw + 0.75rem, 1rem);
    --su-text-lg: clamp(1rem, 0.75vw + 0.75rem, 1.125rem);
    --su-text-xl: clamp(1.125rem, 1vw + 0.75rem, 1.25rem);
    /* Border Radius */
    --su-radius-sm: 4px;
    --su-radius-md: 8px;
    --su-radius-lg: 12px;
    --su-radius-xl: 16px;
    --su-radius-2xl: 18px;
    --su-radius-full: 24px;
    --su-radius-round: 50%;
    /* Shadows */
    --su-shadow-sm: 0 1px 6px rgba(32, 33, 36, 0.28);
    --su-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --su-shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.08);
    --su-shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.08);
    --su-shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.35);
    /* Colors - Light Mode */
    --su-bg-primary: #F4F7FA;
    --su-bg-surface: #ffffff;
    --su-bg-surface-alpha: rgba(255, 255, 255, 0.9);
    --su-bg-glass: rgba(255, 255, 255, 0.75);
    --su-bg-hover: rgba(0, 0, 0, 0.04);
    --su-text-primary: #111;
    --su-text-secondary: #5f6368;
    --su-text-muted: #70757a;
    --su-text-hint: #9aa0a6;
    --su-border-light: rgba(0, 0, 0, 0.06);
    --su-border-default: rgba(0, 0, 0, 0.08);
    --su-border-focus: rgba(0, 0, 0, 0.1);
    /* Transitions */
    --su-transition-fast: 0.15s ease;
    --su-transition-base: 0.2s ease;
    --su-transition-smooth: 0.25s ease;
    --su-transition-slow: 0.3s ease;
    --su-transition-spring: 0.3s ease-in-out;
    /* FIX: correct syntax is "only light" not "light only" */
    color-scheme: only light;
}

/* =============================================================================
   DARK MODE TOKENS
   (Kept for reference — overridden at the bottom of this file for force-light)
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --su-bg-primary: #121212;
        --su-bg-surface: #1e1e2d;
        --su-bg-surface-alpha: rgba(30, 30, 30, 0.8);
        --su-bg-glass: rgba(25, 25, 25, 0.7);
        --su-bg-hover: rgba(255, 255, 255, 0.08);
        --su-text-primary: #f2f2f2;
        --su-text-secondary: #ccc;
        --su-text-muted: #aaa;
        --su-text-hint: #888;
        --su-border-light: rgba(255, 255, 255, 0.08);
        --su-border-default: rgba(255, 255, 255, 0.1);
        --su-border-focus: rgba(255, 255, 255, 0.12);
        --su-shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.5);
        --su-shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.5);
    }
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */
html {
    -webkit-text-size-adjust: 100%;
    background: var(--su-bg-primary);
    /* FIX: allow pull-to-refresh (auto, not none) */
    overscroll-behavior-y: auto;
}

body {
    background: var(--su-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: auto;
}

html, body {
    height: 100%;
}

/* Remove 300ms tap delay */
button,
[role="button"],
.su-cursor-pointer,
a {
    touch-action: manipulation;
}

/* iOS momentum scrolling */
.su-nav-history-content,
.su-suggestions-dropdown,
.su-recent-scans-list,
.mud-dialog-content {
    -webkit-overflow-scrolling: touch;
}

/* Prevent scroll chaining */
.su-left-drawer,
.su-right-drawer,
.su-suggestions-dropdown {
    overscroll-behavior: contain;
}

/* =============================================================================
   PREVENT FIXED-POSITION BREAKAGE
   transform/perspective/filter on ancestors break position:fixed on descendants
   FIX: remove filter:none (too aggressive) — only neutralise transform/will-change
   ============================================================================= */
.mud-layout,
.mud-main-content,
.su-main-content,
.su-content-area,
.su-main-content-wrapper {
    transform: none !important;
    will-change: auto !important;
    perspective: none !important;
    contain: none !important;
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================================================
   ANIMATIONS & KEYFRAMES
   FIX: su-fade-in uses opacity only — NO transform (transform breaks fixed positioning)
   ============================================================================= */
@keyframes su-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes su-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.su-slide-down {
    animation: su-slide-down 0.3s ease-out;
}

/* =============================================================================
   Z-INDEX HIERARCHY
   =============================================================================
   1350 — Floating back button
   1300 — App bars (top + bottom)
   1200 — Drawers
   1199 — Drawer overlay
   100  — Sticky filter header
   ============================================================================= */

/* =============================================================================
   LAYOUT - APP BAR (consolidated single definition)
   ============================================================================= */
.su-appbar {
    background: var(--su-bg-glass);
    border-radius: var(--su-radius-xl);
    box-shadow: var(--su-shadow-md);
    color: var(--su-text-primary);
    transition: all var(--su-transition-spring);
    z-index: 1100 !important;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .su-appbar {
        -webkit-backdrop-filter: blur(14px) saturate(160%);
        backdrop-filter: blur(14px) saturate(160%);
    }
}

@media (hover: hover) and (pointer: fine) {
    .su-appbar:hover {
        box-shadow: var(--su-shadow-lg);
    }
}

/* TOP BAR — fixed, safe-area-aware */
.su-appbar-top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1300 !important;
    transform: none !important;
    will-change: auto !important;
    /* Padding: safe-area top + visual spacing */
    padding-top: calc(var(--su-space-xs) + var(--su-safe-top)) !important;
    padding-bottom: var(--su-space-xs);
    padding-left: clamp(8px, 2vw, 20px);
    padding-right: clamp(8px, 2vw, 20px);
    background: var(--su-bg-glass);
    border-radius: 0 0 var(--su-radius-lg) var(--su-radius-lg);
    box-shadow: var(--su-shadow-md);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .su-appbar-top-bar {
        -webkit-backdrop-filter: blur(14px) saturate(160%);
        backdrop-filter: blur(14px) saturate(160%);
    }
}

@media (max-width: 600px) {
    .su-appbar-top-bar {
        padding-top: calc(6px + var(--su-safe-top)) !important;
        padding-bottom: 6px;
        padding-left: 8px;
        padding-right: 8px;
        border-radius: 0 0 var(--su-radius-md) var(--su-radius-md);
    }

    /* Compact icon buttons */
    .su-appbar .mud-icon-button {
        padding: 8px;
        margin: 0 2px;
    }

    /* Minimal spacers on mobile */
    .su-appbar .mud-spacer {
        flex: 0 0 4px;
        min-width: 4px;
    }

    /* Smaller logo in appbar */
    .su-appbar .su-navbar-logo,
    .su-appbar .su-logo-link img {
        max-width: 90px;
        height: auto;
    }
}

/* BOTTOM BAR — fixed, safe-area-aware */
.su-appbar-bottom-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1300 !important;
    padding-top: var(--su-space-sm);
    padding-bottom: calc(var(--su-space-sm) + var(--su-safe-bottom)) !important;
    padding-left: clamp(8px, 2vw, 20px);
    padding-right: clamp(8px, 2vw, 20px);
    background: var(--su-bg-surface-alpha);
    border-radius: var(--su-radius-lg) var(--su-radius-lg) 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .su-appbar-bottom-bar {
        -webkit-backdrop-filter: blur(14px) saturate(160%);
        backdrop-filter: blur(14px) saturate(160%);
    }
}

@media (max-width: 600px) {
    .su-appbar-bottom-bar {
        padding-top: 6px;
        padding-bottom: calc(6px + var(--su-safe-bottom)) !important;
        padding-left: 10px;
        padding-right: 10px;
    }

        /* Smaller logo in bottom bar */
        .su-appbar-bottom-bar .su-logo-link img {
            max-width: 70px;
        }
}

/* =============================================================================
   LAYOUT - DRAWERS / SIDEBARS
   Drawers sit behind app bar (z-index 1200 < app bar 1300)
   Top padding accounts for the fixed app bar height
   ============================================================================= */
.su-left-drawer,
.su-right-drawer,
.mud-drawer {
    background: var(--su-bg-primary);
    padding-top: calc(56px + var(--su-safe-top)) !important;
    transition: transform var(--su-transition-slow), opacity var(--su-transition-slow);
    z-index: 1200 !important;
}

.su-left-drawer {
    border-right: 1px solid var(--su-border-light);
}

.su-right-drawer {
    border-left: 1px solid var(--su-border-light);
}

.mud-drawer-content {
    padding: var(--su-space-md);
}

/* Drawer overlay behind app bar */
.mud-overlay {
    z-index: 1199 !important;
}

@media (max-width: 600px) {
    .su-left-drawer,
    .su-right-drawer,
    .mud-drawer {
        padding-top: calc(52px + var(--su-safe-top)) !important;
    }
}

/* =============================================================================
   LAYOUT - MAIN CONTENT WRAPPER (consolidated single definition)
   ============================================================================= */
.su-main-content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    /* Account for fixed top app bar + safe area */
    padding-top: calc(56px + var(--su-safe-top));
}

@media (max-width: 600px) {
    .su-main-content-wrapper {
        padding-top: calc(52px + var(--su-safe-top));
    }
}

/* Account for fixed bottom bar + safe area on mobile/tablet */
@media (max-width: 959.98px) {
    .su-main-content-wrapper {
        padding-bottom: calc(64px + var(--su-safe-bottom, 0px));
    }
}

.su-content-area {
    flex: 1 0 auto;
    padding-bottom: var(--su-space-md);
}

.su-main-content {
    background: var(--su-bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   COMPONENTS - LOGO
   ============================================================================= */
.su-logo-link {
    display: flex;
    align-items: center;
}

.su-navbar-logo {
    max-width: clamp(200px, 30vw, 300px);
    width: 100%;
    height: auto;
    padding-right: clamp(12px, 2vw, 20px);
    transition: transform var(--su-transition-smooth), opacity var(--su-transition-slow);
}

@media (hover: hover) and (pointer: fine) {
    .su-navbar-logo:hover {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

/* =============================================================================
   COMPONENTS - BUTTONS
   ============================================================================= */
.mud-button {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: transform var(--su-transition-base), box-shadow var(--su-transition-base);
}

.mud-icon-button {
    transition: background var(--su-transition-base);
    border-radius: var(--su-radius-round);
}

@media (hover: hover) and (pointer: fine) {
    .mud-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    }

    .mud-icon-button:hover {
        background: var(--su-bg-hover);
        transform: scale(1.05);
    }
}

/* Minimum 44px tap targets on mobile */
@media (max-width: 600px) {
    .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* =============================================================================
   COMPONENTS - MUDSWITCH VERTICAL ALIGNMENT FIX
   Root cause: the 44px tap-target rule above inflates .mud-switch-base
   (which IS a mud-icon-button) and pushes the thumb off-centre on mobile.
   Solution: carve out an exception for switches only, placed AFTER the 44px rule.
   ============================================================================= */
@media (max-width: 600px) {
    .mud-switch .mud-icon-button,
    .mud-switch .mud-button-root.mud-icon-button,
    .mud-switch .mud-switch-base {
        min-width: unset !important;
        min-height: unset !important;
        width: auto !important;
        height: auto !important;
        padding: 9px !important;
        margin: 0 !important;
        margin-top: 0 !important;
    }
}

/* Ensure label-level alignment on all screen sizes */
label.mud-switch {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

/* =============================================================================
   COMPONENTS - NAVIGATION HISTORY DRAWER
   ============================================================================= */
.su-nav-history-content {
    max-height: calc(60vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: var(--su-space-md);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

    .su-nav-history-content::-webkit-scrollbar {
        width: 6px;
    }

    .su-nav-history-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .su-nav-history-content::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

.su-history-item {
    padding: 12px 16px !important;
    transition: background-color var(--su-transition-base);
}

@media (hover: hover) and (pointer: fine) {
    .su-history-item:hover {
        background-color: var(--su-bg-hover);
    }
}

.su-history-item-current {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    padding: 12px 16px !important;
}

.su-history-indicator {
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.su-history-time {
    min-width: 60px;
    text-align: right;
}

@media (max-width: 600px) {
    .su-history-time {
        min-width: 50px;
        font-size: var(--su-text-xs);
    }
}

.su-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
    text-align: center;
}

.mud-drawer-header {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.05) 0%, rgba(var(--mud-palette-primary-rgb), 0.02) 100%);
    border-bottom: 1px solid var(--su-border-default);
}

/* =============================================================================
   COMPONENTS - SEARCH
   ============================================================================= */
.su-search-container {
    width: 100%;
    max-width: 584px;
    margin: 0 auto;
    position: relative;
}

    .su-search-container.expanded {
        max-width: 650px;
        transition: max-width var(--su-transition-slow);
    }

.su-search-wrapper {
    border-radius: var(--su-radius-full) !important;
    overflow: visible;
    position: relative;
    background: var(--su-bg-surface);
    transition: box-shadow var(--su-transition-base);
    box-shadow: var(--su-shadow-sm) !important;
}

    .su-search-wrapper:hover {
        box-shadow: var(--su-shadow-sm) !important;
    }

.su-search-field {
    padding: 0 14px;
}

    .su-search-field .mud-input-root {
        margin-top: 0 !important;
    }

    .su-search-field .mud-input {
        font-size: var(--su-text-base);
        color: var(--su-text-primary);
        padding: 12px 0;
        font-family: "Inter", "Segoe UI", arial, sans-serif;
        background: transparent;
    }

    .su-search-field .mud-input-underline:before,
    .su-search-field .mud-input-underline:after {
        display: none !important;
    }

    .su-search-field .mud-input-adornment-start {
        color: var(--su-text-hint);
        margin-right: 13px;
    }

    .su-search-field .mud-icon-button-edge-end {
        color: var(--su-text-muted);
    }

        .su-search-field .mud-icon-button-edge-end:hover {
            color: var(--su-text-primary);
            background-color: transparent;
        }

    .su-search-field.with-end-icons .mud-input {
        padding-right: 64px;
    }

.su-search-row {
    display: flex;
    align-items: center;
    padding: 0 14px;
}

    .su-search-row .mud-input-control {
        flex: 1;
        min-width: 0;
    }

.su-category-menu {
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 160px;
    height: 40px;
    font-size: 15px;
    color: var(--su-text-secondary) !important;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: none;
    padding: 0 6px;
    overflow: hidden;
}

    .su-category-menu:hover {
        color: var(--su-text-secondary) !important;
        background: transparent !important;
    }

.su-search-divider {
    width: 1px;
    height: 26px;
    background: #e0e0e0;
    margin: 0 4px !important;
    flex-shrink: 0;
}

.su-search-end-icons {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 2px;
    align-items: center;
    pointer-events: auto;
    z-index: 2;
}

.su-search-icon-btn {
    color: var(--su-text-muted) !important;
    min-width: 0 !important;
    width: 50px;
    height: 50px;
    border-radius: var(--su-radius-round) !important;
}

@media (hover: hover) and (pointer: fine) {
    .su-search-icon-btn:hover {
        color: var(--su-text-primary) !important;
        background: transparent !important;
    }
}

@media (max-width: 600px) {
    .su-search-icon-btn {
        width: 44px;
        height: 44px;
    }
}

.su-search-spinner {
    width: 20px !important;
    height: 20px !important;
    margin-right: 2px;
    color: var(--su-text-primary) !important;
}

.su-search-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.su-search-btn {
    height: 36px;
    min-width: 54px;
    padding: 0 16px;
    border-radius: var(--su-radius-sm) !important;
    font-size: 14px;
    font-family: arial, sans-serif;
    text-transform: none;
    background-color: #f8f9fa !important;
    color: #3c4043 !important;
    border: 1px solid #f8f9fa !important;
}

@media (hover: hover) and (pointer: fine) {
    .su-search-btn:hover {
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) !important;
        background-color: #f8f9fa !important;
        border: 1px solid #dadce0 !important;
    }
}

.mud-progress-circular {
    color: #4285f4 !important;
}

/* Search - Mobile Responsive */
@media (max-width: 600px) {
    .su-search-container {
        max-width: calc(100% - 24px);
        margin: 0 12px;
    }

    .su-appbar .su-search-container {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .su-appbar .su-search-wrapper {
        width: 100% !important;
        border-radius: var(--su-radius-xl) !important;
        margin: 0 !important;
    }

    .su-appbar .mud-icon-button {
        margin: 0 2px !important;
    }

    .su-search-wrapper {
        border-radius: var(--su-radius-lg) !important;
    }

    .su-suggestions-dropdown.below {
        border-radius: 0 0 var(--su-radius-lg) var(--su-radius-lg) !important;
    }

    .su-suggestions-dropdown.above {
        border-radius: var(--su-radius-lg) var(--su-radius-lg) 0 0 !important;
    }
}

/* =============================================================================
   COMPONENTS - SEARCH SUGGESTIONS DROPDOWN
   ============================================================================= */
.su-suggestions-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    background: var(--su-bg-surface);
}

    .su-suggestions-dropdown.below {
        top: calc(100% - 1px);
        margin-top: 0;
        border-radius: 0 0 var(--su-radius-full) var(--su-radius-full) !important;
        box-shadow: 0 4px 6px rgba(32, 33, 36, 0.28) !important;
        border-top: 1px solid #e9ecef;
    }

    .su-suggestions-dropdown.above {
        bottom: calc(100% - 1px);
        margin-bottom: 0;
        border-radius: var(--su-radius-full) var(--su-radius-full) 0 0 !important;
        box-shadow: 0 -4px 6px rgba(32, 33, 36, 0.28) !important;
        border-bottom: 1px solid #e9ecef;
    }

.su-search-wrapper.open.position-top {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.su-search-wrapper.open.position-bottom {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.su-suggestions-list {
    display: flex;
    flex-direction: column;
}

.su-suggestion-item {
    transition: background-color 0.1s ease;
    min-height: 44px;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .su-suggestion-item:hover {
        background-color: #f8f9fa;
    }
}

.su-suggestion-selected {
    background-color: #e8f0fe !important;
}

.su-suggestion-content {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    width: 100%;
}

.su-suggestion-icon {
    margin-right: 13px;
    font-size: 20px !important;
    min-width: 20px;
}

.su-suggestion-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.su-suggestion-text {
    font-size: var(--su-text-base);
    color: var(--su-text-primary);
    font-family: arial, sans-serif;
}

    .su-suggestion-text .highlight {
        font-weight: 600;
        background-color: transparent;
    }

.su-suggestion-count {
    font-size: var(--su-text-sm);
    color: var(--su-text-muted);
}

.su-suggestion-header {
    background-color: #f8f9fa !important;
    cursor: default !important;
    padding: 4px 0 !important;
    min-height: 32px !important;
}

    .su-suggestion-header:hover {
        background-color: #f8f9fa !important;
    }

.su-suggestion-footer {
    margin: 0;
}

.su-show-more {
    position: sticky;
    bottom: 0;
    background: var(--su-bg-surface);
    border-top: 1px solid #e9ecef;
    font-weight: 600;
    z-index: 2;
}

/* =============================================================================
   COMPONENTS - SEARCH BOX MOBILE LOGO
   ============================================================================= */
.su-search-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px 4px 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.su-search-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@media (max-width: 400px) {
    .su-search-logo {
        height: 24px;
    }

    .su-search-logo-link {
        padding: 4px 6px 4px 10px;
    }
}

.su-search-logo-link + .su-search-divider {
    height: 24px;
    width: 1px;
    background-color: var(--su-border-light, #e0e0e0);
    margin: 0 4px;
    flex-shrink: 0;
}

@media (min-width: 960px) {
    .su-search-logo-link {
        display: none;
    }

        .su-search-logo-link + .su-search-divider {
            display: none;
        }
}

/* =============================================================================
   COMPONENTS - MOBILE EXPANDABLE SEARCH BAR
   ============================================================================= */
.su-search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1099;
    background: transparent;
}

@media (min-width: 600px) {
    .su-search-backdrop {
        display: none;
    }
}

/* Collapsed state */
.su-mobile-search-collapsed {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    margin: 0 4px !important;
    cursor: text;
}

    .su-mobile-search-collapsed .su-search-wrapper {
        pointer-events: none;
        border-radius: 24px !important;
    }

    .su-mobile-search-collapsed .su-search-container {
        width: 100%;
    }

    .su-mobile-search-collapsed .su-suggestions-dropdown {
        display: none !important;
    }

    .su-mobile-search-collapsed .su-search-field input {
        cursor: pointer;
    }

/* Expanded state */
.su-mobile-search-expanded {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    animation: su-search-expand 0.2s ease-out;
    /* FIX: use CSS variable instead of hardcoded #fff */
    background: var(--su-bg-surface);
    border-radius: 28px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    padding: 0 4px 0 0;
    margin: 0 4px;
    position: relative;
}

    .su-mobile-search-expanded .su-search-wrapper {
        pointer-events: auto;
        width: 100%;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

        .su-mobile-search-expanded .su-search-wrapper.mud-paper {
            box-shadow: none !important;
        }

    .su-mobile-search-expanded .su-search-container {
        width: 100%;
        position: static !important;
    }

    .su-mobile-search-expanded .su-search-wrapper {
        position: static !important;
    }

    .su-mobile-search-expanded .su-search-row {
        padding: 4px 8px 4px 0;
    }

    .su-mobile-search-expanded .su-search-field {
        flex: 1;
    }

    /* When suggestions are open — flatten bottom corners */
    .su-mobile-search-expanded:has(.su-suggestions-dropdown),
    .su-mobile-search-expanded.suggestions-open {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 1px 3px rgba(32, 33, 36, 0.2);
    }

    /* Dropdown */
    .su-mobile-search-expanded .su-suggestions-dropdown {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        margin-top: 0 !important;
        border-radius: 0 0 20px 20px !important;
        background: var(--su-bg-surface);
        box-shadow: 0 4px 6px rgba(32, 33, 36, 0.25);
        border-top: 1px solid #ebebeb;
        z-index: 1100;
        max-height: 60vh;
        overflow-y: auto;
    }

        .su-mobile-search-expanded .su-suggestions-dropdown.mud-paper {
            border-radius: 0 0 20px 20px !important;
            box-shadow: 0 4px 6px rgba(32, 33, 36, 0.25) !important;
        }

.su-search-collapse-btn {
    flex-shrink: 0;
    margin: 0 0 0 4px;
    color: #5f6368 !important;
}

    .su-search-collapse-btn:hover {
        background-color: rgba(0, 0, 0, 0.04) !important;
    }

@keyframes su-search-expand {
    from {
        opacity: 0.8;
        transform: scaleX(0.95);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Mobile-specific search states */
@media (max-width: 599px) {
    .su-mobile-search-expanded {
        margin: 0 !important;
        margin-left: -4px !important;
        margin-right: -4px !important;
        border-radius: 20px;
    }

        .su-mobile-search-expanded:has(.su-suggestions-dropdown),
        .su-mobile-search-expanded.suggestions-open {
            border-radius: 16px 16px 0 0;
        }

        .su-mobile-search-expanded .su-suggestions-dropdown {
            left: 0 !important;
            right: 0 !important;
            border-radius: 0 0 16px 16px !important;
        }

        .su-mobile-search-expanded .su-search-row {
            padding: 2px 4px 2px 0;
        }

        .su-mobile-search-expanded .su-search-end-icons {
            gap: 2px;
            padding-right: 2px;
        }

            .su-mobile-search-expanded .su-search-end-icons .mud-fab {
                display: flex;
                width: 38px;
                height: 38px;
                min-width: 38px;
                min-height: 38px;
            }

    .su-mobile-search-collapsed .su-search-row {
        min-height: 38px;
    }

    .su-mobile-search-collapsed .su-search-end-icons .mud-fab {
        display: none;
    }

    .su-search-collapse-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

        .su-search-collapse-btn .mud-icon-root {
            font-size: 22px;
        }
}

/* Bottom bar logo-only variant */
.su-bottom-bar-logo-only {
    justify-content: flex-start;
    min-height: 56px;
    padding: 0 8px;
}

    .su-bottom-bar-logo-only .su-logo-link {
        display: flex;
        align-items: center;
    }

    .su-bottom-bar-logo-only .mud-spacer {
        flex: 1;
    }

/* =============================================================================
   COMPONENTS - ADS (Banner)
   ============================================================================= */
.su-ad-banner-container {
    width: 100%;
    margin: var(--su-space-lg) 0;
    display: flex;
    justify-content: center;
}

    .su-ad-banner-container.compact {
        margin: var(--su-space-sm) 0;
    }

    .su-ad-banner-container.prominent {
        margin: var(--su-space-xl) 0;
        padding: var(--su-space-lg) 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
    }

.su-ad-banner-wrapper {
    position: relative;
    width: 100%;
    max-width: 970px;
    min-height: 90px;
    background: var(--mud-palette-surface);
    border-radius: var(--su-radius-md);
    border: 1px solid var(--su-border-light);
    overflow: hidden;
}

    .su-ad-banner-wrapper.small {
        max-width: 728px;
        min-height: 90px;
    }

    .su-ad-banner-wrapper.medium {
        max-width: 970px;
        min-height: 90px;
    }

    .su-ad-banner-wrapper.large {
        max-width: 970px;
        min-height: 250px;
    }

.su-ad-disclosure {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: var(--su-text-xs);
    color: var(--su-text-secondary);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.su-ad-upgrade-hint {
    position: absolute;
    bottom: 4px;
    right: 8px;
    opacity: 1;
    transition: opacity var(--su-transition-base);
}

@media (max-width: 768px) {
    .su-ad-banner-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

        .su-ad-banner-wrapper.small,
        .su-ad-banner-wrapper.medium {
            min-height: 60px;
        }
}

/* =============================================================================
   COMPONENTS - ADS (Card Style)
   ============================================================================= */
.su-ad-card {
    border-radius: var(--su-radius-lg);
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth);
    border: 1px solid var(--su-border-default);
    background-color: var(--mud-palette-surface);
    position: relative;
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .su-ad-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
}

.su-ad-image-container {
    position: relative;
    width: 100%;
    min-height: clamp(200px, 30vw, 280px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.su-ad-label-container {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.su-ad-label {
    background-color: rgba(255, 255, 255, 0.95) !important;
    font-size: var(--su-text-xs) !important;
    height: 24px !important;
    opacity: 0.9;
}

.su-ad-content {
    width: 100%;
    min-height: clamp(180px, 25vw, 250px);
}

.su-ad-upgrade-prompt {
    background: linear-gradient(90deg, rgba(103, 58, 183, 0.05), rgba(63, 81, 181, 0.05));
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: center;
    padding: 4px 8px;
}

/* =============================================================================
   COMPONENTS - ADS (Sticky Mobile)
   ============================================================================= */
.su-sticky-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--mud-palette-background);
    border-top: 1px solid var(--su-border-focus);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform var(--su-transition-slow), bottom var(--su-transition-slow);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

    .su-sticky-ad-container.visible {
        transform: translateY(0);
    }

.su-sticky-ad-wrapper {
    position: relative;
    padding: var(--su-space-sm);
    display: flex;
    justify-content: center;
}

.su-sticky-ad-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: var(--su-radius-round);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

    .su-sticky-ad-close:hover {
        background: rgba(0, 0, 0, 0.8);
    }

.su-sticky-ad-content {
    max-width: 320px;
    height: 50px;
}

.su-sticky-upgrade-bar {
    width: 100%;
    text-align: center;
    padding: 4px 8px 8px;
    background: linear-gradient(90deg, rgba(103, 58, 183, 0.05), rgba(63, 81, 181, 0.05));
}

@media (min-width: 768px) {
    .su-sticky-ad-container {
        display: none !important;
    }
}

body.has-sticky-ad {
    padding-bottom: 90px;
}

    body.has-sticky-ad.has-bottom-bar {
        padding-bottom: 150px;
    }

body.has-sticky-ad {
    padding-bottom: calc(90px + var(--su-safe-bottom));
}

/* =============================================================================
   COMPONENTS - ADS (Sidebar)
   ============================================================================= */
.su-sidebar-ad-container {
    width: 100%;
    max-width: 336px;
    margin: 0 auto;
}

.su-sidebar-ad-wrapper {
    position: relative;
    background: var(--mud-palette-surface);
    border: 1px solid var(--su-border-default);
    border-radius: var(--su-radius-md);
    overflow: hidden;
    min-height: 280px;
}

.su-sidebar-ad-disclosure {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    color: var(--su-text-secondary);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
}

.su-sidebar-ad-content {
    width: 100%;
    min-height: 250px;
}

.su-sidebar-upgrade-hint {
    text-align: center;
    opacity: 0.8;
}

    .su-sidebar-upgrade-hint:hover {
        opacity: 1;
    }

/* =============================================================================
   COMPONENTS - ALTERNATIVES DIALOG
   ============================================================================= */
.su-alternatives-dialog {
    border-radius: var(--su-radius-2xl);
    box-shadow: var(--su-shadow-xl);
    overflow: hidden;
}

.su-alt-card {
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-surface);
}

@media (hover: hover) and (pointer: fine) {
    .su-alt-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }
}

.su-alt-image-container {
    height: clamp(140px, 20vw, 180px);
    width: 100%;
    background: var(--mud-palette-background-grey);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

    .su-alt-image-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* Allow more lines for alternative product titles */
.su-alt-title {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    line-height: 1.3;
    min-height: auto;
}

.su-dialog-actions {
    padding: var(--su-space-md) clamp(1rem, 2vw, 1.25rem);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: var(--mud-palette-background);
}

@media (max-width: 600px) {
    .su-alternatives-dialog {
        margin: 4px !important;
        max-height: calc(100dvh - 8px) !important;
    }

        .su-alternatives-dialog .mud-dialog-content {
            max-height: calc(100dvh - 160px) !important;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .su-alternatives-dialog .su-alt-image-container {
            height: 140px;
        }
}

/* =============================================================================
   COMPONENTS - BARCODE SCANNER
   ============================================================================= */
.su-scanner-dialog {
    min-width: 340px;
}

.su-scanner-container {
    min-height: 280px;
    position: relative;
}

.su-scanner-viewport {
    width: 100%;
    min-height: 260px;
    border-radius: var(--su-radius-md);
    overflow: hidden;
    background: #1a1a1a;
}

    .su-scanner-viewport.loading {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.su-scanner-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    color: white;
}

.su-camera-controls {
    display: flex;
    justify-content: center;
}

.su-manual-entry {
    padding: var(--su-space-sm) 0;
}

.su-barcode-preview {
    background: #f5f5f5;
    border-radius: var(--su-radius-md);
    padding: 12px;
    text-align: center;
}

.su-barcode-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.su-quick-formats {
    margin-top: var(--su-space-lg);
}

.su-scanned-result {
    margin-top: 12px;
}

.su-recent-scans-list {
    max-height: 300px;
    overflow-y: auto;
}

.su-recent-scan-item {
    cursor: pointer;
    transition: background-color var(--su-transition-base);
}

    .su-recent-scan-item:hover {
        background-color: var(--su-bg-hover);
    }

/* =============================================================================
   COMPONENTS - SOCIAL LOGIN BUTTONS
   ============================================================================= */
.su-social-btn {
    border-radius: var(--su-radius-md);
    font-weight: 600;
    transition: background-color var(--su-transition-base), color var(--su-transition-base), transform var(--su-transition-base);
}

.su-social-btn-google {
    border-color: #4285f4 !important;
    color: #4285f4 !important;
}

.su-social-btn-microsoft {
    border-color: #0078d4 !important;
    color: #0078d4 !important;
}

.su-social-btn-facebook {
    border-color: #1877f2 !important;
    color: #1877f2 !important;
}

.su-social-btn-github {
    border-color: #333 !important;
    color: #333 !important;
}

.mud-theme-dark .su-social-btn-github {
    border-color: #f0f6fc !important;
    color: #f0f6fc !important;
}

@media (hover: hover) and (pointer: fine) {
    .su-social-btn:hover {
        transform: translateY(-2px);
    }

    .su-social-btn-google:hover {
        background-color: #4285f4 !important;
        color: white !important;
    }

    .su-social-btn-microsoft:hover {
        background-color: #0078d4 !important;
        color: white !important;
    }

    .su-social-btn-facebook:hover {
        background-color: #1877f2 !important;
        color: white !important;
    }

    .su-social-btn-github:hover {
        background-color: #333 !important;
        color: white !important;
    }

    .mud-theme-dark .su-social-btn-github:hover {
        background-color: #f0f6fc !important;
        color: #0d1117 !important;
    }
}

/* =============================================================================
   COMPONENTS - DIALOGS (Base)
   ============================================================================= */
.su-dialog {
    border-radius: var(--su-radius-2xl);
    background-color: var(--su-bg-surface);
    max-width: 600px;
    padding: var(--su-space-md);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
    animation: su-dialog-pop 0.25s ease;
}

@keyframes su-dialog-pop {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .mud-dialog {
        margin: 4px !important;
        max-height: calc(100dvh - 8px) !important;
        max-height: calc(100vh - 8px) !important;
    }

    .mud-dialog-content {
        padding: 12px !important;
    }
}

/* =============================================================================
   COMPONENTS - DIALOGS (List Selection)
   ============================================================================= */
.su-dialog-section {
    border-radius: var(--su-radius-lg);
    background-color: #fafafa;
    transition: all var(--su-transition-slow);
}

    .su-dialog-section:hover {
        background-color: #f5f5ff;
    }

.su-info-alert {
    border-radius: var(--su-radius-md);
    background-color: #eef4ff;
}

.su-warning-alert {
    border-radius: var(--su-radius-md);
    background-color: #fff6e5;
}

.su-list-wrapper {
    background-color: var(--su-bg-surface);
    border-radius: var(--su-radius-md);
    box-shadow: inset 0 0 0 1px #f0f0f0;
}

.su-list-item {
    border-radius: var(--su-radius-md);
    padding: 0.6rem 0.75rem;
    transition: background var(--su-transition-base), transform var(--su-transition-base);
    cursor: pointer;
}

    .su-list-item:hover:not(.mud-disabled) {
        background-color: rgba(103, 126, 234, 0.05);
        transform: translateX(2px);
    }

.su-quantity-field {
    width: 90px;
    text-align: center;
}

/* =============================================================================
   COMPONENTS - DIALOGS (Auth)
   ============================================================================= */
.su-auth-dialog {
    max-width: 480px;
}

.su-auth-title {
    padding: var(--su-space-md) var(--su-space-lg) var(--su-space-sm);
}

.su-auth-icon {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-right: var(--su-space-sm);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.su-auth-stack {
    padding: var(--su-space-lg) var(--su-space-xl) var(--su-space-xl);
    text-align: center;
}

.su-auth-btn {
    border-radius: var(--su-radius-md);
    font-weight: 600;
    min-width: 140px;
    transition: all var(--su-transition-smooth);
}

@media (hover: hover) and (pointer: fine) {
    .su-auth-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* =============================================================================
   COMPONENTS - DIALOGS (Filter)
   ============================================================================= */
.su-filter-dialog {
    border-radius: var(--su-radius-xl);
    overflow: hidden;
}

.su-filter-content {
    background-color: #fafafa;
    border-top: 1px solid #eee;
}

.su-filter-select .mud-input-root {
    background-color: var(--su-bg-surface);
    border-radius: var(--su-radius-md);
    transition: box-shadow var(--su-transition-base);
}

    .su-filter-select .mud-input-root:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

.su-filter-numeric .mud-input-root {
    border-radius: var(--su-radius-md);
    background-color: var(--su-bg-surface);
}

.su-filter-switch {
    font-size: 0.95rem;
}

.su-filter-actions {
    padding: 12px 24px;
    border-top: 1px solid #e0e0e0;
    background-color: var(--su-bg-surface);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Filter dialog mobile — full height, actions always visible */
@media (max-width: 600px) {
    .su-filter-dialog {
        margin: 2px !important;
        max-height: calc(100dvh - 4px) !important;
        max-height: calc(100vh - 4px) !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: var(--su-radius-lg);
    }

        .su-filter-dialog .mud-dialog-content {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            max-height: none !important;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Actions pinned at bottom */
        /*.su-filter-dialog .mud-dialog-actions,
        .su-filter-dialog .su-filter-actions {
            flex-shrink: 0 !important;
            padding: 8px 12px !important;
            border-top: 1px solid var(--su-border-light);
            background: var(--su-bg-surface);
        }*/

        /* Actions pinned at bottom */
        .su-filter-dialog .mud-dialog-actions,
        .su-filter-dialog .su-filter-actions {
            flex-shrink: 0 !important;
            padding: 8px 12px !important;
            padding-bottom: calc(8px + env(safe-area-inset-bottom, 12px)) !important; /* ADD THIS */
            border-top: 1px solid var(--su-border-light);
            background: var(--su-bg-surface);
        }

        .su-filter-dialog .mud-dialog-title {
            flex-shrink: 0 !important;
        }

        .su-filter-dialog .mud-tabs-header {
            min-height: 40px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            flex-wrap: nowrap;
        }

        .su-filter-dialog .mud-tab {
            min-height: 40px;
            padding: 6px 12px;
            font-size: 0.8rem;
            white-space: nowrap;
            min-width: auto;
        }

        .su-filter-dialog .su-filter-content {
            padding: 8px !important;
        }

            .su-filter-dialog .su-filter-content .pa-3 {
                padding: 8px !important;
            }
}

@media (min-width: 601px) and (max-width: 959px) {
    .su-filter-dialog .mud-dialog-content {
        max-height: 80vh !important;
    }
}

/* Instant close for filter popover */
/*.su-filter-popover {
    transition-duration: 0ms !important;
}*/
/*
    .su-filter-popover.mud-popover-open-false {
        transition: none !important;
        animation: none !important;
        opacity: 0 !important;
        transform: none !important;
    }*/
/* Suppress all transitions on the filter popover — open AND close */
/*.su-filter-popover,
.su-filter-popover.mud-popover-open-true,
.su-filter-popover.mud-popover-open-false {
    transition: none !important;
    animation: none !important;
}

    .su-filter-popover.mud-popover-open-false {
        opacity: 0 !important;
        pointer-events: none !important;
    }
    .su-filter-popover .mud-popover {
        transition-duration: 0ms !important;
    }*/

/* =============================================================================
   COMPONENTS - TWO-FACTOR DIGIT INPUT
   ============================================================================= */
.su-2fa-container {
    padding: 20px 0;
    animation: su-fade-in 0.3s ease-out;
}

.su-digit-input {
    width: clamp(42px, 6vw, 50px);
    height: clamp(48px, 7vw, 50px);
    text-align: center;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--su-radius-md);
    outline: none;
    transition: border-color var(--su-transition-base), box-shadow var(--su-transition-base);
    background-color: transparent;
    color: inherit;
    margin: 0 4px;
}

    .su-digit-input:focus {
        border-color: rgba(var(--mud-palette-primary-rgb), 0.6);
        box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.15);
    }

    .su-digit-input:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: rgba(0, 0, 0, 0.05);
    }

/* =============================================================================
   COMPONENTS - SESSION CARDS (Security Page)
   ============================================================================= */
.su-session-current {
    border: 2px solid var(--mud-palette-primary);
}

.su-session-online {
    border-left: 4px solid var(--mud-palette-success);
}

.su-session-idle {
    border-left: 4px solid var(--mud-palette-warning);
}

.su-session-offline {
    border-left: 4px solid var(--mud-palette-grey);
}

.su-online-indicator {
    position: absolute;
    bottom: 0;
    right: 12px;
    width: 12px;
    height: 12px;
    background-color: var(--mud-palette-success);
    border-radius: var(--su-radius-round);
    border: 2px solid white;
    animation: su-pulse 2s infinite;
}

@keyframes su-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* =============================================================================
   COMPONENTS - SHARE DIALOG
   ============================================================================= */
.su-share-dialog {
    border-radius: var(--su-radius-2xl);
    overflow: hidden;
    box-shadow: var(--su-shadow-xl);
}

/* =============================================================================
   COMPONENTS - RECONNECT MODAL
   ============================================================================= */
.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    background-color: var(--su-bg-surface, white);
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: var(--su-radius-lg);
    box-shadow: var(--su-shadow-xl);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
}

    #components-reconnect-modal[open] {
        animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
        animation-fill-mode: both;
    }

    #components-reconnect-modal::backdrop {
        background-color: rgba(0, 0, 0, 0.4);
        animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
        opacity: 1;
    }

@keyframes components-reconnect-modal-slideUp {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
    color: var(--su-text-primary);
}

#components-reconnect-modal button {
    border: 0;
    background-color: var(--mud-palette-primary, #6b9ed2);
    color: white;
    padding: 8px 24px;
    border-radius: var(--su-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--su-transition-base), transform var(--su-transition-base);
}

@media (hover: hover) and (pointer: fine) {
    #components-reconnect-modal button:hover {
        background-color: var(--mud-palette-primary-darken, #3b6ea2);
        transform: translateY(-1px);
    }
}

#components-reconnect-modal button:active {
    transform: scale(0.98);
}

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
}

    .components-rejoining-animation div {
        position: absolute;
        border: 3px solid var(--mud-palette-primary, #0087ff);
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2) {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0;
        left: 0;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal,
    #components-reconnect-modal[open],
    #components-reconnect-modal::backdrop,
    .components-rejoining-animation div {
        animation: none;
        transition: none;
    }

        #components-reconnect-modal[open] {
            opacity: 1;
        }
}

/* =============================================================================
   COMPONENTS - EMAIL VERIFICATION ALERT
   ============================================================================= */
.su-email-alert {
    margin-top: var(--su-space-md);
    border-radius: var(--su-radius-md);
}

    .su-email-alert .mud-alert-message {
        width: 100%;
    }

@media (max-width: 600px) {
    .su-email-alert,
    .su-maintenance-banner {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0;
    }
}

/* =============================================================================
   COMPONENTS - MAINTENANCE MODE
   ============================================================================= */
.su-maintenance-banner {
    margin-bottom: var(--su-space-md);
    border-radius: var(--su-radius-md);
    animation: su-slide-down 0.3s ease-out;
}

.su-maintenance-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--su-space-sm);
    width: 100%;
}

.su-maintenance-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--su-space-xs);
}

.su-maintenance-meta {
    display: flex;
    align-items: center;
    gap: var(--su-space-sm);
    margin-left: auto;
}

.su-maintenance-time {
    opacity: 0.9;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .su-maintenance-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .su-maintenance-meta {
        margin-left: 0;
        margin-top: var(--su-space-xs);
    }

    .su-maintenance-text {
        flex-direction: column;
        align-items: flex-start;
    }

        .su-maintenance-text .ml-2 {
            margin-left: 0 !important;
        }
}

.su-maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: su-fade-in 0.3s ease-out;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .su-maintenance-overlay {
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
}

.su-maintenance-card {
    max-width: 500px;
    width: calc(100% - 32px);
    border-radius: var(--su-radius-2xl);
    background: var(--su-bg-surface);
    animation: su-maintenance-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes su-maintenance-pop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.su-maintenance-indicator {
    display: flex;
    align-items: center;
    gap: var(--su-space-xs);
    padding: 4px 12px;
    background: rgba(255, 152, 0, 0.15);
    border-radius: var(--su-radius-full);
    font-size: var(--su-text-sm);
    color: #ff9800;
    font-weight: 600;
}

    .su-maintenance-indicator .mud-icon-root {
        font-size: 16px;
    }

.su-maintenance-dot {
    width: 8px;
    height: 8px;
    background-color: #ff9800;
    border-radius: 50%;
    animation: su-maintenance-pulse 1.5s ease-in-out infinite;
}

@keyframes su-maintenance-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.su-maintenance-progress {
    width: 100%;
    max-width: 300px;
    margin: var(--su-space-lg) auto;
}

.su-maintenance-progress-text {
    text-align: center;
    margin-top: var(--su-space-sm);
    font-size: var(--su-text-sm);
    color: var(--su-text-secondary);
}

/* =============================================================================
   COMPONENTS - FLOATING BACK BUTTON (consolidated single definition)
   ============================================================================= */
.su-floating-back-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1350;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth), bottom var(--su-transition-slow);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .su-floating-back-btn:hover {
        transform: scale(1.08) translateY(-2px);
        box-shadow: var(--su-shadow-elevated);
    }
}

.su-floating-back-btn:active {
    transform: scale(0.95);
}

/* Mobile < 600px */
@media (max-width: 599px) {
    .su-floating-back-btn {
        bottom: 20px;
        left: 16px;
        width: 44px;
        height: 44px;
    }

        .su-floating-back-btn.with-bottom-bar {
            bottom: 76px;
        }

    body.has-sticky-ad .su-floating-back-btn:not(.with-bottom-bar) {
        bottom: 110px;
    }

    body.has-sticky-ad .su-floating-back-btn.with-bottom-bar {
        bottom: 180px;
    }
}

/* Tablet 600–959px (bottom bar still visible) */
@media (min-width: 600px) and (max-width: 959px) {
    .su-floating-back-btn.with-bottom-bar {
        bottom: 88px;
    }

    body.has-sticky-ad .su-floating-back-btn:not(.with-bottom-bar) {
        bottom: 110px;
    }

    body.has-sticky-ad .su-floating-back-btn.with-bottom-bar {
        bottom: 180px;
    }
}

/* Desktop 960px+ — standard position, no bottom bar */
@media (min-width: 960px) {
    .su-floating-back-btn,
    .su-floating-back-btn.with-bottom-bar {
        bottom: 24px;
        left: 24px;
    }
}

/* MAUI safe area */
body.is-hybrid .su-floating-back-btn {
    bottom: calc(24px + var(--su-safe-bottom));
}

@media (max-width: 599px) {
    body.is-hybrid .su-floating-back-btn {
        bottom: calc(20px + var(--su-safe-bottom));
    }

        body.is-hybrid .su-floating-back-btn.with-bottom-bar {
            bottom: calc(76px + var(--su-safe-bottom));
        }
}

/* =============================================================================
   COMPONENTS - STICKY FILTER HEADER (consolidated single definition)
   ============================================================================= */
.su-sticky-filter-header {
    position: sticky !important;
    /* Sits just below the fixed app bar */
    top: calc(80px + var(--su-safe-top, 0px)) !important;
    z-index: 100 !important;
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
    background: var(--su-bg-primary);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 8px !important;
    margin: 0 !important;
    transition: box-shadow var(--su-transition-base);
}

    .su-sticky-filter-header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--su-border-light);
    }

    .su-sticky-filter-header.pt-8 {
        padding-top: 8px !important;
    }

/* On mobile: disable sticky — too tall when email alerts are showing */
@media (max-width: 599.98px) {
    .su-sticky-filter-header {
        position: sticky !important;
        top: calc(60px + var(--su-safe-top, 0px)) !important;
        /* top: auto !important;*/
        z-index: 100 !important;
        max-height: 45vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (min-width: 600px) and (max-width: 959px) {
    .su-sticky-filter-header {
        top: calc(52px + var(--su-safe-top, 0px)) !important;
        padding: 6px 8px !important;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        background: rgba(244, 247, 250, 0.95);
    }
}

/* =============================================================================
   COMPONENTS - BILLING HIGHLIGHT
   ============================================================================= */
.su-billing-highlight {
    background: rgba(var(--mud-palette-primary-rgb), 0.04);
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.18);
    border-radius: var(--su-radius-lg);
    padding: var(--su-space-md) var(--su-space-lg);
    transition: border-color var(--su-transition-base);
}

.su-billing-value {
    font-weight: 800;
    letter-spacing: -0.3px;
}

.su-billing-note {
    color: var(--su-text-muted);
    margin-top: 4px;
}

/* =============================================================================
   MUDBLAZOR OVERRIDES
   ============================================================================= */
.mud-chip {
    font-weight: 600;
    border-radius: 6px;
}

    .mud-chip.mud-chip-size-small {
        height: 28px;
        font-size: 0.8125rem;
    }

.mud-skeleton {
    border-radius: 6px;
}

.mud-tabs {
    border-radius: var(--su-radius-md);
    background-color: var(--mud-palette-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .mud-tabs .mud-tab {
        min-width: 100px;
    }

.mud-tabpanel {
    padding-top: var(--su-space-sm);
}

.mud-collapse {
    background: var(--mud-palette-surface);
    border-radius: var(--su-radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: var(--su-space-md);
}

.mud-fab {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth);
}

    .mud-fab:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

.mud-alert {
    border-radius: var(--su-radius-md);
    font-size: 0.85rem;
}

.mud-dialog {
    border-radius: 14px;
}

    .mud-dialog .mud-textfield {
        margin-bottom: 0.75rem;
    }

.mud-dialog-content {
    max-height: 70vh;
    overflow-y: auto;
}

.mud-autocomplete-popover {
    margin-top: 8px;
    border-radius: var(--su-radius-lg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mud-simple-table {
    border-radius: var(--su-radius-md);
    overflow: hidden;
}

    .mud-simple-table td {
        padding: 6px 8px;
        vertical-align: middle;
    }

.mud-table {
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    background-color: var(--su-bg-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

    .mud-table th {
        font-weight: 600;
        background-color: rgba(var(--mud-palette-primary-rgb), 0.05);
    }

    .mud-table tr:hover td {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.03);
    }

.mud-expansionpanel {
    border-radius: 10px;
    overflow: hidden;
}

    .mud-expansionpanel:not(:last-child) {
        margin-bottom: 6px;
    }

    .mud-expansionpanel .mud-expansionpanel-header {
        background: var(--mud-palette-background-grey);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

@media (max-width: 600px) {
    .mud-expansionpanel .mud-expansionpanel-header {
        padding: 8px 12px;
    }

    .mud-expansionpanel .mud-expansionpanel-content {
        padding: 8px 12px;
    }
}

.mud-radio-group {
    gap: 12px;
}

.mud-radio {
    margin: 8px 0;
}

.mud-select {
    margin-bottom: 8px;
}

.mud-button .mud-chip {
    margin-left: 8px;
    height: 20px;
    padding: 0 6px;
}

/* MudDialogFullscreen sizing */
@media (max-width: 960px) {
    .mud-dialog-fullscreen {
        width: 93vw !important;
        height: 90vh !important;
        max-width: 93vw !important;
        max-height: 90vh !important;
    }
}

@media (min-width: 960px) {
    .mud-dialog-fullscreen {
        width: 80vw !important;
        height: 80vh !important;
        max-width: 80vw !important;
        max-height: 80vh !important;
    }
}

/* Browser autofill label fix */
input:-webkit-autofill ~ label.mud-input-label,
input:-webkit-autofill ~ .mud-input-label {
    transform: translateY(-1.5rem) scale(0.75) !important;
    transform-origin: top left;
}

.mud-input-outlined input:-webkit-autofill ~ .mud-input-label-outlined,
.mud-input-outlined input:-webkit-autofill ~ label {
    transform: translateY(-1.5rem) scale(0.75) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* MudSwitch fix for mobile — see above for full explanation */
/* (Rule is placed earlier in this file, after the 44px tap-target rule) */

/* =============================================================================
   PAGES - BASE AUTH/ACCOUNT PAGE LAYOUT
   ============================================================================= */
.su-auth-page {
    min-height: 80vh;
    min-height: 80dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1rem, 3vw, 2rem) var(--su-space-md);
    animation: su-fade-in 0.4s ease-in-out;
}

.su-account-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(1rem, 3vw, 2rem) var(--su-space-md) clamp(2rem, 5vw, 4rem);
    animation: su-fade-in 0.4s ease-in-out;
}

/* =============================================================================
   PAGES - HERO HEADER
   ============================================================================= */
.su-hero-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    animation: su-fade-in 0.4s ease-in-out 0.05s both;
}

.su-hero-icon {
    font-size: clamp(2.5rem, 4vw, 3rem);
    color: var(--mud-palette-primary);
    margin-bottom: var(--su-space-sm);
}

.su-hero-title {
    font-weight: 800;
    color: var(--mud-palette-primary);
    letter-spacing: 0.3px;
}

.su-hero-subtitle {
    color: var(--mud-palette-text-secondary);
}

/* =============================================================================
   PAGES - CARDS
   ============================================================================= */
.su-page-card {
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-2xl);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
    max-width: 520px;
    animation: su-fade-in 0.5s ease-in-out 0.1s both;
}

    .su-page-card.wide {
        max-width: 800px;
    }

.su-section-card {
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-2xl);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    animation: su-fade-in 0.3s ease-in-out;
}

.su-section-title {
    font-weight: 700;
    color: var(--mud-palette-primary);
    margin-bottom: var(--su-space-md);
}

/* =============================================================================
   PAGES - ACCESS DENIED HEADER
   ============================================================================= */
.su-access-header {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    color: #fff;
    border-top-left-radius: var(--su-radius-2xl);
    border-top-right-radius: var(--su-radius-2xl);
    position: relative;
    overflow: hidden;
}

    .su-access-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.05) 10px, rgba(255, 255, 255, 0.05) 20px);
        animation: su-slide 20s linear infinite;
    }

@keyframes su-slide {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.su-access-icon {
    font-size: clamp(3rem, 5vw, 4rem) !important;
    color: white;
    position: relative;
    z-index: 1;
}

.su-access-title {
    font-weight: 800;
    color: white;
    position: relative;
    z-index: 1;
}

.su-access-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.su-tip-card {
    margin-top: var(--su-space-lg);
    border-radius: var(--su-radius-xl);
    background: var(--su-bg-surface);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    padding: var(--su-space-lg);
    max-width: 800px;
    width: 100%;
}

.su-current-row {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
}

/* =============================================================================
   PAGES - FOOTER
   ============================================================================= */
.su-page-footer {
    flex-shrink: 0;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: var(--su-text-sm);
    padding: var(--su-space-lg) var(--su-space-md);
    margin-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid var(--su-border-light);
    background: var(--su-bg-primary);
}

    .su-page-footer a {
        color: var(--mud-palette-primary);
        font-weight: 600;
        text-decoration: none;
    }

/* =============================================================================
   PAGES - HOME PAGE
   ============================================================================= */
.su-home {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: clamp(6vh, 10vh, 14vh); /* was clamp(12vh, 18vh, 22vh) */
    padding-bottom: var(--su-space-lg);
    padding-left: var(--su-space-md);
    padding-right: var(--su-space-md);
}

@media (max-width: 600px) {
    .su-home {
        padding-top: clamp(4vh, 7vh, 10vh); /* was clamp(8vh, 12vh, 15vh) */
        min-height: calc(100vh - 56px);
        min-height: calc(100dvh - 56px);
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (min-width: 601px) and (max-width: 960px) {
    .su-home {
        padding-top: clamp(5vh, 8vh, 12vh); /* was clamp(10vh, 15vh, 18vh) */
    }
}

.su-home-logo-container {
    margin-bottom: 0.75rem; /* was: clamp(1rem, 2.5vw, 1.5rem) */
    animation: su-float 3s ease-in-out infinite;
}

.su-home-logo {
    width: clamp(180px, 35vw, 272px);
    max-width: 80%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes su-float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.su-home-tagline {
    color: #666;
    letter-spacing: 0.01em;
}

.su-home-search-wrapper {
    width: 100%;
}

@media (max-width: 650px) {
    .su-home-search-wrapper {
        max-width: calc(100% - 5px);
    }
}

.su-home-trending {
    width: 100%;
    max-width: 584px;
}

.su-home .su-home-ad-section {
    margin-top: 1.5rem; /* was: margin-top: auto */
    padding-top: 0; /* was: clamp(2rem, 5vw, 4rem) */
}

/* Rainbow gradient text */
.su-rainbow-text {
    background: linear-gradient(90deg, #EA4335, #FBBC04, #4285F4, #0F9D58, #EA4335);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.su-home-search-card {
    border-radius: var(--su-radius-lg);
    background-color: var(--su-bg-surface);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
    transition: box-shadow var(--su-transition-slow), transform var(--su-transition-slow);
}

@media (hover: hover) and (pointer: fine) {
    .su-home-search-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
    }
}

.su-trending-list {
    flex-wrap: wrap;
    max-width: 584px;
    gap: 6px;
}

.su-trending-chip {
    cursor: pointer;
    font-weight: 500;
    height: 30px;
    font-size: 0.8rem;
    transition: all var(--su-transition-smooth);
    background-color: #f9f9f9;
}

@media (max-width: 600px) {
    .su-trending-chip {
        height: 26px;
        font-size: 0.75rem;
        padding: 0 10px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .su-trending-chip:hover {
        transform: translateY(-3px);
        background-color: #f3f3ff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        color: #3f51b5;
    }
}

.su-category-card {
    cursor: pointer;
    border-radius: 10px;
    background-color: var(--su-bg-surface);
    transition: all var(--su-transition-slow);
}

@media (hover: hover) and (pointer: fine) {
    .su-category-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
        background-color: rgba(103, 126, 234, 0.05);
    }
}

.su-sponsored-deal-card {
    cursor: pointer;
    transition: transform var(--su-transition-base), box-shadow var(--su-transition-base);
    border-radius: var(--su-radius-md);
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .su-sponsored-deal-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

.su-deal-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.3;
}

.su-home-ad-section {
    width: 100%;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================================
   PAGES - SUBSCRIPTION / PRICING
   ============================================================================= */
.su-subscription-wrapper {
    animation: su-fade-in 0.35s ease-in-out both;
    padding-bottom: clamp(2rem, 4vw, 3rem);
}

.su-current-plan-card {
    border-radius: var(--su-radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--su-bg-surface);
    transition: all var(--su-transition-smooth);
    padding: var(--su-space-lg);
}

@media (hover: hover) and (pointer: fine) {
    .su-current-plan-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
        border-color: rgba(var(--mud-palette-primary-rgb), 0.25);
    }
}

.su-plans-grid .mud-item {
    display: flex;
}

.su-plan-card {
    position: relative;
    border-radius: var(--su-radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--su-bg-surface);
    width: 100%;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
    .su-plan-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
        border-color: rgba(var(--mud-palette-primary-rgb), 0.28);
    }
}

.su-plan-card.recommended {
    border: 2px solid rgba(var(--mud-palette-primary-rgb), 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
}

.su-ribbon {
    position: absolute;
    top: 12px;
    right: -10px;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 1) 0%, rgba(var(--mud-palette-primary-rgb), 0.85) 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 14px;
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

    .su-ribbon .mud-icon-root {
        opacity: 0.95;
    }

.su-plan-name {
    font-weight: 800;
}

.su-price-line {
    font-weight: 800;
}

    .su-price-line sub {
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--mud-palette-text-secondary);
        margin-left: 2px;
    }

.su-plan-divider {
    margin: 12px 0 16px 0;
}

.su-plan-features .mud-list {
    background: transparent;
}

.su-plan-features .mud-list-item {
    border-radius: var(--su-radius-md);
    padding: 6px 10px;
    transition: background-color 0.18s ease;
}

    .su-plan-features .mud-list-item:hover {
        background: rgba(var(--mud-palette-primary-rgb), 0.05);
    }

.su-cta-btn {
    border-radius: var(--su-radius-lg);
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
    .su-cta-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    }
}

/* =============================================================================
   PAGES - ONBOARDING
   ============================================================================= */
.su-onboarding {
    padding-top: clamp(32px, 6vw, 64px);
    padding-bottom: clamp(32px, 6vw, 64px);
}

@media (max-width: 900px) {
    .su-onboarding {
        padding-top: 32px;
        padding-bottom: 48px;
    }
}

.su-onb-header {
    display: grid;
    gap: var(--su-space-sm);
    justify-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.su-onb-subtitle {
    color: var(--mud-palette-text-secondary);
    max-width: 720px;
}

.su-onb-card {
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.su-onb-hero {
    border-radius: var(--su-radius-xl);
    padding: 12px 16px;
}

.su-onb-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 12px 0;
}

.su-feat-chip {
    padding-top: 10px;
}

.su-pulse {
    animation: su-pulse-scale 2s infinite;
}

@keyframes su-pulse-scale {
    0% {
        transform: translateZ(0) scale(1);
    }

    50% {
        transform: translateZ(0) scale(1.02);
    }

    100% {
        transform: translateZ(0) scale(1);
    }
}

/* =============================================================================
   PAGES - ADMIN
   ============================================================================= */
.su-admin-container {
    padding-top: var(--su-space-md);
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

.su-admin-header {
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: var(--su-radius-lg);
    padding: var(--su-space-lg) clamp(1.25rem, 2vw, 1.75rem);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.su-admin-card {
    background-color: var(--su-bg-surface);
    border-radius: var(--su-radius-lg);
    padding: var(--su-space-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.su-stat-card {
    transition: transform var(--su-transition-base), box-shadow var(--su-transition-base);
}

@media (hover: hover) and (pointer: fine) {
    .su-stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }
}

.su-admin-tabs {
    margin-top: var(--su-space-md);
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    background-color: var(--su-bg-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.su-tab-panel {
    padding: var(--su-space-lg);
    background-color: var(--su-bg-surface);
}

.su-admin-table {
    border-radius: var(--su-radius-md);
    overflow: hidden;
}

/* =============================================================================
   COMPONENTS - PRODUCT CARDS
   ============================================================================= */
.su-product-card {
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    border: 1px solid var(--su-border-light);
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth);
    background-color: var(--mud-palette-surface);
    height: 100%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
    .su-product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    }
}

.su-product-card.has-unavailable-price {
    border-left: 3px solid #ffc107;
}

.su-product-card.out-of-stock {
    opacity: 0.85;
}

.su-product-image-container {
    position: relative;
    width: 100%;
    height: clamp(180px, 25vw, 250px);
    overflow: hidden;
    background-color: var(--mud-palette-background-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

    .su-product-image-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: transform var(--su-transition-slow);
    }

@media (hover: hover) and (pointer: fine) {
    .su-product-card:hover .su-product-image-container img {
        transform: scale(1.05);
    }
}

.su-product-card .mud-card-content {
    flex: 1;
    overflow: hidden;
}

.su-product-card .mud-card-actions {
    margin-top: auto;
}

.su-product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    min-height: 48px;
    height: 48px;
}

.su-product-brand,
.su-product-store,
.su-product-package {
    color: var(--mud-palette-text-secondary);
}

.su-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.su-badge-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.su-badge-store {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
}

.su-product-image-container .mud-chip {
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.75rem;
    opacity: 0.95;
}

.su-price-was {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Mobile product cards */
@media (max-width: 600px) {
    .su-product-card {
        border-radius: var(--su-radius-md);
    }

    .su-product-image-container {
        height: clamp(110px, 32vw, 160px);
    }

    .su-product-card .mud-card-content {
        padding: 8px !important;
    }

    .su-product-title {
        font-size: 0.8rem;
        min-height: 32px;
        height: auto;
        line-height: 1.25;
    }

    .su-product-brand, .su-product-store {
        font-size: 0.7rem;
    }

    .su-product-card .mud-typography-h6 {
        font-size: 0.95rem;
    }

    .su-badge-sale, .su-badge-stock, .su-badge-store {
        top: 4px;
        left: 4px;
        right: auto;
    }

    .su-badge-stock {
        left: auto;
        right: 4px;
    }

    .su-badge-store {
        top: auto;
        bottom: 4px;
        left: 4px;
    }

    .su-product-image-container .mud-chip {
        height: 18px !important;
        font-size: 0.6rem !important;
        padding: 0 5px !important;
    }

    .su-product-card .mud-card-actions {
        padding: 4px 8px 6px !important;
    }

    .su-product-card .su-cta-btn {
        display: none;
    }

    .su-price-was {
        font-size: 0.75rem;
    }
}

/* =============================================================================
   COMPONENTS - LIST CARDS
   ============================================================================= */
.su-list-card {
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth);
    cursor: pointer;
    border: 1px solid var(--su-border-light);
    background-color: var(--mud-palette-surface);
}

@media (hover: hover) and (pointer: fine) {
    .su-list-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
}

.su-list-card .mud-card-content {
    padding: 1.25rem 1rem;
}

.su-list-card .mud-card-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
}

.su-list-card.has-unavailable-prices {
    border-left: 3px solid #ffc107;
}

.su-list-item-unavailable {
    border-left: 3px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.05);
}

@media (max-width: 600px) {
    .su-list-card .mud-card-content {
        padding: 0.75rem !important;
    }

    .su-list-card .mud-card-actions {
        padding: 0.5rem 0.75rem !important;
    }
}

.su-create-list-card {
    border-radius: var(--su-radius-lg);
    border: 2px dashed var(--mud-palette-primary);
    background-color: var(--mud-palette-surface);
    transition: all var(--su-transition-smooth);
    cursor: pointer;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
    .su-create-list-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        border-color: var(--mud-palette-primary-darken);
    }
}

.su-create-list-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    border-color: var(--mud-palette-text-disabled);
}

    .su-create-list-card.disabled:hover {
        transform: none;
        box-shadow: none;
        background-color: var(--mud-palette-surface);
    }

.su-create-list-content {
    text-align: center;
    padding: clamp(1rem, 3vw, 2rem);
}

    .su-create-list-content .mud-icon-root {
        font-size: clamp(2.5rem, 5vw, 4rem);
        color: var(--mud-palette-primary);
        margin-bottom: var(--su-space-md);
    }

.su-create-list-card.disabled .su-create-list-content .mud-icon-root {
    color: var(--mud-palette-text-disabled);
}

@media (max-width: 600px) {
    .su-create-list-card {
        min-height: 120px;
    }
}

.su-summary-card {
    border-radius: 10px;
    border: 1px solid var(--su-border-light);
    transition: box-shadow var(--su-transition-base);
    background-color: var(--mud-palette-surface);
}

@media (hover: hover) and (pointer: fine) {
    .su-summary-card:hover {
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }
}

/* =============================================================================
   COMPONENTS - PRODUCT DETAIL PAGE
   ============================================================================= */
.su-product-left {
    position: relative;
}

.su-product-right {
    position: sticky;
    top: 96px;
}

.su-gallery-card {
    border-radius: var(--su-radius-xl);
    overflow: hidden;
    background-color: var(--mud-palette-surface);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: box-shadow var(--su-transition-slow);
}

@media (hover: hover) and (pointer: fine) {
    .su-gallery-card:hover {
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    }
}

.su-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.su-thumb {
    border: 1px solid var(--su-border-default);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--su-transition-base), box-shadow var(--su-transition-base), border-color var(--su-transition-base);
    background-color: var(--mud-palette-surface);
}

@media (hover: hover) and (pointer: fine) {
    .su-thumb:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
        border-color: rgba(var(--mud-palette-primary-rgb), 0.4);
    }
}

.su-thumb.active {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 0;
}

.su-buy-box {
    background: var(--mud-palette-surface);
    border: 1px solid var(--su-border-light);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow var(--su-transition-smooth), transform var(--su-transition-smooth);
}

@media (hover: hover) and (pointer: fine) {
    .su-buy-box:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
}

.su-price-wrap {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.su-price-main {
    font-weight: 800;
    line-height: 1;
    color: var(--mud-palette-primary);
}

.su-price-unit {
    color: var(--mud-palette-text-secondary);
}

.su-save-badge {
    animation: su-badge-pulse 2s infinite;
}

@keyframes su-badge-pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

.su-card-slim {
    border-radius: 14px;
    border: 1px solid var(--su-border-light);
    background-color: var(--mud-palette-surface);
    overflow: hidden;
    transition: transform var(--su-transition-smooth), box-shadow var(--su-transition-smooth), border-color var(--su-transition-smooth);
    height: 100%;
}

@media (hover: hover) and (pointer: fine) {
    .su-card-slim:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
        border-color: rgba(var(--mud-palette-primary-rgb), 0.3);
    }
}

.su-section {
    margin-top: 32px;
}

.su-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.su-section-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 12px 0;
}

.su-store-chip {
    font-weight: 600;
}

.su-product-sidebar-ad {
    border-radius: var(--su-radius-md);
    overflow: hidden;
    min-height: 250px;
}

.su-upgrade-cta-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--su-radius-lg);
    color: white;
}

    .su-upgrade-cta-card .mud-text-secondary {
        color: rgba(255, 255, 255, 0.8) !important;
    }

@media (max-width: 600px) {
    .su-gallery-card .mud-carousel {
        height: 260px !important;
    }

    .su-thumbs {
        gap: 6px;
    }

    .su-thumb {
        width: 52px;
        height: 52px;
    }

    .su-buy-box {
        padding: 12px;
        border-radius: var(--su-radius-md);
    }

    .su-price-main {
        font-size: 1.5rem;
    }

    .su-card-slim .mud-card-media {
        height: 90px !important;
    }

    .su-card-slim .mud-card-content {
        padding: 8px !important;
    }

    .su-section {
        margin-top: 20px;
    }

    .su-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* =============================================================================
   COMPONENTS - STICKY HEADER (Generic)
   ============================================================================= */
.su-sticky-header {
    position: sticky;
    top: 64px;
    z-index: 100;
}

/* =============================================================================
   COMPONENTS - GRADIENT ICON CIRCLE
   ============================================================================= */
.su-gradient-icon-circle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--su-radius-round);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =============================================================================
   COMPONENTS - PAGINATION
   ============================================================================= */
.su-pagination {
    margin-top: clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
    display: flex;
    justify-content: center;
}

.su-pagination-modern {
    margin-top: clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(3rem, 6vw, 5rem);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: var(--su-space-xl);
}

.su-pagination-container {
    padding: 0.75rem 1.25rem;
    border-radius: var(--su-radius-xl);
    background: var(--mud-palette-surface);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    justify-content: center;
}

.mud-pagination button {
    border-radius: var(--su-radius-round);
    width: 38px;
    height: 38px;
    margin: 0 4px;
    transition: all var(--su-transition-smooth);
}

    .mud-pagination button:hover {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
        transform: translateY(-2px);
    }

.mud-pagination .mud-selected {
    box-shadow: 0 3px 10px rgba(var(--mud-palette-primary-rgb), 0.3);
    color: white !important;
}

    .mud-pagination .mud-selected:hover {
        transform: scale(1.05);
    }

@media (max-width: 600px) {
    .su-pagination-modern {
        margin-top: var(--su-space-md);
        margin-bottom: var(--su-space-lg);
    }

    .su-pagination-container {
        width: 100%;
        border-radius: var(--su-radius-md);
        padding: 6px 10px;
    }

    .mud-pagination button {
        width: 30px;
        height: 30px;
        min-width: 30px;
        margin: 0 2px;
        font-size: 0.75rem;
    }
}

/* =============================================================================
   COMPONENTS - EMPTY STATE
   ============================================================================= */
.su-empty-state {
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem) var(--su-space-md);
    color: var(--mud-palette-text-secondary);
}

    .su-empty-state .mud-icon {
        font-size: clamp(3rem, 6vw, 5rem);
        color: var(--mud-palette-secondary);
        opacity: 0.7;
    }

    .su-empty-state h5 {
        margin-top: var(--su-space-lg);
        color: var(--mud-palette-text-primary);
    }

@media (max-width: 600px) {
    .su-empty-state {
        padding: 2rem 1rem;
    }

        .su-empty-state .mud-icon {
            font-size: 3rem;
        }
}

/* =============================================================================
   COMPONENTS - FEATURE MATRIX
   ============================================================================= */
.su-category-header {
    background-color: var(--mud-palette-background-grey);
    font-weight: 500;
}

.su-feature-matrix {
    position: relative;
}

.su-centered-col {
    display: flex;
    justify-content: center;
}

/* =============================================================================
   GLOBAL CONTAINER SPACING
   ============================================================================= */
.mud-container {
    padding-left: clamp(12px, 3vw, 24px) !important;
    padding-right: clamp(12px, 3vw, 24px) !important;
}

@media (max-width: 600px) {
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

        .mud-container .mud-container {
            padding-left: 4px !important;
            padding-right: 4px !important;
        }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */
.su-text-muted {
    color: #666;
}

.su-gap-2 {
    gap: 8px;
}

.su-cursor-pointer {
    cursor: pointer;
}

.su-create-btn {
    font-weight: 500;
    border-radius: var(--su-radius-md);
}

.su-flex-wrap {
    flex-wrap: wrap;
}

.su-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.su-muted {
    color: var(--mud-palette-text-secondary);
}

.su-rounded-xl {
    border-radius: var(--su-radius-xl);
}

.su-rounded-lg {
    border-radius: var(--su-radius-lg);
}

.su-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Circular branded bottom bar buttons */
.su-bottom-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    border: 2px solid transparent !important;
    margin: 0 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .su-bottom-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    }

.su-bottom-btn-teal {
    color: #26C6DA !important;
    border-color: #26C6DA !important;
    background-color: rgba(38, 198, 218, 0.08) !important;
}

    .su-bottom-btn-teal:hover {
        background-color: rgba(38, 198, 218, 0.18) !important;
    }

.su-bottom-btn-coral {
    color: #FF6B6B !important;
    border-color: #FF6B6B !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

    .su-bottom-btn-coral:hover {
        background-color: rgba(255, 107, 107, 0.18) !important;
    }

/* Store column responsive grid */
@media (max-width: 768px) {
    .su-store-columns {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .su-store-columns {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================================================
   MAUI HYBRID SPECIFIC STYLES
   Add class="is-hybrid" to <body> in your BlazorWebView
   ============================================================================= */
body.is-hybrid .su-appbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

body.is-hybrid a {
    -webkit-touch-callout: none;
}

body.is-hybrid .su-appbar-bottom-bar {
    padding-bottom: var(--su-safe-bottom);
}

/* =============================================================================
   FORCE LIGHT MODE
   Overrides all dark mode media queries — MUST be at end of file
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --su-bg-primary: #F4F7FA !important;
        --su-bg-surface: #ffffff !important;
        --su-bg-surface-alpha: rgba(255, 255, 255, 0.9) !important;
        --su-bg-glass: rgba(255, 255, 255, 0.75) !important;
        --su-bg-hover: rgba(0, 0, 0, 0.04) !important;
        --su-text-primary: #111 !important;
        --su-text-secondary: #5f6368 !important;
        --su-text-muted: #70757a !important;
        --su-text-hint: #9aa0a6 !important;
        --su-border-light: rgba(0, 0, 0, 0.06) !important;
        --su-border-default: rgba(0, 0, 0, 0.08) !important;
        --su-border-focus: rgba(0, 0, 0, 0.1) !important;
        --su-shadow-sm: 0 1px 6px rgba(32, 33, 36, 0.28) !important;
        --su-shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
        color-scheme: only light !important;
    }

    html, body {
        background: #F4F7FA !important;
        color: #111 !important;
    }

    .su-home {
        background-color: transparent !important;
    }

    .su-home-tagline {
        color: #666 !important;
    }

    .su-home-search-card {
        background-color: #ffffff !important;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05) !important;
    }

    .su-trending-chip {
        background-color: #f9f9f9 !important;
        color: inherit !important;
    }

    .su-category-card {
        background-color: #ffffff !important;
    }

    .su-page-card, .su-section-card {
        background: #ffffff !important;
        box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08) !important;
    }

    .su-dialog {
        background-color: #ffffff !important;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12) !important;
    }

    .su-alternatives-dialog {
        background-color: #ffffff !important;
    }

    .su-alt-card {
        background-color: #ffffff !important;
    }

    .su-gallery-card, .su-buy-box, .su-card-slim {
        background-color: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    }

    .su-thumb {
        background-color: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .su-section-divider {
        background: rgba(0, 0, 0, 0.08) !important;
    }

    .su-upgrade-cta-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }

    .su-plan-card, .su-current-plan-card {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
    }

    .su-ribbon {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18) !important;
    }

    .su-admin-header {
        background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%) !important;
    }

    .su-admin-header, .su-admin-card, .su-tab-panel {
        background-color: #ffffff !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
    }

    .mud-table {
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    }

    .su-text-muted {
        color: #666 !important;
    }

    .su-digit-input {
        background: transparent !important;
        border-color: rgba(0, 0, 0, 0.15) !important;
        color: inherit !important;
    }

    .su-divider__line {
        background-color: rgba(0, 0, 0, 0.1) !important;
    }

    .su-ad-image-container {
        background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%) !important;
    }

    .su-ad-label {
        background-color: rgba(255, 255, 255, 0.95) !important;
        color: inherit !important;
    }

    .su-ad-upgrade-prompt {
        background: linear-gradient(90deg, rgba(103, 58, 183, 0.05), rgba(63, 81, 181, 0.05)) !important;
    }

    .su-ad-banner-container.prominent {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%) !important;
    }

    .su-sidebar-ad-disclosure {
        background: rgba(255, 255, 255, 0.8) !important;
    }

    .su-sticky-upgrade-bar {
        background: linear-gradient(90deg, rgba(103, 58, 183, 0.05), rgba(63, 81, 181, 0.05)) !important;
    }

    .su-share-dialog {
        background-color: #ffffff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    }

    .su-auth-page, .su-account-page {
        background: transparent !important;
    }

    .su-maintenance-overlay {
        background-color: rgba(0, 0, 0, 0.7) !important;
    }

    .su-maintenance-card {
        background: #ffffff !important;
        box-shadow: none !important;
    }

    #components-reconnect-modal {
        background-color: #ffffff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    }

        #components-reconnect-modal::backdrop {
            background-color: rgba(0, 0, 0, 0.4) !important;
        }

    .su-gradient-icon-circle {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }

    .su-price-was {
        color: #9ca3af !important;
    }

    .mud-drawer-header {
        background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.05) 0%, rgba(var(--mud-palette-primary-rgb), 0.02) 100%) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .su-dialog-section {
        background-color: #fafafa !important;
    }

    .su-list-wrapper {
        background-color: #ffffff !important;
        box-shadow: inset 0 0 0 1px #f0f0f0 !important;
    }

    .su-list-item:hover:not(.mud-disabled) {
        background-color: rgba(103, 126, 234, 0.05) !important;
    }

    .su-warning-alert {
        background-color: #fff6e5 !important;
    }

    .su-tip-card {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
    }

    .su-current-row {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    }

    .su-sticky-filter-header {
        background: rgba(244, 247, 250, 0.95) !important;
    }
}

/* =============================================================================
   END OF SHARED UI STYLES
   ============================================================================= */


/* =============================================================================
   FIX 1: MudSwitch — suppress thumb movement on hover
   MudBlazor translates the thumb left on hover when switch is ON
   ============================================================================= */
.mud-switch:hover .mud-switch-thumb,
.mud-switch .mud-button-root:hover .mud-switch-thumb {
    transform: none !important;
    transition: none !important;
}

/* Also suppress the ripple/scale effect on the button itself */
.mud-switch .mud-button-root:hover {
    transform: none !important;
    background: transparent !important;
}

/* =============================================================================
   FIX 2: Bottom bar icon consistency
   All action icons in the bottom bar should be the same visual size
   ============================================================================= */

/* Make ALL bottom bar icon buttons the same circle size */
.su-appbar-bottom-bar .mud-icon-button,
.su-appbar-bottom-bar .mud-button-root {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

    /* Ensure icons inside are the same size */
    .su-appbar-bottom-bar .mud-icon-button .mud-icon-root,
    .su-appbar-bottom-bar .mud-button-root .mud-icon-root {
        font-size: 22px !important;
        width: 22px !important;
        height: 22px !important;
    }

/* Avatar/initial chips in bottom bar — match the circle size */
.su-appbar-bottom-bar .mud-avatar {
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
}

/* Override the tap-target minimum that inflates some icons */
@media (max-width: 600px) {
    .su-appbar-bottom-bar .mud-icon-button {
        min-width: 42px !important;
        min-height: 42px !important;
    }
}

/* =============================================================================
   FIX 3: Page content margins — prevent content bleeding to edges
   ============================================================================= */

/* Ensure account/subscription pages have consistent side padding */
.su-account-page {
    padding-left: clamp(12px, 4vw, 2rem) !important;
    padding-right: clamp(12px, 4vw, 2rem) !important;
}

    /* Ensure section cards inside account pages don't bleed */
    .su-account-page .su-section-card,
    .su-account-page .su-page-card,
    .su-account-page .su-current-plan-card {
        margin-left: 0;
        margin-right: 0;
    }

    /* Any MudText headings that are direct children shouldn't touch the edge */
    .su-account-page > .mud-typography,
    .su-account-page > .mud-container > .mud-typography {
        padding-left: 0;
        padding-right: 0;
    }

/* Global safety net — any full-width content sections */
@media (max-width: 600px) {
    .su-content-area > .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Section titles should have breathing room */
    .mud-typography.mud-typography-h5,
    .mud-typography.mud-typography-h6 {
        padding-left: 4px;
    }
}

/* =============================================================================
   ADD THESE RULES TO SharedUI.css
   Section: COMPONENTS — Bottom bar / nav icon consistency
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Neutral variant — Menu hamburger, MenuBook, unauthenticated account icon
   Matches the su-bottom-btn base (42px circle, border, hover scale) but uses
   a subtle grey palette instead of the branded teal/coral colours.
   ----------------------------------------------------------------------------- */
.su-bottom-btn-neutral {
    color: var(--su-text-primary, #333) !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
    background-color: rgba(0, 0, 0, 0.04) !important;
}

    .su-bottom-btn-neutral:hover {
        background-color: rgba(0, 0, 0, 0.10) !important;
    }

/* -----------------------------------------------------------------------------
   Unauthenticated account circle
   Uses su-bottom-btn + su-bottom-btn-neutral already — these rules just centre
   the icon and ensure the cursor is correct since it's a <div>, not a button.
   ----------------------------------------------------------------------------- */
.su-login-anon-btn {
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.su-login-anon-icon {
    font-size: 22px !important;
    color: var(--su-text-primary, #333);
    pointer-events: none; /* let clicks fall through to the div */
}

/* -----------------------------------------------------------------------------
   Authenticated avatar — sized to match the 42px circle system exactly
   ----------------------------------------------------------------------------- */
.su-login-avatar {
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

    .su-login-avatar:hover {
        transform: scale(1.08);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    }

/* -----------------------------------------------------------------------------
   MudSwitch hover fix — suppress thumb sliding left on hover when ON
   ----------------------------------------------------------------------------- */
.mud-switch .mud-button-root:hover {
    transform: none !important;
    background: transparent !important;
}

.mud-switch:hover .mud-switch-thumb {
    transform: none !important;
}

/* =============================================================================
   FIX: Right drawer scroll clearance for mobile bottom bar
   ============================================================================= */
@media (max-width: 959.98px) {
    .su-right-drawer .mud-drawer-content,
    .su-left-drawer .mud-drawer-content {
        padding-bottom: calc(64px + var(--su-safe-bottom, 0px) + var(--su-space-md)) !important;
        overflow-y: auto !important;
    }
}


/* FIX: Pin switch thumb position on hover */
.mud-switch .mud-switch-base:not(.mud-checked):hover {
    transform: translateX(0) !important;
}

.mud-switch .mud-switch-base.mud-checked:hover {
    transform: translateX(20px) !important;
}

/* =============================================================================
   FIX: MudSelect dropdown clipped by bottom app bar on mobile
   Bottom bar height = 64px (matches su-main-content-wrapper padding-bottom)
   ============================================================================= */
@media (max-width: 959.98px) {
    .mud-popover-open {
        z-index: 1500 !important; /* ✅ above overlay (1401) and app bar (1300) */
    }


    /* ✅ Only add bottom clearance OUTSIDE dialogs */
    body:not(:has(.mud-dialog-container)) .mud-popover-open .mud-list {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ✅ Inside dialogs — reset to normal */
    .mud-dialog-container .mud-popover-open .mud-list {
        padding-bottom: 8px !important;
    }

       /* .mud-popover-open .mud-list {
            padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        }*/
}


.su-left-drawer,
.su-right-drawer,
.mud-drawer {
    padding-top: calc(72px + var(--su-safe-top)) !important; /* +16px breathing room */
}


@media (max-width: 600px) {
    .su-left-drawer,
    .su-right-drawer,
    .mud-drawer {
        padding-top: calc(68px + var(--su-safe-top)) !important;
    }
}

/* LOGIN MENU — cancel the select-dropdown bottom padding fix.
   The login menu is anchored to the top bar, not the bottom, so it
   doesn't need clearance for the bottom app bar. */
@media (max-width: 959.98px) {
    .su-login-menu-popover .mud-list {
        padding-bottom: 8px !important;
    }
}

/* Prevent logo swap from being jarring */
.su-appbar .su-logo-link {
    transition: opacity 0.15s ease;
}

/* SSR placeholder search box matches the real one's dimensions */
.su-search-ssr-placeholder {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.su-search-ssr-input {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(0,0,0,0.23);
    border-radius: 4px;
    background: white;
    font-size: 16px;
    color: rgba(0,0,0,0.38);
    cursor: default;
}

.su-mobile-search-expanded {
    /* existing styles... */
    
    /* ✅ Cancel out the app bar's side padding to go edge-to-edge */
    margin-left: calc(-1 * clamp(8px, 2vw, 20px)) !important;
    margin-right: calc(-1 * clamp(8px, 2vw, 20px)) !important;
    
    width: calc(100% + (2 * clamp(8px, 2vw, 20px))) !important;
}

@media (max-width: 599px) {
    .su-mobile-search-expanded {
        margin-left: -24px !important;
        margin-right: -24px !important;
        width: calc(100% + 48px) !important;
        
    }
}

@media (max-width: 600px) {
    .su-home .su-search-container {
        /*   max-width: calc(100% + 16px) !important;*/
        width: calc(100% + 16px) !important;
        margin-left: -8px !important;
        margin-right: -8px !important;
    }

   
}

.su-mobile-search-expanded .su-suggestions-dropdown {
    overscroll-behavior: contain; /* ✅ prevents scroll leaking to body */
}

/* ✅ Prevent flicker during dialog open animation */
.su-filter-dialog {
    overflow: hidden;
    /* Add this: */
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}


/* =============================================================================
   COMPONENTS - FILTER AUTOCOMPLETE + CHIP ROW
   Add these rules into your SharedUI.css under the filter dialog section
   ============================================================================= */

/* Chip row sits just below each autocomplete field */
.su-filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 0;
    padding-top: 6px;
}

    /* Hide the chip row entirely when empty so it takes no space */
    .su-filter-chip-row:empty {
        display: none;
        padding-top: 0;
    }

/* Tighten the autocomplete field bottom margin so chips sit snug */
.su-filter-autocomplete.mud-input-control {
    margin-bottom: 0 !important;
}

/* Chips — slightly smaller close icon on mobile */
@media (max-width: 600px) {
    .su-filter-chip-row .mud-chip {
        font-size: 0.75rem;
    }
}

/* Make MudMenu popover match the activator button width */
.mud-menu-popover-full-width .mud-popover {
    width: 100% !important;
    min-width: unset !important;
}




/* =============================================================================
   LIST DETAIL PAGE — ld- prefix (List Detail)
   Add this block to the bottom of SharedUI.css
   ============================================================================= */

/* =============================================================================
   SIDEBAR — sticky, hidden on mobile
   ============================================================================= */
.ld-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: calc(72px + var(--su-safe-top));
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 80px; /* clearance for bottom bar */
}

    .ld-sidebar::-webkit-scrollbar {
        display: none;
    }

/* =============================================================================
   ACTIONS ROW — rename / share / delete
   ============================================================================= */
.ld-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0 2px;
}

.ld-action-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--su-border-default) !important;
    background: var(--su-bg-surface) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}

    .ld-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.10) !important;
        background: var(--su-bg-hover) !important;
    }

    .ld-action-btn.danger {
        border-color: rgba(211, 47, 47, 0.3) !important;
    }

        .ld-action-btn.danger:hover {
            background: rgba(211, 47, 47, 0.06) !important;
        }

/* =============================================================================
   BUDGET CARD — desktop sidebar
   ============================================================================= */
.ld-budget-card {
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid var(--su-border-light);
}

.ld-budget-card-header {
    background: linear-gradient( 135deg, rgba(var(--mud-palette-primary-rgb), 0.09) 0%, rgba(var(--mud-palette-primary-rgb), 0.03) 100% );
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--su-border-light);
}

.ld-budget-card-body {
    padding: 14px;
}

.ld-budget-amount {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--mud-palette-text-primary);
}

.ld-budget-period {
    font-size: 0.75rem;
    color: var(--su-text-muted);
    font-weight: 500;
}

.ld-budget-progress-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.07);
    overflow: hidden;
    margin: 10px 0 6px;
}

.ld-budget-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.ld-budget-remaining-label {
    font-size: 0.78rem;
    font-weight: 600;
}

.ld-budget-divider {
    height: 1px;
    background: var(--su-border-light);
    margin: 10px 0;
}

.ld-budget-monthly-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.ld-budget-explanation {
    font-size: 0.68rem;
    color: var(--su-text-hint);
    line-height: 1.4;
    margin-top: 6px;
}

/* =============================================================================
   STAT CARDS — desktop sidebar
   ============================================================================= */
.ld-stat-card {
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-md);
    padding: 10px 14px;
    border: 1px solid var(--su-border-light);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

    .ld-stat-card::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        border-radius: 0 2px 2px 0;
    }

    .ld-stat-card.items::before {
        background: var(--mud-palette-info);
    }

    .ld-stat-card.total::before {
        background: var(--mud-palette-primary);
    }

    .ld-stat-card.diff::before {
        background: var(--mud-palette-success);
    }

    .ld-stat-card.diff.up::before {
        background: var(--mud-palette-warning);
    }

.ld-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px !important;
}

.ld-stat-card.items .ld-stat-icon {
    background: rgba(var(--mud-palette-info-rgb), 0.12);
}

.ld-stat-card.total .ld-stat-icon {
    background: rgba(var(--mud-palette-primary-rgb), 0.10);
}

.ld-stat-card.diff .ld-stat-icon {
    background: rgba(var(--mud-palette-success-rgb), 0.10);
}

.ld-stat-card.diff.up .ld-stat-icon {
    background: rgba(var(--mud-palette-warning-rgb), 0.10);
}

.ld-stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--su-text-muted);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 3px;
}

.ld-stat-value {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1;
}

/* =============================================================================
   SORT INDICATOR — current sort shown in sticky header
   ============================================================================= */
.ld-sort-chip {
    font-size: 0.72rem !important;
    height: 26px !important;
    padding: 0 8px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer;
}

/* =============================================================================
   MOBILE BUDGET BAR — compact pill, xs only
   ============================================================================= */
.ld-mobile-budget-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 14px;
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-lg);
    border: 1px solid var(--su-border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    margin: 0 0 6px 0;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.15s ease;
}

    .ld-mobile-budget-bar:active {
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }

.ld-mobile-budget-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ld-mobile-budget-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--su-text-muted);
}

.ld-mobile-budget-main {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.ld-mobile-budget-remaining {
    font-size: 0.75rem;
    font-weight: 600;
}

.ld-mobile-budget-tap {
    font-size: 0.68rem;
    color: var(--su-text-hint);
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.ld-mobile-progress-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(0,0,0,0.07);
    overflow: hidden;
}

.ld-mobile-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* =============================================================================
   MOBILE BOTTOM SHEET — budget breakdown modal
   ============================================================================= */
.ld-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2100;
    display: flex;
    align-items: flex-end;
    animation: ld-overlay-fade 0.2s ease forwards;
}

@keyframes ld-overlay-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ld-sheet {
    width: 100%;
    background: var(--su-bg-surface);
    border-radius: var(--su-radius-xl) var(--su-radius-xl) 0 0;
    padding: 8px 20px 0;
    padding-bottom: calc(24px + var(--su-safe-bottom));
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: ld-sheet-slide 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes ld-sheet-slide {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.ld-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.14);
    border-radius: 2px;
    margin: 4px auto 18px;
}

.ld-sheet-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    margin-bottom: 14px;
}

/* Sheet stat row — large display */
.ld-sheet-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.ld-sheet-stat {
    background: rgba(var(--mud-palette-primary-rgb), 0.04);
    border-radius: var(--su-radius-md);
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--su-border-light);
}

.ld-sheet-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1;
    margin-bottom: 3px;
}

.ld-sheet-stat-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--su-text-muted);
    font-weight: 600;
}

/* Sheet budget progress section */
.ld-sheet-budget-section {
    background: rgba(var(--mud-palette-primary-rgb), 0.04);
    border-radius: var(--su-radius-lg);
    padding: 14px;
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.1);
    margin-bottom: 12px;
}

.ld-sheet-budget-amount {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 2px;
}

.ld-sheet-budget-period {
    font-size: 0.75rem;
    color: var(--su-text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.ld-sheet-progress-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 6px;
}

.ld-sheet-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ld-sheet-budget-remaining {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.ld-sheet-budget-note {
    font-size: 0.68rem;
    color: var(--su-text-hint);
    line-height: 1.4;
}

.ld-sheet-monthly-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-top: 1px solid var(--su-border-light);
    font-size: 0.78rem;
}

    .ld-sheet-monthly-row:first-of-type {
        margin-top: 8px;
    }

/* =============================================================================
   PRODUCT CARD REFINEMENTS — list detail specific
   ============================================================================= */

/* Taller image on desktop */
@media (min-width: 960px) {
    .su-product-card .su-product-image-container {
        height: 200px;
    }
}

/* Quantity controls alignment */
.ld-qty-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.ld-qty-badge {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* =============================================================================
   STORE FILTER CHIPS — refined
   ============================================================================= */
.ld-store-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .ld-store-chips::-webkit-scrollbar {
        display: none;
    }

/* =============================================================================
   ITEM LIMIT BADGE — counts in header
   ============================================================================= */
.ld-item-limit-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(var(--mud-palette-primary-rgb), 0.10);
    color: var(--mud-palette-primary);
    white-space: nowrap;
}

/* =============================================================================
   SET BUDGET EMPTY STATE
   ============================================================================= */
.ld-set-budget-btn {
    border: 1.5px dashed rgba(var(--mud-palette-primary-rgb), 0.4) !important;
    border-radius: var(--su-radius-md) !important;
    width: 100%;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 8px 0 !important;
    color: var(--mud-palette-primary) !important;
    transition: all 0.15s ease !important;
}

    .ld-set-budget-btn:hover {
        background: rgba(var(--mud-palette-primary-rgb), 0.05) !important;
        border-color: var(--mud-palette-primary) !important;
    }

/* =============================================================================
   ALERTS — warning / out of stock in header area
   ============================================================================= */
.ld-status-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* =============================================================================
   RESPONSIVE OVERRIDES
   ============================================================================= */

/* Mobile: hide sidebar entirely */
@media (max-width: 599px) {
    .ld-sidebar-item {
        display: none !important;
    }

    .ld-products-item {
        /* Takes full 12 cols on mobile */
    }
}

/* Tablet: sidebar takes less space */
@media (min-width: 600px) and (max-width: 959px) {
    .ld-mobile-budget-bar {
        display: none !important;
    }

    .ld-overlay {
        display: none !important;
    }
}

/* Desktop */
@media (min-width: 960px) {
    .ld-mobile-budget-bar {
        display: none !important;
    }

    .ld-overlay {
        display: none !important;
    }
}


/* Autocomplete adornment — red close icon with border when open */
.su-filter-autocomplete.ac-open .mud-input-adornment-end .mud-icon-button {
    color: var(--mud-palette-error) !important;
    border: 1.5px solid var(--mud-palette-error) !important;
    border-radius: 50% !important;
    transition: background 0.15s ease, color 0.15s ease;
}

    .su-filter-autocomplete.ac-open .mud-input-adornment-end .mud-icon-button:hover {
        background: rgba(var(--mud-palette-error-rgb), 0.08) !important;
    }



/* =============================================================================
   COMPONENTS - PRICE HISTORY SECTION — ph- prefix (Price History)
   Used in: PriceHistorySection.razor (embedded in ProductDetail page)
   Follows the same patterns as ld- (list detail) section above.
   ============================================================================= */

/* =============================================================================
   SECTION WRAPPER
   ============================================================================= */
.ph-section {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    animation: su-fade-in 0.35s ease-in-out;
}

/* =============================================================================
   SECTION HEADER — title + period selector row
   ============================================================================= */
.ph-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

/* =============================================================================
   KPI CARDS — 4-up grid (Current / Lowest / Highest / Trend)
   ============================================================================= */
.ph-kpi-card {
    border-radius: var(--su-radius-lg) !important;
    border: 1px solid var(--su-border-light) !important;
    background: var(--su-bg-surface);
    padding: 12px 14px;
    height: 100%;
    transition: box-shadow var(--su-transition-base), transform var(--su-transition-smooth);
    position: relative;
    overflow: hidden;
}

    /* Accent left-edge stripe — mirrors ld-stat-card pattern */
    .ph-kpi-card::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        border-radius: 0 2px 2px 0;
        background: var(--mud-palette-primary);
        opacity: 0.5;
    }

    .ph-kpi-card.current::before {
        background: var(--mud-palette-primary);
    }

    .ph-kpi-card.lowest::before {
        background: #388e3c;
    }

    .ph-kpi-card.highest::before {
        background: #d32f2f;
    }

    .ph-kpi-card.trend::before {
        background: var(--mud-palette-secondary);
    }

@media (hover: hover) and (pointer: fine) {
    .ph-kpi-card:hover {
        box-shadow: var(--su-shadow-md) !important;
        transform: translateY(-2px);
    }
}

/* Label — small caps above the value, mirrors ld-stat-label */
.ph-kpi-label {
    font-size: var(--su-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--su-text-muted);
    line-height: 1;
    margin-bottom: 5px;
}

/* Main value — bold, fluid size */
.ph-kpi-value {
    font-size: clamp(1.25rem, 2.5vw, 1.6rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    line-height: 1;
}

/* Change percentage line below value */
.ph-kpi-change {
    font-size: var(--su-text-xs);
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.3;
}

.ph-kpi-change--up {
    color: #d32f2f;
}

.ph-kpi-change--down {
    color: #388e3c;
}

.ph-kpi-change--flat {
    color: var(--su-text-muted);
}

/* Date hint below lowest/highest value */
.ph-kpi-date {
    font-size: var(--su-text-xs);
    color: var(--su-text-muted);
    margin-top: 3px;
    line-height: 1.2;
}

/* Trend pill chip */
.ph-trend-chip {
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    border-radius: 50px !important;
    height: 26px !important;
    padding: 0 10px !important;
}

.ph-trend-note {
    font-size: var(--su-text-xs);
    color: var(--su-text-muted);
    margin-top: 5px;
    line-height: 1.3;
}

/* =============================================================================
   PERIOD SELECTOR — button group (30d / 90d / 6m / 1y)
   ============================================================================= */
.ph-period-btn {
    border-radius: 50px !important;
    min-width: 44px !important;
    height: 30px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 0 12px !important;
    transition: all var(--su-transition-base) !important;
}

/* =============================================================================
   CHART WRAPPER
   ============================================================================= */
.ph-chart-wrap {
    border-radius: var(--su-radius-lg);
    border: 1px solid var(--su-border-light);
    padding: 1rem 0.5rem 0.5rem;
    background: var(--su-bg-surface);
    box-shadow: var(--su-shadow-md);
    transition: box-shadow var(--su-transition-slow);
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .ph-chart-wrap:hover {
        box-shadow: var(--su-shadow-lg);
    }
}

/* Ensure MudChart SVG doesn't clip labels */
.ph-chart-wrap .mud-chart-line {
    overflow: visible;
}

/* =============================================================================
   RECENT CHANGES TABLE
   ============================================================================= */
.ph-change-table td {
    padding: 5px 8px;
    font-size: var(--su-text-sm);
    vertical-align: middle;
}

.ph-change-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--su-border-light);
}

.ph-change-amount {
    font-weight: 700;
}

.ph-change-amount--up {
    color: #d32f2f;
}

.ph-change-amount--down {
    color: #388e3c;
}

/* =============================================================================
   AVERAGE PRICE FOOTER NOTE
   ============================================================================= */
.ph-avg-note {
    font-size: var(--su-text-xs);
    color: var(--su-text-muted);
    margin-top: 8px;
    display: block;
    line-height: 1.5;
}

/* =============================================================================
   EMPTY / NO-DATA STATE
   Reuses su-empty-state aesthetics but with a dashed border variant
   ============================================================================= */
.ph-no-data {
    border-radius: var(--su-radius-lg);
    border: 1.5px dashed var(--su-border-default);
    padding: clamp(1.5rem, 4vw, 2.5rem) var(--su-space-lg);
    text-align: center;
    background: var(--su-bg-primary);
    color: var(--su-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

    .ph-no-data .mud-icon-root {
        font-size: clamp(2rem, 4vw, 2.5rem);
        opacity: 0.5;
    }

/* =============================================================================
   RESPONSIVE OVERRIDES
   ============================================================================= */

/* Mobile — tighter padding, smaller KPI values */
@media (max-width: 600px) {
    .ph-section {
        margin-top: 1.25rem;
    }

    .ph-kpi-card {
        padding: 10px 12px;
    }

    .ph-kpi-value {
        font-size: 1.15rem !important;
        letter-spacing: -0.3px;
    }

    .ph-chart-wrap {
        padding: 8px 2px 4px;
        border-radius: var(--su-radius-md);
    }

    /* Period buttons — narrower on small screens */
    .ph-period-btn {
        min-width: 36px !important;
        padding: 0 8px !important;
        font-size: 0.7rem !important;
    }

    /* Expansion panel text is slightly smaller */
    .ph-change-table td {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    .ph-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Tablet — slight reduction only */
@media (min-width: 601px) and (max-width: 959px) {
    .ph-kpi-value {
        font-size: 1.35rem !important;
    }
}

/* =============================================================================
   DARK-MODE FORCE-LIGHT OVERRIDES (matches the pattern at the bottom of the file)
   These rules are placed here for co-location but the actual @media override
   block at the bottom of SharedUI.css must also include these if needed.
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    .ph-kpi-card {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .ph-chart-wrap {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .ph-no-data {
        background: #F4F7FA !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }
}

/* =============================================================================
   COMPONENTS - PRICE HISTORY SECTION v2 (ph-v2- prefix)
   Append this block to SharedUI.css after the existing ph- section.

   Design decisions implemented:
   • Desktop: always-visible card — title + trend badge + period selector
     in one header row, then 3 compact stat chips, then chart as hero,
     then recent-changes accordion (collapsed), then avg note.
   • Mobile: collapsed by default — summary row shows Low / High sub-label
     + trend pill + chevron. Tap to expand full card inline.
   • Removed 4-KPI-card layout that ate vertical space before the chart.
   • Trend badge is now inline next to the title, not a full KPI card.
   • Chart renders before period buttons on mobile (chart is the primary goal).
   ============================================================================= */

/* ── Outer shell ─────────────────────────────────────────────────────────────
   Replaces .ph-section so the component doesn't conflict with the old class.
   ─────────────────────────────────────────────────────────────────────────── */
.ph-shell {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    animation: su-fade-in 0.35s ease-in-out;
}

/* ── Desktop card — shown ≥ 600 px, hidden on mobile ────────────────────── */
.ph-desktop-card {
    background: var(--su-bg-surface);
    border: 1px solid var(--su-border-light);
    border-radius: var(--su-radius-xl);
    padding: 1.25rem;
    box-shadow: var(--su-shadow-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 599px) {
    .ph-desktop-card {
        display: none;
    }
}

/* ── Mobile card — shown < 600 px, hidden on desktop ────────────────────── */
.ph-mobile-card {
    display: none;
    background: var(--su-bg-surface);
    border: 1px solid var(--su-border-light);
    border-radius: var(--su-radius-xl);
    overflow: hidden;
    box-shadow: var(--su-shadow-md);
}

@media (max-width: 599px) {
    .ph-mobile-card {
        display: block;
    }
}

/* ── Skeleton placeholder ─────────────────────────────────────────────────── */
.ph-skeleton-card {
    gap: 10px;
}

/* ── Desktop header row: title group + period buttons ─────────────────────── */
.ph-v2-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ph-v2-title-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.ph-v2-period-wrap {
    flex-shrink: 0;
    align-self: flex-start;
}

/* ── Trend badge — inline next to title ──────────────────────────────────── */
.ph-v2-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 3px 9px 3px 6px;
    border-radius: 50px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

/* Smaller variant used in the mobile summary row */
.ph-v2-trend-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

/* ── 3-column compact stat row ───────────────────────────────────────────── */
.ph-v2-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ph-v2-stat {
    border: 1px solid var(--su-border-light);
    border-radius: var(--su-radius-md);
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.015);
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

    /* Accent left stripe — matches the ld-stat-card / ph-kpi-card pattern */
    .ph-v2-stat::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        border-radius: 0 2px 2px 0;
    }

    .ph-v2-stat.current::before {
        background: var(--mud-palette-primary);
        opacity: 0.6;
    }

    .ph-v2-stat.lowest::before {
        background: #388e3c;
        opacity: 0.6;
    }

    .ph-v2-stat.highest::before {
        background: #d32f2f;
        opacity: 0.6;
    }

.ph-v2-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--su-text-muted);
    line-height: 1;
}

.ph-v2-stat-value {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.ph-v2-stat-meta {
    font-size: 0.68rem;
    color: var(--su-text-muted);
    line-height: 1.2;
    margin-top: 1px;
}

/* Mobile stat row — slightly tighter */
.ph-v2-stats-row.mobile .ph-v2-stat {
    padding: 8px 10px;
}

.ph-v2-stats-row.mobile .ph-v2-stat-value {
    font-size: 1rem;
}

/* ── Chart wrapper — desktop and mobile variants ─────────────────────────── */
.ph-v2-chart-wrap {
    border: 1px solid var(--su-border-light);
    border-radius: var(--su-radius-lg);
    padding: 10px 4px 4px;
    background: var(--su-bg-surface);
    box-shadow: var(--su-shadow-md);
    overflow: hidden;
    transition: box-shadow var(--su-transition-slow);
}

@media (hover: hover) and (pointer: fine) {
    .ph-v2-chart-wrap:hover {
        box-shadow: var(--su-shadow-lg);
    }
}

.ph-v2-chart-wrap.mobile {
    padding: 6px 2px 2px;
    border-radius: var(--su-radius-md);
}

    /* Prevent chart SVG clipping axis labels */
    .ph-v2-chart-wrap .mud-chart-line,
    .ph-v2-chart-wrap.mobile .mud-chart-line {
        overflow: visible;
    }

/* ── Mobile toggle button ─────────────────────────────────────────────────── */
.ph-v2-mobile-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background-color var(--su-transition-base);
}

    .ph-v2-mobile-toggle:active {
        background-color: var(--su-bg-hover);
    }

@media (hover: hover) and (pointer: fine) {
    .ph-v2-mobile-toggle:hover {
        background-color: var(--su-bg-hover);
    }
}

.ph-v2-mobile-toggle-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ph-v2-mobile-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ph-v2-mobile-sublabel {
    font-size: 0.72rem;
    color: var(--su-text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Mobile expanded body ─────────────────────────────────────────────────── */
.ph-v2-mobile-body {
    padding: 0 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--su-border-light);
    padding-top: 12px;
    animation: su-fade-in 0.2s ease-in-out;
}

/* Period buttons — scroll horizontally if needed */
.ph-v2-mobile-periods {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

    .ph-v2-mobile-periods::-webkit-scrollbar {
        display: none;
    }

/* ── Force-light overrides (matches the pattern at bottom of SharedUI.css) ── */
@media (prefers-color-scheme: dark) {
    .ph-desktop-card,
    .ph-mobile-card {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .ph-v2-stat {
        background: rgba(0, 0, 0, 0.015) !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .ph-v2-chart-wrap {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }
}



.phs-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    align-self: center; /* use baseline if you want it slightly lower */
}

.phs-trend-icon {
    font-size: 16px !important;
}

.pd-price-was {
    text-decoration: line-through;
    color: var(--mud-palette-text-secondary);
    font-size: 0.95rem;
    align-self: flex-end;
    padding-bottom: 4px;
}

.pd-history-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 8px 0 4px;
    font-size: 0.84rem;
    color: var(--mud-palette-text-secondary);
}

.pd-history-pill {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.pd-history-item {
    white-space: nowrap;
}

.pd-history-date {
    color: var(--mud-palette-text-secondary);
    opacity: 0.9;
}

.pd-history-link {
    min-width: auto !important;
    padding: 0 !important;
    font-size: 0.78rem !important;
    text-transform: none !important;
}

@media (max-width: 600px) {
    .pd-history-inline {
        gap: 6px 10px;
        font-size: 0.8rem;
    }

    .pd-history-item {
        white-space: normal;
    }
}

.pd-history-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
}

/* ============================================================
   HOME PAGE — SSR STATIC BLOCK
   These styles apply to the static SSR fallback content.
   The interactive block uses your existing su-home styles.
   ============================================================ */

/* Hero text */
.su-home-static-hero {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.su-home-static-h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--mud-palette-text-primary);
    line-height: 1.3;
}

.su-home-static-tagline {
    color: var(--mud-palette-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Static search box */
.su-search-static-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.su-search-static-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.su-search-static-row {
    display: flex;
    align-items: center;
    background: var(--mud-palette-surface);
    border-radius: 28px;
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0 1.25rem;
    height: 52px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.su-search-static-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--mud-palette-text-primary);
    padding: 0;
    width: 100%;
}

    .su-search-static-input::placeholder {
        color: var(--mud-palette-text-disabled);
    }

/* Feature tiles */
.su-home-static-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .su-home-static-features {
        grid-template-columns: repeat(4, 1fr);
    }
}

.su-home-static-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    gap: 0.35rem;
    border-radius: 12px;
    background: var(--mud-palette-background-grey);
}

.su-home-static-feature-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    line-height: 1.3;
}

.su-home-static-feature-desc {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.5;
}

/* Store list */
.su-home-static-stores {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 680px;
    margin: 20px auto;
    padding: 0 1rem 1rem;
}

.su-home-static-stores-label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-disabled);
    margin-right: 0.25rem;
}

.su-home-static-store {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
}

    .su-home-static-store.coles {
        color: #ed1c24;
        background: rgba(237,28,36,0.08);
    }

    .su-home-static-store.woolworths {
        color: #009b4d;
        background: rgba(0,155,77,0.08);
    }

    .su-home-static-store.aldi {
        color: #00205b;
        background: rgba(0,32,91,0.08);
    }

    .su-home-static-store.iga {
        color: #e31837;
        background: rgba(227,24,55,0.08);
    }

    .su-home-static-store.costco {
        color: #005daa;
        background: rgba(0,93,170,0.08);
    }

@media (max-width: 600px) {
    .su-home-static-features {
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .su-home-static-feature {
        padding: 0.6rem;
    }

    .su-home-static-h1 {
        font-size: 1.25rem;
    }
}




@media (max-width: 600px) {
    .su-home-static-h1 {
        font-size: 1.1rem; /* was 1.25rem — saves about a line */
    }

    .su-home-static-tagline {
        font-size: 0.78rem; /* was 0.9rem — tighter */
        line-height: 1.5;
    }

    .su-home-static-hero {
        margin-bottom: 1rem; /* was 1.5rem — tighten gap to search */
    }

    .su-search-static-wrapper {
        margin-bottom: 1rem; /* was 1.5rem */
    }
}

/* =============================================================================
   COMPONENTS - SSR NAVBAR PLACEHOLDER
   Shown during prerender before MudBlazor paints .mud-layout.
   Uses the same design tokens as .su-appbar-top-bar so the transition
   is invisible to the user.
   Hidden automatically via CSS :has() + sibling selector once Blazor
   hydrates and .mud-layout appears — zero JavaScript required.
   ============================================================================= */

.ssr-navbar-placeholder {
    /* Match .su-appbar-top-bar exactly */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1300 !important;
    transform: none !important;
    will-change: auto !important;
    display: flex;
    align-items: center;
    /* Match the exact padding from .su-appbar-top-bar */
    padding-top: calc(var(--su-space-xs) + var(--su-safe-top)) !important;
    padding-bottom: var(--su-space-xs);
    padding-left: clamp(8px, 2vw, 20px);
    padding-right: clamp(8px, 2vw, 20px);
    /* Glass effect — matches .su-appbar-top-bar */
    background: var(--su-bg-glass);
    border-radius: 0 0 var(--su-radius-lg) var(--su-radius-lg);
    box-shadow: var(--su-shadow-md);
    /* Height matches MudAppBar default */
    height: 64px;
    gap: 12px;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .ssr-navbar-placeholder {
        -webkit-backdrop-filter: blur(14px) saturate(160%);
        backdrop-filter: blur(14px) saturate(160%);
    }
}

@media (max-width: 600px) {
    .ssr-navbar-placeholder {
        height: 56px;
        padding-top: calc(6px + var(--su-safe-top)) !important;
        padding-bottom: 6px;
        padding-left: 8px;
        padding-right: 8px;
        border-radius: 0 0 var(--su-radius-md) var(--su-radius-md);
        gap: 8px;
    }
}

/* ── Hamburger menu skeleton — left side ───────────────────────────────── */
.ssr-navbar-placeholder__menu {
    width: 40px;
    height: 40px;
    border-radius: var(--su-radius-round);
    background: var(--su-bg-hover);
    flex-shrink: 0;
    /* Subtle shimmer so it doesn't look broken */
    background: linear-gradient( 90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75% );
    background-size: 200% 100%;
    animation: ssr-shimmer 1.5s infinite;
}

@media (max-width: 600px) {
    .ssr-navbar-placeholder__menu {
        width: 36px;
        height: 36px;
    }
}

/* ── Logo skeleton — matches .su-navbar-logo dimensions ───────────────── */
.ssr-navbar-placeholder__logo {
    /* Mirrors the logo image dimensions from su-navbar-logo */
    width: clamp(90px, 15vw, 140px);
    height: 36px;
    border-radius: var(--su-radius-sm);
    flex-shrink: 0;
    background: linear-gradient( 90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75% );
    background-size: 200% 100%;
    animation: ssr-shimmer 1.5s infinite;
    animation-delay: 0.1s;
}

/* Hide logo on mobile — matches your layout B (no logo on small screens) */
@media (max-width: 600px) {
    .ssr-navbar-placeholder__logo {
        display: none;
    }
}

/* ── Search bar skeleton — matches .su-search-wrapper exactly ─────────── */
.ssr-navbar-placeholder__search {
    flex: 1;
    /* Matches su-search-container max-width */
    max-width: 584px;
    height: 46px;
    /* Matches su-search-wrapper: pill shape, surface bg, shadow */
    border-radius: var(--su-radius-full);
    background: var(--su-bg-surface);
    box-shadow: var(--su-shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 0 auto;
    /* Inner search icon hint — mimics the real search bar */
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    pointer-events: none;
}

    /* Search icon dot */
    .ssr-navbar-placeholder__search::before {
        content: '';
        width: 20px;
        height: 20px;
        border-radius: var(--su-radius-round);
        background: rgba(0, 0, 0, 0.10);
        flex-shrink: 0;
    }

    /* Search text hint line */
    .ssr-navbar-placeholder__search::after {
        content: '';
        flex: 1;
        height: 14px;
        border-radius: var(--su-radius-sm);
        background: rgba(0, 0, 0, 0.06);
        max-width: 200px;
    }

/* Mobile: search fills available space between two icon buttons */
@media (max-width: 600px) {
    .ssr-navbar-placeholder__search {
        max-width: 100%;
        height: 40px;
        border-radius: var(--su-radius-xl);
        margin: 0;
        padding: 0 12px;
    }
}

/* ── Right side icon group — account + categories ──────────────────────── */
.ssr-navbar-placeholder__icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ssr-navbar-placeholder__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--su-radius-round);
    background: linear-gradient( 90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75% );
    background-size: 200% 100%;
    animation: ssr-shimmer 1.5s infinite;
    flex-shrink: 0;
}

    .ssr-navbar-placeholder__icon:nth-child(2) {
        animation-delay: 0.2s;
    }

@media (max-width: 600px) {
    .ssr-navbar-placeholder__icon {
        width: 36px;
        height: 36px;
    }
}

/* ── Shimmer animation ─────────────────────────────────────────────────── */
@keyframes ssr-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Auto-hide once Blazor hydrates ────────────────────────────────────── */
/*
 * Strategy 1: :has() selector — hides placeholder when .mud-layout
 * exists anywhere on the page. Supported in Chrome 105+, Safari 15.4+,
 * Firefox 121+. Covers the vast majority of your users.
 */
body:has(.mud-layout) .ssr-navbar-placeholder {
    display: none !important;
}

/*
 * Strategy 2: Adjacent sibling selector — placeholder must be placed
 * IMMEDIATELY before the Blazor Routes component in App.razor.
 * Works in all browsers as a fallback.
 */
.mud-layout ~ .ssr-navbar-placeholder {
    display: none !important;
}

/*
 * Strategy 3: MAUI hybrid — hide entirely on native app.
 * MAUI renders the nav natively or handles it differently.
 */
body.is-hybrid .ssr-navbar-placeholder {
    display: none !important;
}

/* ── Force-light override ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .ssr-navbar-placeholder {
        background: rgba(255, 255, 255, 0.75) !important;
        box-shadow: var(--su-shadow-md) !important;
    }

    .ssr-navbar-placeholder__search {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }
}

/* =============================================================================
   END SSR NAVBAR PLACEHOLDER
   ============================================================================= */

/* =============================================================================
   AUTHORIZING SKELETON — shared shimmer utility
   Used in Routes.razor <Authorizing> block
   ============================================================================= */
.ssr-skel {
    background: linear-gradient( 90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 75% );
    background-size: 200% 100%;
    animation: ssr-shimmer 1.5s infinite;
    flex-shrink: 0;
}

/* Mobile — collapse to single column */
@media (max-width: 600px) {
    .ssr-skel[style*="width:420px"],
    .ssr-skel[style*="height:420px"] {
        height: 260px !important;
    }
}

@media (prefers-color-scheme: dark) {
    .ssr-skel {
        background: linear-gradient( 90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.06) 75% ) !important;
        background-size: 200% 100% !important;
    }
}



.su-home-static-h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--mud-palette-text-primary);
    line-height: 1.3;
    border: none; /* ← add this */
    outline: none; /* ← add this */
}

h1, h2, h3, h4, h5, h6 {
    border: none;
    outline: none;
}


/* ── Blazor reconnect flash suppression ─────────────────────────────────── */

/* Dim content while disconnected — keeps layout stable, no jarring blank */
body.blazor-disconnected .su-main-content {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Fade back in smoothly after reconnect */
body.blazor-reconnected .su-main-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Spinner inside reconnect modal */
.reconnect-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--mud-palette-primary, #1976d2);
    border-radius: 50%;
    animation: reconnect-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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