:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2937;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.15);
    --accent-glow: rgba(0, 212, 170, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(148, 163, 184, 0.12);
    --border-accent: rgba(0, 212, 170, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --header-h: 64px;
    --header-control-h: 2.25rem; /* 36px — search, nav, auth, lang, social */
    --transition: 0.2s ease;
    --container: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Author CSS often sets display on containers that also use [hidden];
   without !important the UA [hidden]{display:none} loses and empty panels show. */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.mono {
    font-family: var(--font-mono);
}

/* JetBrains Mono liga/calt turn "://" into one glyph that looks like
   "https: /…" inside <input>/<textarea> (value stays correct on copy). */
input,
textarea {
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #33e0be;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Background effects */
.site-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(59, 130, 246, 0.05), transparent);
    pointer-events: none;
    z-index: -2;
}

.site-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 1rem;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.logo img {
    display: block;
    height: 40px;
    width: auto;
    max-width: none;
}

.logo-bracket { color: var(--text-muted); }
.logo-dot { color: var(--accent); }

.header-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.categories-nav {
    position: relative;
}

.categories-toggle,
.header-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: var(--header-control-h);
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    transition: all var(--transition);
}

.header-nav-icon {
    flex-shrink: 0;
}

.header-nav-link:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-dim);
}

.categories-toggle {
    background: transparent;
    cursor: pointer;
}

.categories-toggle:hover,
.categories-toggle[aria-expanded="true"] {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-dim);
}

.categories-icon {
    flex-shrink: 0;
    color: var(--accent);
}

.categories-chevron {
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform var(--transition);
}

.categories-toggle[aria-expanded="true"] .categories-chevron {
    transform: rotate(180deg);
}

.categories-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 1.5rem;
}

.categories-modal[hidden] {
    display: none;
}

.categories-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 14, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.categories-modal-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: min(70vh, 640px);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    animation: categoriesModalIn 0.2s ease;
}

@keyframes categoriesModalIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.categories-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.categories-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.categories-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.categories-modal-close:hover {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.categories-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.categories-modal-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.categories-modal-link {
    display: block;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition);
}

.categories-modal-link:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.categories-modal-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
}

.categories-modal-desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.categories-modal-link:hover .categories-modal-desc {
    color: var(--text-secondary);
}

body.categories-modal-open {
    overflow: hidden;
}

.header-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-search-panel {
    flex: 1;
    max-width: 220px;
    min-width: 0;
}

.header-social {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--header-control-h);
    height: var(--header-control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.header-social-btn:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-dim);
}

.header-social-facebook:hover {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.35);
    background: rgba(24, 119, 242, 0.12);
}

.header-social-twitter:hover {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.1);
}

.header-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: var(--header-control-h);
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1;
    transition: all var(--transition);
    white-space: nowrap;
}

.header-auth-btn:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-dim);
}

a.header-auth-btn,
a.header-auth-btn:hover {
    color: var(--text-secondary);
}

a.header-auth-btn:hover {
    color: var(--accent);
}

a.header-logout-btn:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.12);
}

.header-auth-text {
    display: none;
}

@media (min-width: 1100px) {
    .header-auth-text {
        display: inline;
    }
}

.search-box {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.search-input {
    width: 100%;
    height: var(--header-control-h);
    padding: 0 0.75rem 0 2.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1;
}

.search-input:focus {
    outline: none;
    border-color: var(--border-accent);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    min-width: 260px;
    max-height: 320px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.search-results:not([hidden]) {
    display: block;
}

.search-result-item {
    display: block;
    padding: 0.55rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all var(--transition);
}

.search-result-item:hover,
.search-result-item.active {
    color: var(--accent);
    background: var(--accent-dim);
}

.search-result-empty {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.lang-switcher {
    position: relative;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: var(--header-control-h);
    padding: 0 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color var(--transition);
}

.lang-toggle:hover {
    border-color: var(--border-accent);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.lang-option:hover,
.lang-option.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.lang-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.7;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Main */
.site-main {
    min-height: calc(100vh - var(--header-h) - 200px);
    padding-bottom: 4rem;
}

/* Hero */
.hero {
    padding: 4rem 0 3rem;
}

.hero-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.home-intro-section {
    padding: 0 0 2.5rem;
}

.home-intro-body {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.75rem 2rem;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
}

.home-intro-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.home-intro-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.home-intro-body p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.home-intro-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.home-intro-body li {
    margin-bottom: 0.5rem;
    line-height: 1.55;
}

.home-intro-body li:last-child {
    margin-bottom: 0;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Featured type=4 tools (homepage spotlight) */
.featured-tools-section {
    position: relative;
    padding: 1rem 0 2.75rem;
    overflow: hidden;
}

.featured-tools-section::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 10%;
    width: min(720px, 90vw);
    height: 280px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0, 212, 170, 0.14), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.featured-tools-section .container {
    position: relative;
    z-index: 1;
}

.featured-tools-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 1.75rem;
}

.featured-tools-eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.28rem 0.85rem;
    border: 1px solid var(--border-accent);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.18), rgba(0, 212, 170, 0.05));
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.featured-tools-title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.45rem, 3.2vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 20%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-tools-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.55;
}

.featured-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
}

.featured-tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 220px;
    padding: 1.75rem 1.65rem 1.45rem;
    color: inherit;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid rgba(0, 212, 170, 0.3);
    background:
        linear-gradient(145deg, rgba(0, 212, 170, 0.14) 0%, transparent 38%),
        linear-gradient(200deg, rgba(26, 35, 50, 0.95) 0%, var(--bg-card) 55%),
        var(--bg-card);
    box-shadow:
        0 0 0 1px rgba(0, 212, 170, 0.05),
        0 18px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    animation: featured-tool-in 0.55s ease both;
    animation-delay: calc(var(--ft-i, 0) * 80ms);
}

.featured-tool-card:hover {
    transform: translateY(-6px);
    color: inherit;
    border-color: rgba(0, 212, 170, 0.6);
    box-shadow:
        0 0 0 1px rgba(0, 212, 170, 0.14),
        0 22px 52px rgba(0, 212, 170, 0.14);
}

.featured-tool-card-glow {
    position: absolute;
    inset: auto -25% -45% -25%;
    height: 75%;
    background: radial-gradient(circle at 50% 0%, rgba(0, 212, 170, 0.28), transparent 68%);
    opacity: 0.6;
    pointer-events: none;
    transition: opacity var(--transition);
}

.featured-tool-card-shine {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 55%;
    height: 90%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%);
    transform: rotate(18deg);
    pointer-events: none;
    opacity: 0.55;
}

.featured-tool-card:hover .featured-tool-card-glow {
    opacity: 1;
}

.featured-tool-top {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.featured-tool-category {
    position: relative;
    max-width: 100%;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-tool-badge {
    position: relative;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-accent);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.featured-tool-name {
    position: relative;
    margin: 0;
    font-size: clamp(1.2rem, 2.2vw, 1.45rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.featured-tool-text {
    position: relative;
    margin: 0;
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.featured-tool-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.featured-tool-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.featured-tool-cta {
    color: var(--accent);
    font-size: 1.15rem;
    line-height: 1;
    transition: transform var(--transition);
}

.featured-tool-card:hover .featured-tool-cta {
    transform: translateX(4px);
}

@keyframes featured-tool-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    .featured-tools-grid {
        grid-template-columns: 1fr;
    }

    .featured-tool-card {
        min-height: 0;
        padding: 1.45rem 1.25rem 1.25rem;
    }
}

/* Categories */
.categories-section {
    padding: 2rem 0;
}

.category-block {
    margin-bottom: 3.5rem;
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    color: var(--accent);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.category-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.category-title-link:hover {
    color: var(--accent);
}

.category-block-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-start;
}

.category-view-all svg {
    flex-shrink: 0;
}

.category-page {
    padding: 2rem 0 4rem;
}

.category-page-header {
    margin-bottom: 2rem;
}

.category-page-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-page-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 720px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 44px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #33e0be;
    color: var(--bg-primary);
    box-shadow: 0 0 24px var(--accent-glow);
}

a.btn,
a.btn:hover,
a.btn-primary,
a.btn-primary:hover {
    color: var(--bg-primary);
}

a.btn-secondary {
    color: var(--text-primary);
}

a.btn-secondary:hover {
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-accent);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    background: rgba(17, 24, 39, 0.5);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-col summary.footer-title {
    list-style: none;
    cursor: default;
    margin-bottom: 1rem;
}

.footer-col summary.footer-title::-webkit-details-marker {
    display: none;
}

.footer-col summary.footer-title::marker {
    content: '';
}

.footer-chevron {
    display: none;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform var(--transition);
}

.footer-col-content {
    min-width: 0;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
}

.footer-link-btn:hover {
    color: var(--accent);
}

.footer-about {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-lang-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-lang-link {
    padding: 0.25rem 0.5rem;
    background: var(--bg-card);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-lang-link:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Error page */
.error-page {
    padding: 6rem 0;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    margin: 1rem 0;
}

.error-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 992px) and (min-width: 769px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 108px;
    }

    .container {
        padding: 0 1rem;
    }

    .site-header {
        height: auto;
        padding-top: env(safe-area-inset-top, 0);
    }

    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "start toolbar"
            "search search";
        align-items: center;
        height: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem 0.625rem;
    }

    .header-start {
        grid-area: start;
        gap: 0.4rem;
    }

    .header-toolbar {
        grid-area: toolbar;
        gap: 0.4rem;
    }

    .header-logout-btn {
        display: none;
    }

    .header-search-panel {
        grid-area: search;
        max-width: none;
    }

    .logo {
        font-size: 1.05rem;
    }

    .categories-toggle,
    .header-nav-link {
        width: var(--header-control-h);
        height: var(--header-control-h);
        padding: 0;
        justify-content: center;
    }

    .header-nav-text {
        display: none;
    }

    .header-social {
        display: none;
    }

    .categories-label,
    .categories-chevron {
        display: none;
    }

    .lang-toggle {
        height: var(--header-control-h);
        padding: 0 0.6rem;
    }

    .search-input {
        height: var(--header-control-h);
        font-size: 16px;
    }

    .header-auth-btn {
        height: var(--header-control-h);
        min-width: var(--header-control-h);
        padding: 0 0.55rem;
    }

    .search-results {
        min-width: 0;
        max-height: min(50vh, 280px);
    }

    .categories-modal {
        padding: 0.75rem;
        align-items: stretch;
    }

    .categories-modal-panel {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
    }

    .site-footer {
        padding: 2rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0));
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 1.5rem;
    }

    .footer-col {
        border-bottom: 1px solid var(--border);
    }

    .footer-col:last-child {
        border-bottom: none;
    }

    .footer-col summary.footer-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        cursor: pointer;
        margin-bottom: 0;
        padding: 0.875rem 0;
        -webkit-tap-highlight-color: transparent;
    }

    .footer-col[open] summary.footer-title {
        margin-bottom: 0.5rem;
        padding-bottom: 0;
    }

    .footer-chevron {
        display: block;
    }

    .footer-col[open] .footer-chevron {
        transform: rotate(180deg);
    }

    .footer-col-content {
        padding-bottom: 0.875rem;
    }

    .footer-links a,
    .footer-link-btn {
        display: block;
        padding: 0.4rem 0;
    }

    .footer-lang-link {
        min-height: 2rem;
        display: inline-flex;
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
        padding-top: 1.25rem;
        font-size: 0.8125rem;
    }

    .footer-tagline {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}

@media (min-width: 769px) {
    .footer-col summary.footer-title {
        pointer-events: none;
    }
}

@media (max-width: 576px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .header-start {
        gap: 0.3rem;
    }
}

[dir="rtl"] .header-inner,
[dir="rtl"] .category-header,
[dir="rtl"] .footer-bottom {
    direction: rtl;
}
