:root {
    --bg: #071019;
    --bg-secondary: #0c1724;
    --surface-1: #101b2a;
    --surface-2: #172535;
    --surface-3: #233548;
    --fg: #f4f8fc;
    --fg-secondary: rgb(236 242 248 / 72%);
    --fg-tertiary: rgb(236 242 248 / 44%);
    --accent: #f1b24f;
    --accent-blue: #74c8ff;
    --accent-green: #4ade80;
    --accent-red: #ff6b6b;
    --amber: #f1b24f;
    --amber-dim: rgb(241 178 79 / 18%);
    --ice: #74c8ff;
    --ice-dim: rgb(116 200 255 / 18%);
    --burgundy: #cf6679;
    --burgundy-dim: rgb(207 102 121 / 18%);
    --gold: #ffd371;
    --gold-glow: rgb(255 211 113 / 30%);
    --separator: rgb(173 186 205 / 16%);
    --separator-thick: rgb(173 186 205 / 24%);
    --glass-bg: rgb(14 22 33 / 76%);
    --glass-border: rgb(255 255 255 / 8%);
    --glass-blur: blur(34px) saturate(165%) contrast(110%);
    --card: rgb(16 25 37 / 90%);
    --card-border: rgb(255 255 255 / 7%);
    --card-highlight: rgb(255 255 255 / 4%);
    --card-shadow: 0 18px 50px rgb(2 6 12 / 22%), 0 0 0 1px rgb(255 255 255 / 3%);
    --input-bg: rgb(118 130 150 / 12%);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-snappy: cubic-bezier(0.2, 0.9, 0.3, 1.2);
    --nav-h: 50px;
    --header-h: 52px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-xxl: 36px;
    --thumb-radius: 14px;
    --radius-card: 18px;
    --text-xs: 10px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 36px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-9: 36px;
    --space-10: 40px;
    --space-11: 48px;
    --space-12: 56px;
    --font-stack:
        -apple-system, blinkmacsystemfont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
    --font-display:
        -apple-system, blinkmacsystemfont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    /* Size-specific tracking — tighten large, loosen small */
    --tracking-4xl: -0.03em;
    --tracking-3xl: -0.025em;
    --tracking-2xl: -0.02em;
    --tracking-xl: -0.015em;
    --tracking-lg: -0.01em;
    --tracking-md: -0.005em;
    --tracking-base: 0;
    --tracking-sm: 0.01em;
    --tracking-xs: 0.02em;
    --vh: 1vh;

    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    touch-action: manipulation;
    text-size-adjust: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: calc(var(--vh, 1vh) * 100);
    min-height: 100dvh;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
}

body {
    background:
        radial-gradient(1200px 700px at 10% 0%, rgb(116 200 255 / 14%), transparent 55%),
        radial-gradient(900px 600px at 90% 5%, rgb(241 178 79 / 12%), transparent 50%),
        radial-gradient(900px 700px at 72% 90%, rgb(207 102 121 / 10%), transparent 55%),
        linear-gradient(180deg, #071019 0%, #0a1320 55%, #071019 100%);
    color: var(--fg);
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

input,
textarea {
    user-select: text !important;
}

.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;
}

/* ─── Grain Texture Overlay ─── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    mix-blend-mode: overlay;
}

.app-container,
.bottom-nav,
.tab-view,
.modal-content,
.hero-card,
.search-card,
.search-item,
.favorite-card {
    transform: translateZ(0);
}

/* ─── App Shell ─── */
.app-container {
    position: relative;
    /* Na iOS Safari standalone, 100dvh jest ok. Usuwamy height:100% które
     na iOS standalone mode może przeciąż minimalną wysokość i zepsuć flex. */
    height: 100dvh;
    height: calc(var(--vh, 1svh) * 100);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.3s var(--ease-out),
        transform 0.3s var(--ease-out),
        scale 0.3s var(--ease-out),
        border-radius 0.3s var(--ease-out),
        filter 0.3s var(--ease-out);
}

body.app-loaded .app-container {
    opacity: 1;
    transform: translateY(0);
}

.app-container.scale-back {
    transform: scale(0.92);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.content-area {
    flex: 1;
    min-height: 0;
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;
}

.content-area::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* ─── Atmospheric Background ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 560px at 14% -8%, rgb(116 200 255 / 10%), transparent 58%),
        radial-gradient(720px 420px at 88% 12%, rgb(241 178 79 / 8%), transparent 52%),
        radial-gradient(620px 620px at 72% 82%, rgb(207 102 121 / 8%), transparent 54%),
        radial-gradient(540px 420px at 50% 100%, rgb(116 200 255 / 5%), transparent 60%),
        linear-gradient(180deg, rgb(0 0 0 / 18%), rgb(0 0 0 / 0%));
}

/* ─── Header ─── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 120;
    padding-top: env(safe-area-inset-top, 0);
    background: rgb(9 16 24 / 74%);
    backdrop-filter: blur(42px) saturate(165%);
    border-bottom: 0.5px solid rgb(173 186 205 / 16%);
    box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

.header-main {
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    height: 30px;
    width: 30px;
    border-radius: 7px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
}

.app-header h1 {
    font-size: 20px;
    font-weight: 720;
    letter-spacing: var(--tracking-xl);
    margin: 0;
    font-family: var(--font-display);
    transition: font-size 0.25s var(--ease-out), letter-spacing 0.25s var(--ease-out);
}

.app-header h1.header-collapsed {
    font-size: 16px;
    letter-spacing: var(--tracking-md);
}

/* ─── Bottom Navigation — iOS 18 ─── */
.bottom-nav {
    /* Sticky bottom — flex-shrink:0 + flex-direction:column na .app-container
     automatycznie umieszcza pasek na dole bez potrzeby position:fixed.
     To eliminuje błąd iOS gdzie env(safe-area-inset-bottom) = 0 przy cold start. */
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    /* Fallback dla starszych iOS bez wsparcia env() */
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 6px;
    border-top: 0.5px solid rgb(173 186 205 / 16%);
    background: rgb(9 16 24 / 78%);
    backdrop-filter: blur(42px) saturate(165%) contrast(108%);
    transition:
        transform 0.28s var(--ease-out),
        opacity 0.28s var(--ease-out);
    box-shadow: 0 -10px 24px rgb(0 0 0 / 16%);
}

.bottom-nav.tab-bar-hidden {
    transform: translate3d(0, 100%, 0);
    opacity: 0;
    pointer-events: none;
}

body.keyboard-open .bottom-nav {
    transform: translate3d(0, 100%, 0);
    opacity: 0;
    pointer-events: none;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 44px;
    padding: 0 8px;
    color: rgb(236 242 248 / 38%);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s var(--ease-out);
    gap: 2px;
}

.nav-item:active {
    transform: scale(0.95);
    transition: transform 0.12s var(--ease-snappy);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active .nav-icon svg {
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgb(212 160 23 / 35%));
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.28s var(--ease-spring);
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

.nav-item.active .nav-icon {
    transform: scale(1.1) translateY(-1px);
}

.nav-label {
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    opacity: 0.8;
}

/* ─── Tabs (iOS crossfade) ─── */
.tab-view {
    display: none;
    padding: 0 18px;
    width: 100%;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    will-change: opacity, transform;
}

.tab-view.active {
    display: block;
    opacity: 1;
}

#tab-start.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.tab-flex-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tab-view.tab-exit {
    opacity: 0;
    transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

.large-title-spacer {
    height: max(12px, env(safe-area-inset-top, 0px));
    flex-shrink: 0;
}

.empty-state-text {
    opacity: 0.5;
    font-weight: 500;
    font-size: 18px;
}

.recent-scroll--spaced {
    margin-top: clamp(6px, 1vh, 10px);
}

/* ─── Glass Utility ─── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 0.5px solid var(--glass-border);
}

/* ─── Premium Hero Card (Dashboard) — iOS Premium ─── */
.premium-hero {
    position: relative;
    background:
        linear-gradient(155deg, rgb(16 25 37 / 94%), rgb(12 20 31 / 92%)),
        radial-gradient(120% 90% at 0% 0%, rgb(116 200 255 / 10%), transparent 46%),
        radial-gradient(120% 90% at 100% 0%, rgb(241 178 79 / 8%), transparent 42%);
    border-radius: var(--radius-xxl);
    padding: clamp(14px, 2.8vh, 24px);
    border: 1px solid rgb(255 255 255 / 8%);
    backdrop-filter: blur(42px) saturate(160%) contrast(108%);
    box-shadow:
        0 20px 60px rgb(0 0 0 / 22%),
        0 0 0 0.5px rgb(255 255 255 / 4%),
        inset 0 1px 0 rgb(255 255 255 / 7%);
    overflow: hidden;
    transition:
        transform 0.3s var(--ease-spring),
        box-shadow 0.25s var(--ease-out);
}

.premium-hero:active {
    transform: translateY(1px) scale(0.988);
    box-shadow: 0 6px 24px rgb(0 0 0 / 20%);
}

/* Bokeh light spots */
.bokeh-spot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(20px);
    opacity: 0.65;
}

.bokeh-spot--1 {
    top: -28px;
    right: -16px;
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgb(241 178 79 / 16%), transparent 70%);
}

.bokeh-spot--2 {
    bottom: -34px;
    left: -28px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgb(116 200 255 / 10%), transparent 70%);
}

.hero-halo {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.95;
    filter: blur(10px);
}

.hero-halo--amber {
    top: 14px;
    right: 14px;
    width: 76px;
    height: 76px;
    background: radial-gradient(circle, rgb(241 178 79 / 24%), transparent 68%);
}

.hero-halo--blue {
    left: 16px;
    bottom: 18px;
    width: 88px;
    height: 88px;
    background: radial-gradient(circle, rgb(116 200 255 / 18%), transparent 70%);
}

/* Greeting header */
.greeting-header {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vh, 14px);
    margin-bottom: clamp(12px, 2vh, 18px);
    position: relative;
    z-index: 1;
}

.profile-icon {
    width: clamp(40px, 6vh, 52px);
    height: clamp(40px, 6vh, 52px);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgb(21 33 48 / 94%), rgb(12 20 31 / 96%)),
        radial-gradient(circle at 20% 20%, rgb(116 200 255 / 12%), transparent 55%);
    border: 1px solid rgb(116 200 255 / 18%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 0 0 3px rgb(116 200 255 / 7%),
        0 0 18px rgb(116 200 255 / 12%),
        inset 0 1px 0 rgb(255 255 255 / 8%);
    transition: box-shadow 0.3s var(--ease-out);
}

.profile-icon:active {
    box-shadow:
        0 0 0 4px rgb(48 209 88 / 14%),
        0 0 24px rgb(48 209 88 / 20%);
}

.profile-icon-svg,
.profile-icon svg {
    width: 26px;
    height: 26px;
    color: var(--ice);
    stroke-width: 1.8;
    filter: drop-shadow(0 0 6px rgb(116 200 255 / 28%));
}

.greeting-title {
    font-size: clamp(22px, 3.8vh, 30px);
    font-weight: 760;
    margin: 0;
    letter-spacing: -0.7px;
    background: linear-gradient(135deg, var(--fg), rgb(255 255 255 / 74%));
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-display);
}

.greeting-sub {
    font-size: clamp(12px, 1.9vh, 14px);
    margin: 2px 0 0;
    opacity: 0.72;
    font-weight: 420;
    letter-spacing: -0.12px;
    max-width: 42ch;
}

/* Hero stats row */
.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgb(255 255 255 / 4%);
    border-radius: 18px;
    padding: clamp(10px, 2vh, 14px) clamp(10px, 2vw, 14px);
    border: 1px solid rgb(255 255 255 / 5%);
    position: relative;
    z-index: 1;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: clamp(2px, 0.35vh, 3px);
}

.stat-icon,
.hero-stat-item svg {
    width: clamp(15px, 2.5vh, 18px);
    height: clamp(15px, 2.5vh, 18px);
    opacity: 0.5;
    margin-bottom: clamp(1px, 0.3vh, 2px);
    stroke-width: 1.8;
}

.stat-icon--star,
[data-lucide='star'] {
    color: var(--gold);
    opacity: 0.9;
    filter: drop-shadow(0 0 6px var(--gold-glow));
}

.hero-stat-val {
    font-size: clamp(16px, 3vh, 22px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.hero-stat-label {
    font-size: 9px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.54;
}

.hero-divider {
    width: 1px;
    height: clamp(18px, 3vh, 24px);
    background: rgb(255 255 255 / 5%);
    opacity: 0.5;
}

.category-truncate {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Badges Section ─── */
.badges-section {
    margin-top: clamp(10px, 1.8vh, 20px);
    position: relative;
    z-index: 1;
}

.badges-section-title {
    font-size: clamp(13px, 2vh, 16px);
    font-weight: 650;
    margin: 0 0 clamp(8px, 1vh, 10px);
    color: var(--fg);
    letter-spacing: -0.3px;
    font-family: var(--font-display);
}

.badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 0.8vh, 10px);
}

.badge-card {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vh, 10px);
    padding: clamp(8px, 1.2vh, 12px) clamp(8px, 1.2vh, 12px) clamp(8px, 1.2vh, 12px)
        clamp(10px, 1.5vh, 14px);
    border-radius: 18px;
    background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
    border: 1px solid rgb(255 255 255 / 6%);
    backdrop-filter: blur(14px);
    transition:
        transform 0.15s var(--ease-spring),
        background 0.15s var(--ease-out);
}

.badge-card:active {
    transform: scale(0.96);
    background: rgb(255 255 255 / 5%);
}

.badge-pin {
    width: clamp(30px, 5vh, 40px);
    height: clamp(30px, 5vh, 40px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 2px 8px rgb(0 0 0 / 30%),
        inset 0 1px 0 rgb(255 255 255 / 20%);
}

.badge-pin:empty {
    background: linear-gradient(145deg, #3a3a3c, #2c2c2e);
}

.badge-icon-svg,
.badge-pin svg {
    width: clamp(16px, 2.5vh, 20px);
    height: clamp(16px, 2.5vh, 20px);
    color: rgb(10 10 10 / 90%);
    stroke-width: 2.2;
}

.badge-info {
    flex: 1;
    min-width: 0;
}

.badge-name {
    font-size: clamp(10px, 1.6vh, 12px);
    font-weight: 650;
    letter-spacing: -0.12px;
    margin-bottom: clamp(3px, 0.4vh, 5px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-progress-track {
    height: clamp(3px, 0.6vh, 4px);
    border-radius: 999px;
    background: rgb(255 255 255 / 8%);
    overflow: hidden;
    margin-bottom: 3px;
}

.badge-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), rgb(241 178 79 / 58%));
    transition: width 0.6s var(--ease-out);
}

.badge-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-count {
    font-size: clamp(8px, 1.2vh, 10px);
    font-weight: 500;
    opacity: 0.5;
    letter-spacing: -0.05px;
}

.badge-tier {
    font-size: clamp(7px, 1.2vh, 8.5px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.35;
}

/* ─── NEW START SCREEN ─── */

/* Greeting bar */
.start-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgb(255 255 255 / 4%);
    border-radius: 20px;
    border: 0.5px solid rgb(255 255 255 / 7%);
    margin-bottom: 12px;
    animation-duration: 0.35s;
}

.start-greeting-emoji {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgb(0 0 0 / 30%));
}

.start-greeting-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.start-greeting-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--fg);
    font-family: var(--font-display);
}

.start-greeting-sub {
    font-size: 12px;
    color: var(--fg-secondary);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 700;
    color: rgb(255 159 10);
    background: rgb(255 159 10 / 14%);
    border: 0.5px solid rgb(255 159 10 / 22%);
    border-radius: 999px;
    padding: 4px 10px 4px 7px;
    flex-shrink: 0;
    letter-spacing: -0.2px;
    transition: transform 0.3s var(--ease-spring), color 0.2s var(--ease-out);
}

.start-streak.bump {
    transform: scale(1.15);
    color: rgb(255 180, 40);
}

.start-streak svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
    color: rgb(255 159 10);
}

/* Stats grid */
.start-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.start-stat-card {
    background: rgb(255 255 255 / 4%);
    border-radius: 20px;
    border: 0.5px solid rgb(255 255 255 / 7%);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.15s var(--ease-out);
}

.start-stat-card:active {
    background: rgb(255 255 255 / 7%);
}

.start-stat-main {
    grid-column: span 1;
    background: linear-gradient(145deg, rgb(116 200 255 / 7%), rgb(116 200 255 / 2%));
    border-color: rgb(116 200 255 / 14%);
}

.start-stat-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.start-stat-ico {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
    opacity: 0.5;
    flex-shrink: 0;
}

.start-stat-ico--gold {
    color: var(--gold);
    opacity: 0.85;
    filter: drop-shadow(0 0 4px var(--gold-glow));
}

.start-stat-ico--cat {
    color: var(--cat-color, var(--accent));
    opacity: 1;
}

.start-stat-ico--trophy {
    color: rgb(255 214 10);
    opacity: 1;
    filter: drop-shadow(0 0 4px rgb(255 214 10 / 40%));
}

.start-stat-lbl {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.45;
}

.start-stat-big {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: var(--tracking-4xl);
    line-height: 1;
    color: var(--fg);
    font-family: var(--font-display);
}

.start-stat-big--sm {
    font-size: 28px;
    letter-spacing: var(--tracking-3xl);
}

.start-stat-sub {
    font-size: 11px;
    color: var(--fg-tertiary);
    font-weight: 400;
}

.start-stat-cat {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--cat-color, var(--fg));
    line-height: 1.1;
}

/* Rating bar */
.start-rating-bar {
    height: 4px;
    background: rgb(255 255 255 / 8%);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.start-rating-fill {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    transform: scaleX(var(--fill, 0));
    transform-origin: left;
    transition: transform 0.5s var(--ease-out);
}

/* Best entry card */
.start-stat-best {
    grid-column: span 2;
    background: linear-gradient(135deg, rgb(255 214 10 / 6%), rgb(255 159 10 / 4%));
    border-color: rgb(255 214 10 / 14%);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
}

.start-best-name {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.2px;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 65%;
}

.start-best-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: rgb(255 214 10);
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

.start-best-rating svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
    fill: rgb(255 214 10);
}

.start-stat-empty {
    grid-column: span 1;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    text-align: center;
}

/* ─── Quick Actions — iOS Premium ─── */

/* ─── Quick Actions — REDESIGNED ─── */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 1vh, 12px);
    margin-top: clamp(10px, 1vh, 14px);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(8px, 1.5vh, 12px);
    padding: clamp(12px, 1.8vh, 18px) clamp(13px, 2.5vw, 16px);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    font-size: clamp(13px, 2vh, 15px);
    font-weight: 650;
    letter-spacing: -0.18px;
    background: linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%));
    backdrop-filter: blur(8px);
    color: var(--accent);
    cursor: pointer;
    min-height: clamp(52px, 7vh, 64px);
    box-shadow:
        0 10px 28px rgb(0 0 0 / 24%),
        inset 0 0.5px 0 rgb(255 255 255 / 4%);
    transition:
        transform 0.15s var(--ease-spring),
        background 0.15s var(--ease-out),
        box-shadow 0.15s var(--ease-out);
}

.action-btn:active {
    transform: scale(0.97);
    background: rgb(241 178 79 / 10%);
    box-shadow: 0 3px 12px rgb(0 0 0 / 18%);
}

@media (hover: hover) and (pointer: fine) {
    .action-btn:hover {
        background: rgb(212 160 23 / 7%);
    }
}

.action-btn.secondary {
    color: var(--fg);
}

.action-btn.secondary:active {
    background: rgb(255 255 255 / 6%);
}

@media (hover: hover) and (pointer: fine) {
    .action-btn.secondary:hover {
        background: rgb(255 255 255 / 4%);
    }
}

/* Action icon — colored circle background */
.action-icon-wrap {
    width: clamp(28px, 4.5vh, 34px);
    height: clamp(28px, 4.5vh, 34px);
    border-radius: 12px;
    background: rgb(241 178 79 / 14%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn.secondary .action-icon-wrap {
    background: rgb(255 255 255 / 6%);
}

.action-icon-wrap svg,
.action-icon-svg {
    width: clamp(15px, 2.5vh, 18px);
    height: clamp(15px, 2.5vh, 18px);
    stroke-width: 2.5;
}

.action-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Section Header ─── */
.section-container {
    flex-shrink: 0;
    margin-bottom: clamp(8px, 2vh, 24px);
    margin-top: clamp(10px, 2.5vh, 30px);
    padding-top: clamp(12px, 2vh, 24px);
    border-top: 0.5px solid rgb(173 186 205 / 16%);
}

.section-header-flex {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: clamp(4px, 1vh, 8px);
}

.section-title {
    font-size: clamp(13px, 2vh, 16px);
    font-weight: 650;
    margin: 0;
    color: var(--fg);
    letter-spacing: -0.2px;
    font-family: var(--font-display);
}

.section-title--flush {
    margin: 0;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.84;
    transition: opacity 0.2s var(--ease-out);
}

.link-btn:active {
    opacity: 0.4;
}

/* ─── Recently Rated — iOS Premium ─── */
.recent-scroll {
    display: flex;
    gap: clamp(6px, 1vh, 10px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 6px 0 clamp(10px, 1.5vh, 14px);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.recent-scroll::-webkit-scrollbar {
    display: none;
}

.recent-card {
    flex: 0 0 clamp(110px, 20vw, 170px);
    background: linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%));
    border-radius: 22px;
    padding: clamp(8px, 1.5vh, 18px) clamp(10px, 1.5vw, 14px) clamp(8px, 1.2vh, 14px);
    scroll-snap-align: start;
    box-shadow:
        0 14px 34px rgb(0 0 0 / 18%),
        0 0 0 0.5px rgb(255 255 255 / 4%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 0.5px solid var(--card-border);
    position: relative;
    overflow: hidden;
    transition:
        transform 0.25s var(--ease-spring),
        box-shadow 0.2s var(--ease-out);
}

.recent-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(255 255 255 / 5%), transparent 55%);
    pointer-events: none;
    border-radius: inherit;
}

.recent-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 6%), transparent);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.recent-card:active {
    transform: scale(0.95);
    box-shadow: 0 4px 14px rgb(0 0 0 / 22%);
}

@media (hover: hover) and (pointer: fine) {
    .recent-card:hover {
        transform: translateY(-2px);
        box-shadow:
            0 18px 38px rgb(0 0 0 / 28%),
            0 0 0 0.5px rgb(255 255 255 / 5%);
    }
}

/* Recent card product thumb */
.recent-card .product-thumb {
    margin-bottom: clamp(8px, 1.5vh, 12px);
    border-radius: 18px;
    box-shadow: 0 4px 14px rgb(0 0 0 / 25%);
    width: clamp(44px, 8vh, 80px) !important;
    height: clamp(44px, 8vh, 80px) !important;
    min-width: clamp(44px, 8vh, 80px) !important;
}

.recent-name {
    font-size: clamp(10px, 1.6vh, 13.5px);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    min-height: 2.6em;
    margin-bottom: 3px;
    letter-spacing: -0.1px;
    text-align: center;
    word-break: break-word;
}

.recent-stars {
    font-size: clamp(12px, 2.2vh, 18px);
    color: var(--gold);
    font-weight: 700;
    letter-spacing: -0.1px;
    filter: drop-shadow(0 0 6px var(--gold-glow));
    margin-top: clamp(3px, 0.6vh, 5px);
}

.recent-stars .inline-star-icon svg {
    width: clamp(11px, 2vh, 14px);
    height: clamp(11px, 2vh, 14px);
    fill: var(--gold);
    stroke-width: 1.8;
    vertical-align: -2px;
}

.recent-meta {
    font-size: clamp(9px, 1.4vh, 11px);
    color: var(--fg-secondary);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: clamp(1px, 0.3vh, 2px);
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

/* ─── Info Block ─── */
.info-block-icon svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--accent-green);
}

.info-block {
    flex-shrink: 0;
    text-align: center;
    font-size: clamp(9px, 1.5vh, 11.5px);
    color: rgb(236 242 248 / 70%);
    padding: clamp(4px, 1vh, 8px) clamp(10px, 2vw, 14px);
    border-radius: 14px;
    margin-top: clamp(8px, 1vh, 16px);
    margin-bottom: clamp(8px, 1.5vh, 20px);
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgb(255 255 255 / 5%);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ─── Filter Chips — iOS 18 Segmented Control ─── */
.filters-container {
    display: flex;
    gap: 0;
    background: rgb(118 130 150 / 12%);
    padding: 2px;
    border-radius: 16px;
    margin: 4px 0 16px;
    border: 1px solid rgb(255 255 255 / 5%);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.filter-chip {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    color: rgb(236 242 248 / 46%);
    padding: 7px 0;
    min-height: 44px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.2s var(--ease-out),
        color 0.15s var(--ease-out);
    letter-spacing: -0.2px;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.filter-chip.active {
    background: rgb(255 255 255 / 14%);
    color: var(--fg);
    font-weight: 600;
    box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
    backdrop-filter: blur(8px);
}

.filter-chip:active {
    background: rgb(255 255 255 / 4%);
}

/* ─── Product Thumbnails — NEW ─── */
.product-thumb {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--thumb-radius);
    box-shadow: 0 2px 8px rgb(0 0 0 / 22%);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    display: block;
}

/* Line-art glass glyph shown instead of a photo (no URL, or it failed to load —
   in both cases the .thumb-broken container's only child is the fallback svg) */
.product-thumb.thumb-broken {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb.thumb-broken svg {
    width: 50%;
    height: 50%;
    color: rgb(255 255 255 / 20%);
}

/* ─── Results & Lists ─── */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 0.5px solid rgb(255 255 255 / 8%);
    margin-top: 12px;
}

#favorites-list {
    flex: 1;
}

.search-card,
.favorite-card {
    display: flex;
    align-items: stretch;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 0.5px solid rgb(255 255 255 / 6%);
    position: relative;
    overflow: hidden;
    transition: background 0.15s var(--ease-out);
    margin-bottom: 0;
    cursor: pointer;
    padding: 0;
}

.search-card:last-child,
.favorite-card:last-child {
    border-bottom: none;
}

.search-card::before,
.favorite-card::before {
    display: none;
}

.search-card:active,
.favorite-card:active {
    background: rgb(255 255 255 / 8%);
    transform: none;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .search-card:hover,
    .favorite-card:hover {
        background: rgb(255 255 255 / 4%);
        transform: none;
        box-shadow: none;
    }
}

.search-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.search-card-rating {
    color: var(--gold);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 14px;
    letter-spacing: -0.1px;
    filter: drop-shadow(0 0 6px var(--gold-glow));
}

.search-card-rating .inline-star-icon svg {
    width: 14px;
    height: 14px;
    fill: var(--gold);
    stroke-width: 1.8;
    vertical-align: -2px;
}

.search-highlight {
    background: rgb(241 178 79 / 20%);
    border-radius: 3px;
    padding: 0 2px;
    color: var(--fg);
    transition: background-color 0.2s var(--ease-out);
}

.fav-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    transition: transform 0.35s var(--ease-out);
    will-change: transform;
}

.fav-main.swiped {
    transform: translateX(-64px);
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
    gap: 2px;
}

.item-name {
    font-weight: 650;
    font-size: 15px;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
    color: var(--fg);
    word-break: break-word;
}

.separator {
    margin: 0 4px;
    color: var(--fg-tertiary);
}

.alcohol-badge {
    font-size: 9px;
    font-weight: 650;
    color: rgb(236 242 248 / 58%);
    background: rgb(118 130 150 / 16%);
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: -0.05px;
    white-space: nowrap;
}

.item-meta {
    font-size: 11px;
    color: var(--fg-secondary);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 999px;
    color: var(--type-color);
    background: var(--type-bg);
    letter-spacing: 0.15px;
    text-transform: uppercase;
}

/* Stars in list items — bigger & brighter */
.item-stars {
    color: var(--gold);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: 2px;
    letter-spacing: -0.1px;
    filter: drop-shadow(0 0 6px rgb(255 211 113 / 28%));
    flex-shrink: 0;
}

.item-stars .inline-star-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--gold);
    stroke-width: 1.8;
}

/* ─── Delete Button ─── */
.favorite-card .delete-btn {
    background: rgb(255 107 107 / 78%);
    border: none;
    width: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.18s var(--ease-out);
    padding: 0;
    margin: 0;
    border-radius: 0 18px 18px 0;
    min-height: 100%;
}

.favorite-card .delete-btn:active {
    background: rgb(255 107 107 / 92%);
}

.slide-out-left {
    animation: slideOut 0.3s var(--ease-out) forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(-110%);
        opacity: 0;
    }
}

/* ─── Search Bar ─── */
.glass-sticky {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 8px 0;
    padding-top: max(12px, env(safe-area-inset-top));
    background: rgb(9 16 24 / 72%);
    backdrop-filter: blur(36px) saturate(165%);
    border-bottom: 0.5px solid rgb(255 255 255 / 8%);
    box-shadow: 0 4px 24px rgb(0 0 0 / 22%);
}

#tab-search .large-title-spacer {
    height: max(8px, env(safe-area-inset-top, 0px));
}

.search-bar-container {
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.search-flex {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-wrapper {
    position: relative;
    flex-grow: 1;
    height: 42px;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    height: 100%;
    background: rgb(118 130 150 / 12%);
    border: 1px solid rgb(255 255 255 / 6%);
    border-radius: 16px;
    padding: 8px 38px;
    color: var(--fg);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.15px;
    outline: none;
    backdrop-filter: blur(8px);
    transition:
        background-color 0.25s var(--ease-out),
        box-shadow 0.25s var(--ease-out);
}

#search-input:focus {
    background: rgb(118 130 150 / 18%);
    box-shadow: 0 0 0 2px rgb(241 178 79 / 18%);
}

#search-input::placeholder {
    color: rgb(236 242 248 / 34%);
    font-weight: 400;
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(118 118 128 / 55%);
    pointer-events: none;
    transition: color 0.2s var(--ease-out);
    width: 18px;
    height: 18px;
}

#search-input:focus ~ .search-icon {
    color: var(--accent);
}

.search-cancel-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    pointer-events: none;
    white-space: nowrap;
    height: 42px;
    display: flex;
    align-items: center;
    letter-spacing: -0.1px;
}

.search-cancel-btn.visible {
    opacity: 1;
    max-width: 100px;
    padding: 0 6px 0 10px;
    pointer-events: auto;
}

.clear-btn {
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgb(118 130 150 / 40%);
    border: none;
    color: rgb(255 255 255 / 70%);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.22s var(--ease-spring),
        opacity 0.22s var(--ease-out),
        background 0.2s var(--ease-out);
    padding: 0;
    transform: scale(0.7);
}

.search-wrapper:has(input:not(:placeholder-shown)) .clear-btn {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.clear-btn:active {
    transform: scale(0.85);
    background: rgb(118 130 150 / 60%);
}

/* ─── Search Suggestions ─── */
.search-suggestions {
    padding: 18px 0 8px;
    animation: cardEnter 0.42s var(--ease-out) both;
}

.search-intro-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 28px;
    background:
        linear-gradient(155deg, rgb(16 25 37 / 96%), rgb(11 18 28 / 94%)),
        radial-gradient(circle at 0% 0%, rgb(116 200 255 / 12%), transparent 45%),
        radial-gradient(circle at 100% 0%, rgb(241 178 79 / 10%), transparent 42%);
    border: 1px solid rgb(255 255 255 / 7%);
    box-shadow:
        0 18px 48px rgb(0 0 0 / 22%),
        inset 0 1px 0 rgb(255 255 255 / 6%);
}

.search-intro-card::after {
    content: '';
    position: absolute;
    inset: auto -36px -42px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(116 200 255 / 14%), transparent 68%);
    pointer-events: none;
}

.search-intro-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.search-intro-copy {
    min-width: 0;
}

.search-intro-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: rgb(236 242 248 / 42%);
}

.search-intro-title {
    margin: 0;
    font-size: clamp(20px, 3.2vh, 28px);
    line-height: 1.08;
    letter-spacing: -0.6px;
    font-weight: 760;
    color: var(--fg);
    font-family: var(--font-display);
}

.search-intro-sub {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--fg-secondary);
    max-width: 34ch;
}

.search-intro-orb {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    flex-shrink: 0;
    background:
        linear-gradient(145deg, rgb(241 178 79 / 24%), rgb(116 200 255 / 18%)),
        radial-gradient(circle at 30% 30%, rgb(255 255 255 / 20%), transparent 40%);
    box-shadow:
        0 10px 24px rgb(0 0 0 / 22%),
        inset 0 1px 0 rgb(255 255 255 / 18%);
}

.search-intro-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.search-metric {
    padding: 10px 10px 9px;
    border-radius: 18px;
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgb(255 255 255 / 5%);
}

.search-metric-value {
    display: block;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.4px;
    color: var(--fg);
}

.search-metric-label {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: rgb(236 242 248 / 44%);
}

.results-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgb(255 255 255 / 5%);
    box-shadow: 0 12px 32px rgb(0 0 0 / 16%);
}

.results-summary-copy {
    min-width: 0;
}

.results-summary-kicker {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: rgb(236 242 248 / 42%);
}

.results-summary-title {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.2px;
    color: var(--fg);
}

.results-summary-chip {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgb(241 178 79 / 10%);
    border: 1px solid rgb(241 178 79 / 18%);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.1px;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 20px 30px;
    margin-top: 12px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%)),
        radial-gradient(circle at 50% 0%, rgb(241 178 79 / 8%), transparent 48%);
    border: 1px solid rgb(255 255 255 / 5%);
}

.search-empty-orb {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgb(241 178 79 / 16%), rgb(116 200 255 / 10%)),
        radial-gradient(circle at 30% 30%, rgb(255 255 255 / 20%), transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    box-shadow: 0 12px 26px rgb(0 0 0 / 20%);
}

.search-empty-orb svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
}

.search-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.25px;
    color: var(--fg);
}

.search-empty-copy {
    margin: 0;
    max-width: 34ch;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
    color: var(--fg-secondary);
}

.search-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.search-empty-chip {
    border: 1px solid rgb(255 255 255 / 6%);
    background: rgb(118 130 150 / 10%);
    color: var(--fg);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.1px;
    cursor: pointer;
}

.search-empty-chip:active {
    transform: scale(0.98);
}

.search-suggestions .recent-searches {
    margin-top: 16px;
}

.suggestions-label {
    font-size: 12px;
    font-weight: 600;
    color: rgb(236 242 248 / 42%);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0 0 14px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.suggestion-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%));
    border: 1px solid color-mix(in srgb, var(--chip-accent, rgb(241 178 79)) 22%, transparent);
    color: var(--chip-accent, rgb(236 242 248 / 70%));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.22s var(--ease-out),
        transform 0.22s var(--ease-spring),
        border-color 0.22s var(--ease-out);
    backdrop-filter: blur(8px);
    letter-spacing: -0.1px;
}

.suggestion-chip:active {
    background: color-mix(in srgb, var(--chip-accent, rgb(241 178 79)) 12%, rgb(255 255 255 / 2%));
    transform: scale(0.95);
}

.suggestion-icon {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    color: var(--chip-accent, currentColor);
}

.recent-searches {
    margin-top: 4px;
    animation: fadeInUp 0.3s var(--ease-out);
}

.recent-searches-label {
    font-size: 11px;
    font-weight: 600;
    color: rgb(236 242 248 / 36%);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px;
}

.recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recent-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgb(118 130 150 / 10%);
    border: 1px solid rgb(255 255 255 / 4%);
    color: rgb(236 242 248 / 62%);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
    line-height: 1;
    letter-spacing: -0.1px;
}

.recent-chip:active {
    background: rgb(118 130 150 / 18%);
}

.recent-chip-remove {
    opacity: 0.35;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    transition: opacity 0.15s;
}

.recent-chip:active .recent-chip-remove {
    opacity: 0.6;
}

/* ─── Empty State ─── */
.empty-state-animated {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 20px;
    text-align: center;
    animation: fadeInUp 0.45s var(--ease-out);
    height: 100%;
    flex-grow: 1;
}

.floating-ghost {
    animation: float 3.4s ease-in-out infinite;
    margin-bottom: 16px;
    color: var(--fg-tertiary);
    opacity: 0.58;
}

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

.ghost-svg {
    width: 40px;
    height: 40px;
}

/* ─── Skeleton Loading ─── */
.skeletons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.skeleton-row {
    height: 62px;
    background: var(--card);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    border: 0.5px solid var(--card-border);
}

.skeleton-row::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 4%), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ─── Modal (iOS Sheet) ─── */
#modal-wrapper {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

#modal-wrapper.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(4 8 14 / 54%);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

#modal-wrapper.active .modal-overlay {
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background:
        linear-gradient(180deg, rgb(16 25 37 / 98%), rgb(11 18 28 / 98%)),
        radial-gradient(120% 90% at 50% 0%, rgb(116 200 255 / 8%), transparent 42%);
    backdrop-filter: blur(40px) saturate(165%) contrast(108%);
    border-radius: 32px 32px 0 0;
    padding: 26px 22px calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateY(104%);
    box-shadow:
        0 -24px 64px rgb(0 0 0 / 30%),
        0 0 0 0.5px rgb(255 255 255 / 6%) inset;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    will-change: transform, border-radius;
}

#modal-wrapper.active .modal-content {
    transform: translateY(0);
}

.modal-grabber {
    width: 36px;
    height: 4px;
    background: rgb(118 130 150 / 52%);
    border-radius: 2px;
    margin: 4px auto 18px;
}

.close-btn-right {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgb(118 130 150 / 22%);
    border: 5px solid transparent;
    box-sizing: content-box;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--fg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        transform 0.18s var(--ease-spring),
        background 0.2s var(--ease-out),
        color 0.2s var(--ease-out);
    z-index: 10;
}

.close-btn-right:active {
    transform: scale(0.92);
    background: rgb(118 130 150 / 35%);
    color: var(--fg);
}

.modal-title {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 760;
    text-align: center;
    letter-spacing: var(--tracking-xl);
    line-height: 1.25;
    padding-right: 40px;
    padding-left: 40px;
    font-family: var(--font-display);
}

.modal-title .separator {
    margin: 0 5px;
}

.modal-title .alcohol-badge {
    font-size: 11px;
    vertical-align: middle;
}

.category-badge {
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12.5px;
    color: var(--accent);
    font-weight: 650;
    margin: 0 auto 18px;
    background: rgb(241 178 79 / 10%);
    padding: 5px 14px;
    border-radius: 999px;
    letter-spacing: -0.05px;
    width: fit-content;
    display: flex;
}

.note-label {
    display: block;
    font-size: 13px;
    color: var(--fg-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: -0.05px;
}

#note-input {
    background: var(--input-bg);
    color: var(--fg);
    border: 1px solid rgb(255 255 255 / 6%);
    border-radius: 16px;
    padding: 12px;
    width: 100%;
    font-size: 15.5px;
    line-height: 1.35;
    resize: none;
    font-family: inherit;
    letter-spacing: -0.1px;
    transition:
        background 0.25s var(--ease-out),
        box-shadow 0.25s var(--ease-out);
}

#note-input:focus {
    background: rgb(118 130 150 / 22%);
    box-shadow: 0 0 0 3px rgb(241 178 79 / 18%);
    outline: none;
}

#note-input::placeholder {
    color: var(--fg-tertiary);
}

/* ─── Stars ─── */
.stars-container {
    display: flex;
    justify-content: center;
    flex-direction: row-reverse;
    gap: 16px;
    margin: 10px 0 20px;
    padding: 0 10px;
}

.star svg {
    width: 42px;
    height: 42px;
    stroke-width: 1.5;
    display: block;
    transition:
        filter 0.2s var(--ease-out),
        transform 0.18s var(--ease-spring);
}

.star {
    color: rgb(236 242 248 / 30%);
    cursor: pointer;
    transition:
        transform 0.18s var(--ease-spring),
        color 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    position: relative;
}

/* hover preview: podświetl gwiazdkę i wszystkie przed nią (row-reverse trick) */
@media (hover: hover) and (pointer: fine) {
    .stars-container:not(:has(.star.active:hover)) .star:hover,
    .stars-container:not(:has(.star.active:hover)) .star:hover ~ .star {
        color: rgb(241 178 79 / 60%);
    }

    .stars-container:not(:has(.star.active:hover)) .star:hover svg {
        filter: drop-shadow(0 0 6px rgb(241 178 79 / 30%));
    }
}

.star:active {
    transform: scale(0.9);
}

.star.active {
    color: var(--gold);
    animation: starFill 0.35s var(--ease-spring) forwards;
}

.star.active svg {
    fill: var(--gold);
    filter: drop-shadow(0 0 8px var(--gold-glow)) drop-shadow(0 0 24px rgb(255 214 10 / 12%));
}

.star.star-pop svg {
    animation: starPop 0.4s var(--ease-spring) forwards;
}

@keyframes starFill {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }
    55% {
        transform: scale(1.3);
        opacity: 1;
    }
    75% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes starPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.4);
    }
    70% {
        transform: scale(0.88);
    }
    100% {
        transform: scale(1);
    }
}

/* ─── Primary Button ─── */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--amber), #d58d3b);
    color: #0c1320;
    padding: 15px;
    border-radius: 18px;
    border: none;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.2px;
    margin-top: 18px;
    cursor: pointer;
    transition:
        transform 0.15s var(--ease-spring),
        filter 0.15s var(--ease-out),
        opacity 0.15s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-primary:active {
    transform: scale(0.975);
    filter: brightness(0.9);
}

.btn-primary:disabled {
    background: rgb(118 130 150 / 28%);
    color: rgb(255 255 255 / 45%);
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 50%;
    z-index: 10000;
    background: rgb(14 22 33 / 94%);
    backdrop-filter: blur(22px) saturate(165%);
    color: #fff;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.15px;
    border: 1px solid rgb(255 255 255 / 10%);
    box-shadow:
        0 10px 30px rgb(0 0 0 / 22%),
        0 0 0 0.5px rgb(255 255 255 / 4%);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -40px) scale(0.85);
    transition:
        opacity 0.25s var(--ease-out),
        transform 0.25s var(--ease-spring);
}

.toast:has(.toast-undo-btn) {
    pointer-events: auto;
}

.toast-undo-btn {
    background: rgb(255 255 255 / 12%);
    border: 0.5px solid rgb(255 255 255 / 18%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    margin-left: 4px;
    letter-spacing: -0.1px;
    transition: background 0.15s var(--ease-out);
    flex-shrink: 0;
}

.toast-undo-btn:active {
    background: rgb(255 255 255 / 22%);
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.toast.closing {
    opacity: 0;
    transform: translate(-50%, -16px) scale(0.92);
    transition:
        opacity 0.2s var(--ease-out),
        transform 0.2s var(--ease-out);
}

/* ─── Utility Animations ─── */
.animate-fade-in {
    animation: cardEnter 0.3s var(--ease-out) both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translate3d(0, 16px, 0) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.search-card.animate-fade-in,
.favorite-card.animate-fade-in,
.recent-card.animate-fade-in,
.action-btn.animate-fade-in,
.badge-card.animate-fade-in,
.search-intro-card.animate-fade-in,
.results-summary-card.animate-fade-in,
.search-empty-card.animate-fade-in {
    animation-duration: 0.3s;
    animation-timing-function: var(--ease-out);
}

.animate-fade-in:nth-child(1) {
    animation-delay: 0ms;
}
.animate-fade-in:nth-child(2) {
    animation-delay: 30ms;
}
.animate-fade-in:nth-child(3) {
    animation-delay: 60ms;
}
.animate-fade-in:nth-child(4) {
    animation-delay: 90ms;
}
.animate-fade-in:nth-child(5) {
    animation-delay: 120ms;
}
.animate-fade-in:nth-child(6) {
    animation-delay: 150ms;
}
.animate-fade-in:nth-child(7) {
    animation-delay: 180ms;
}
.animate-fade-in:nth-child(8) {
    animation-delay: 210ms;
}
.animate-fade-in:nth-child(9) {
    animation-delay: 240ms;
}
.animate-fade-in:nth-child(10) {
    animation-delay: 270ms;
}
.animate-fade-in:nth-child(n + 11) {
    animation-delay: 290ms;
}

/* ─── Haptic Touch Context Menu ─── */
.context-menu {
    position: fixed;
    z-index: 3000;
    background: rgb(14 22 33 / 93%);
    backdrop-filter: blur(34px) saturate(165%) contrast(106%);
    border: 0.5px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow:
        0 8px 40px rgb(0 0 0 / 35%),
        0 0 0 0.5px rgb(255 255 255 / 4%);
    min-width: 160px;
    opacity: 0;
    transform: scale(0.92);
    transition:
        opacity 0.18s var(--ease-out),
        transform 0.22s var(--ease-spring);
    transform-origin: top left;
    pointer-events: none;
}

.context-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s var(--ease-out);
}

.context-menu-item.destructive {
    color: var(--accent-red);
}

.context-menu-item:active {
    background: rgb(255 255 255 / 6%);
}

.context-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2999;
    background: transparent;
}

/* ─── Pull to Refresh ─── */
.ptr-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    overflow: hidden;
    transform: translateY(-56px);
    transition: transform 0.25s var(--ease-out);
}

.ptr-container.active {
    transform: translateY(0);
}

.ptr-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgb(241 178 79 / 25%);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: ptrSpin 0.7s linear infinite;
    opacity: 0;
    transition: opacity 0.2s var(--ease-out);
}

.ptr-container.loading .ptr-spinner {
    opacity: 1;
}

.ptr-container.pulling .ptr-spinner {
    opacity: 0.6;
    border-top-color: rgb(241 178 79 / 50%);
    animation: none;
}

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

.ptr-label {
    font-size: 12px;
    color: var(--fg-secondary);
    margin-left: 10px;
    font-weight: 500;
}

/* ─── Update Banner ─── */
.update-banner {
    position: fixed;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    width: calc(100% - 32px);
    max-width: 420px;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.28s var(--ease-out),
        transform 0.28s var(--ease-spring);
    display: none;
}

.update-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.update-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgb(14 22 33 / 94%);
    backdrop-filter: blur(24px) saturate(165%);
    border: 1px solid rgb(255 255 255 / 8%);
    box-shadow:
        0 8px 32px rgb(0 0 0 / 40%),
        0 0 0 0.5px rgb(255 255 255 / 4%);
    color: #fff;
}

.update-icon {
    flex-shrink: 0;
    color: var(--accent-green);
    opacity: 0.9;
}

.update-text {
    flex: 1;
    font-size: 13.5px;
    font-weight: 550;
    letter-spacing: -0.1px;
    color: rgb(255 255 255 / 90%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-btn {
    flex-shrink: 0;
    background: var(--amber);
    color: #0c1320;
    border: none;
    border-radius: 12px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.1px;
    min-height: 32px;
    transition:
        filter 0.15s var(--ease-out),
        transform 0.15s var(--ease-spring);
}

.update-btn:active {
    filter: brightness(0.85);
    transform: scale(0.96);
}

.update-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgb(255 255 255 / 30%);
    font-size: 13px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition:
        color 0.2s var(--ease-out),
        background 0.2s var(--ease-out);
}

.update-dismiss:active {
    color: rgb(255 255 255 / 60%);
    background: rgb(255 255 255 / 6%);
}

/* ─── Keyboard Accessory Toolbar ─── */
.keyboard-toolbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2500;
    height: 44px;
    background: rgb(14 22 33 / 93%);
    backdrop-filter: blur(34px) saturate(165%);
    border-top: 0.5px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    transform: translateY(100%);
    transition: transform 0.3s var(--ease-out);
}

.keyboard-toolbar.visible {
    transform: translateY(0);
}

.keyboard-done-btn {
    background: var(--amber);
    border: none;
    color: #0c1320;
    font-size: 14px;
    font-weight: 750;
    padding: 6px 16px;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: -0.1px;
    transition:
        filter 0.15s var(--ease-out),
        transform 0.12s var(--ease-snappy);
}

.keyboard-done-btn:active {
    filter: brightness(0.85);
    transform: scale(0.95);
}

/* ─── iOS-style Activity Indicator ─── */
.activity-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
}

.activity-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgb(241 178 79 / 20%);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: activitySpin 0.75s linear infinite;
}

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

.activity-label {
    font-size: 13px;
    color: var(--fg-secondary);
    font-weight: 500;
}

/* ─── Focus Visible — Apple-style ring ─── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

input:focus-visible,
textarea:focus-visible {
    outline: none;
}

/* ─── Hover States ─── */
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover {
        color: rgb(236 242 248 / 55%);
    }

    .nav-item.active:hover {
        color: var(--accent);
    }

    .filter-chip:hover {
        background: rgb(255 255 255 / 6%);
    }

    .filter-chip.active:hover {
        background: rgb(255 255 255 / 14%);
    }

    .context-menu-item:hover {
        background: rgb(255 255 255 / 6%);
    }

    .btn-primary:hover {
        filter: brightness(1.08);
    }

    .badge-card:hover,
    .start-stat-card:hover,
    .suggestion-chip:hover,
    .recent-chip:hover,
    .search-empty-chip:hover {
        background: rgb(255 255 255 / 6%);
    }
}

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

    .tab-view,
    .toast,
    .modal-content {
        transition:
            opacity 0.2s ease,
            background-color 0.2s ease !important;
    }

    .tab-view {
        transform: none !important;
    }

    .toast {
        transform: translate(-50%, 0) !important;
    }

    .toast.closing {
        opacity: 0 !important;
    }

    .nav-icon,
    .star,
    .star svg {
        transition: none !important;
        transform: none !important;
    }

    .star.active svg,
    .star.star-pop svg {
        animation: none !important;
        filter: none !important;
    }

    .recent-card:active,
    .search-card:active,
    .favorite-card:active,
    .action-btn:active,
    .nav-item:active,
    .btn-primary:active,
    .suggestion-chip:active,
    .recent-chip:active {
        transform: none !important;
    }

    .modal-content {
        transform: translateY(0) !important;
        transition: transform 0.15s ease !important;
    }

    #modal-wrapper:not(.active) .modal-content {
        transform: translateY(100%) !important;
    }

    .badge-progress-fill,
    .start-rating-fill {
        transition: none !important;
    }

    .fav-main {
        transition: none !important;
    }

    .fav-main.swiped {
        transform: translateX(-62px) !important;
    }

    .bottom-nav {
        transition: none !important;
    }

    .recent-card:hover,
    .search-card:hover,
    .favorite-card:hover {
        transform: none !important;
    }
}

/* ─── Backdrop-filter Fallback ─── */
@supports not (backdrop-filter: blur(0)) {
    .glass,
    .bottom-nav,
    .modal-content,
    .header-glass,
    .filter-chips-row,
    .search-cancel-btn,
    .filter-chip,
    .keyboard-toolbar,
    .toast,
    .context-menu {
        background: var(--bg-secondary);
    }

    .modal-content {
        background:
            linear-gradient(180deg, rgb(16 25 37 / 99%), rgb(11 18 28 / 99%));
    }
}

/* ─── Reduced Transparency ─── */
@media (prefers-reduced-transparency: reduce) {
    .glass,
    .bottom-nav,
    .modal-content,
    .header-glass,
    .filter-chips-row,
    .search-cancel-btn,
    .filter-chip,
    .keyboard-toolbar,
    .toast,
    .context-menu {
        backdrop-filter: none !important;
        background: var(--bg-secondary) !important;
    }

    .modal-content {
        background:
            linear-gradient(180deg, rgb(16 25 37 / 99%), rgb(11 18 28 / 99%)) !important;
    }
}
