/* Store-feel chrome shared by /apps/repo and /apps/sources — matches the
   app-store wireframe used on /apps (promos, search, chips, card list,
   floating tab bar). Loaded after home.css/repo.css so it can fine-tune
   a few shared selectors (icon centering, link-flavoured cards). */

.apps-wire-icons span {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.app-store-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
}

a.app-store-card {
    text-decoration: none;
    color: inherit;
}

.apps-wire-list .app-store-get .icon-check {
    color: #34a853;
}

.apps-wire-list .app-store-get.is-copied .icon-copy {
    display: none;
}

.apps-wire-list .app-store-get:not(.is-copied) .icon-check {
    display: none;
}

.apps-wire-chip-add {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.apps-wire-chip-add:hover {
    text-decoration: none;
}

.store-section-stack {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-top: 1.75rem;
}

.store-manage-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* /apps/sources keeps its own <main class="src-main"> (not .main-content),
   so it needs its own clearance above the floating apps-wire-tabs bar. */
.apps-store-page .src-main {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

/* App detail page (app.php), when reached from /apps (?from=apps) and
   wrapped in the same floating apps-wire-tabs bar. */
.apps-store-page .det-main {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

.apps-store-page .apps-wire-promos {
    margin-top: 0.15rem;
}

/* Category-grouped catalog on /apps */
.apps-category-group {
    margin-bottom: 1.35rem;
}

.apps-category-group:last-child {
    margin-bottom: 0;
}

.apps-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    padding: 0 0.1rem;
}

.apps-category-heading {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 800;
}

.apps-category-count {
    color: #8b8b8f;
    font-size: 0.74rem;
    font-weight: 650;
}

.apps-category-seeall {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
    padding: 0;
    color: var(--accent-blue);
    background: transparent;
    border: 0;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.apps-category-seeall svg {
    width: 15px;
    height: 15px;
    transition: transform 0.18s;
}

.apps-category-group.is-expanded .apps-category-seeall svg {
    transform: rotate(90deg);
}

/* A category with no cards left after search/filter collapses instead of
   leaving an empty heading. */
.apps-category-group:not(:has(.app-card:not(.hidden))) {
    display: none;
}

/* Horizontal 3-row carousel: fills column-major (1/2/3 in col 1, 4/5/6 in
   col 2, ...) so users swipe sideways to see more of a category. */
.apps-carousel-list {
    grid-auto-flow: column;
    grid-template-columns: none;
    /* auto (not 1fr) so a category with fewer than 3 apps doesn't stretch
       its empty row(s) to match the tallest column's height. */
    grid-template-rows: repeat(3, auto);
    grid-auto-columns: min(88vw, 320px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.apps-carousel-list::-webkit-scrollbar {
    display: none;
}

.apps-carousel-list .app-store-card {
    scroll-snap-align: start;
}

/* "See All" swaps the carousel back to a plain full-width vertical list. */
.apps-category-group.is-expanded .apps-carousel-list {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
    overflow: visible;
}

/* FAQ disclosure list on /app (home_header-driven .repo-modern-block content) */
.app-faq-item {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #24262d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.6rem;
}

.app-faq-item:last-child {
    margin-bottom: 0;
}

.app-faq-item summary {
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    list-style: none;
}

.app-faq-item summary::-webkit-details-marker {
    display: none;
}

.app-faq-item summary::after {
    content: '+';
    float: right;
    color: #9ca3af;
    font-weight: 400;
}

.app-faq-item[open] summary::after {
    content: '−';
}

.app-faq-item p {
    margin: 0.6rem 0 0;
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ---------------------------------------------------------------------
   "Liquid Glass" chrome — iOS 26 style frosted glass for /apps,
   /apps/repo and /apps/sources only. Each surface layers three things:
   a diagonal light sheen (catches light unevenly, like curved glass),
   heavy blur + saturation (real translucency, not a flat dark panel),
   and a bright inset rim along the top edge (the specular highlight
   that reads as glass thickness). Scoped to .apps-store-page so none of
   it reaches the rest of the site.
   ------------------------------------------------------------------- */

.apps-store-page .apps-wire-tabs {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%),
        rgba(32, 32, 36, 0.48);
    border-color: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 -14px 22px -16px rgba(255, 255, 255, 0.1),
        0 18px 50px rgba(0, 0, 0, 0.5);
}

.apps-store-page .apps-wire-tab-active {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.apps-store-page .apps-wire-searchbox {
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 46%),
        rgba(58, 58, 62, 0.38);
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.apps-store-page .apps-wire-lock {
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
}

.apps-store-page .apps-wire-chip {
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0) 55%),
        rgba(70, 70, 74, 0.34);
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.apps-store-page .apps-wire-chip.filter-option-active {
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 60%),
        rgba(150, 150, 156, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.apps-store-page .apps-wire-list .app-store-card {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 50%),
        rgba(40, 40, 44, 0.44);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    transition: background 0.18s, transform 0.16s, box-shadow 0.18s;
}

.apps-store-page .apps-wire-list .app-store-card:hover,
.apps-store-page .apps-wire-list .app-store-card:focus-visible {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0) 55%),
        rgba(60, 60, 64, 0.56);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.apps-store-page .apps-store-stats {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 50%),
        rgba(36, 36, 42, 0.4);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.apps-store-page .apps-store-stats div {
    border-color: rgba(255, 255, 255, 0.1);
}

.apps-store-page .modal {
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 35%),
        rgba(30, 30, 34, 0.6);
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
        0 26px 70px rgba(0, 0, 0, 0.56);
}

.apps-store-page .modal-close {
    background: rgba(130, 130, 138, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* FAQ was a stack of separate glass boxes inside the already-glass panel
   (glass-in-glass). Flatten it into one list — hairline dividers, a
   round +/− badge instead of a floated character — matching the
   icon-list treatment "Why Use" got above. */
.apps-store-page .app-faq-item {
    padding: 0.95rem 0;
    margin-bottom: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apps-store-page .app-faq-item:first-child {
    padding-top: 0;
}

.apps-store-page .app-faq-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.apps-store-page .app-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    font-size: 0.92rem;
}

.apps-store-page .app-faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: rgba(125, 211, 252, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.28);
    color: #7dd3fc;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.2s, background 0.2s;
}

.apps-store-page .app-faq-item[open] summary::after {
    content: '−';
    background: rgba(125, 211, 252, 0.26);
}

.apps-store-page .app-faq-item p {
    padding-right: 2.3rem;
}

/* "About / Why Use / FAQ" blocks on /apps — same glass surface as the
   rest of the section, plus a proper eyebrow badge and roomier type so
   the copy reads as a designed panel instead of a plain text dump. */
.apps-store-page .repo-modern-block {
    padding: 1.35rem 1.3rem;
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 48%),
        rgba(32, 32, 38, 0.4);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(26px) saturate(190%);
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 34px rgba(0, 0, 0, 0.3);
}

.apps-store-page .repo-modern-section-head {
    align-items: flex-start;
    margin-bottom: 1rem;
}

.apps-store-page .repo-modern-section-head > div {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.apps-store-page .repo-modern-section-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    background: rgba(74, 158, 255, 0.14);
    border: 1px solid rgba(125, 211, 252, 0.3);
    color: #7dd3fc;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.apps-store-page .repo-modern-section-head h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    letter-spacing: -0.01em;
}

.apps-store-page .repo-modern-block > p {
    color: #d7dbe2;
    font-size: 0.92rem;
    line-height: 1.75;
    max-width: 62ch;
}

.apps-store-page .repo-modern-block > p + p {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* "Why Use" cards were 4 tall, near-identical boxes stacked on mobile —
   icon on top, title, paragraph, repeat. Collapse them into one compact
   glass list (icon + copy on a single row, hairline dividers) so the
   section reads at a glance instead of forcing four scrolls-worth of
   near-duplicate cards. Tablet+ gets the roomier tile grid back. */
.apps-store-page .repo-modern-feature-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.apps-store-page .repo-modern-feature-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.85rem;
    row-gap: 0;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.apps-store-page .repo-modern-feature-card:last-child {
    border-bottom: 0;
}

.apps-store-page .repo-modern-feature-icon {
    grid-row: span 2;
    flex-shrink: 0;
    margin-bottom: 0;
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.35);
}

.apps-store-page .repo-modern-feature-card h3 {
    grid-column: 2;
    margin-bottom: 0.3rem;
}

.apps-store-page .repo-modern-feature-card p {
    grid-column: 2;
}

@media (min-width: 620px) {
    .apps-store-page .repo-modern-feature-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.75rem;
        border: 0;
        background: none;
        border-radius: 0;
    }

    .apps-store-page .repo-modern-feature-card {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-radius: 16px;
        border-bottom: 0;
        background:
            linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 55%),
            rgba(38, 38, 44, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(18px) saturate(180%);
        -webkit-backdrop-filter: blur(18px) saturate(180%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .apps-store-page .repo-modern-feature-icon {
        grid-row: auto;
        margin-bottom: 0.7rem;
    }
}

/* iOS reduces transparency in some accessibility modes and Safari <18 may
   not support backdrop-filter at all — fall back to flat, fully opaque
   surfaces rather than near-invisible glass. */
@media (prefers-reduced-transparency: reduce) {
    .apps-store-page .apps-wire-tabs,
    .apps-store-page .apps-wire-searchbox,
    .apps-store-page .apps-wire-chip,
    .apps-store-page .apps-wire-list .app-store-card,
    .apps-store-page .apps-store-stats,
    .apps-store-page .modal,
    .apps-store-page .repo-modern-block {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(28, 28, 30, 0.96);
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .apps-store-page .apps-wire-tabs,
    .apps-store-page .apps-wire-searchbox,
    .apps-store-page .apps-wire-chip,
    .apps-store-page .apps-wire-list .app-store-card,
    .apps-store-page .apps-store-stats,
    .apps-store-page .modal,
    .apps-store-page .repo-modern-block {
        background: rgba(28, 28, 30, 0.96);
    }
}
