:root {
    /* Zen-inspired warm dark backgrounds — unchanged */
    --bg-primary: #1a1814;
    --bg-secondary: #201e1a;
    --bg-tertiary: #2a2723;
    --bg-card: #201e1a;
    --bg-card-hover: #26231e;
    --text-primary: #f0ede8;
    --text-secondary: #a89f94;
    --text-muted: #6b6358;
    /* Buttons on blue/green bg: dark text works on light colors, white on dark */
    --btn-on-accent: #0d1117;

    /* NullStore logo: blue #58a6ff → green #3fb950 */
    --accent: #58a6ff;
    /* logo blue — primary CTA, links, filters */
    --accent-glow: rgba(88, 166, 255, 0.18);
    --accent-stable: #3fb950;
    /* logo green — stable channel */
    --accent-stable-glow: rgba(63, 185, 80, 0.18);
    --accent-beta: #e8832a;
    /* warm orange — beta channel */
    --accent-beta-glow: rgba(232, 131, 42, 0.18);
    --accent-obtainium: #c47bd4;
    /* signature lavender purple — Obtainium buttons (dark) */
    --accent-obtainium-glow: rgba(196, 123, 212, 0.25);
    --accent-danger: #f85149;
    /* GitHub red — errors */
    --accent-warning: #d4a04a;
    --accent-archive: #d4a04a;
    /* dark yellow / amber — archive channel & badges */
    --accent-archive-bg: rgba(212, 160, 74, 0.12);
    --accent-archive-border: rgba(212, 160, 74, 0.35);

    --border: rgba(240, 237, 232, 0.08);
    --border-hover: rgba(88, 166, 255, 0.45);
    --border-stable: rgba(63, 185, 80, 0.35);
    --border-beta: rgba(232, 131, 42, 0.35);
    --shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
    --shadow-hover: 0 16px 32px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(88, 166, 255, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-sans: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Zen-inspired light mode: warm paper bg, blue+green accents */
body.light-mode {
    --bg-primary: #faf8f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f2ede6;
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-card-hover: #ffffff;
    --text-primary: #1c1a17;
    --text-secondary: #3d3730;
    --text-muted: #7a6e64;
    /* Blue/green buttons: white text for contrast */
    --btn-on-accent: #ffffff;

    /* Deeper versions of the logo palette for light bg readability */
    --accent: #0969da;
    /* GitHub blue (light) */
    --accent-glow: rgba(9, 105, 218, 0.12);
    --accent-stable: #1a7f37;
    /* GitHub green (light) */
    --accent-stable-glow: rgba(26, 127, 55, 0.12);
    --accent-beta: #bc4c00;
    /* warm orange — beta channel (light) */
    --accent-beta-glow: rgba(188, 76, 0, 0.12);
    --accent-obtainium: #8250df;
    /* signature purple — Obtainium buttons (light) */
    --accent-obtainium-glow: rgba(130, 80, 223, 0.20);
    --accent-danger: #cf222e;
    /* GitHub danger */
    --accent-warning: #9a6700;
    --accent-archive: #9a6700;
    /* dark golden yellow (light) */
    --accent-archive-bg: rgba(154, 103, 0, 0.10);
    --accent-archive-border: rgba(154, 103, 0, 0.35);

    --border: #e8e0d5;
    --border-hover: #0969da;
    --border-stable: rgba(26, 127, 55, 0.4);
    --border-beta: rgba(188, 76, 0, 0.4);
    --shadow: 0 2px 16px -2px rgba(28, 26, 23, 0.08), 0 0 0 1px var(--border);
    --shadow-hover: 0 10px 24px -4px rgba(28, 26, 23, 0.14), 0 0 0 1px rgba(9, 105, 218, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    /* Reserve the scrollbar space permanently so opening a modal
       (body.modal-open { overflow: hidden }) doesn't shift/reflow the layout */
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    /* Transparent so it blends into the solid body bg — any opaque fill here
       (or the old blur) showed up as a visible seam across the top */
    background: transparent;
    padding: 36px 0 20px;
    text-align: center;
    margin-bottom: 24px;
    transition: background 0.4s ease, border-color 0.4s ease;
}

header h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-stable) 50%, var(--accent-beta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: filter 0.35s ease;
}

.top-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

@media (hover: hover) {


    .top-link:hover {
        color: var(--accent);
        border-color: var(--accent);
        background: var(--accent-glow);
        transform: translateY(-2px);
    }
}

.top-link-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.top-link-wrap {
    position: relative;
}

/* Header Dropdown Menus (GitHub / Donate / Telegram / Theme) */
.top-link.menu-trigger {
    cursor: pointer;
    font: inherit;
}

.top-link-wrap.open>.top-link {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* Keep the donate trigger's open state in its own rose color */
.top-link-wrap:has(.donate-link).open>.top-link {
    color: #f43f5e;
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.12);
}

@media (hover: hover) {


    .top-links .donate-link:hover {
        color: #f43f5e;
        border-color: #f43f5e;
        background: rgba(244, 63, 94, 0.12);
    }
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -8px);
    width: fit-content;
    min-width: 150px;
    max-width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1200;
}

.top-link-wrap.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-item-indicator {
    flex: none;
    width: 1.2em;
    text-align: right;
}

@media (hover: hover) {


    .dropdown-item:hover {
        background: var(--accent-glow);
        color: var(--accent);
    }
}

/* Update Status Pill */
.update-pill {
    --pill-color: var(--accent-stable);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: color-mix(in srgb, var(--pill-color) 12%, transparent);
    color: var(--pill-color);
    border: 1px solid color-mix(in srgb, var(--pill-color) 25%, transparent);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    width: fit-content;
    margin-top: 14px;
    transition: all 0.2s ease;
}

.update-pill.checking {
    --pill-color: var(--accent-warning);
}

.update-pill.error {
    --pill-color: var(--accent-danger);
}

.update-pill.success {
    --pill-color: var(--accent-stable);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.update-pill svg.spin {
    animation: spin 1s linear infinite;
}

/* Main Content */
main {
    padding: 0 0 60px;
}

/* Search Box Container */
.search-box {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    min-width: 0;
    padding: 16px 48px 16px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchClearBtn {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
    transition: all 0.2s ease;
    z-index: 5;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.search-input-wrap.has-value #searchClearBtn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

@media (hover: hover) {


    #searchClearBtn:hover {
        background: var(--accent-danger);
        color: #ffffff;
    }
}

/* Channel filter bar removed — use .filter-toolbar for all filters */

/* Secondary Filter & Sort Toolbar */
.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.filter-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
}

@media (hover: hover) {


    .filter-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-glow);
        transform: translateY(-1px);
    }
}

/* Dark mode active: colored bg → use dark text for readability */
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--btn-on-accent);
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-glow);
}

.sort-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-opt-icon {
    display: block;
    width: 16px;
    height: 16px;
}

.sort-select .sort-opt-icon {
    width: 18px;
    height: 18px;
}

.dropdown-item-icon {
    display: inline-flex;
    flex: none;
}

.sort-select:focus-visible {
    outline: none;
    border-color: var(--accent);
}

@media (hover: hover) {


    .sort-select:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

/* Highlight follows the open state (like the top buttons) so it clears on close */
.sort-dropdown.open .sort-select {
    border-color: var(--accent);
    color: var(--accent);
}

.sort-dropdown {
    position: relative;
    flex-shrink: 0;
}

/* Right-align so the popup stays on-screen at the toolbar's edge */
.sort-dropdown .dropdown-menu {
    left: auto;
    right: 0;
    transform: translateY(-8px);
}

.sort-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Catalog Status Bar */
.catalog-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.catalog-count-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Loading & Error */
.loading {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.error-message {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--accent-danger);
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

.no-results {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    column-span: all;
    grid-column: 1 / -1;
}

/* Builds Grid */
.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

/* App Card */
.build-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s ease,
        border-color 0.2s ease,
        background 0.35s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.build-card:not(.open) {
    min-height: 86px;
    justify-content: center;
}

@media (hover: hover) {


    .build-card:hover {
        border-color: var(--border-hover);
        box-shadow: var(--shadow-hover);
        transform: translateY(-4px);
    }
}

.app-card-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}



.app-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.app-badge-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.patch-count-badge {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-glow);
    border: 1px solid var(--border-hover);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.app-card-chevron {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.app-card.open .app-card-chevron {
    transform: rotate(180deg);
}

.app-card-body-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-card.open .app-card-body-wrapper,
.modal-build-card.open .app-card-body-wrapper {
    grid-template-rows: 1fr;
}

.app-card-body {
    overflow: hidden;
}

.app-card-body-inner {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Dynamic Notices */
.app-notice {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--notice-border, var(--border));
    background: var(--notice-bg, linear-gradient(90deg, var(--accent-glow), transparent));
}

.app-notice-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--notice-color, var(--text-primary));
}

.app-notice-text {
    margin-top: 4px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.app-notice-links {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-notice-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    border: 1px solid var(--notice-border, var(--border));
    color: var(--notice-color, var(--text-primary));
}

@media (hover: hover) {
    .app-notice-links a:hover {
        background: var(--notice-color, var(--text-primary));
        color: var(--btn-on-accent);
    }
}


/* Patch Entries & Variant Matrix */
.patches-list,
.brands-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.patch-entry {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.patch-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.patch-chip-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.patch-engine-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.patch-engine-link {
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {


    .patch-engine-link:hover {
        opacity: 0.88;
        transform: translateY(-1px);
    }
}

.patch-link-arrow {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    opacity: 0.85;
}

.patch-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
}

.patch-applied-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-variant);
    border: 1px solid var(--accent-variant);
    color: var(--btn-on-accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px var(--accent-variant-glow);
}

@media (hover: hover) {


    .patch-applied-btn:hover {
        opacity: 0.92;
        transform: translateY(-1px);
    }
}

/* Per-arch applied-patch tabs: shown when one build's arches resolve to distinct
   patch sets (a fallback arch applied a different list). Each tab is also a
   .patch-applied-btn, so it inherits the accent chrome; this stacks the arch
   label above its own version. */
.arch-tab-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.arch-tab-label {
    font-weight: 700;
}

.arch-tab-ver {
    font-weight: 500;
    font-size: 0.68rem;
    opacity: 0.82;
}

/* Variant Rows & Matrix */
.variant-matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.10);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

body.light-mode .variant-row {
    background: rgba(0, 0, 0, 0.025);
}

.variant-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.variant-name-chip {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-variant);
}


.variant-channels-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.channel-box-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.channel-box-btn.stable {
    border-color: var(--border-stable);
}

.channel-box-btn.beta {
    border-color: var(--border-beta);
}

.channel-box-btn.archive {
    border-color: var(--accent-archive-border);
}

@media (hover: hover) {
    .channel-box-btn:hover {
        transform: translateY(-1px);
    }

    .channel-box-btn.stable:hover {
        background: var(--accent-stable-glow);
        border-color: var(--accent-stable);
    }

    .channel-box-btn.beta:hover {
        background: var(--accent-beta-glow);
        border-color: var(--accent-beta);
    }

    .channel-box-btn.archive:hover {
        background: var(--accent-archive-bg);
        border-color: var(--accent-archive);
    }
}

.channel-box-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 3px;
}

.channel-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.channel-tag.stable {
    color: var(--accent-stable);
}

.channel-tag.beta {
    color: var(--accent-beta);
}

.channel-tag.archive {
    color: var(--accent-archive);
}

.channel-date {
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.channel-version {
    font-size: 0.84rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    word-break: normal;
    overflow-wrap: break-word;
    width: 100%;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.channel-build-num {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

/* Modals */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 6, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal-overlay.open {
    display: flex;
    animation: modalFadeIn 0.2s ease-out forwards;
}

.modal-overlay.open .modal-card {
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

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

.modal-overlay.closing {
    animation: modalFadeOut 0.2s ease-in forwards;
}

.modal-overlay.closing .modal-card {
    animation: modalSlideDown 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modalSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
}

.modal-card {
    width: min(900px, 100%);
    max-height: 88vh;
    max-height: 88dvh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-card-wide {
    width: min(960px, 100%);
}

.modal-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    background: var(--bg-tertiary);
}

.modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.modal-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.filter-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-group-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

.modal-filter-btn {
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: var(--shadow);
}

@media (hover: hover) {


    .modal-filter-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-glow);
    }
}

.modal-filter-btn.active {
    border-color: var(--accent);
    color: var(--btn-on-accent);
    background: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-glow);
}

.modal-obtainium-btn {
    border: 1px solid var(--accent-obtainium);
    background: var(--accent-obtainium);
    color: var(--btn-on-accent);
    border-radius: var(--radius-sm);
    height: 36px;
    padding: 0 14px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-shadow: 0 4px 12px var(--accent-obtainium-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (hover: hover) {


    .modal-obtainium-btn:hover {
        opacity: 0.92;
        transform: translateY(-1px);
    }
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex: 0 0 40px;
}

@media (hover: hover) {


    .modal-close:hover {
        border-color: var(--accent-danger);
        color: var(--accent-danger);
    }
}

.modal-body {
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Modal Build Cards */
.modal-build-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: 12px;
    box-sizing: border-box;
    display: block;
    width: 100%;
}

body.light-mode .modal-build-card {
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.modal-build-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    min-height: 56px;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

body.light-mode .modal-build-header {
    background: #ffffff;
}

body.light-mode .download-btn {
    background: #faf8f5;
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .modal-build-header:hover {
        background: rgba(0, 0, 0, 0.18);
    }

    body.light-mode .modal-build-header:hover {
        background: #f7f4ee;
    }

    body.light-mode .download-btn:hover {
        background: #f2ede6;
    }
}



.modal-build-card.open .modal-build-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid var(--border);
}

.modal-build-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}

.modal-build-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.modal-build-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.4;
}

.modal-build-date {
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-muted);
    line-height: 1.3;
}

.modal-build-downloads {
    overflow: hidden;
}

.modal-build-downloads-inner {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

/* Badges */
.badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.patch-info-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.patch-info-actions>* {
    flex: 1 1 auto;
    min-width: max-content;
    text-align: center;
}

.release-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.release-badge.archive {
    background: var(--accent-archive-bg);
    border: 1px solid var(--accent-archive-border);
    color: var(--accent-archive);
}

.release-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s ease, opacity 0.2s ease;
}

@media (hover: hover) {


    .release-link:hover {
        opacity: 0.8;
    }
}

.release-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow);
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 600;
}

@media (hover: hover) {


    .release-link-button:hover {
        opacity: 1;
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-glow);
    }
}

.patch-applied-btn,
.release-link-button {
    min-height: 38px;
}

.patch-applied-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

@media (hover: hover) {


    .patch-applied-btn:hover,
    .release-link-button:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-glow);
    }
}

/* Asset Download Groups */
.asset-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 6px;
}

.asset-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

@media (hover: hover) {


    .download-btn:hover {
        background: var(--bg-card-hover);
        border-color: var(--border);
        transform: translateY(-1px);
        box-shadow: var(--shadow-hover);
    }
}

.asset-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.asset-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.asset-subtitle {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
    line-height: 1.3;
}

.asset-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.btn-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.download-action-btn {
    padding: 8px 18px;
    background: var(--accent);
    color: var(--btn-on-accent) !important;
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {


    .download-action-btn:hover {
        opacity: 0.9;
        transform: translateY(-2px);
    }
}

/* Applied Patches Modal Specifics */
.applied-patches-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.applied-patches-search-wrap {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.patch-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

#patchSearchInput {
    width: 100%;
    min-width: 0;
    padding: 10px 40px 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    height: 42px;
    box-sizing: border-box;
}

#patchSearchClearBtn {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
    transition: all 0.2s ease;
    z-index: 5;
    box-sizing: border-box;
}

.patch-search-input-wrap.has-value #patchSearchClearBtn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

@media (hover: hover) {


    #patchSearchClearBtn:hover {
        background: var(--accent-danger);
        color: #ffffff;
    }
}

#patchCountBadge {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#patchSearchInput:focus {
    outline: none;
    border-color: var(--accent);
}

/* Applied Patches filter band: arch pills, a divider, then APK/Module pills —
   shown only when that dimension's patch sets actually differ. */
.patch-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.patch-filter-pills .filter-group-divider {
    height: 22px;
    margin: 0 2px;
}

.patch-medium-btn,
.patch-arch-btn {
    padding: 4px 12px;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.patch-medium-btn .medium-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    opacity: 0.75;
}

.applied-patches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.applied-patch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.patch-check-icon {
    color: var(--accent-stable);
    font-weight: 800;
    font-size: 0.9rem;
}

/* Obtainium Modal */
.obtainium-instructions {
    color: var(--text-primary);
}

.obtainium-instructions a:not(.obtainium-add-btn) {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

@media (hover: hover) {


    .obtainium-instructions a:not(.obtainium-add-btn):hover {
        opacity: 0.8;
    }
}

.obtainium-instructions ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instruction-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-wrap: nowrap;
}

.instruction-code code {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
}

.instruction-code .copy-btn,
.instruction-code .obtainium-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}

.copy-btn {
    background: var(--accent);
    color: var(--btn-on-accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {


    .copy-btn:hover {
        opacity: 0.85;
        transform: translateY(-1px);
    }
}

/* Obtainium add button — signature purple */
.obtainium-add-btn {
    background: var(--accent-obtainium);
    color: var(--btn-on-accent) !important;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    font-weight: 700;
    border: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px var(--accent-obtainium-glow);
}

@media (hover: hover) {


    .obtainium-add-btn:hover {
        opacity: 0.88;
        color: var(--btn-on-accent) !important;
        text-decoration: none !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 16px var(--accent-obtainium-glow);
    }
}

.code-with-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.code-with-copy code {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--accent-stable);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 36px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

@media (hover: hover) {


    footer a:hover {
        text-decoration: underline;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    header {
        padding: 24px 0 16px;
        margin-bottom: 18px;
    }

    .builds-grid {
        grid-template-columns: 1fr;
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
    }

    .catalog-status-bar {
        justify-content: center;
        text-align: center;
    }

    .modal-overlay {
        padding: 8px;
    }

    .modal-card {
        max-height: 94vh;
        max-height: 94dvh;
    }

    .modal-header {
        position: static;
        padding: 14px 16px 12px;
        gap: 10px;
    }

    .modal-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .modal-header-top h2 {
        font-size: 1.05rem;
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        line-height: 1.25;
    }

    .modal-header-right {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .modal-obtainium-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 0.74rem;
        white-space: nowrap;
    }

    .modal-close {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
        flex-basis: 34px;
    }

    .modal-filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .modal-filter-btn {
        flex-shrink: 0;
        padding: 4px 12px;
        font-size: 0.74rem;
    }

    .patch-info-actions {
        justify-content: center;
        width: 100%;
    }

    .patch-info-actions>* {
        flex: 1 1 auto;
        min-width: max-content;
    }

    .instruction-code {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }

    .instruction-code code {
        flex: 1 1 100%;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.74rem;
    }

    .instruction-code .copy-btn,
    .instruction-code .obtainium-add-btn {
        flex: 1 1 0;
        width: 0;
        min-height: 32px;
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .instruction-code.code-with-copy {
        flex-wrap: nowrap;
    }

    .instruction-code.code-with-copy code {
        flex: 1 1 0;
        width: auto;
    }

    .instruction-code.code-with-copy .copy-btn {
        flex: 0 0 auto;
        width: auto;
        padding: 6px 12px;
    }

    .download-btn {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .asset-right {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }

    .download-action-btn {
        flex: 0 0 auto;
        width: auto;
        padding: 6px 14px;
        font-size: 0.78rem;
    }
}

/* Respect reduced-motion preferences: disable non-essential animation */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}