/* =========================================================
   IPSW.dl  —  macOS-Inspired Design System
   ========================================================= */

/* ----------------------------------------------------------
   0. Fonts & Reset
   ---------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Backgrounds */
    --bg-window:      #1c1c1e;
    --bg-surface:     #2c2c2e;
    --bg-elevated:    #3a3a3c;
    --bg-overlay:     rgba(44,44,46,0.92);
    --bg-glass:       rgba(28,28,30,0.75);
    --bg-sidebar:     rgba(28,28,30,0.85);
    --bg-toolbar:     rgba(28,28,30,0.8);
    --bg-card:        rgba(44,44,46,0.8);
    --bg-input:       rgba(118,118,128,0.12);
    --bg-hover:       rgba(255,255,255,0.05);
    --bg-active:      rgba(0,113,227,0.18);

    /* Text */
    --text-primary:   #f5f5f7;
    --text-secondary: rgba(235,235,245,0.6);
    --text-tertiary:  rgba(210, 210, 233, 0.35);
    --text-accent:    #0077ed;

    /* Accent */
    --accent:         #0071e3;
    --accent-hover:   #0077ed;
    --accent-bright:  #2997ff;
    --accent-light:   rgba(0,113,227,0.15);
    --accent-ring:    rgba(0,113,227,0.4);

    /* Status */
    --green:          #30d158;
    --green-bg:       rgba(48,209,88,0.15);
    --yellow:         #ffd60a;
    --yellow-bg:      rgba(255,214,10,0.15);
    --red:            #ff453a;
    --red-bg:         rgba(255,69,58,0.15);
    --orange:         #ff9f0a;
    --orange-bg:      rgba(255,159,10,0.15);
    --blue:           #64d2ff;
    --blue-bg:        rgba(100,210,255,0.15);

    /* Borders */
    --border:         rgba(255,255,255,0.08);
    --border-light:   rgba(255,255,255,0.05);
    --border-strong:  rgba(255,255,255,0.14);
    --border-accent:  rgba(0,113,227,0.5);

    /* Extra backgrounds (used in apps pages) */
    --bg-secondary:   #2c2c2e;
    --bg-tertiary:    #3a3a3c;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.5);
    --shadow-pop: 0 20px 60px rgba(0,0,0,0.7);

    /* Overlay / scrim */
    --bg-overlay: rgba(44,44,46,0.94);
    --bg-scrim:   rgba(0,0,0,0.55);

    /* Radius */
    --r-xs:  4px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-pill:9999px;

    /* Layout */
    --sidebar-w:    240px;
    --toolbar-h:    52px;
    --content-max:  1280px;

    /* Transitions */
    --ease:         cubic-bezier(0.4,0,0.2,1);
    --ease-spring:  cubic-bezier(0.34,1.56,0.64,1);

    /* Font */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', ui-monospace, 'Cascadia Mono', 'Courier New', monospace;
}

/* ----------------------------------------------------------
   Light theme variable set
   Applied in two ways:
    1. System preference (before JS runs) via @media — but skip
       if the user has explicitly forced dark with .theme-dark.
    2. Explicit JS toggle via the .theme-light class on <html>.
   ---------------------------------------------------------- */

/* shared light-mode property values (used in both selectors below) */
@media (prefers-color-scheme: light) {
    html:not(.theme-dark) {
        --bg-window:    #f5f5f7;
        --bg-surface:   #ffffff;
        --bg-elevated:  #f0f0f2;
        --bg-overlay:   rgba(250,250,252,0.96);
        --bg-glass:     rgba(245,245,247,0.8);
        --bg-sidebar:   rgba(236,236,238,0.92);
        --bg-toolbar:   rgba(245,245,247,0.85);
        --bg-card:      rgba(255,255,255,0.88);
        --bg-input:     rgba(118,118,128,0.08);
        --bg-hover:     rgba(0,0,0,0.04);
        --bg-active:    rgba(0,113,227,0.1);
        --bg-scrim:     rgba(0,0,0,0.3);
        --text-primary:   #1d1d1f;
        --text-secondary: #636366;
        --text-tertiary:  #8e8e93;
        --text-accent:    #0066cc;
        --border:         rgba(0,0,0,0.08);
        --border-light:   rgba(0,0,0,0.05);
        --border-strong:  rgba(0,0,0,0.14);
        --shadow-sm:  0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
        --shadow-md:  0 4px 16px rgba(0,0,0,0.12);
        --shadow-lg:  0 12px 40px rgba(0,0,0,0.16);
        --shadow-pop: 0 20px 60px rgba(0,0,0,0.25);
        --bg-secondary:   #f0f0f2;
        --bg-tertiary:    #e5e5ea;
    }
}

/* Explicit user override — JS sets this class via the toggle button */
html.theme-light {
    --bg-window:    #f5f5f7;
    --bg-surface:   #ffffff;
    --bg-elevated:  #f0f0f2;
    --bg-overlay:   rgba(250,250,252,0.96);
    --bg-glass:     rgba(245,245,247,0.8);
    --bg-sidebar:   rgba(236,236,238,0.92);
    --bg-toolbar:   rgba(245,245,247,0.85);
    --bg-card:      rgba(255,255,255,0.88);
    --bg-input:     rgba(118,118,128,0.08);
    --bg-hover:     rgba(0,0,0,0.04);
    --bg-active:    rgba(0,113,227,0.1);
    --bg-scrim:     rgba(0,0,0,0.3);
    --text-primary:   #1d1d1f;
    --text-secondary: #636366;
    --text-tertiary:  #8e8e93;
    --text-accent:    #0066cc;
    --border:         rgba(0,0,0,0.08);
    --border-light:   rgba(0,0,0,0.05);
    --border-strong:  rgba(0,0,0,0.14);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.16);
    --shadow-pop: 0 20px 60px rgba(0,0,0,0.25);
    --bg-secondary:   #f0f0f2;
    --bg-tertiary:    #e5e5ea;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-window);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.theme-light { color-scheme: light; }
body.theme-dark  { color-scheme: dark;  }

/* ----------------------------------------------------------
   1. Typography
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p  { color: var(--text-secondary); line-height: 1.65; }
a  { color: var(--accent-bright); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-hover); }

small { font-size: 0.8125rem; }
code, kbd, pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-elevated);
    border-radius: var(--r-xs);
    padding: 2px 6px;
    color: var(--text-primary);
}

/* ----------------------------------------------------------
   2. Layout — App Shell
   ---------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
}
.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,113,227,0.4);
}
.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}
.sidebar-logo-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.sidebar-logo-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Sidebar Search */
.sidebar-search {
    padding: 12px 12px 8px;
}
.sidebar-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    padding: 6px 12px 6px 32px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    position: relative;
}
.sidebar-search-wrap {
    position: relative;
}
.sidebar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    opacity: 0.4;
    pointer-events: none;
}
.sidebar-search-input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Nav Sections */
.sidebar-section {
    padding: 8px 8px 4px;
    flex: 1;
}
.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 6px 8px 4px;
}
.sidebar-nav {
    list-style: none;
}
.sidebar-nav li a,
.sidebar-nav li button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
    text-align: left;
}
.sidebar-nav li a svg,
.sidebar-nav li button svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    flex-shrink: 0;
}
.sidebar-nav li a:hover,
.sidebar-nav li button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sidebar-nav li a.active,
.sidebar-nav li a[aria-current="page"] {
    background: var(--bg-active);
    color: var(--accent-bright);
    font-weight: 500;
}
.sidebar-nav li a.active svg { opacity: 1; }

/* ── nav_style variants for sidebar ── */
/* flat: hide all section labels — everything is one continuous list */
.sidebar[data-nav-style="flat"] .sidebar-section-label { display: none; }

/* minimal: hide More + Device Types sections entirely */
.sidebar[data-nav-style="minimal"] .sidebar-sl--more,
.sidebar[data-nav-style="minimal"] .sidebar-nav--more,
.sidebar[data-nav-style="minimal"] .sidebar-sl--types,
.sidebar[data-nav-style="minimal"] .sidebar-nav--types { display: none; }
.sidebar[data-nav-style="minimal"] .sidebar-section-label { display: none; }

/* ── Collapsible sidebar section toggles ─────────────────── */
.sidebar-sl-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: default;           /* overridden in minimal style */
    padding: 6px 8px 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    font-family: inherit;
    text-align: left;
}
.sidebar-sl-chev {
    display: none;             /* visible only in minimal style */
    flex-shrink: 0;
    opacity: .5;
    transition: transform .2s;
}
.sidebar[data-nav-style="minimal"] .sidebar-sl-toggle {
    cursor: pointer;
}
.sidebar[data-nav-style="minimal"] .sidebar-sl-toggle:hover { color: var(--text-secondary); }
.sidebar[data-nav-style="minimal"] .sidebar-sl-chev { display: block; }
.sidebar[data-nav-style="minimal"] .sidebar-sl-toggle[aria-expanded="false"] .sidebar-sl-chev {
    transform: rotate(-90deg);
}
/* In minimal, remove the display:none overrides — JS controls visibility via max-height */
.sidebar[data-nav-style="minimal"] .sidebar-sl--more,
.sidebar[data-nav-style="minimal"] .sidebar-nav--more,
.sidebar[data-nav-style="minimal"] .sidebar-sl--types,
.sidebar[data-nav-style="minimal"] .sidebar-nav--types { display: revert; }

/* ── Topbar nav style ─────────────────────────────────────── */
@media (min-width: 769px) {
    .app-shell--topbar .sidebar           { display: none; }
    .app-shell--topbar .main-content      { margin-left: 0; }
    .app-shell--topbar .mobile-menu-toggle { display: none; }
    .app-shell--topbar .toolbar-title     { display: none; }
    .app-shell--topbar .page-content      { max-width: none; }
}
@media (max-width: 768px) {
    .tn-logo, .topbar-nav { display: none !important; }
    .app-shell--topbar .toolbar-title     { display: block !important; }
    .app-shell--topbar .mobile-menu-toggle { display: flex !important; }
}

/* Topbar logo */
.tn-logo {
    display: none;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}
.app-shell--topbar .tn-logo { display: flex; }
.tn-logo-name {
    font-size: .9rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Topbar nav */
.topbar-nav {
    display: none;
    flex: 1;
    align-items: center;
    gap: 2px;
    min-width: 0;
    overflow: visible;
}
.app-shell--topbar .topbar-nav { display: flex; }

/* Topbar item (links + dropdown buttons share this) */
.tn-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
    transition: background .15s, color .15s;
}
.tn-item:hover    { background: var(--bg-hover, rgba(128,128,128,.1)); color: var(--text-primary); }
.tn-item.tn-active { color: var(--accent, #007AFF); }
/* Icons inside top-level nav items */
.tn-item > svg:not(.tn-chev) { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }
.tn-item.tn-active > svg:not(.tn-chev) { opacity: 1; }
.tn-chev { transition: transform .2s; opacity: .5; flex-shrink: 0; }

/* Dropdown container */
.tn-dd { position: relative; }
.tn-dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    z-index: 500;
    padding: 4px 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
}
.tn-dd.tn-open .tn-dd-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.tn-dd.tn-open .tn-chev { transform: rotate(180deg); opacity: 1; }
.tn-dd-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: .84rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    transition: background .1s;
}
.tn-dd-link:hover       { background: var(--bg-hover); }
.tn-dd-link--act        { color: var(--accent, #007AFF); }
.tn-dd-sep              { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
/* Size icons injected via getDeviceTypeIcon() inside topbar dropdowns */
.tn-dd-link svg         { width: 14px; height: 14px; flex-shrink: 0; opacity: .65; }

/* Sidebar footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}
.theme-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.toolbar {
    position: sticky;
    top: 0;
    height: var(--toolbar-h);
    background: var(--bg-toolbar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    width: 100%;
}
.toolbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    display: block;          /* required: text-overflow only works on block-level */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Page Content */
.page-content {
    flex: 1;
    /* Subtract the fixed sidebar from the viewport so max-width is
       always relative to the actual available column, not the full vw. */
    width: 100%;
    max-width: calc(98vw - var(--sidebar-w));
    padding: 28px 32px 48px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   3. Spotlight Search Overlay
   ---------------------------------------------------------- */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-scrim);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 900;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
}
.spotlight-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.spotlight-box {
    width: 100%;
    max-width: 620px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
    transform: scale(0.96) translateY(-8px);
    transition: transform .25s var(--ease-spring);
}
.spotlight-overlay.open .spotlight-box {
    transform: scale(1) translateY(0);
}
.spotlight-input-wrap {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.spotlight-input-wrap svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
#spotlight-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    color: var(--text-primary);
}
#spotlight-input::placeholder { color: var(--text-tertiary); }
.spotlight-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}
.spotlight-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: var(--text-primary);
}
.spotlight-result-item:hover,
.spotlight-result-item.focused {
    background: var(--bg-active);
}
.spotlight-result-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--r-xs);
}
.spotlight-result-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spotlight-result-name { font-size: 0.9375rem; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.spotlight-result-id   { font-size: 0.8rem; color: var(--text-tertiary); font-family: var(--font-mono); }
.spotlight-result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spotlight-result-icon svg { width: 16px; height: 16px; opacity: 0.6; }
.spotlight-result-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    flex-shrink: 0;
}
.spotlight-result-badge.beta {
    background: rgba(255, 214, 10, 0.15);
    color: #ffd60a;
    border: 1px solid rgba(255, 214, 10, 0.3);
}
.spotlight-result-badge.blog {
    background: rgba(48, 209, 88, 0.12);
    color: #30d158;
    border: 1px solid rgba(48, 209, 88, 0.25);
}
.spotlight-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}
.spotlight-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
.spotlight-hint kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xs);
    padding: 2px 6px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* ----------------------------------------------------------
   4. Cards
   ---------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}
.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-body   { padding: 18px 20px; }
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.card-header h3 { font-size: 0.9375rem; font-weight: 600; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
}

/* Device Card */
.device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px 16px;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: all .25s var(--ease);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    cursor: pointer;
}
.device-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-light);
    transform: translateY(-3px) scale(1.01);
    color: var(--text-primary);
}
.device-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    transition: filter .2s, transform .2s;
}
.device-card:hover img {
    filter: drop-shadow(0 6px 20px rgba(0,113,227,0.3));
    transform: scale(1.05);
}
.device-card-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}
.device-card-id {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ----------------------------------------------------------
   5. Device Grid
   ---------------------------------------------------------- */
.device-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    animation: fadeIn .35s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.device-grid.loading {
    pointer-events: none;
}

/* Skeleton loader */
.skeleton,
.skel {
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        rgba(255,255,255,0.04) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--r-sm);
}
/* Inline shimmer (inside text spans) */
.skel-inline {
    display: inline-block;
    height: 1em;
    vertical-align: middle;
    border-radius: 4px;
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        rgba(255,255,255,0.06) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
/* Skeleton image placeholder inside featured-card */
.skel-img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    flex-shrink: 0;
    align-self: center;
}
.featured-card-skel {
    pointer-events: none;
    gap: 12px;
    align-items: center;
    display: flex;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    height: 160px;
    border-radius: var(--r-lg);
}

/* ----------------------------------------------------------
   6. Segmented Control (type filter)
   ---------------------------------------------------------- */
.segmented-control {
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.segmented-control::-webkit-scrollbar { display: none; }
.segmented-control a,
.segmented-control button {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.segmented-control a:hover,
.segmented-control button:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.segmented-control a.active,
.segmented-control button.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Segmented control scroll wrapper */
.sc-wrap {
    width: 95vw;
    overflow-x: auto;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
    padding-bottom: 2px;
}
.sc-wrap::-webkit-scrollbar { display: none; }

/* ----------------------------------------------------------
   7. Badges & Status Pills
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge-signed   { background: var(--green-bg);  color: var(--green);  }
.badge-unsigned { background: var(--red-bg);    color: var(--red);    }
.badge-beta     { background: var(--orange-bg); color: var(--orange); }
.badge-rc       { background: var(--blue-bg);   color: var(--blue);   }
.badge-accent   { background: var(--accent-light); color: var(--accent-bright); }

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}
.badge-signed::before   { animation: pulse-green  2s infinite; }
.badge-unsigned::before { animation: none; opacity: 0.6; }

@keyframes pulse-green {
    0%,100% { opacity:1; transform: scale(1); }
    50%      { opacity:.5; transform: scale(0.8); }
}

/* ----------------------------------------------------------
   8. Firmware / OTA Table
   ---------------------------------------------------------- */
.fw-table-wrap {
    overflow-x: auto;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
}
.fw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.fw-table thead tr {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-strong);
}
.fw-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.fw-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.fw-table tbody tr { transition: background .12s; }
.fw-table tbody tr:hover { background: var(--bg-hover); }
.fw-table tbody tr:last-child td { border-bottom: none; }
.fw-table td.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }

/* ----------------------------------------------------------
   9. Firmware Detail Page
   ---------------------------------------------------------- */
.fw-hero {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
}
.fw-hero-device {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}
.fw-hero-device img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
    transition: transform .3s var(--ease);
}
.fw-hero-device img:hover { transform: scale(1.06); }
.fw-hero-info { flex: 1; min-width: 220px; }
/* Card wrapper for the whole hero block */
.fw-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 22px 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.fw-hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--blue));
}
.fw-hero-device-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}
.fw-hero-device-id {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    text-align: center;
    display: block;
    background: none;
    padding: 0;
}
.fw-hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.fw-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    color: var(--accent-bright);
    padding: 4px 12px;
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.fw-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.fw-meta-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
}
.fw-meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}
.fw-meta-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}
.fw-meta-value.mono { font-family: var(--font-mono); font-size: 0.8rem; }

/* Beta firmware link */
.fw-beta-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.825rem;
    color: var(--text-tertiary);
}
.fw-beta-link svg { flex-shrink: 0; opacity: 0.6; }
.fw-beta-link a { color: var(--accent); text-decoration: none; }
.fw-beta-link a:hover { text-decoration: underline; }

/* Beta device page — hero header */
.beta-device-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.beta-device-hero__img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .beta-device-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }
    .beta-device-hero__img {
        width: 110px;
        height: 110px;
    }
    .beta-device-hero div > div {
        justify-content: center;
    }
}

/* Beta device page footer (back + public firmware links) */
.beta-page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 28px;
}
.beta-page-footer__back {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-decoration: none;
}
.beta-page-footer__public { margin-top: 0; }

/* Beta index table date separator row */
.beta-index-date-sep {
    padding: 8px 14px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Beta index table responsive column hiding */
@media (max-width: 768px) {
    .fw-table--beta-index th:nth-child(3),
    .fw-table--beta-index td:nth-child(3) { display: none; } /* OS */
    /* OTA table: hide Type */
    .fw-table--ota th:nth-child(3),
    .fw-table--ota td:nth-child(3) { display: none; }
}
@media (max-width: 480px) {
    .fw-table--beta-index th:nth-child(4),
    .fw-table--beta-index td:nth-child(4) { display: none; } /* Signed */
    /* IPSW table: hide Build ID + Release Date */
    .fw-table--ipsw th:nth-child(2),
    .fw-table--ipsw td:nth-child(2),
    .fw-table--ipsw th:nth-child(3),
    .fw-table--ipsw td:nth-child(3) { display: none; }
    /* OTA table: hide Build ID + Release Date */
    .fw-table--ota th:nth-child(2),
    .fw-table--ota td:nth-child(2),
    .fw-table--ota th:nth-child(4),
    .fw-table--ota td:nth-child(4) { display: none; }
}

/* Beta table — hide File Size on medium screens */
@media (max-width: 768px) {
    .fw-table--beta th:nth-child(4),
    .fw-table--beta td:nth-child(4) { display: none; } /* File Size */
}
@media (max-width: 480px) {
    .fw-table--beta th:nth-child(2),
    .fw-table--beta td:nth-child(2) { display: none; } /* Build ID */
    .beta-page-footer {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* Firmware description */
.fw-about-desc {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0;
}
.fw-about-desc + .fw-about-desc { margin-top: 8px; }
.fw-about-desc strong { color: var(--text-primary); font-weight: 600; }
.fw-inline-code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--bg-elevated);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.fw-signed-text   { color: #30d158; }
.fw-unsigned-text { color: var(--text-tertiary); }

/* Hash box */
.hash-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
}
.hash-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    min-width: 56px;
    flex-shrink: 0;
}
.hash-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.copy-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 3px 8px;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}
.copy-btn:hover { background: var(--bg-active); color: var(--accent-bright); border-color: var(--border-accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ----------------------------------------------------------
   10. Download Button
   ---------------------------------------------------------- */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,113,227,0.35);
    transition: all .2s var(--ease);
    letter-spacing: 0.01em;
}
.btn-download:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,113,227,0.5);
}
.btn-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,113,227,0.35);
}
.btn-download svg { width: 18px; height: 18px; }

/* Secondary button */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--r-pill);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: all .2s var(--ease);
}
.btn:hover { background: var(--bg-surface); border-color: var(--border-accent); color: var(--accent-bright); }
.btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-success { border-color: var(--green); color: var(--green); }
.btn-success:hover { background: var(--green-bg); }

/* ----------------------------------------------------------
   11. Hero Section (Home)
   ---------------------------------------------------------- */
.hero {
    padding: 56px 0 40px;
    text-align: center;
    position: relative;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-light);
    color: var(--accent-bright);
    border: 1px solid rgba(0,113,227,0.3);
    border-radius: var(--r-pill);
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent-bright);
}
.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Hero split layout ──────────────────────────────────────────────
   Section 23: Hero Art Illustration
   ─────────────────────────────────────────────────────────────────── */
.hero--split {
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
    padding: 52px 0 44px;
}
.hero-copy {
    flex: 1 1 0;
    min-width: 0;
}
.hero--split .hero-subtitle { margin-left: 0; margin-right: 0; max-width: 500px; }
.hero--split .hero-actions   { justify-content: flex-start; }
.hero--split .hero-stats     { justify-content: flex-start; }

/* Art container */
.hero-art {
    flex-shrink: 0;
    width: 370px;
    height: 430px;
    position: relative;
    pointer-events: none;
    user-select: none;
}

/* Ambient glow blobs */
.ha-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: ha-pulse 7s ease-in-out infinite alternate;
}
.ha-blob-1 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(0,122,255,0.22) 0%, transparent 70%);
    top: 130px; left: 50px;
    filter: blur(45px);
}
.ha-blob-2 {
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(191,90,242,0.20) 0%, transparent 70%);
    top: 30px; right: 20px;
    filter: blur(35px);
    animation-delay: -3s;
}
.ha-blob-3 {
    width: 130px; height: 130px;
    background: radial-gradient(circle, rgba(255,55,95,0.14) 0%, transparent 70%);
    bottom: 50px; left: 10px;
    filter: blur(30px);
    animation-delay: -5s;
}
@keyframes ha-pulse {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0.5; transform: scale(1.12); }
}

/* MacBook */
.ha-mac {
    position: absolute;
    left: 0; top: 22px;
    width: 248px;
    z-index: 10;
    animation: ha-float-a 5.5s ease-in-out infinite alternate;
}
.ha-mac-lid {
    width: 248px;
    height: 160px;
    background: #2c2c2e;
    border-radius: 9px 9px 0 0;
    border: 1.5px solid rgba(255,255,255,0.10);
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
}
.ha-mac-lid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, transparent 55%);
    border-radius: 9px 9px 0 0;
    pointer-events: none;
    z-index: 5;
}
.ha-mac-notch {
    width: 5px; height: 5px;
    background: #3a3a3c;
    border-radius: 50%;
    margin: 5px auto 0;
    position: relative; z-index: 6;
}
.ha-mac-screen {
    position: absolute;
    inset: 12px 5px 5px 5px;
    background: #0d0d0e;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ha-mac-bar {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    height: 16px;
    flex-shrink: 0;
    font-size: 5.5px;
    color: rgba(255,255,255,0.45);
}
.ha-apple { font-size: 7.5px; color: rgba(255,255,255,0.7); margin-right: 1px; }
.ha-mi    { color: rgba(255,255,255,0.4); }
.ha-mc-r  { margin-left: auto; }
.ha-win {
    flex: 1;
    margin: 4px;
    background: #161618;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.ha-win-tbar {
    display: flex;
    align-items: center;
    gap: 3.5px;
    padding: 5px 7px;
    background: rgba(255,255,255,0.025);
    border-bottom: 1px solid rgba(255,255,255,0.055);
    flex-shrink: 0;
}
.ha-tf     { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ha-tf-r   { background: #FF5F57; }
.ha-tf-y   { background: #FEBC2E; }
.ha-tf-g   { background: #28C840; }
.ha-win-ttl {
    font-size: 5.5px;
    color: rgba(255,255,255,0.35);
    margin-left: 6px;
    font-weight: 500;
}
.ha-win-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}
.ha-win-side {
    width: 54px;
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.ha-wsb {
    padding: 3.5px 7px;
    font-size: 5.5px;
    color: rgba(255,255,255,0.3);
    border-radius: 3px;
}
.ha-wsb-a {
    background: rgba(0,122,255,0.16);
    color: #5aabff;
    font-weight: 700;
}
.ha-win-main {
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ha-fw-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 3px;
    background: rgba(255,255,255,0.02);
}
.ha-fw-row-dim { opacity: 0.5; }
.ha-fw-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #636366;
    flex-shrink: 0;
}
.ha-fw-dot-g {
    background: #30D158;
    box-shadow: 0 0 5px rgba(48,209,88,0.7);
}
.ha-fw-name {
    font-size: 5.5px;
    color: rgba(255,255,255,0.75);
    flex: 1;
    font-weight: 500;
}
.ha-fw-badge {
    font-size: 4.5px;
    padding: 1.5px 5px;
    border-radius: 10px;
    background: rgba(48,209,88,0.12);
    color: #30D158;
    font-weight: 700;
    border: 0.5px solid rgba(48,209,88,0.25);
    flex-shrink: 0;
}
.ha-fw-badge-dim {
    background: rgba(99,99,102,0.12);
    color: rgba(255,255,255,0.25);
    border-color: rgba(99,99,102,0.18);
}
.ha-mac-chin {
    width: 248px;
    height: 7px;
    background: #2c2c2e;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-top: none;
}
.ha-mac-base {
    width: 270px;
    height: 9px;
    background: #2a2a2c;
    border-radius: 0 0 4px 4px;
    margin-left: -11px;
    border: 1.5px solid rgba(255,255,255,0.07);
    border-top: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ha-mac-foot {
    width: 190px;
    height: 5px;
    background: #222224;
    border-radius: 0 0 8px 8px;
    margin-left: 29px;
}

/* iPhone mockup */
.ha-phone {
    position: absolute;
    right: 8px; top: 62px;
    width: 146px; height: 292px;
    background: #1c1c1e;
    border-radius: 38px;
    border: 1.5px solid rgba(255,255,255,0.14);
    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 0 0 0.5px rgba(255,255,255,0.04) inset,
        18px 0 50px rgba(0,122,255,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 20;
    animation: ha-float-b 4.8s ease-in-out infinite alternate;
}
.ha-phone::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #000;
    border-radius: 36px;
    z-index: 0;
}
.ha-phone::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 35%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.025) 100%);
    border-radius: 0 38px 38px 0;
    pointer-events: none;
    z-index: 30;
}
/* Dynamic Island */
.ha-di {
    width: 78px; height: 26px;
    background: #000;
    border: 1.5px solid #1c1c1e;
    border-radius: 20px;
    margin: 10px auto 0;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
/* Status bar */
.ha-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 14px;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
.ha-status-time {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.ha-status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}
/* Weather widget */
.ha-wgt {
    margin: 3px 8px;
    background: linear-gradient(155deg, #1a4a96 0%, #0a245c 100%);
    border-radius: 14px;
    padding: 7px 8px;
    flex-shrink: 0;
    position: relative; z-index: 2;
    overflow: hidden;
}
.ha-wgt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255,200,80,0.18) 0%, transparent 55%);
    border-radius: 14px;
    pointer-events: none;
}
.ha-wgt-loc {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 8.5px; color: rgba(255,255,255,0.7); font-weight: 500; margin-bottom: 1px;
}
.ha-wgt-tmp { font-size: 30px; font-weight: 200; color: #fff; line-height: 1; letter-spacing: -0.03em; }
.ha-wgt-cnd { font-size: 7px; color: rgba(255,255,255,0.5); margin-top: 1px; }
/* App icons */
.ha-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px 9px;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
.ha-ic {
    aspect-ratio: 1;
    border-radius: 7px;
    background: var(--ci, #007AFF);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* Dock */
.ha-dock {
    margin: auto 8px 8px;
    background: rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative; z-index: 2;
}
/* Home bar */
.ha-bar {
    width: 42px; height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 3px auto 7px;
    flex-shrink: 0;
    position: relative; z-index: 2;
}
/* Hardware side buttons */
.ha-sbtn {
    position: absolute;
    width: 3px;
    background: #2a2a2e;
    border-radius: 2px;
    border: 0.5px solid rgba(255,255,255,0.07);
    z-index: 25;
}
.ha-sbtn-mute { left: -2px; top: 72px; height: 24px; }
.ha-sbtn-v1   { left: -2px; top: 110px; height: 34px; }
.ha-sbtn-v2   { left: -2px; top: 152px; height: 34px; }
.ha-sbtn-pwr  { right: -2px; top: 110px; height: 46px; }

/* Floating notification */
.ha-notif {
    position: absolute;
    right: -4px; top: 6px;
    width: 188px;
    background: rgba(28,28,30,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 16px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 36px rgba(0,0,0,0.45), 0 0 0 0.5px rgba(255,255,255,0.04) inset;
    z-index: 30;
    animation: ha-float-c 3.9s ease-in-out infinite alternate;
}
.ha-notif-ico {
    width: 30px; height: 30px;
    background: linear-gradient(145deg, #1a8ef5 0%, #0360cc 100%);
    border-radius: 8px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(0,122,255,0.4);
}
.ha-notif-txt { flex: 1; min-width: 0; }
.ha-notif-app { font-size: 7.5px; font-weight: 700; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1.5px; }
.ha-notif-msg { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-notif-tm  { font-size: 8px; color: rgba(255,255,255,0.3); align-self: flex-start; margin-top: 1px; flex-shrink: 0; }

/* Chip badge */
.ha-chip {
    position: absolute;
    left: 12px; bottom: 28px;
    background: rgba(48,209,88,0.10);
    border: 1px solid rgba(48,209,88,0.24);
    border-radius: 100px;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    color: #30D158;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 25;
    animation: ha-float-c 4.3s ease-in-out infinite alternate;
    animation-delay: -1.2s;
}
.ha-chip-dot {
    width: 6px; height: 6px;
    background: #30D158;
    border-radius: 50%;
    box-shadow: 0 0 7px rgba(48,209,88,0.85);
    animation: ha-blink 1.9s ease-in-out infinite;
}
@keyframes ha-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

/* Float keyframes */
@keyframes ha-float-a {
    from { transform: translateY(0px) rotate(-0.5deg); }
    to   { transform: translateY(-9px) rotate(0.5deg); }
}
@keyframes ha-float-b {
    from { transform: translateY(0px); }
    to   { transform: translateY(-13px); }
}
@keyframes ha-float-c {
    from { transform: translateY(0px); }
    to   { transform: translateY(-7px); }
}

/* Responsive — hide art, revert to centred stack below 960 px */
@media (max-width: 960px) {
    .hero-art    { display: none; }
    .hero--split { flex-direction: column; text-align: center; gap: 0; padding: 40px 0 28px; }
    .hero--split .hero-actions  { justify-content: center; }
    .hero--split .hero-stats    { justify-content: center; }
    .hero--split .hero-subtitle { margin: 0 auto 32px; }
}
/* ─────────────────────────────────────────────────────────────────── */

/* Stats strip */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-light), transparent 60%);
    opacity: 0;
    transition: opacity .2s var(--ease);
    pointer-events: none;
}
.stat-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-light);
    transform: translateY(-3px);
    color: var(--text-primary);
}
.stat-card:hover::after { opacity: 1; }
.stat-card-icon {
    width: 48px; height: 48px;
    background: var(--accent-light);
    border-radius: var(--r-lg);
    display: flex; align-items: center; justify-content: center;
    transition: background .2s var(--ease), transform .2s var(--ease-spring);
}
.stat-card:hover .stat-card-icon { background: var(--accent); transform: scale(1.1); }
.stat-card-icon svg { width: 22px; height: 22px; color: var(--accent-bright); transition: color .2s; }
.stat-card:hover .stat-card-icon svg { color: #fff; }
.stat-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-value { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: 0.72rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }

/* Ad slots */
.ad-slot {
    text-align: center;
    overflow: hidden;
    max-width: 90vw;
    margin: 2px auto;
    line-height: 0; 
}
.ad-slot:empty { display: none; }

/* ── Restore Instructions ──────────────────────────────────── */
.restore-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 8px;
}

.restore-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.restore-card-title svg { flex-shrink: 0; color: var(--accent-bright); }

.restore-steps {
    list-style: decimal;
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
.restore-steps strong { color: var(--text-primary); font-weight: 600; }
.restore-steps code {
    font-size: 0.8em;
    padding: 1px 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
}
.restore-steps kbd {
    display: inline-block;
    padding: 1px 7px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: 0.76rem;
    font-family: ui-monospace, 'SF Mono', monospace;
    color: var(--text-primary);
    line-height: 1.6;
}
.restore-alert { margin-top: 14px; }

.restore-dfu-intro {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0 0 14px;
}
.restore-dfu-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.restore-dfu-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
}
.restore-dfu-panel-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.restore-dfu-steps {
    list-style: decimal;
    padding-left: 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.restore-dfu-steps strong { color: var(--text-primary); font-weight: 600; }

/* SHSH Blobs */
.shsh-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.shsh-tool-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.shsh-tool-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.shsh-tool-hd svg { color: var(--accent-bright); flex-shrink: 0; }
.shsh-tool-hd strong { font-size: 0.875rem; }
.shsh-tool-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}
.shsh-cmd-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 9px 12px;
    margin-top: 10px;
    overflow: hidden;
}
.shsh-cmd {
    flex: 1;
    font-size: 0.76rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    word-break: break-all;
    white-space: pre-wrap;
    background: none;
    border: none;
    padding: 0;
}
.shsh-tool-note {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin: 6px 0 0;
    line-height: 1.5;
}
.shsh-tool-note code {
    font-size: 0.9em;
    padding: 1px 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
}
@media (max-width: 640px) {
    .shsh-tools-grid { grid-template-columns: 1fr; }
}

/* SHSH save-now CTA banner */
.shsh-cta-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent-light) 0%, transparent 100%),
                var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-left: 3px solid var(--accent-bright);
    border-radius: var(--r-lg);
}
.shsh-cta-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--accent-light);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-bright);
}
.shsh-cta-body {
    flex: 1;
    min-width: 0;
}
.shsh-cta-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.shsh-cta-text {
    font-size: 0.845rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.shsh-cta-text code {
    font-size: 0.88em;
    font-family: var(--font-mono);
    padding: 1px 5px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
}
.shsh-cta-badge { flex-shrink: 0; }
@media (max-width: 600px) {
    .shsh-cta-banner { flex-wrap: wrap; gap: 12px; }
    .shsh-cta-badge { order: -1; }
}


/* Featured grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    transition: all .2s var(--ease);
    box-shadow: var(--shadow-sm);
}
.featured-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
}
.featured-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.featured-card-info { flex: 1; min-width: 0; }
.featured-card-name { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-card-version { font-size: 0.8rem; color: var(--text-tertiary); font-family: var(--font-mono); }

/* ----------------------------------------------------------
   12. Page Header
   ---------------------------------------------------------- */
.page-header {
    margin-bottom: 28px;
}
.page-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--accent-bright); }
.breadcrumb-sep { opacity: 0.4; }

/* ----------------------------------------------------------
   13. Tabs (IPSW / OTA)
   ---------------------------------------------------------- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 2px;
    margin-bottom: 24px;
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .25s var(--ease); }

/* ----------------------------------------------------------
   14. Forms
   ---------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-label small { font-size: 0.75rem; color: var(--text-tertiary); font-weight: 400; margin-left: 6px; }
.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 9px 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.form-control:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-control::placeholder { color: var(--text-tertiary); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    border-radius: var(--r-xs);
}

/* ----------------------------------------------------------
   15. Alerts / Toast
   ---------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg);  border-color: rgba(48,209,88,0.3);  color: var(--green); }
.alert-error   { background: var(--red-bg);    border-color: rgba(255,69,58,0.3);  color: var(--red); }
.alert-warning { background: var(--yellow-bg); border-color: rgba(255,214,10,0.3); color: var(--yellow); }
.alert-info    { background: var(--blue-bg);   border-color: rgba(100,210,255,0.3);color: var(--blue); }

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    pointer-events: all;
    animation: toastIn .3s var(--ease-spring) forwards;
    min-width: 240px;
    max-width: 360px;
}
.toast.hide { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); }    to { opacity:0; transform: translateX(20px); } }

/* ----------------------------------------------------------
   16. Release Notes Panel
   ---------------------------------------------------------- */
.release-notes {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    margin-top: 24px;
}
.release-notes h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}
.release-notes-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.release-notes-body ul, .release-notes-body ol {
    padding-left: 20px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.release-notes-body li { margin-bottom: 4px; }
.release-notes-body a { color: var(--accent-bright); }

/* ----------------------------------------------------------
   17. Loading Spinner
   ---------------------------------------------------------- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent-bright);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 32px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ----------------------------------------------------------
   18. Empty State
   ---------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 64px 32px;
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-elevated);
    border-radius: var(--r-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 4px;
}
.empty-state h3 { font-size: 1rem; font-weight: 600; }
.empty-state p  { font-size: 0.875rem; color: var(--text-tertiary); max-width: 320px; }

/* ----------------------------------------------------------
   19. Mobile Hamburger
   ---------------------------------------------------------- */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--text-secondary);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ----------------------------------------------------------
   20. Scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ----------------------------------------------------------
   Blog & Static Pages
   ---------------------------------------------------------- */
.page-content-wrap {
    padding: 36px 28px 60px;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}
.page-content-inner {
    max-width: 740px;
}
.page-content-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.25;
}
.page-content-updated {
    font-size: 0.825rem;
    color: var(--text-tertiary);
    margin: 0 0 28px;
}
.page-content-body {
    font-size: 0.9625rem;
    line-height: 1.75;
    color: var(--text-secondary);
}
.page-content-body h2 { font-size: 1.25rem; font-weight: 700; margin: 1.5em 0 .5em; color: var(--text-primary); }
.page-content-body h3 { font-size: 1.05rem; font-weight: 600; margin: 1.25em 0 .4em; color: var(--text-primary); }
.page-content-body p  { margin: 0 0 1em; }
.page-content-body a  { color: var(--accent); text-decoration: underline; }
.page-content-body ul,
.page-content-body ol { padding-left: 1.5em; margin: 0 0 1em; }
.page-content-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 10px 18px;
    margin: 1em 0;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.page-content-body img { max-width: 100%; border-radius: var(--r-md); margin: .5em 0; }
.page-content-body hr  { border: none; border-top: 1px solid var(--border-strong); margin: 2em 0; }

/* Blog Index */
.blog-index-header { margin-bottom: 32px; }
.blog-index-header h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 6px; }
.blog-index-header p  { color: var(--text-tertiary); font-size: 0.9rem; margin: 0; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--bg-elevated);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.blog-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}
.blog-card-cover {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-base);
    flex-shrink: 0;
}
.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.blog-card-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-card-cover-empty svg {
    width: 36px;
    height: 36px;
    opacity: 0.25;
}
.blog-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.blog-card-date { font-size: 0.78rem; color: var(--text-tertiary); margin: 0; }
.blog-card-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--text-primary); line-height: 1.35; }
.blog-card-excerpt { font-size: 0.875rem; color: var(--text-secondary); margin: 0; line-height: 1.5; flex: 1; }
.blog-card-more { font-size: 0.82rem; color: var(--accent); margin-top: auto; }

/* Blog Single Post */
.blog-post-cover {
    width: 100%;
    max-height: 340px;
    overflow: hidden;
    border-radius: var(--r-xl);
    margin-bottom: 24px;
}
.blog-post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.blog-back {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color .12s;
}
.blog-back:hover { color: var(--text-primary); }
.blog-post-excerpt {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0 0 24px;
    line-height: 1.6;
    font-style: italic;
}
.blog-post-body { /* extends .page-content-body */ }
.blog-post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}
.page-btn {
    padding: 8px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background .12s, color .12s;
}
.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-info { font-size: 0.875rem; color: var(--text-tertiary); }

/* ----------------------------------------------------------
   21. Responsive
   ---------------------------------------------------------- */

/* ── Tablet (≤ 1024px) — sidebar still visible ──────────── */
@media (max-width: 1024px) {
    /* calc(98vw - sidebar-w) still applies here — just tighten the gutters */
    .page-content        { padding-left: 20px; padding-right: 20px; }
    .device-grid{ grid-template-columns: repeat(3, 1fr); }
    .featured-grid       { grid-template-columns: repeat(3, 1fr); }
    .fw-meta-grid        { grid-template-columns: repeat(2, 1fr); }
    .stats-strip         { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ── Mobile (≤ 768px) ────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 280px;
        --toolbar-h: 48px;
    }

    /* Sidebar slides in over content */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-pop);
    }
    .sidebar-overlay.show { display: block; }

    /* Full-width main */
    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: flex; }

    /* Sidebar hidden — full viewport available; switch max-width back to full */
    .page-content { padding: 20px 16px 48px; max-width: 100%; }

    /* ── Hero ── */
    .hero { padding: 32px 0 24px; }
    .hero-title {
        -webkit-text-fill-color: var(--text-primary);
        background: none;
        font-size: clamp(1.6rem, 7vw, 2.4rem);
    }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-stats { gap: 20px; }
    .hero-stat-value { font-size: 1.5rem; }

    /* ── Stats strip / featured ── */
    .stats-strip    { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .featured-grid  { grid-template-columns: 1fr; gap: 12px; }
    .featured-card  { padding: 14px; }

    /* ── Device grid ── */
    .device-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .device-card { padding: 14px 10px 12px; }
    .device-card img { width: 60px; height: 60px; }
    .device-card-name { font-size: 0.8rem; }
    .device-card-id   { display: none; }   /* hide identifier on tiny screens */

    /* ── Segmented control ── */
    .segmented-control { border-radius: var(--r-md); padding: 4px; gap: 0; }
    .segmented-control a,
    .segmented-control button { padding: 6px 12px; font-size: 0.78rem; white-space: nowrap; }

    /* ── Firmware hero ── */
    .fw-hero-card { padding: 16px; border-radius: var(--r-lg); }
    .fw-hero { display: block; }
    .fw-hero-device { min-width: unset; }
    .fw-hero-device img { width: 72px; height: 72px; }
    .fw-hero-info { min-width: unset; width: 100%; }
    .fw-meta-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .fw-meta-item { padding: 8px 10px; }
    .fw-meta-label { font-size: 0.68rem; }
    .fw-meta-value { font-size: 0.8rem; }

    /* ── Tables ── */
    .fw-table-wrap { border-radius: var(--r-md); }
    .fw-table th,
    .fw-table td { padding: 10px 12px; font-size: 0.8rem; }

    /* ── Hash rows ── */
    .hash-row { flex-wrap: wrap; gap: 6px; }
    .hash-value { white-space: normal; }

    /* ── Tabs ── */
    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tab-btn { padding: 10px 14px; font-size: 0.85rem; white-space: nowrap; }

    /* ── Toolbar ── */
    .toolbar { padding: 0 14px; gap: 10px; }
    .toolbar-title { font-size: 0.875rem; flex: 1; max-width: 75vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ── Blog / Pages ── */
    .page-content-wrap { padding: 24px 16px 60px; }
    .blog-index-header { margin-bottom: 24px; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-card-cover { aspect-ratio: 16/9; }
    .blog-post-cover img { height: 220px; }
    .pagination { margin-top: 32px; gap: 10px; }

    /* ── Device show header ── */
    .page-header > div > div { flex-direction: column; align-items: flex-start; }

    /* ── Page header ── */
    .page-header-inner { flex-direction: column; }

    /* ── Spotlight ── */
    .spotlight-overlay { padding-top: 8vh; padding-left: 12px; padding-right: 12px; }
    .spotlight-box { border-radius: var(--r-lg); }

    /* ── Toast ── */
    #toast-container { bottom: 12px; right: 12px; left: 12px; }
    .toast { min-width: unset; max-width: 100%; }
}

/* ── Small mobile (≤ 480px) ─────────────────────────────── */
@media (max-width: 480px) {
    /* ── Device grid — 2 cols so cards aren't comically wide ── */
    .device-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .device-card  { padding: 12px 8px 10px; }
    .device-card img { width: 52px; height: 52px; }
    .device-card-name { font-size: 0.78rem; }

    .stats-strip  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .featured-grid { grid-template-columns: 1fr; }

    .fw-meta-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .fw-meta-item { padding: 7px 9px; }

    .hero-stats   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .page-content { padding: 12px 12px 40px; }

    .fw-table th:nth-child(3),
    .fw-table td:nth-child(3) { display: none; }   /* hide Release Date column */

    .hash-label { min-width: 42px; font-size: 0.68rem; }
    .hash-value { font-size: 0.72rem; }

    /* ── Toolbar ── */
    .toolbar { padding: 0 10px; gap: 8px; }
    .toolbar-title { font-size: 0.8125rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Icon-only search button — hide text + hotkey hint */
    #spotlight-trigger > span,
    #spotlight-trigger > kbd { display: none; }
    #spotlight-trigger { padding: 7px 8px; min-width: 32px; justify-content: center; }

    /* ── Spotlight / Search ── */
    .spotlight-overlay { padding-top: 4vh; padding-left: 8px; padding-right: 8px; }
    .spotlight-box { border-radius: var(--r-md); }
    #spotlight-input { font-size: 0.9375rem; }
    .spotlight-hint { display: none; }
    .spotlight-results { max-height: 260px; }
}

/* ----------------------------------------------------------
   23. Beta builds list (homepage widget)
   ---------------------------------------------------------- */
.beta-home-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
}
.beta-home-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background .12s;
}
.beta-home-row:last-child { border-bottom: none; }
a.beta-home-row:hover { background: var(--bg-hover, rgba(255,255,255,.04)); }
.beta-home-row-skel { pointer-events: none; }
.beta-home-date-sep {
    padding: 5px 18px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

/* Beta async skeleton device card */
.beta-dev-skel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 0;
}

/* Beta index table skeleton rows */
.beta-skel-row td { padding: 12px 14px; }

/* Beta pagination flex container */
#beta-fw-pagination,
#beta-builds-pagination,
#beta-pagination {
    display: none;
    flex-direction: row;
}

/* Apps async skeleton row */
.as-row-skel {
    pointer-events: none;
    cursor: default;
}
.as-row-skel .as-row-icon { align-items: center; justify-content: center; }
.as-row-skel .as-row-body { justify-content: center; gap: 6px; }

/* Apps pagination flex containers */
#apps-pagination,
#dev-pagination {
    display: none;
    flex-direction: row;
}

/* ----------------------------------------------------------
   22. Mobile bottom tab bar
   ---------------------------------------------------------- */
.mobile-tab-bar {
    display: none; /* desktop: hidden */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 190;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: stretch;
    justify-content: space-around;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .01em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px 4px;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.mobile-tab svg {
    flex-shrink: 0;
    transition: transform .15s;
    stroke: currentColor;
}
.mobile-tab.active {
    color: var(--accent, #007AFF);
}
.mobile-tab:active svg {
    transform: scale(.88);
}

@media (max-width: 768px) {
    .mobile-tab-bar { display: flex; }
    /* Give page-content extra bottom padding so content isn't hidden under the bar */
    .page-content { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 20px); }
    /* Push toast above tab bar */
    #toast-container { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ----------------------------------------------------------
   23. Misc utilities
   ---------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.text-muted    { color: var(--text-tertiary); }
.text-accent   { color: var(--accent-bright); }
.text-success  { color: var(--green); }
.text-danger   { color: var(--red); }
.text-mono     { font-family: var(--font-mono); }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mt-4  { margin-top: 32px; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.mb-4  { margin-bottom: 32px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 14px;
}
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ============================================================
   SPECS PAGE
   ============================================================ */

/* Hero â€” reuse fw-hero-card / fw-hero, small tweaks */
.specs-hero-card { margin-bottom: 24px; }
.specs-hero { align-items: flex-start; gap: 24px; }
.specs-hero-device img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Quick facts grid */
.specs-qf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.specs-qf-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.specs-qf-item:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.specs-qf-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-light);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-bright);
}
.specs-qf-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.specs-qf-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.specs-qf-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Full specs table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.specs-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    line-height: 1.5;
}
.specs-table tr:last-child td { border-bottom: none; }
.specs-table tbody tr:not(.specs-section-header):hover td {
    background: var(--bg-elevated);
}

/* Section header row */
.specs-section-header td {
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 7px 16px;
}
.specs-section-hd {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.specs-section-header:first-child td { border-top: none; }
.specs-section-icon {
    flex-shrink: 0;
    opacity: 0.65;
    color: var(--accent);
}

/* Key column */
.specs-key {
    width: 36%;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.specs-key-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
}
.specs-key-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
    opacity: 0.8;
}

/* Value column */
.specs-val {
    color: var(--text-primary);
}

/* Price â€” currency pill badges */
.specs-price-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}
.specs-price-item {
    display: inline-flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--r-pill);
    padding: 3px 10px;
    font-size: 0.825rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -.01em;
}

@media (max-width: 600px) {
    .specs-qf-grid { grid-template-columns: repeat(2, 1fr); }
    .specs-qf-value { white-space: normal; font-size: 0.8rem; }
    .specs-qf-icon { width: 30px; height: 30px; }
    .specs-qf-item { padding: 10px 11px; gap: 9px; }
    .specs-hero { flex-direction: column; align-items: center; text-align: center; }
    .specs-hero .fw-hero-device { align-items: center; }
    .specs-key { width: 42%; white-space: normal; }
    .specs-key-wrap { gap: 5px; }
    .specs-table td { padding: 9px 12px; font-size: 0.8rem; }
}


/* ============================================================
   JAILBREAKS PAGE
   ============================================================ */

.jb-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.jb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.jb-card-header {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border-light);
}

.jb-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.jb-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0;
}

.jb-card-platforms {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Type badge */
.jb-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    white-space: nowrap;
    flex-shrink: 0;
}
.jb-type-untethered      { background: rgba(48,209,88,.15);  color: #30d158; }
.jb-type-semi-untethered { background: rgba(10,132,255,.15); color: #0a84ff; }
.jb-type-tethered        { background: rgba(255,69,58,.15);  color: #ff453a; }
.jb-type-semi-tethered   { background: rgba(255,159,10,.15); color: #ff9f0a; }
.jb-type-userspace       { background: rgba(191,90,242,.15); color: #bf5af2; }
.jb-type-unknown         { background: rgba(255,255,255,.08);color: var(--text-tertiary); }

/* Versions */
.jb-card-versions {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
}

.jb-versions-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-tertiary);
    margin: 0 0 8px;
}

.jb-version-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.jb-version-pill {
    display: inline-block;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--r-pill);
    padding: 2px 9px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Notes */
.jb-card-notes {
    padding: 10px 18px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    border-bottom: 1px solid var(--border-light);
}

/* Footer */
.jb-card-footer {
    padding: 12px 18px;
    margin-top: auto;
}

/* Back nav */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.back-link:hover { color: var(--accent-bright); }

/* Filter bar (shared: jailbreaks index, device pages) */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.filter-search-wrap {
    position: relative;
    flex: 1;
}
.filter-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
}
.filter-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color .15s;
}
.filter-search:focus { border-color: var(--accent); }
.filter-search::placeholder { color: var(--text-tertiary); }
.filter-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}
.filter-select {
    height: 36px;
    padding: 0 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--bg-surface); color: var(--text-primary); }

/* Jailbreak quick-stats bar */
.jb-stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

/* ============================================================
   APPS PAGE  —  Apple-inspired
   ============================================================ */

/* ── App list rows (search-results style) ─────────────────── */
.as-list { display: flex; flex-direction: column; }
.as-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: opacity .15s;
}
.as-row:last-child { border-bottom: none; }
.as-row:hover { opacity: .75; }
.as-row:hover .as-get-btn { background: #007AFF; color: #fff; }

.as-row-icon { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.as-row-icon img {
    width: 64px; height: 64px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border-light);
}
.as-row-icon-fallback {
    width: 64px; height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.as-row-body { flex: 1; min-width: 0; }
.as-row-name {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.as-row-dev {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.as-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── GET / VIEW button ────────────────────────────────────── */
.as-get-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    height: 30px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(0,122,255,.12);
    color: #007AFF;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: .03em;
    border: none;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.as-get-btn:hover { background: #007AFF; color: #fff; }

/* Large GET button used on detail / download pages */
.as-get-btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 28px;
    border-radius: 999px;
    background: #007AFF;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, opacity .15s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.as-get-btn-lg:hover { background: #0062CC; color: #fff; }

/* ── Badges / Tags ────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}
.tag-source { background: var(--accent-light); color: var(--accent-bright); border-color: transparent; }
.app-badge-beta   { display: inline-flex; align-items: center; background: rgba(255,159,10,.15); color: #ff9f0a; font-size: .7rem; padding: 1px 7px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.app-badge-stable { display: inline-flex; align-items: center; background: rgba(50,215,75,.12);  color: #32d74b; font-size: .7rem; padding: 1px 7px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

/* ── Detail hero header ───────────────────────────────────── */
.app-detail-hero-inner {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    position: relative;
    overflow: hidden;
}
.app-detail-hero-tint {
    position: absolute;
    inset: 0;
    opacity: .12;
    pointer-events: none;
}
.app-detail-icon {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    z-index: 1;
}
.app-detail-icon img {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.08);
}
.app-detail-icon-fallback {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.app-detail-info { flex: 1; min-width: 0; z-index: 1; }
.app-detail-name {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.02em;
    margin-bottom: 4px;
    line-height: 1.2;
}
.app-detail-dev  { font-size: .9rem; color: #007AFF; font-weight: 500; margin-bottom: 8px; }
.app-detail-sub  { font-size: .9rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.app-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.app-detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── Sections ─────────────────────────────────────────────── */
.app-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px 24px;
    margin-top: 16px;
}
.app-detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    letter-spacing: -.01em;
}

/* ── Description collapse ─────────────────────────────────── */
.app-desc-text {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.75;
}
.app-desc-text.collapsed {
    max-height: 6.5rem;
    overflow: hidden;
}
.app-desc-more-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: .88rem;
    font-weight: 500;
    padding: 6px 0 0;
    cursor: pointer;
    display: block;
}

/* ── Information table ────────────────────────────────────── */
.app-info-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.app-info-table tr { border-bottom: 1px solid var(--border-light); }
.app-info-table tr:last-child { border-bottom: none; }
.app-info-table td:first-child {
    color: var(--text-tertiary);
    font-weight: 500;
    padding: 10px 16px 10px 0;
    width: 140px;
    white-space: nowrap;
    vertical-align: top;
}
.app-info-table td:last-child { color: var(--text-primary); padding: 10px 0; word-break: break-all; }

/* ── Screenshots ──────────────────────────────────────────── */
.app-screenshots-scroll {
    display: flex;
    max-width: 85vw;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.app-screenshots-scroll::-webkit-scrollbar { height: 4px; }
.app-screenshots-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.app-screenshot {
    height: 300px;
    width: auto;
    border-radius: 14px;
    flex-shrink: 0;
    scroll-snap-align: start;
    object-fit: contain;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: transform .15s;
}
.app-screenshot:hover { transform: scale(1.02); }

/* Contain screenshots so hover-scale doesn't bleed outside the card */
.app-detail-section:has(.app-screenshots-scroll) { overflow: hidden; }

/* ── Screenshot lightbox ──────────────────────────────────── */
.ss-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ss-lightbox.active { display: flex; }
.ss-lightbox-img { max-height: 90vh; max-width: 90vw; border-radius: 16px; object-fit: contain; }
.ss-lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    transition: background .15s;
}
.ss-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Version list ─────────────────────────────────────────── */
.version-list { display: flex; flex-direction: column; }
.version-item { padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.version-item:last-child { border-bottom: none; }
.version-item.version-item-hidden { display: none; }
.version-header { display: flex; align-items: flex-start; gap: 10px; }
.version-num  { font-weight: 600; font-size: .92rem; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.version-meta { font-size: .8rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.version-desc-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: .8rem;
    font-weight: 500;
    padding: 2px 0;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Version description modal ────────────────────────────── */
.vd-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 8000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 24px;
}
.vd-modal-overlay.active { display: flex; }
.vd-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 540px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    overflow: hidden;
}
.vd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.vd-modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.vd-modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: .95rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.vd-modal-close:hover { background: var(--border); }
.vd-modal-meta { font-size: .8rem; color: var(--text-tertiary); padding: 10px 20px 0; flex-shrink: 0; }
.vd-modal-body {
    padding: 12px 20px 24px;
    overflow-y: auto;
    font-size: .875rem;
    color: var(--text-secondary);
    line-height: 1.75;
    white-space: pre-wrap;
}

/* ── Download countdown page ──────────────────────────────── */
.dl-page { display: flex; flex-direction: column; align-items: center; padding: 60px 24px 80px; text-align: center; }
.dl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 40px 36px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.dl-card-icon { width: 96px; height: 96px; flex-shrink: 0; }
.dl-card-icon img { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; border: 1px solid rgba(255,255,255,.08); display: block; }
.dl-card-icon-fallback { width: 96px; height: 96px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 700; color: #fff; }
.dl-name    { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.dl-version { font-size: .85rem; color: var(--text-tertiary); margin: -6px 0 0; }
.dl-countdown-ring { position: relative; width: 80px; height: 80px; }
.dl-countdown-ring svg { transform: rotate(-90deg); display: block; }
.dl-countdown-ring circle { fill: none; stroke-width: 4; }
.dl-ring-bg { stroke: var(--border-light); }
.dl-ring-fg { stroke: #007AFF; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.dl-countdown-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.dl-countdown-label { font-size: .82rem; color: var(--text-tertiary); margin-top: -8px; max-width: 240px; line-height: 1.4; }
.dl-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.dl-skip-link { font-size: .8rem; color: var(--text-tertiary); }
.dl-skip-link a { color: #007AFF; }

/* ── Apps index grid ──────────────────────────────────────── */
.as-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.as-grid .as-row {
    padding: 14px 12px 14px 0;
    border-bottom: 1px solid var(--border-light);
}
/* Give left column a right divider on desktop */
.as-grid .as-row:nth-child(odd) {
    padding-right: 20px;
    border-right: 1px solid var(--border-light);
}
.as-grid .as-row:nth-child(even) {
    padding-left: 20px;
}
/* Remove bottom border from last row in each column on even counts */
.as-grid .as-row:nth-last-child(-n+2):not(:nth-child(even)) { border-bottom: none; }
.as-grid .as-row:last-child { border-bottom: none; }

/* ── Apps pagination ──────────────────────────────────────── */
.apps-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.apps-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--r-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
    cursor: pointer;
}
.apps-pager-btn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
.apps-pager-btn.active { background: #007AFF; color: #fff; border-color: transparent; }
.apps-pager-btn.disabled { opacity: .35; pointer-events: none; }
.apps-pager-ellipsis { color: var(--text-tertiary); padding: 0 4px; font-size: .85rem; line-height: 34px; }

/* ── Developer badge on index row ────────────────────────── */
.as-dev-link { color: #007AFF; font-size: .8rem; text-decoration: none; }
.as-dev-link:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .app-detail-hero-inner { flex-direction: column; align-items: center; text-align: center; }
    .app-detail-tags   { justify-content: center; }
    .app-detail-actions { justify-content: center; }
    .as-row-dev { display: none; }
    .app-screenshot { height: 220px; }
    .dl-card { padding: 32px 24px 28px; }
    .as-grid { grid-template-columns: 1fr; }
    .as-grid .as-row { padding: 14px 0 !important; border-right: none !important; }
}
@media (max-width: 480px) {
    .as-row { gap: 12px; }
    .as-row-icon, .as-row-icon img, .as-row-icon-fallback { width: 54px; height: 54px; }
    .app-screenshot { height: 180px; }
    .app-detail-icon, .app-detail-icon img, .app-detail-icon-fallback { width: 90px; height: 90px; border-radius: 20px; }
}
.jb-stat-card {
    flex: 1;
    min-width: 130px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.jb-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-tertiary);
}
.jb-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.02em;
    line-height: 1.2;
}
.jb-stat-sub {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* What is jailbreaking — info block */
.jb-info-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
}
.jb-info-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.jb-info-section p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0 0 10px;
}
.jb-info-section p:last-child { margin-bottom: 0; }

/* Pros / Cons grid */
.jb-proscons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.jb-proscons-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
}
.jb-proscons-card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.jb-proscons-pros h3 { color: #30d158; }
.jb-proscons-cons h3 { color: #ff453a; }
.jb-proscons-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.jb-proscons-list li {
    font-size: 0.825rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}
.jb-proscons-list li::before {
    content: '';
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 6px;
}
.jb-proscons-pros li::before { background: #30d158; }
.jb-proscons-cons li::before { background: #ff453a; }

/* Types legend in header */
.jb-type-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Section heading above cards */
.jb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.jb-section-head h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Warning notice */
.jb-warning {
    background: rgba(255,159,10,.07);
    border: 1px solid rgba(255,159,10,.2);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 28px;
    line-height: 1.5;
}
.jb-warning-icon { flex-shrink: 0; color: #ff9f0a; margin-top: 1px; }

@media (max-width: 640px) {
    .jb-cards-grid  { grid-template-columns: 1fr; }
    .jb-proscons    { grid-template-columns: 1fr; }
    .jb-stats-bar   { gap: 8px; }
    .jb-stat-card   { min-width: 100px; padding: 11px 13px; }
}
