/* Self-hosted Google Fonts; licenses in assets/fonts/. */
/* latin-ext */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/figtree-v9-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/figtree-v9-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-v12-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-v12-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   AliPaczka • Okazje — implementation of the Claude Design "AliPaczka Okazje"
   Plus Jakarta Sans (display) + Figtree (body). Warm orange/red brand.
   Mobile-first; desktop gets a sticky left rail with a category tree.
   ========================================================================== */

:root {
    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Figtree', system-ui, -apple-system, sans-serif;

    --bg: #f6f3ee;
    --surface: #ffffff;
    --surface-2: #f3efe8;
    --line: #ebe5dc;
    --field-line: #d8d0c4;
    --fg: #1b1a18;
    --muted: #6f6a61;

    --accent: #F04E23;
    --accent-2: #F7941E;
    --accent-soft: #fdeadf;
    --accent-text: #b3320f;
    --accent-solid: #bf3815;
    --on-accent: #fff;
    --hot: #e8431d;
    --hot-soft: #fff3ec;
    --hot-line: #f8d7c8;
    --ok: #147b42;
    --ok-soft: #e6f5ec;
    --warn: #c2710a;
    --warn-soft: #fbeccd;

    --skeleton: linear-gradient(90deg, #ece7df 25%, #f6f2ec 37%, #ece7df 63%);
    --shadow: rgba(40, 30, 20, .45);

    --maxw: 1140px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121110; --surface: #1b1917; --surface-2: #221f1b;
        --line: #322d26; --field-line: #3b342b; --fg: #f3eee6; --muted: #a39b8e;
        --accent: #ff6a3d; --accent-2: #f9a23a; --accent-soft: #3a2017;
        --accent-text: #ff8a61; --accent-solid: #ff6a3d; --on-accent: #1b1a18;
        --hot: #ff6a3d; --hot-soft: #2c1812; --hot-line: #43251a;
        --ok: #34c074; --ok-soft: #16301f; --warn: #eba24a; --warn-soft: #2f2212;
        --skeleton: linear-gradient(90deg, #221f1b 25%, #2b2722 37%, #221f1b 63%);
        --shadow: rgba(0, 0, 0, .8);
    }
    .card__media { background: #efe9e1; } /* keep product photos on a light tile */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--fg);
    font-family: var(--font-body); -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; }

@keyframes apShimmer { 0% { background-position: -360px 0; } 100% { background-position: 360px 0; } }
@keyframes apFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes apSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes apPop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- HEADER ---- */
.site-head {
    position: sticky; top: 0; z-index: 30;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-head__in {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    /* Plain padding — no safe-area-inset reservation: the mobile-app webview
       manages the status bar itself, so env(safe-area-inset-top) just added an
       unwanted ~44px margin above the logo. */
    padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand img { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand__name .a { color: var(--accent-2); }
.brand__name .p { color: var(--accent-text); }
.brand__name .o { color: var(--fg); }

/* ------------------------------------------------------- LAYOUT (grid) --- */
.layout { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 48px; }
@media (min-width: 1024px) {
    .layout { display: grid; grid-template-columns: 264px 1fr; gap: 26px; align-items: start; padding: 22px 24px 48px; }
}

/* ------------------------------------------------ MOBILE FILTER BAR ------ */
.filterbar {
    position: sticky; top: var(--header-height, 49px); z-index: 25;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    margin: 0 -16px 14px; padding: 11px 14px 13px;
    display: flex; flex-direction: column; gap: 10px;
    transition: transform .2s ease;
}
/* Auto-hide on scroll-down, reveal on scroll-up (toggled by app.js). It slides
   up behind the sticky header so it stops eating half the viewport. */
.filterbar.is-hidden { transform: translateY(-100%); }
@media (min-width: 1024px) { .filterbar { display: none; } }

.segmented { display: flex; gap: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.segmented a {
    flex: 1; height: 38px; border-radius: 9px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; line-height: 1.05;
    font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--fg);
}
.segmented a span { font-size: 9.5px; font-weight: 600; opacity: .7; }
.segmented a.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px var(--shadow); }

.catbtn {
    display: flex; align-items: center; gap: 11px; width: 100%; cursor: pointer; text-align: left;
    background: var(--surface-2); border: 1.5px solid var(--field-line); border-radius: 13px; padding: 0 12px; height: 52px;
}
.catbtn__ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.catbtn__t { flex: 1; min-width: 0; }
.catbtn__k { display: block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.catbtn__v { display: block; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catbtn__n { font-size: 12px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; margin-right: 6px; }
.catbtn__chev { color: var(--muted); display: inline-flex; }

.filterbar__row { display: flex; align-items: center; gap: 8px; }
.sortbtn {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px;
    font-size: 12.5px; font-weight: 600; color: var(--fg);
}
.sortbtn .lbl { color: var(--muted); flex: none; }
.sortbtn .val { flex: 1; min-width: 0; text-align: left; font-family: var(--font-display); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sortbtn .cv { flex: none; color: var(--muted); display: inline-flex; }

.disc { display: flex; align-items: center; gap: 8px; }
.disc__lbl { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.disc__chips { flex: 1; display: flex; gap: 6px; }
.disc__chips a {
    flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 0;
    font-family: var(--font-display); font-weight: 700; font-size: 12.5px; background: var(--surface); color: var(--fg);
}
.disc__chips a.on { background: var(--accent); border-color: var(--accent-text); color: #fff; }

/* Books/music switch: a link styled as a toggle. The inline copy serves
   mobile (the filter bar stays compact); desktop uses the one in the rail. */
.mswitch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--fg); }
.mswitch__t { display: flex; flex-direction: column; font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 1.2; }
.mswitch__s { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--muted); margin-top: 2px; }
.mswitch__k { flex: none; position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--muted); transition: background .15s ease; }
.mswitch__k::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px var(--shadow); transition: transform .15s ease; }
.mswitch[aria-checked="true"] .mswitch__k { background: var(--accent-solid); }
.mswitch[aria-checked="true"] .mswitch__k::after { transform: translateX(16px); }
.mswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.mswitch--inline { display: inline-flex; justify-content: flex-start; margin-top: 6px; }
@media (min-width: 1024px) { .mswitch--inline { display: none; } }
.rail__switch { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ------------------------------------------------- DESKTOP LEFT RAIL ----- */
.rail { display: none; }
@media (min-width: 1024px) {
    .rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
}
.rail__card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px; }
.rail__h { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--fg); margin: 0 0 10px; }
.rail__h--mt { margin-top: 16px; }
.rail .segmented a { height: 36px; font-size: 12.5px; }
.rail .disc__chips a { height: 36px; display: flex; align-items: center; justify-content: center; }

.tree { display: flex; flex-direction: column; gap: 3px; max-height: 60vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.tree__all { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: none; border-radius: 10px; padding: 10px 11px; cursor: pointer; text-align: left; background: var(--surface-2); }
.tree__all.on { background: var(--accent-soft); }
.tree__all .l { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--fg); }
.tree__all .l svg { color: var(--accent-text); }
.tree__all .n { font-size: 12px; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.tree details { border-radius: 10px; }
.tree summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; cursor: pointer; border-radius: 10px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--surface-2); }
.tree summary .l { display: flex; align-items: center; gap: 9px; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--fg); }
.tree summary .l span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree summary .r { flex: none; display: flex; align-items: center; gap: 7px; }
.tree summary .n { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree summary .cv { color: var(--muted); display: inline-flex; transition: transform .2s; }
.tree details[open] summary .cv { transform: rotate(180deg); }
.tree__subs { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 7px 18px; }
.tree__subs a { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.tree__subs a:hover { background: var(--surface-2); }
.tree__subs a.on { background: var(--accent-soft); color: var(--accent-text); }
.tree__subs a.whole { font-weight: 700; color: var(--accent-text); }
.tree__subs a .n { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail__search { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1.5px solid var(--field-line); border-radius: 11px; padding: 0 11px; height: 42px; margin-bottom: 11px; }
.rail__search svg { color: var(--muted); flex: none; }
.rail__search input { flex: 1; border: none; background: none; outline: none; font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--fg); min-width: 0; }

/* --------------------------------------------------------------- MAIN ---- */
.main { min-width: 0; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 4px 2px 14px; flex-wrap: wrap; }
.results-head h1 { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--fg); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (min-width: 1024px) { .results-head h1 { font-size: 26px; } }
.results-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.clear { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); border: none; color: var(--accent-text); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12px; font-weight: 700; }
.sort-desktop { display: none; position: relative; }
@media (min-width: 1024px) { .sort-desktop { display: block; } }

/* ----------------------------------------------------------- HOTTEST ----- */
.hottest { margin-bottom: 20px; }
.hottest__head { display: flex; align-items: center; gap: 7px; margin: 0 2px 11px; }
.hottest__head svg { color: var(--hot); }
.hottest__head h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--fg); }
.hottest__head .ph { font-size: 11px; color: var(--muted); font-weight: 600; }
.hottest__track { display: flex; gap: 11px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.hottest__track::-webkit-scrollbar { display: none; }
.hottest__track .hcard { flex: none; width: 156px; }
@media (min-width: 1024px) {
    .hottest { background: var(--hot-soft); border: 1px solid var(--hot-line); border-radius: 18px; padding: 16px; }
    .hottest__track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow: visible; padding: 0; }
    .hottest__track .hcard { width: auto; }
}
.hcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 6px 18px -12px var(--shadow); transition: transform .16s, border-color .16s; }
@media (hover: hover) { .hcard:hover { border-color: var(--accent-text); transform: translateY(-2px); } }
.hcard__media { position: relative; height: 104px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.hcard__media img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.hcard__b { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.hcard__body { padding: 9px 10px 11px; }
.hcard__title { font-size: 12px; font-weight: 600; color: var(--fg); line-height: 1.25; height: 30px; overflow: hidden; }
.hcard__price { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; }
.hcard__price .now { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--fg); }
.hcard__price .was { font-size: 11px; color: var(--muted); text-decoration: line-through; }

/* ----------------------------------------------------------- DEAL GRID --- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 14px -12px var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s;  }
@media (hover: hover) { .card:hover { border-color: var(--accent-text); transform: translateY(-3px); box-shadow: 0 18px 34px -18px var(--shadow); } .card:hover .card__media img { transform: scale(1.04); } }
.card__media { position: relative; height: 128px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
@media (min-width: 1024px) { .card__media { height: 158px; } }
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .25s; }
.card__media .fallback { color: var(--muted); opacity: .5; }
.badge { position: absolute; top: 9px; left: 9px; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 14px; padding: 3px 9px; border-radius: 9px; box-shadow: 0 2px 7px rgba(0,0,0,.2); }
.badge--hot { background: linear-gradient(105deg, var(--accent), var(--accent-2)); }
.pill-rank { position: absolute; top: 9px; right: 9px; display: flex; align-items: center; gap: 3px; background: rgba(17,16,15,.74); color: #fff; font-weight: 700; font-size: 10px; padding: 3px 7px; border-radius: 8px; backdrop-filter: blur(2px); }
.pill-low { position: absolute; bottom: 9px; left: 9px; display: flex; align-items: center; gap: 4px; background: var(--ok); color: #fff; font-weight: 700; font-size: 10px; padding: 3px 8px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.card__body { padding: 11px 11px 12px; display: flex; flex-direction: column; flex: 1; }
.card__brand { font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; }
.card__title { font-size: 14px; font-weight: 600; color: var(--fg); line-height: 1.35; margin: 3px 0 0; height: 57px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
@media (min-width: 1024px) { .card__title { font-size: 13.5px; height: 55px; } }
.card__pricerow { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 8px; }
.card__now { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--fg); line-height: 1; }
@media (min-width: 1024px) { .card__now { font-size: 21px; } }
.card__was { font-size: 11px; color: var(--muted); text-decoration: line-through; margin-top: 3px; }
.card__spark { flex: none; color: var(--ok); opacity: .85; }
.card__save { margin-top: 7px; display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; background: var(--ok-soft); color: var(--ok); border-radius: 7px; padding: 3px 7px; font-size: 10.5px; font-weight: 700; }
.cta { margin-top: 11px; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px; box-shadow: 0 8px 18px -10px var(--accent); }
@media (min-width: 1024px) { .cta { height: 44px; font-size: 14px; } }

/* ---- out-of-stock (greyed, non-clickable) deal cards ------------------ */
.card--out { opacity: .92; }
.card--out:hover { transform: none; border-color: var(--line); box-shadow: 0 4px 14px -12px var(--shadow); }
.card--out:hover .card__media img { transform: none; }
.card--out .card__media { background: var(--surface-2); }
.card--out .card__media img { filter: grayscale(.7); opacity: .5; }
.card--out .card__now { color: var(--muted); }
.badge--out { display: inline-flex; align-items: center; gap: 3px; background: #6b7280; font-size: 11px; }
.cta--out { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: default; }
.hcard--out { opacity: .92; }
.hcard--out:hover { transform: none; border-color: var(--line); }
.hcard--out .hcard__media img { filter: grayscale(.7); opacity: .5; }
.hcard--out .hcard__price .now { color: var(--muted); }
.hcard__b--out { display: inline-flex; align-items: center; gap: 3px; background: #6b7280; }

/* --------------------------------------------------------- SHOW MORE ----- */
.showmore { margin-top: 16px; display: flex; justify-content: center; }
.showmore a, .showmore button { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 14px; cursor: pointer; }
.nomore { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------- STATES ---- */
.state { text-align: center; padding: 50px 24px; display: flex; flex-direction: column; align-items: center; gap: 15px; }
@media (min-width: 1024px) { .state { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 60px 30px; } }
.state__ic { width: 70px; height: 70px; border-radius: 21px; display: flex; align-items: center; justify-content: center; }
.state__ic--empty { background: var(--accent-soft); color: var(--accent-text); }
.state__ic--error { background: var(--warn-soft); color: var(--warn); }
.state h2 { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--fg); margin: 0; }
.state p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 8px auto 0; max-width: 360px; }
.state .btn-accent { margin-top: 4px; }
.btn-accent { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 24px; border: none; border-radius: 13px; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; cursor: pointer; box-shadow: 0 10px 22px -10px var(--accent); }

/* --------------------------------------------------------- DISCLOSURE ---- */
.disclosure { margin-top: 24px; padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 12px; align-items: flex-start; }
.disclosure__ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.disclosure h3 { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--fg); margin: 0 0 5px; }
.disclosure p { font-size: 11.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.disclosure strong { color: var(--fg); font-weight: 600; }

/* ------------------------------------------------------------ SKELETON --- */
.skel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.skel__img { height: 128px; }
@media (min-width: 1024px) { .skel__img { height: 158px; } }
.skel__b { padding: 11px; display: flex; flex-direction: column; gap: 8px; }
.shim { background: var(--skeleton); background-size: 720px 100%; animation: apShimmer 1.3s infinite linear; border-radius: 5px; }

/* --------------------------------------------------------------- SHEET --- */
.sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet:target, .sheet.open { display: block; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(10,8,6,.5); }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; overflow: hidden; animation: apSheet .3s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
.sheet__grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 12px auto 0; }
.sheet__head { padding: 6px 16px 12px; border-bottom: 1px solid var(--line); }
.sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 12px; }
.sheet__title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sheet__search { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1.5px solid var(--field-line); border-radius: 13px; padding: 0 12px; height: 46px; }
.sheet__search svg { color: var(--muted); flex: none; }
.sheet__search input { flex: 1; border: none; background: none; outline: none; font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--fg); min-width: 0; }
.sheet__body { flex: 1; overflow-y: auto; padding: 12px 14px 22px; }

.catrow { display: flex; align-items: center; gap: 11px; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; cursor: pointer; text-align: left; margin-bottom: 7px; }
.catrow.on { background: var(--accent-soft); border-color: transparent; }
.catrow--all { border-width: 1.5px; margin-bottom: 12px; }
.catrow__ic { flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.catrow__t { flex: 1; min-width: 0; }
.catrow__t b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 14.5px; color: var(--fg); }
.catrow__t b.sm { font-weight: 700; font-size: 14px; }
.catrow__t span { display: block; font-size: 11.5px; color: var(--muted); }
.catrow__n { flex: none; font-size: 13px; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.catrow__chev { flex: none; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.catrow__chev .n { font-size: 12.5px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.cat-meta { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 2px 4px 9px; }

/* sort options */
.sortlist { display: flex; flex-direction: column; gap: 3px; }
.sortlist a { display: flex; align-items: center; gap: 12px; border-radius: 13px; padding: 12px 12px; cursor: pointer; }
.sortlist a:hover, .sortlist a.on { background: var(--surface-2); }
.sortlist a .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.sortlist a .lbl { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--fg); }
.sortlist a .ck, .sortmenu a .ck { flex: none; color: var(--accent-text); display: none; }
.sortlist a.on .ck, .sortmenu a.on .ck { display: inline-flex; }

/* desktop sort dropdown (native <details>) */
.sort-desktop > summary { list-style: none; cursor: pointer; }
.sort-desktop > summary::-webkit-details-marker { display: none; }
.sortmenu { position: absolute; top: 48px; right: 0; z-index: 40; width: 256px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 44px -16px var(--shadow); padding: 7px; animation: apPop .16s ease; }
.sortmenu a { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 10px 11px; }
.sortmenu a:hover, .sortmenu a.on { background: var(--surface-2); }
.sortmenu a .lbl { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--fg); }
.sortmenu a .ic { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Author display:flex rules must not override the native hidden attribute. */
[hidden] { display: none !important; }

/* Readable controls and stable layout on narrow screens. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.results-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.listing-intro { margin: 7px 0 0; font-size: 13px; color: var(--muted); }
.card__pricerow > div { min-width: 0; }
.card__now { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card__was { display: block; }
.card__save { flex-wrap: wrap; }
.cta { min-height: 44px; height: auto; padding: 9px 5px; margin-top: auto; }
.card__save + .cta, .card__pricerow + .cta { margin-top: 11px; }
.card--added { animation: apFade .18s ease-out; }
.hottest__track { scroll-snap-type: x proximity; }
.hcard { scroll-snap-align: start; }
.hcard__price { flex-wrap: wrap; }
.filterbar:focus-within { transform: none; }
.filterbar .segmented a, .disc__chips a, .clear, .tree__subs a, .iconbtn { min-height: 44px; }
.iconbtn { width: 44px; height: 44px; }
.rail__search:focus-within, .sheet__search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet__search input { font-size: 16px; } /* avoid Safari zoom on focus */
.sheet__body { min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet__panel { max-width: 640px; margin: 0 auto; }
body.sheet-open { position: fixed; top: var(--sheet-scroll-top, 0); left: 0; right: 0; overflow: hidden; width: 100%; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pagination span { padding: 8px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; gap: 5px 9px; padding: 0; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.breadcrumbs li + li::before { content: '/'; margin-right: 9px; }
.breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.price-explainer { margin-top: 24px; font-size: 13px; color: var(--muted); }
.price-explainer summary { cursor: pointer; min-height: 44px; padding: 12px 0; color: var(--fg); font-weight: 600; }
.price-explainer p { margin: 4px 0 12px; line-height: 1.6; }
.showmore a { height: auto; min-height: 50px; text-align: center; padding: 12px 20px; }
@media (max-width: 1023px) {
    .filterbar { gap: 7px; padding-top: 8px; padding-bottom: 8px; }
    .filterbar__row .catbtn { flex: 1; min-width: 0; }
    .filterbar__row .mobile-sort { flex: 0 0 86px; min-height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 5px; font-size: 11px; }
    .filterbar .segmented a span { font-size: 10px; }
    .card__spark { display: none; }
}
@media (max-width: 359px) {
    .layout { padding-left: 12px; padding-right: 12px; }
    .filterbar { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
    .card__body { padding-left: 9px; padding-right: 9px; }
    .cta { font-size: 12px; }
    .hottest__head .ph { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .card:hover, .hcard:hover, .card:hover .card__media img { transform: none; }
}

/* Keep the brand hue while giving small button/badge text sufficient contrast. */
.cta:not(.cta--out), .btn-accent, .disc__chips a.on, .badge:not(.badge--out), .hcard__b:not(.hcard__b--out) {
    background: var(--accent-solid); color: var(--on-accent);
}

.catbtn__t { display: flex; flex-direction: column; position: relative; }
