.mobile-dock {
    display: none;
}

@media (max-width: 63.999rem) {
    .mobile-dock {
        --dock-h: var(--header-h, 4.25rem);
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-rows: minmax(0, 1fr);
        align-items: stretch;
        gap: 0;
        height: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
        padding: 0;
        border-top: 1px solid var(--line);
        background: color-mix(in oklab, var(--surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(10px);
        backdrop-filter: saturate(1.4) blur(10px);
    }

    body:has(.mobile-dock) {
        padding-bottom: calc(var(--header-h, 4.25rem) + env(safe-area-inset-bottom, 0px));
    }

    .mobile-dock-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.18rem;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: 0 0.1rem;
        border: 0;
        border-radius: 0;
        background: none;
        color: var(--muted);
        font: 600 clamp(0.55rem, 2.55vw, 0.64rem)/1.1 var(--font);
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        transition: color 0.18s;
        animation: dock-pop 0.5s cubic-bezier(.22, 1, .36, 1) both;
        animation-delay: calc(var(--dock-i, 0) * 45ms + 70ms);
    }

    .mobile-dock-post {
        position: relative;
        display: block;
        height: 100%;
        min-width: 0;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        color: var(--accent);
        font: 650 clamp(0.58rem, 2.6vw, 0.64rem)/1.1 var(--font);
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        animation: dock-pop-cta 0.56s cubic-bezier(.22, 1, .36, 1) both;
        animation-delay: calc(var(--dock-i, 0) * 45ms + 70ms);
    }

    .mobile-dock-item > span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-dock-post > span:last-child {
        position: absolute;
        right: 0;
        bottom: 0.76rem;
        left: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-dock-item:active,
    .mobile-dock-item:focus-visible {
        color: var(--accent);
        outline: none;
    }

    .mobile-dock-icon {
        position: relative;
        display: grid;
        place-items: center;
        width: 1.4rem;
        height: 1.4rem;
    }

    .mobile-dock-icon .gi {
        width: 1.4rem;
        height: 1.4rem;
    }

    .mobile-dock-count {
        position: absolute;
        top: -0.3rem;
        right: -0.42rem;
        display: grid;
        place-items: center;
        min-width: 1rem;
        height: 1rem;
        padding: 0 0.22rem;
        border-radius: 999px;
        background: var(--accent);
        color: var(--accent-ink);
        font-size: 0.56rem;
        font-weight: 750;
        line-height: 1;
    }

    .mobile-dock-count[hidden] {
        display: none;
    }

    .mobile-dock-post-icon {
        position: absolute;
        bottom: calc(0.76rem + 0.72rem + 0.18rem);
        left: 50%;
        display: grid;
        place-items: center;
        width: 2.875rem;
        height: 2.875rem;
        border-radius: 50%;
        transform: translateX(-50%);
        background: var(--accent);
        color: var(--accent-ink);
        box-shadow: 0 0 0 5px var(--surface);
        transition: transform 0.18s var(--ease-out);
        z-index: 2;
    }

    .mobile-dock-post-icon .gi {
        position: relative;
        z-index: 2;
        width: 1.25rem;
        height: 1.25rem;
        stroke-width: 2.15;
    }

    .mobile-dock-post:active .mobile-dock-post-icon,
    .mobile-dock-post:focus-visible .mobile-dock-post-icon {
        transform: translateX(-50%) scale(0.95);
    }

    .mobile-dock-post:focus-visible {
        outline: none;
    }

    .mobile-dock-item.is-active,
    body:has(.discovery.is-open) .mobile-dock [data-discovery-toggle],
    body:has(#glance-search-dialog[open]) .mobile-dock [data-search-toggle],
    body:has(#glance-saved:popover-open) .mobile-dock [data-saved-toggle] {
        color: var(--accent);
    }

    .mobile-dock > :nth-child(1) { --dock-i: 0; }
    .mobile-dock > :nth-child(2) { --dock-i: 1; }
    .mobile-dock > :nth-child(3) { --dock-i: 2; }
    .mobile-dock > :nth-child(4) { --dock-i: 3; }
    .mobile-dock > :nth-child(5) { --dock-i: 4; }

    .mobile-dock-icon.is-tap {
        animation: dock-press 0.4s cubic-bezier(.22, 1, .36, 1);
    }

@keyframes dock-pop {
    from {
        opacity: 0;
        transform: translateY(7px) scale(0.94);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes dock-pop-cta {
    from {
        opacity: 0;
        transform: translateY(9px) scale(0.8);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}


@keyframes dock-press {
    0% { transform: scale(1); }
    30% { transform: scale(0.82); }
    65% { transform: scale(1.08); }
    82% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

    @media (prefers-reduced-motion: reduce) {
        .mobile-dock,
        .mobile-dock *,
        .mobile-dock *::before,
        .mobile-dock *::after,
        .mobile-dock::before,
        .mobile-dock::after {
            animation: none !important;
            transition: none !important;
        }
    }
}

/* The mobile header carries the search field; the dock no longer duplicates it. */
@media (max-width: 63.999rem) {
    body:has(.mobile-dock) .site-header .header-search {
        display: flex;
    }
}

/* Mobile: one header row with the search field in the centre. */
@media (max-width: 52rem) {
    :root {
        --header-h: calc(var(--tap) + 2 * var(--sp-2) + 1px);
    }

    .site-header .bar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 1fr;
        gap: 0.4rem;
        padding-block: var(--sp-2);
    }

    .site-header .header-search {
        display: flex;
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    .header-search-toggle {
        display: none;
    }

    .site-header .header-mobile-actions {
        display: flex;
        grid-column: 3;
        grid-row: 1;
        align-items: center;
        justify-self: end;
        gap: 0.15rem;
    }

    .site-header .header-search input {
        font-size: 0.82rem;
    }

    .site-header .header-search button {
        padding-inline: 0.6rem;
        font-size: 0.72rem;
    }
}

/* Logged-in header: user-specific controls live in the Hesabım sheet. */
@media (max-width: 63.999rem) {
    .site-header.is-user .header-mobile-messages {
        display: none;
    }

    body:has(.mobile-dock) .site-header.is-user .header-mobile-actions .header-theme-toggle,
    body:has(.mobile-dock) .site-header.is-user .header-mobile-actions .theme-switch {
        display: none;
    }

    /* Search results: equal breathing room above and below the results head. */
    .results-top {
        padding-block: var(--sp-3) var(--sp-3);
    }

    .results-head {
        margin-bottom: 0;
    }

    .results-top > .chips {
        margin-top: 0.5rem;
        margin-bottom: 0;
    }

    .results-top > .chips:not(:has(.chip:not(.chip-add))) {
        margin-top: 0;
    }
}

.account-sheet {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--ink);
}

.account-sheet[open] {
    display: flex;
    align-items: flex-end;
}

.account-sheet::backdrop {
    background: var(--scrim-soft, rgb(8 10 16 / 0.5));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.account-sheet[open] .account-sheet-panel {
    animation: account-sheet-rise var(--panel-open) var(--panel-ease) both;
}

/* The category sheet fades its scrim together with the panel closing. */
.account-sheet[open]::backdrop {
    animation: category-sheet-scrim-in var(--panel-open) var(--panel-ease) both;
}

.account-sheet.is-closing::backdrop {
    animation: category-sheet-scrim-out 0.22s var(--ease-out) both;
}

.category-sheet.is-closing .account-sheet-panel {
    animation: category-sheet-sink 0.22s var(--ease-out) both;
}

/* The global mobile .sheet backdrop rule forces a static blur(12px). A closing
   account/category sheet explicitly lowers it, so the blur leaves with the
   panel instead of staying hard until the dialog is removed. */
/* Account sheet: one static blur layer, opacity animated with the panel. */
#glance-account-sheet::backdrop {
    background: var(--panel-scrim);
    opacity: var(--account-sheet-scrim, 1) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
    backdrop-filter: blur(12px) saturate(1.1) !important;
    animation: none !important;
    transition: opacity var(--panel-open) ease !important;
    will-change: opacity;
}

#glance-account-sheet.is-dragging::backdrop {
    transition: none !important;
}

/* Category sheet: one JS-driven blur + scrim so drag, open and close can move
   them in lockstep with the panel instead of competing CSS animations. */
#glance-category-sheet::backdrop {
    background: var(--panel-scrim);
    opacity: var(--cs-scrim, 1) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
    backdrop-filter: blur(12px) saturate(1.1) !important;
    animation: none !important;
    transition: none !important;
    will-change: opacity;
}

.category-sheet .account-sheet-panel,
.category-sheet.is-closing .account-sheet-panel {
    animation: none !important;
    transition: none !important;
    will-change: transform, opacity;
}

/* Scrim opacity and backdrop blur leave together, so the panel never fades
   while a hard blur is still sitting behind it. */
@keyframes category-sheet-scrim-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes category-sheet-scrim-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes category-sheet-sink {
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes account-sheet-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.account-sheet-panel {
    width: 100%;
    max-height: calc(100dvh - 1rem);
    padding: 0 var(--gutter) calc(1rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-sheet);
    scrollbar-width: thin;
}

.account-sheet-handle {
    display: block;
    width: 2.6rem;
    height: 0.3rem;
    margin: 0.5rem auto 0.15rem;
    border-radius: 999px;
    background: var(--line-strong);
}

.account-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0 0.9rem;
    border-bottom: 1px solid var(--line);
}

.account-sheet-kicker {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--accent);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.account-sheet-head h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.account-sheet-head p {
    margin: 0.15rem 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-sheet-close {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--muted);
    cursor: pointer;
}

.account-sheet-close:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.account-sheet-close .gi {
    width: 1rem;
    height: 1rem;
}

.account-sheet-links {
    display: grid;
    gap: 0.1rem;
    padding: 0.55rem 0;
}

.account-sheet-links a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 3rem;
    padding: 0 0.7rem;
    border-radius: 9px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.16s;
}

.account-sheet-links a:hover {
    background: var(--sunk);
}

.account-sheet-links .gi {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--muted);
}

.account-sheet-links hr {
    margin: 0.3rem 0;
}

.account-sheet-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-inline-start: auto;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--save);
    color: var(--paper);
    font-size: 0.6rem;
    font-weight: 750;
}

.account-sheet-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 0 0.2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.account-sheet-theme .header-theme-toggle {
    background: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
    .account-sheet[open] .account-sheet-panel,
    .category-sheet[open]::backdrop {
        animation: none;
    }

    .category-sheet.is-closing::backdrop,
    .category-sheet.is-closing .account-sheet-panel {
        animation: none;
    }
}

/* Account wallet: the same prominent credit balance used in the desktop menu. */
.account-sheet-wallet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    margin: 0.2rem 0 0.7rem;
    padding: 0.8rem;
    border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--line));
    border-radius: 12px;
    background: var(--accent-tint);
}

.account-sheet-wallet-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.account-sheet-wallet-coin {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent);
}

.account-sheet-wallet-coin .gi {
    width: 1.05rem;
    height: 1.05rem;
}

.account-sheet-wallet-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.account-sheet-wallet-label {
    color: var(--muted);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.account-sheet-wallet-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.account-sheet-wallet-unit {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.account-sheet-wallet-topup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 2.4rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.account-sheet-wallet-topup .gi {
    width: 0.8rem;
    height: 0.8rem;
}

.account-sheet-handle,
.account-sheet-head {
    touch-action: none;
    cursor: grab;
}

.account-sheet-handle:active,
.account-sheet-head:active {
    cursor: grabbing;
}

.account-sheet-head .account-sheet-close {
    cursor: pointer;
}

@media (max-width: 22rem) {
    .account-sheet-wallet {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-sheet-wallet-topup {
        width: 100%;
    }
}

/* Mobile category sheet: child categories from the strip or breadcrumb. */
.category-sheet-links {
    padding: 0.35rem 0 0.15rem;
}

.category-sheet-links ul {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-sheet-links li {
    margin: 0;
}

.category-sheet-links a {
    justify-content: space-between;
}

.category-sheet-links .crumbs-menu-count,
.category-sheet-links .home-cat-menu-count {
    margin-inline-start: auto;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.category-sheet-links .crumbs-menu-all,
.category-sheet-links .home-cat-menu-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.4rem;
    padding: 0.8rem 0.7rem;
    border-top: 1px solid var(--line);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
}

.category-sheet-links .gi {
    width: 0.85rem;
    height: 0.85rem;
}

.category-sheet .account-sheet-panel {
    max-height: min(82dvh, 44rem);
}

/* ── Header item metrics: every control follows the wordmark band height ─── */
@media (min-width: 52.01rem) {
    .site-header { --header-item-h: 2.6rem; }

    .site-header .header-search {
        height: var(--header-item-h);
    }

    .site-header .header-search form {
        height: 100%;
    }

    .site-header .header-search input {
        min-height: 0;
    }

    .site-header .header-search button {
        height: calc(var(--header-item-h) - 6px);
        min-height: 0;
    }

    .site-header .nav-link,
    .site-header .nav-post {
        height: var(--header-item-h);
        min-height: var(--header-item-h);
    }

    .site-header .header-theme-toggle,
    .site-header .header-mobile-messages {
        width: var(--header-item-h);
        height: var(--header-item-h);
        min-height: var(--header-item-h);
    }
}

@media (max-width: 52rem) {
    .site-header { --header-item-h: 2.3rem; }

    .site-header .header-search {
        height: var(--header-item-h);
    }

    .site-header .header-search form {
        height: 100%;
    }

    .site-header .header-search input {
        min-height: 0;
    }

    .site-header .header-search button {
        height: calc(var(--header-item-h) - 6px);
        min-height: 0;
    }

    .site-header .header-theme-toggle,
    .site-header .header-menu-toggle,
    .site-header .header-mobile-messages {
        width: var(--header-item-h);
        height: var(--header-item-h);
        min-height: var(--header-item-h);
    }
}

/* Header search: rounded band corners, icon inside the submit button. */
.site-header .brand-bant-strip {
    border-radius: var(--radius);
}

.site-header .header-search input {
    padding-inline-start: 0.75rem;
}

.site-header .header-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.site-header .header-search button .gi {
    inline-size: 1rem;
    block-size: 1rem;
    flex: none;
    margin: 0;
    color: currentColor;
}

@media (max-width: 52rem) {
    .site-header .header-search input {
        padding-inline-start: 0.65rem;
    }

    .site-header .header-search button {
        gap: 0.28rem;
    }

    .site-header .header-search button .gi {
        inline-size: 0.9rem;
        block-size: 0.9rem;
    }
}

/* The header wordmark sits straight; the slight tilt is a hover signature. */
.site-header .brand-bant-strip {
    overflow: visible;
    transform: rotate(0deg);
    transform-origin: center;
}

@media (hover: hover) and (pointer: fine) {
    .site-header .brand:hover .brand-bant-strip,
    .site-header .brand:focus-visible .brand-bant-strip {
        transform: rotate(-1.5deg);
    }
}

/* The dot menu uses one backdrop blur layer for the whole page. */
.header-mobile-menu-backdrop {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Keep the slanted wordmark crisp: lighter .com, precise text, stable layer. */
.site-header .brand-bant-word {
    text-rendering: geometricPrecision;
}

.site-header .brand-bant-tld {
    color: #111318;
    opacity: 1;
    font-size: 0.66em;
    font-weight: 800;
}

/* Blur enters and leaves with the same short, inexpensive transition. */
.site-header .brand,
.site-header .nav-actions,
.site-header .header-mobile-actions {
    transition: filter 0.22s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    .site-header .brand,
    .site-header .nav-actions,
    .site-header .header-mobile-actions {
        transition: none;
    }
}

/* Saved / Sign in / Account: the reader filter toggle's quiet button language. */
.site-header .nav-actions .nav-saved,
.site-header .nav-actions .nav-signin,
.site-header .nav-actions .account-menu > summary.nav-link {
    gap: var(--sp-1);
    border: 0;
    border-radius: var(--radius);
    color: var(--muted);
    transition: background-color 0.18s, color 0.18s;
}

.site-header .nav-actions .nav-saved .gi {
    transition: none;
}

.site-header .nav-actions .nav-saved:hover,
.site-header .nav-actions .nav-saved:focus-visible,
.site-header .nav-actions .nav-saved:active,
.site-header .nav-actions .nav-signin:hover,
.site-header .nav-actions .nav-signin:focus-visible,
.site-header .nav-actions .nav-signin:active,
.site-header .nav-actions .account-menu > summary.nav-link:hover,
.site-header .nav-actions .account-menu > summary.nav-link:focus-visible,
.site-header .nav-actions .account-menu > summary.nav-link:active {
    background: var(--sunk);
    color: var(--ink);
    box-shadow: none;
}

.site-header .nav-actions .nav-saved:hover .gi,
.site-header .nav-actions .nav-saved:focus-visible .gi,
.site-header .nav-actions .nav-saved:active .gi {
    transform: none;
}

/* Clear / leave the header search in one tap. */
.site-header .header-search .header-search-clear {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 1.75rem;
    block-size: 1.75rem;
    min-height: 0;
    margin: 0 0 0 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.16s, color 0.16s;
}

.site-header .header-search .header-search-clear[hidden] {
    display: none;
}

.site-header .header-search .header-search-clear .gi {
    inline-size: 1rem;
    block-size: 1rem;
    margin: 0;
    color: currentColor;
    stroke-width: 2.2;
}

.site-header .header-search .header-search-clear:hover,
.site-header .header-search .header-search-clear:focus-visible {
    background: var(--sunk);
    color: var(--accent);
}

.site-header .header-search .header-search-clear:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

/* Saved stays in the same quiet active state while its popover is open. */
body:has(#glance-saved:popover-open) .nav-actions .nav-saved {
    background: var(--sunk);
    color: var(--ink);
    box-shadow: none;
}

body:has(#glance-saved:popover-open) .nav-actions .nav-saved .gi {
    color: currentColor;
    transform: none;
}

/* Mobile: keep the header surface in step with the single blur layer. */
@media (max-width: 63.999rem) {
    .site-header {
        transition: background-color 0.22s var(--ease-out), border-bottom-color 0.22s var(--ease-out);
    }
}

@media (max-width: 63.999rem) and (prefers-reduced-motion: reduce) {
    .site-header {
        transition: none;
    }
}

/* Mobile: every blur surface uses the item-detail sheet blur (12px + saturate). */
@media (max-width: 63.999rem) {
    .header-mobile-menu-backdrop,
    .account-sheet::backdrop {
        -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
        backdrop-filter: blur(12px) saturate(1.1) !important;
    }

    body:has(.discovery.is-open) .site-header .brand,
    body:has(.discovery.is-open) .site-header .header-search,
    body:has(.discovery.is-open) .site-header .nav-actions > :not(.discovery-open),
    body:has(.discovery.is-open) .site-header .header-mobile-actions {
        filter: blur(12px) saturate(1.1);
    }

    body:has(.discovery.is-open) .mobile-dock > :not([data-discovery-toggle]) > * {
        filter: blur(12px) saturate(1.1);
    }
}

/* Mobile: Keşfet uses the same single backdrop blur as the item-detail sheet;
   header and content blur together instead of the header being filtered on top. */
@media (max-width: 63.999rem) {
    body:has(.discovery.is-open) .site-header {
        z-index: 40;
        background: color-mix(in oklab, var(--surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(10px);
        backdrop-filter: saturate(1.4) blur(10px);
        border-bottom-color: var(--line);
    }

    body:has(.discovery.is-open) .mobile-dock {
        z-index: 60;
    }

    body:has(.discovery.is-open) .site-header .brand,
    body:has(.discovery.is-open) .site-header .header-search,
    body:has(.discovery.is-open) .site-header .nav-actions > :not(.discovery-open),
    body:has(.discovery.is-open) .site-header .header-mobile-actions,
    body:has(.discovery.is-open) .mobile-dock > :not([data-discovery-toggle]) > * {
        filter: none;
    }

    body:has(.discovery.is-open) .mobile-dock > :not([data-discovery-toggle]) {
        pointer-events: auto;
    }
}

/* Saved sheet: same pull gesture feedback as the item-detail sheet. */
.saved-pop::backdrop {
    opacity: var(--saved-scrim, 1);
    transition: opacity var(--panel-close) ease;
}

.saved-pop .mobile-sheet-handle,
.saved-pop .saved-head {
    touch-action: none;
}

/* Category sheet depth navigation: back, drill chevrons, counts and the
   "all listings in this category" row. */
.account-sheet-head > div {
    flex: 1;
    min-width: 0;
}

.account-sheet-back {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--muted);
    cursor: pointer;
}

.account-sheet-back:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.account-sheet-back[hidden] {
    display: none;
}

.account-sheet-back .gi {
    width: 1rem;
    height: 1rem;
}

.category-sheet-links ul {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-sheet-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.category-sheet-row > a {
    flex: 1;
    min-width: 0;
}

.category-sheet-count {
    flex: none;
    min-width: 1.8rem;
    margin-inline-start: auto;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: var(--sunk);
    color: var(--muted);
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.category-sheet-drill {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.category-sheet-drill::before {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-inline-end: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}

.category-sheet-drill:hover,
.category-sheet-drill:focus-visible {
    border-color: var(--accent);
    background: var(--accent-tint);
    color: var(--accent);
}

.category-sheet-all {
    justify-content: center;
    margin-top: 0.35rem;
    border: 1px solid var(--line);
    color: var(--accent);
    text-align: center;
}

.category-sheet-loading {
    margin: 0;
    padding: 0.85rem 0.7rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Category/account sheets use the same single-blur rule as the filter sheet:
   the header stays visible behind the scrim but never blurs the pixels twice. */
@media (max-width: 63.999rem) {
    html:has(dialog.account-sheet[open]) .site-header,
    html:has(dialog.account-sheet[open]) .mobile-dock {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

/* Category levels swap inside a stable-height sheet, so drilling or going back
   never resizes or jumps the panel. */
.category-sheet .account-sheet-panel {
    height: min(82dvh, 46rem);
    max-height: calc(100dvh - 1rem);
}

.category-sheet-links.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* The category sheet handle keeps the small visual bar but gets a full-width
   touch target, matching how native sheets behave. */
.category-sheet .account-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 1.75rem;
    margin: 0.1rem auto 0;
    padding: 0;
    background: transparent;
}

.category-sheet .account-sheet-handle::before {
    content: "";
    width: 2.6rem;
    height: 0.3rem;
    border-radius: 999px;
    background: var(--line-strong);
}

/* Account sheet: same backdrop timing story as the category sheet, with a
   full-width drag target around the small visual handle. */
#glance-account-sheet::backdrop {
    transition: opacity var(--panel-open) ease !important;
}

#glance-account-sheet.is-closing::backdrop {
    transition: opacity var(--panel-close) var(--panel-close-ease) !important;
}

#glance-account-sheet .account-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 1.75rem;
    margin: 0.1rem auto 0;
    padding: 0;
    background: transparent;
}

#glance-account-sheet .account-sheet-handle::before {
    content: "";
    width: 2.6rem;
    height: 0.3rem;
    border-radius: 999px;
    background: var(--line-strong);
}

:root {
    --panel-open: 300ms;
    --panel-close: 300ms;
    --panel-snap: 280ms;
    --panel-ease: cubic-bezier(.22, 1, .36, 1);
    --panel-close-ease: cubic-bezier(.4, 0, .2, 1);
    --panel-scrim: rgb(8 10 16 / 0.45);
}

/* One opening duration for every managed mobile sheet. */
@media (max-width: 63.999rem) {
    dialog[data-gs-sheet="1"].is-gs-opening,
    dialog[data-gs-sheet="1"].is-gs-opening::backdrop {
        animation-duration: var(--panel-open) !important;
    }
}

/* The header and dock are solid on phones. Their own backdrop-filter used to
   return the moment a sheet closed, which read as the blur loading a second
   time. Panels keep their own single blur layer; the chrome stays stable. */
@media (max-width: 63.999rem) {
    .site-header,
    .mobile-dock {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background-color: var(--surface) !important;
    }
}

/* ---- Mobile category sheet: admin design language ----------------------- */

#glance-category-sheet .account-sheet-panel {
    border: 1px solid var(--osc-rule);
    border-bottom: 0;
    border-radius: var(--osc-radius) var(--osc-radius) 0 0;
    background: var(--osc-bench);
    color: var(--osc-ink);
    box-shadow: var(--osc-shadow-modal);
}

#glance-category-sheet .account-sheet-handle {
    background: transparent;
}

#glance-category-sheet .account-sheet-handle::before {
    background: var(--osc-rule-strong);
}

#glance-category-sheet .account-sheet-head {
    padding: 0.4rem 0.9rem 0.75rem;
    border-bottom: 1px solid var(--osc-rule);
}

#glance-category-sheet .account-sheet-kicker {
    color: var(--osc-bronze);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

#glance-category-sheet #glance-category-sheet-title {
    color: var(--osc-ink);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

#glance-category-sheet .account-sheet-close,
#glance-category-sheet .account-sheet-back {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--osc-rule);
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench);
    color: var(--osc-ink-muted);
}

#glance-category-sheet .account-sheet-close:hover,
#glance-category-sheet .account-sheet-close:focus-visible,
#glance-category-sheet .account-sheet-back:hover,
#glance-category-sheet .account-sheet-back:focus-visible {
    border-color: var(--osc-bronze);
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
}

#glance-category-sheet .account-sheet-close:focus-visible,
#glance-category-sheet .account-sheet-back:focus-visible {
    outline: 2px solid var(--osc-bronze);
    outline-offset: 1px;
}

#glance-category-sheet .category-sheet-links {
    padding: 0.5rem 0.9rem max(1rem, env(safe-area-inset-bottom));
    scrollbar-width: thin;
    scrollbar-color: var(--osc-rule-strong) transparent;
}

#glance-category-sheet .category-sheet-links ul {
    gap: 0;
}

#glance-category-sheet .category-sheet-row {
    border-top: 1px solid var(--osc-rule);
}

#glance-category-sheet .category-sheet-row:first-child {
    border-top: 0;
}

#glance-category-sheet .category-sheet-row > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 0.35rem;
    border-radius: var(--osc-radius-sm);
    color: var(--osc-ink);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}

#glance-category-sheet .category-sheet-row > a:hover,
#glance-category-sheet .category-sheet-row > a:focus-visible {
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
    text-decoration: none;
}

#glance-category-sheet .category-sheet-row > a:focus-visible {
    outline: 2px solid var(--osc-bronze);
    outline-offset: -2px;
}

#glance-category-sheet .category-sheet-count {
    min-width: 1.5rem;
    padding: 0.1rem 0.35rem;
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench-sunk);
    color: var(--osc-ink-muted);
    font-size: 0.6875rem;
    font-weight: 600;
}

#glance-category-sheet .category-sheet-row > a:hover .category-sheet-count,
#glance-category-sheet .category-sheet-row > a:focus-visible .category-sheet-count {
    background: var(--osc-bench);
    color: var(--osc-bronze);
}

#glance-category-sheet .category-sheet-drill {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--osc-rule);
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench);
    color: var(--osc-ink-muted);
}

#glance-category-sheet .category-sheet-drill:hover,
#glance-category-sheet .category-sheet-drill:focus-visible {
    border-color: var(--osc-bronze);
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
}

#glance-category-sheet .category-sheet-drill:focus-visible {
    outline: 2px solid var(--osc-bronze);
    outline-offset: 1px;
}

#glance-category-sheet .category-sheet-all {
    justify-content: space-between;
    margin-top: 0.35rem;
    padding: 0.75rem 0.35rem 0.2rem;
    border: 0;
    border-top: 1px solid var(--osc-rule);
    color: var(--osc-bronze);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: start;
}

#glance-category-sheet .category-sheet-all:hover,
#glance-category-sheet .category-sheet-all:focus-visible {
    color: var(--osc-bronze-deep);
    text-decoration: underline;
}

#glance-category-sheet .category-sheet-all:focus-visible {
    outline: 2px solid var(--osc-bronze);
    outline-offset: 2px;
}

#glance-category-sheet .category-sheet-loading {
    padding: 0.85rem 0.35rem;
    color: var(--osc-ink-muted);
    font-size: 0.8125rem;
}

#glance-category-sheet .category-sheet-links > ul {
    border: 1px solid var(--osc-rule);
    border-radius: var(--osc-radius);
    background: var(--osc-bench);
    overflow: hidden;
}

/* Category sheet: same search, crumb and row metrics as the filter pane. */
#glance-category-sheet .category-sheet-search {
    margin: 0.5rem 0.9rem 0;
}

#glance-category-sheet .category-sheet-search .gi {
    color: var(--osc-ink-muted);
}

#glance-category-sheet .category-sheet-search input {
    width: 100%;
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem 0.35rem 2.15rem;
    border: 1px solid var(--osc-rule);
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench);
    color: var(--osc-ink);
    font: 400 0.8125rem/1.4 var(--font);
}

#glance-category-sheet .category-sheet-search input:focus {
    border-color: var(--osc-bronze);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--osc-bronze) 20%, transparent);
}

#glance-category-sheet .category-sheet-crumbs {
    margin: 0.4rem 0.9rem 0.1rem;
}

#glance-category-sheet .category-sheet-row {
    gap: 0.4rem;
    padding-inline-end: 0.35rem;
}

#glance-category-sheet .category-sheet-row > a {
    min-height: 2.5rem;
    padding: 0 0.55rem;
    gap: 0.5rem;
}

#glance-category-sheet .category-sheet-count {
    min-width: 1.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench-sunk);
    font-size: 0.6875rem;
}

#glance-category-sheet .category-sheet-drill {
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: var(--osc-ink-emphasis);
}

#glance-category-sheet .category-sheet-drill:hover,
#glance-category-sheet .category-sheet-drill:focus-visible {
    border-color: transparent;
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
}

#glance-category-sheet .category-sheet-crumbs [data-category-sheet-root] {
    border-color: var(--osc-rule);
    background: var(--osc-bench);
    color: var(--osc-ink);
    font-weight: 500;
}

#glance-category-sheet .category-sheet-crumbs [data-category-sheet-root].is-current,
#glance-category-sheet .category-sheet-crumbs [data-category-sheet-current] {
    border-color: var(--osc-bronze);
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
    font-weight: 600;
    opacity: 1;
}

#glance-category-sheet .category-sheet-crumbs [data-category-sheet-current] {
    cursor: default;
}

#glance-category-sheet .category-sheet-crumbs button:hover,
#glance-category-sheet .category-sheet-crumbs button:focus-visible {
    border-color: var(--osc-bronze);
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
}

#glance-category-sheet #glance-category-sheet-title {
    font-size: 0.9375rem;
}

/* Keep the category list scroll inside its card, not the whole sheet. */
#glance-category-sheet .account-sheet-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#glance-category-sheet .account-sheet-handle,
#glance-category-sheet .account-sheet-head,
#glance-category-sheet .category-sheet-search,
#glance-category-sheet .category-sheet-crumbs,
#glance-category-sheet .category-sheet-all {
    flex: none;
}

#glance-category-sheet .category-sheet-links {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#glance-category-sheet .category-sheet-links > ul {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--osc-rule-strong) transparent;
}

#glance-category-sheet .category-sheet-drill {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--osc-rule);
    border-radius: var(--osc-radius-sm);
    background: var(--osc-bench);
    color: var(--osc-ink);
    box-shadow: 0 1px 2px var(--osc-shadow-tight);
}

#glance-category-sheet .category-sheet-drill:hover,
#glance-category-sheet .category-sheet-drill:focus-visible {
    border-color: var(--osc-bronze);
    background: var(--osc-bronze-tint);
    color: var(--osc-bronze);
}

#glance-category-sheet .category-sheet-links > ul {
    scrollbar-gutter: auto;
}

/* Category sheets match the filter sheet height on every category. */
#glance-category-sheet .account-sheet-panel {
    height: 94dvh;
    max-height: 94dvh;
}
