﻿/*
Theme Name: AIHub Theme
Author: AIHub
Version: 0.1.0
Description: Headless-ready theme for AIHub (WPGraphQL + Next.js).
Text Domain: aihub
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    font-size: calc(100% * var(--site-text-scale));
}

html,
body.admin-bar {
    margin-top: 0 !important;
}

body.admin-bar #wpadminbar {
    position: fixed;
    top: 0;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('./assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('./assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    src: url('./assets/fonts/FiraCode-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    src: url('./assets/fonts/FiraCode-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-page: #0b0d12;
    --bg-card: #0f172a;
    --bg-surface: #111827;
    --text-primary: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #1f2937;
    --accent: #22d3ee;
    --accent-2: #7c3aed;
    --success: #16a34a;
    --danger: #ef4444;
    --code-bg: #0b1221;
    --site-text-scale: 0.8;
    --archive-text-scale: 1;
    --prompt-bg: #0a111d;
    --prompt-header-bg: #0e1626;
    --prompt-border: #182334;
    --prompt-text: var(--text-primary);
    --prompt-muted: var(--text-muted);
    --prompt-btn-text: #cbd5f5;
    --prompt-btn-border: rgba(148, 163, 184, 0.35);
    --prompt-btn-hover-bg: rgba(148, 163, 184, 0.15);
    --prompt-btn-hover-border: rgba(148, 163, 184, 0.6);
    --prompt-backdrop: rgba(15, 23, 42, 0.75);
    --prompt-scrollbar-size: 6px;
    --prompt-scrollbar-track: rgba(148, 163, 184, 0.12);
    --prompt-scrollbar-thumb: rgba(148, 163, 184, 0.52);
    --prompt-scrollbar-thumb-hover: rgba(148, 163, 184, 0.68);
    --prompt-placeholder-bg: rgba(34, 211, 238, 0.12);
    --prompt-placeholder-border: rgba(34, 211, 238, 0.35);
    --prompt-placeholder-text: #a5f3fc;
    --prompt-format-md-bg: rgba(16, 185, 129, 0.08);
    --prompt-format-md-border: rgba(16, 185, 129, 0.35);
    --prompt-format-json-bg: rgba(59, 130, 246, 0.1);
    --prompt-format-json-border: rgba(59, 130, 246, 0.42);
    --prompt-placeholder-inline: #22d3ee;
    --prompt-md-heading: #60a5fa;
    --prompt-md-marker: #93c5fd;
    --prompt-md-link-text: #fdba74;
    --prompt-md-link-url: #fb923c;
    --prompt-md-code: #fdba74;
    --prompt-md-strong: #f8fafc;
    --prompt-md-em: #cbd5e1;
    --prompt-json-key: #f472b6;
    --prompt-json-string: #2dd4bf;
    --prompt-json-number: #facc15;
    --prompt-json-boolean: #fb7185;
    --prompt-json-null: #a78bfa;
    --prompt-json-punctuation: #e2e8f0;
    --cat-text-start: #0b2f59;
    --cat-text-end: #1d4ed8;
    --cat-text-border: #3b82f6;
    --cat-text-text: #dbeafe;
    --cat-image-start: #2b0f3a;
    --cat-image-end: #6d28d9;
    --cat-image-border: #7c3aed;
    --cat-image-text: #f3e8ff;
    --cat-video-start: #4a1111;
    --cat-video-end: #b91c1c;
    --cat-video-border: #ef4444;
    --cat-video-text: #fee2e2;
    --cat-code-start: #0f3d2e;
    --cat-code-end: #166534;
    --cat-code-border: #22c55e;
    --cat-code-text: #dcfce7;
    --cat-music-start: #4a2a0b;
    --cat-music-end: #c2410c;
    --cat-music-border: #f97316;
    --cat-music-text: #ffedd5;
    --cat-voice-start: #0c2f3a;
    --cat-voice-end: #0891b2;
    --cat-voice-border: #22d3ee;
    --cat-voice-text: #cffafe;
    --kb-tutorial-start: #60a5fa;
    --kb-tutorial-end: #2563eb;
    --kb-tutorial-border: #3b82f6;
    --kb-tutorial-text: #eff6ff;
    --kb-course-start: #a78bfa;
    --kb-course-end: #6d28d9;
    --kb-course-border: #8b5cf6;
    --kb-course-text: #f5f3ff;
    --kb-guide-start: #34d399;
    --kb-guide-end: #047857;
    --kb-guide-border: #10b981;
    --kb-guide-text: #ecfdf5;
    --kb-skill-pack-start: #fcd34d;
    --kb-skill-pack-end: #d97706;
    --kb-skill-pack-border: #f59e0b;
    --kb-skill-pack-text: #1f2937;
    --kb-workshop-start: #f87171;
    --kb-workshop-end: #b91c1c;
    --kb-workshop-border: #ef4444;
    --kb-workshop-text: #fff1f2;
    --kb-workflows-start: #818cf8;
    --kb-workflows-end: #4338ca;
    --kb-workflows-border: #6366f1;
    --kb-workflows-text: #eef2ff;
    --kb-generic-start: rgba(14, 165, 233, 0.22);
    --kb-generic-end: rgba(6, 182, 212, 0.2);
    --kb-generic-border: rgba(34, 211, 238, 0.45);
    --kb-generic-text: var(--text-primary);
    --subscriber-gold-border: #f59e0b;
    --subscriber-gold-ring: rgba(245, 158, 11, 0.35);
    --archive-glass-bg: rgba(15, 23, 42, 0.20);
    --archive-glass-fallback-bg: rgba(15, 23, 42, 0.54);
    --archive-glass-border: rgba(226, 232, 240, 0.14);
    --archive-glass-shadow: 0 18px 45px rgba(2, 6, 23, 0.22);
    --archive-glass-blur: 4px;
    --aihub-admin-offset: 0px;

}

:root[data-theme="light"] {
    --bg-page: #f7f8fb;
    --bg-card: #ffffff;
    --bg-surface: #eef2f7;
    --text-primary: #0f172a;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --accent: #0ea5e9;
    --accent-2: #7c3aed;
    --success: #16a34a;
    --danger: #ef4444;
    --code-bg: #f3f4f6;
    --prompt-bg: #eef1f5;
    --prompt-header-bg: #e7edf4;
    --prompt-border: #d9e0ea;
    --prompt-text: var(--text-primary);
    --prompt-muted: var(--text-muted);
    --prompt-btn-text: #64748b;
    --prompt-btn-border: rgba(100, 116, 139, 0.35);
    --prompt-btn-hover-bg: rgba(100, 116, 139, 0.12);
    --prompt-btn-hover-border: rgba(100, 116, 139, 0.6);
    --prompt-backdrop: rgba(15, 23, 42, 0.6);
    --prompt-scrollbar-size: 6px;
    --prompt-scrollbar-track: rgba(100, 116, 139, 0.12);
    --prompt-scrollbar-thumb: rgba(100, 116, 139, 0.48);
    --prompt-scrollbar-thumb-hover: rgba(100, 116, 139, 0.62);
    --prompt-placeholder-bg: rgba(14, 165, 233, 0.1);
    --prompt-placeholder-border: rgba(14, 165, 233, 0.28);
    --prompt-placeholder-text: #075985;
    --prompt-format-md-bg: rgba(5, 150, 105, 0.08);
    --prompt-format-md-border: rgba(5, 150, 105, 0.3);
    --prompt-format-json-bg: rgba(37, 99, 235, 0.08);
    --prompt-format-json-border: rgba(37, 99, 235, 0.32);
    --prompt-placeholder-inline: #0284c7;
    --prompt-md-heading: #2563eb;
    --prompt-md-marker: #3b82f6;
    --prompt-md-link-text: #c2410c;
    --prompt-md-link-url: #ea580c;
    --prompt-md-code: #c2410c;
    --prompt-md-strong: #0f172a;
    --prompt-md-em: #334155;
    --prompt-json-key: #be185d;
    --prompt-json-string: #047857;
    --prompt-json-number: #a16207;
    --prompt-json-boolean: #be123c;
    --prompt-json-null: #7c3aed;
    --prompt-json-punctuation: #1e293b;
    --cat-text-start: #dbeafe;
    --cat-text-end: #bfdbfe;
    --cat-text-border: #3b82f6;
    --cat-text-text: #1e3a8a;
    --cat-image-start: #f3e8ff;
    --cat-image-end: #e9d5ff;
    --cat-image-border: #7c3aed;
    --cat-image-text: #4c1d95;
    --cat-video-start: #fee2e2;
    --cat-video-end: #fecaca;
    --cat-video-border: #ef4444;
    --cat-video-text: #7f1d1d;
    --cat-code-start: #dcfce7;
    --cat-code-end: #bbf7d0;
    --cat-code-border: #22c55e;
    --cat-code-text: #14532d;
    --cat-music-start: #ffedd5;
    --cat-music-end: #fed7aa;
    --cat-music-border: #f97316;
    --cat-music-text: #9a3412;
    --cat-voice-start: #cffafe;
    --cat-voice-end: #a5f3fc;
    --cat-voice-border: #06b6d4;
    --cat-voice-text: #155e75;
    --kb-tutorial-start: #dbeafe;
    --kb-tutorial-end: #bfdbfe;
    --kb-tutorial-border: #60a5fa;
    --kb-tutorial-text: #1e3a8a;
    --kb-course-start: #ede9fe;
    --kb-course-end: #ddd6fe;
    --kb-course-border: #a78bfa;
    --kb-course-text: #4c1d95;
    --kb-guide-start: #dcfce7;
    --kb-guide-end: #bbf7d0;
    --kb-guide-border: #34d399;
    --kb-guide-text: #065f46;
    --kb-skill-pack-start: #fef3c7;
    --kb-skill-pack-end: #fde68a;
    --kb-skill-pack-border: #f59e0b;
    --kb-skill-pack-text: #78350f;
    --kb-workshop-start: #fee2e2;
    --kb-workshop-end: #fecaca;
    --kb-workshop-border: #f87171;
    --kb-workshop-text: #7f1d1d;
    --kb-workflows-start: #e0e7ff;
    --kb-workflows-end: #c7d2fe;
    --kb-workflows-border: #818cf8;
    --kb-workflows-text: #312e81;
    --kb-generic-start: #e0f2fe;
    --kb-generic-end: #bae6fd;
    --kb-generic-border: #38bdf8;
    --kb-generic-text: #0c4a6e;
    --subscriber-gold-border: #f59e0b;
    --subscriber-gold-ring: rgba(245, 158, 11, 0.35);
    --archive-glass-bg: rgba(255, 255, 255, 0.15);
    --archive-glass-fallback-bg: rgba(255, 255, 255, 0.45);
    --archive-glass-border: rgba(148, 163, 184, 0.34);
    --archive-glass-shadow: 0 18px 40px rgba(148, 163, 184, 0.18);

}

body {
    background: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    font-family: var(--wp--preset--font-family--jetbrains-mono), "JetBrains Mono", monospace;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    max-width: 100%;
}

.aihub-triangle-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.aihub-triangle-bg__canvas {
    display: block;
    width: 100%;
    height: 100%;
}

body.admin-bar {
    --aihub-admin-offset: 32px;
}

body.mobile-nav-open {
    overflow: hidden;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--bg-page);
    border-radius: 8px;
    font-weight: 700;
}

.skip-link:focus {
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
}

a {
    color: var(--accent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header {
    position: sticky;
    top: var(--aihub-admin-offset);
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 0 6px;
}


.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.site-branding {
    flex: 1;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}

.site-description {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.primary-nav .nav-list,
.footer-nav .nav-list {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.primary-nav a,
.footer-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.primary-nav a:hover,
.footer-nav a:hover {
    color: var(--accent);
}

.nav-list {
    gap: 1rem;
}

.nav__item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav__link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 40px;
    height: 40px;
    line-height: 1.2;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav__link:hover {
    color: var(--bg-page) !important;
    background: var(--accent);
    border-color: var(--accent);
}

.nav__item--parent>.nav__link {
    padding-right: 1.5rem;
    position: relative;
}

.nav__item--parent>.nav__link::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    position: absolute;
    right: 0.5rem;
    top: 50%;
    margin-top: -3px;
    transition: transform 0.2s ease, border-color 0.15s ease;
    transform-origin: center;
}

.nav__submenu {
    position: absolute;
    top: calc(100% - 1px);
    margin-top: 0;
    left: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    padding: 0.75rem 0.75rem 0.5rem;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

.nav__submenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.nav__item--open>.nav__submenu,
.nav__item:hover>.nav__submenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav__item--open>.nav__link::after {
    transform: rotate(225deg);
    color: var(--accent);
}

.nav__submenu .nav__item {
    display: block;
}

.nav__submenu .nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    font-weight: 600;
    padding: 0.45rem 0.65rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}

.nav__submenu .nav__link:hover {
    color: var(--bg-page);
    background: var(--accent);
    border-color: var(--accent);
}

.nav__item.is-active>.nav__link {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.12);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.nav__item.is-active>.nav__link:hover {
    color: var(--bg-page) !important;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
}

.nav__link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav__submenu .nav__link {
    position: relative;
    padding-left: 1.5rem;
}

.nav__submenu .nav__link::before {
    content: '\203A';
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: currentColor;
    font-size: 0.95em;
    line-height: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.aihub-lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.aihub-lang-switcher__toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
    font-weight: 600;
}

.aihub-lang-switcher__toggle:hover {
    border-color: var(--accent);
}

.aihub-lang-switcher__toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.aihub-lang-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    min-width: 124px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.18);
    display: grid;
    gap: 4px;
}

.aihub-lang-switcher__menu[hidden] {
    display: none;
}

.aihub-lang-switcher__item {
    min-height: 40px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    line-height: 1;
}

.aihub-lang-switcher__item:hover {
    background: var(--bg-page);
}

.aihub-lang-switcher__item.is-active {
    background: var(--accent);
    color: var(--bg-page);
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-size: 0.95rem;
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}

.cta-btn--primary {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
}

.cta-btn--primary:hover {
    filter: brightness(0.95);
}

.cta-btn--ghost {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.cta-btn--ghost:hover {
    color: var(--bg-page) !important;
    background: var(--accent);
    border-color: var(--accent);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
    width: 20ch;
    max-width: 220px;
    min-width: 180px;
    box-sizing: border-box;
}

.user-popover-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-avatar-toggle {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: 50%;
    padding: 2px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-avatar-toggle.is-subscriber {
    border-color: var(--subscriber-gold-border);
    box-shadow: 0 0 0 1px var(--subscriber-gold-ring);
}

.user-avatar-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.user-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding: 0.6rem;
    min-width: 220px;
    max-width: 280px;
    z-index: 200;
}

.user-popover[hidden] {
    display: none;
}

.user-chip--popover {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.user-popover__actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.user-popover__link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
}

.user-popover__link:hover {
    color: var(--accent);
}

.user-popover__settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    box-sizing: border-box;
}

.user-popover__settings:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.user-popover__settings:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.user-popover__btn {
    width: 100%;
    justify-content: center;
}

.user-chip__placeholder,
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    box-sizing: border-box;
}

.header-avatar--subscriber,
.user-chip__placeholder--subscriber {
    border: 2px solid var(--subscriber-gold-border);
}

.user-chip__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.user-chip__name {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.user-chip__name:hover {
    color: var(--accent);
}

.user-chip__role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.theme-toggle {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle {
    display: none;
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 0;
    cursor: pointer;
    width: 24px;
    height: 24px;
}

.mobile-toggle.minimal-toggle {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    align-content: center;
    justify-content: center;
}

.mobile-toggle span {
    display: block;
    width: 5px;
    height: 5px;
    background: var(--text-primary);
    margin: 0;
    border-radius: 50%;
}

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.mobile-nav.is-open {
    display: block;
}

.mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-nav__panel {
    position: absolute;
    inset: 0;
    top: var(--aihub-admin-offset);
    left: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 300px;
    height: calc(100vh - var(--aihub-admin-offset));
    height: calc(100dvh - var(--aihub-admin-offset));
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.4);
    padding: 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav.is-open .mobile-nav__backdrop {
    opacity: 1;
}

.mobile-nav.is-open .mobile-nav__panel {
    transform: translateX(0);
    opacity: 1;
}

.mobile-nav__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.mobile-nav__brand {
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-nav__header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.mobile-nav__close {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.mobile-nav__list .nav__link {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    height: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    white-space: normal;
    overflow-wrap: break-word;
}

.mobile-nav__list .nav__item--parent {
    display: block;
}

.mobile-nav__list .nav__item--parent>.nav__link {
    border-radius: 10px;
}

.mobile-nav__list a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.mobile-nav__list a:hover {
    color: var(--accent);
}

.mobile-nav__actions {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-direction: column;
}

.mobile-nav__actions .cta-btn,
.mobile-nav__actions .user-chip {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.mobile-nav__profile {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-surface);
}

.mobile-nav__profile:hover {
    color: var(--accent);
}

.mobile-nav__panel .theme-toggle {
    display: inline-flex;
}

.breadcrumb-bar {
    padding-top: 4px;
    padding-bottom: 12px;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 10;
    background: transparent;
}


.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb__sep {
    color: var(--text-muted);
    padding: 0 0.2rem;
}

.site-content {
    padding-top: 0;
}



.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
}

.copyright {
    color: var(--text-muted);
}

.footer-nav .nav-list {
    flex-wrap: wrap;
    gap: 0.6rem 0.9rem;
    justify-content: flex-start;
}

.footer-nav .nav-list li+li::before {
    content: "•";
    margin-right: 0.75rem;
    color: var(--text-muted);
}

.footer-nav .nav__item.is-active>.nav__link {
    color: var(--accent);
    border-color: var(--accent);
}

.footer-cookie-settings {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.footer-cookie-settings:hover,
.footer-cookie-settings:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.aihub-consent-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 10050;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.aihub-consent-banner[hidden] {
    display: none !important;
}

.aihub-consent-banner__text {
    margin: 0;
    color: var(--text-muted);
}

.aihub-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    pointer-events: auto;
}

.aihub-consent-banner__actions .cta-btn {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.aihub-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    pointer-events: auto;
}

.aihub-consent-modal[hidden] {
    display: none;
}

.aihub-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.64);
}

.aihub-consent-modal__dialog {
    position: relative;
    width: min(700px, calc(100% - 2rem));
    margin: 7vh auto 0;
    max-height: 86vh;
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.aihub-consent-modal__close {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.aihub-consent-modal__title {
    margin: 0 0 0.5rem;
}

.aihub-consent-modal__lead {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.aihub-consent-modal__row {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}

.aihub-consent-modal__option,
.aihub-consent-modal__toggle {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    color: var(--text-primary);
}

.aihub-consent-modal__toggle input {
    margin-top: 0.2rem;
}

.aihub-consent-modal__option-title {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
}

.aihub-consent-modal__option-text {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.95em;
}

.aihub-consent-modal__required {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.aihub-consent-modal__policy {
    margin: 1rem 0 0;
}

.aihub-consent-modal__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.aihub-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    position: relative;
}

.aihub-card__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.aihub-card__title {
    width: 100%;
    margin: 0.25rem 0 0.5rem;
    font-size: 1.8rem;
}

.aihub-card__content p {
    line-height: 1.6;
}

.aihub-prompt-layout {
    display: grid;
    grid-template-columns: minmax(220px, 42%) minmax(0, 1fr);
    grid-template-areas:
        "media title"
        "media description";
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1rem;
}

.aihub-prompt-layout--no-image {
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "description";
}

.aihub-prompt-layout__title {
    grid-area: title;
}

.aihub-prompt-layout__media {
    grid-area: media;
    margin: 0;
}

.aihub-prompt-layout__description {
    grid-area: description;
}

.aihub-prompt-layout__media .aihub-hero__btn {
    width: 100%;
}

.aihub-prompt-layout__media .aihub-hero img {
    margin: 0;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.aihub-card__bookmark {
    position: absolute;
    top: 10px;
    right: 10px;
}
.aihub-bookmark-btn {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.aihub-bookmark-btn.is-active {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.aihub-bookmark-count {
    min-width: 14px;
    text-align: center;
    display: inline-block;
}
.aihub-bookmark-count:empty {
    display: none;
}

/* Archive bookmarks */
.aihub-archive .aihub-archive-card__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: end;
}

.aihub-archive .aihub-archive-card .aihub-card__bookmark {
    position: static;
    margin-top: 0;
    align-self: end;
    justify-self: end;
}

.aihub-archive .aihub-bookmark-btn {
    background: transparent;
    color: #F59E0B;
    border-color: #F59E0B;
}

.aihub-archive .aihub-bookmark-btn.is-active {
    background: #F59E0B;
    color: #fff;
    border-color: #F59E0B;
}

.aihub-card--prompt .aihub-bookmark-btn {
    background: transparent;
    color: #F59E0B;
    border-color: #F59E0B;
}

.aihub-card--prompt .aihub-bookmark-btn.is-active {
    background: #F59E0B;
    color: #fff;
    border-color: #F59E0B;
}

.aihub-card--kb .aihub-bookmark-btn {
    background: transparent;
    color: #F59E0B;
    border-color: #F59E0B;
}

.aihub-card--kb .aihub-bookmark-btn.is-active {
    background: #F59E0B;
    color: #fff;
    border-color: #F59E0B;
}

.aihub-card--ai-tools .aihub-bookmark-btn {
    background: transparent;
    color: #F59E0B;
    border-color: #F59E0B;
}

.aihub-card--ai-tools .aihub-bookmark-btn.is-active {
    background: #F59E0B;
    color: #fff;
    border-color: #F59E0B;
}

/* Toast (global) */
.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    min-width: 220px;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    background: #16a34a;
}
.toast--success { background: #16a34a; }
.toast--warn { background: #f59e0b; }
.toast--error { background: #ef4444; }
.toast__icon { font-weight: 700; }

.aihub-hero img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    max-height: 500px;
    object-fit: cover;
    margin-left: auto;
    margin-right: auto;
}

.aihub-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aihub-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: calc(0.875rem * var(--archive-text-scale));
    text-decoration: none;
    border: 1px solid var(--border);
}

.aihub-badge--lock {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #f8f5ff;
}

.aihub-badge--copy {
    background: var(--success);
    border-color: #22c55e;
    color: #f0fdf4;
}

.aihub-badge--copy.off {
    background: #374151;
    border-color: #4b5563;
}

.aihub-badge--muted {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-muted);
}

.aihub-badge--cat-text {
    background: linear-gradient(135deg, var(--cat-text-start), var(--cat-text-end));
    border-color: var(--cat-text-border);
    color: var(--cat-text-text);
}

.aihub-badge--cat-image {
    background: linear-gradient(135deg, var(--cat-image-start), var(--cat-image-end));
    border-color: var(--cat-image-border);
    color: var(--cat-image-text);
}

.aihub-badge--cat-video {
    background: linear-gradient(135deg, var(--cat-video-start), var(--cat-video-end));
    border-color: var(--cat-video-border);
    color: var(--cat-video-text);
}

.aihub-badge--cat-code {
    background: linear-gradient(135deg, var(--cat-code-start), var(--cat-code-end));
    border-color: var(--cat-code-border);
    color: var(--cat-code-text);
}

.aihub-badge--cat-music {
    background: linear-gradient(135deg, var(--cat-music-start), var(--cat-music-end));
    border-color: var(--cat-music-border);
    color: var(--cat-music-text);
}

.aihub-badge--cat-voice {
    background: linear-gradient(135deg, var(--cat-voice-start), var(--cat-voice-end));
    border-color: var(--cat-voice-border);
    color: var(--cat-voice-text);
}

.aihub-badge--kb-type {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    background: linear-gradient(135deg, var(--kb-type-start, var(--kb-generic-start)), var(--kb-type-end, var(--kb-generic-end)));
    border-color: var(--kb-type-border, var(--kb-generic-border));
    color: var(--kb-type-text, var(--kb-generic-text));
    font-weight: 600;
}

.aihub-kb-type-badge__icon {
    width: 0.98rem;
    height: 0.98rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex: 0 0 auto;
}

.aihub-kb-type-badge__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.aihub-kb-type-badge__label {
    line-height: 1.1;
}

.aihub-badge--kb-type-tutorial {
    --kb-type-start: var(--kb-tutorial-start);
    --kb-type-end: var(--kb-tutorial-end);
    --kb-type-border: var(--kb-tutorial-border);
    --kb-type-text: var(--kb-tutorial-text);
}

.aihub-badge--kb-type-course {
    --kb-type-start: var(--kb-course-start);
    --kb-type-end: var(--kb-course-end);
    --kb-type-border: var(--kb-course-border);
    --kb-type-text: var(--kb-course-text);
}

.aihub-badge--kb-type-guide {
    --kb-type-start: var(--kb-guide-start);
    --kb-type-end: var(--kb-guide-end);
    --kb-type-border: var(--kb-guide-border);
    --kb-type-text: var(--kb-guide-text);
}

.aihub-badge--kb-type-skill-pack {
    --kb-type-start: var(--kb-skill-pack-start);
    --kb-type-end: var(--kb-skill-pack-end);
    --kb-type-border: var(--kb-skill-pack-border);
    --kb-type-text: var(--kb-skill-pack-text);
}

.aihub-badge--kb-type-workshop {
    --kb-type-start: var(--kb-workshop-start);
    --kb-type-end: var(--kb-workshop-end);
    --kb-type-border: var(--kb-workshop-border);
    --kb-type-text: var(--kb-workshop-text);
}

.aihub-badge--kb-type-workflows {
    --kb-type-start: var(--kb-workflows-start);
    --kb-type-end: var(--kb-workflows-end);
    --kb-type-border: var(--kb-workflows-border);
    --kb-type-text: var(--kb-workflows-text);
}

.aihub-badge--kb-type-generic {
    --kb-type-start: var(--kb-generic-start);
    --kb-type-end: var(--kb-generic-end);
    --kb-type-border: var(--kb-generic-border);
    --kb-type-text: var(--kb-generic-text);
}

.aihub-badge--pricing {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.18));
    border-color: rgba(16, 185, 129, 0.45);
    color: var(--text-primary);
}

.aihub-badge--industry {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.18));
    border-color: rgba(245, 158, 11, 0.45);
    color: var(--text-primary);
}

.aihub-archive-card__price {
    margin: 0.25rem 0 0.6rem;
    color: var(--text-primary);
    font-weight: 600;
}

.aihub-title-with-verified {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.aihub-title-with-icon__content {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
}

.aihub-title-with-icon__text {
    min-width: 0;
}

.aihub-resource-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.aihub-resource-icon--single {
    width: 64px;
    height: 64px;
}

.aihub-resource-icon__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.aihub-archive-card__title-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    min-width: 0;
    text-decoration: none;
}

.aihub-verified-badge {
    display: inline-flex;
    width: 1.1em;
    height: 1.1em;
    color: #41a9ef;
    vertical-align: top;
    line-height: 1;
}

.aihub-verified-badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

.aihub-verified-badge__shape {
    fill: currentColor;
}

.aihub-verified-badge__check {
    fill: #fff;
}

.aihub-verified-badge--superscript {
    margin-top: -0.28em;
    flex: 0 0 auto;
}

.aihub-verified-badge:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.aihub-kb-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.38rem 0.72rem;
    border-radius: 9px;
    border: 1px solid rgba(34, 211, 238, 0.55);
    background: rgba(34, 211, 238, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.aihub-kb-link-btn:hover {
    border-color: rgba(34, 211, 238, 0.9);
    background: rgba(34, 211, 238, 0.2);
}

.aihub-kb-link-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.aihub-prompt-block {
    margin-top: 1rem;
    border: 1px solid var(--prompt-border);
    border-radius: 10px;
    overflow: hidden;
}

.aihub-prompt-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--prompt-header-bg);
    border-bottom: 1px solid var(--prompt-border);
}

.aihub-prompt-text {
    margin: 0;
    padding: 1rem;
    background: var(--prompt-bg);
    color: var(--prompt-text);
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    white-space: pre-wrap;
}

.aihub-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 8px;
    padding: 0.35rem;
    cursor: pointer;
    line-height: 1;
}

.aihub-copy-btn:hover {
    filter: brightness(0.95);
}

.aihub-copy-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.aihub-copy-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.aihub-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.aihub-meta-block strong {
    display: block;
    margin-bottom: 0.35rem;
}

.aihub-related h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.aihub-related ul {
    margin: 0;
    padding-left: 1rem;
}

.aihub-related__list {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.aihub-related__item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
}

.aihub-related__item a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.aihub-related__item a:hover {
    color: var(--accent);
}

.aihub-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}

.aihub-hero--placeholder {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
    border: 1px dashed var(--border);
    border-radius: 10px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.aihub-hero__btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: zoom-in;
}

body.aihub-lightbox-open {
    overflow: hidden;
}

.aihub-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.aihub-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.aihub-lightbox__dialog {
    position: relative;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
}

.aihub-lightbox__dialog img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 10px;
}

.aihub-lightbox__close {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.aihub-copy-status {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.aihub-archive {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

body.aihub-has-triangle-bg .aihub-archive {
    background: var(--archive-glass-fallback-bg);
    border-color: var(--archive-glass-border);
    box-shadow: var(--archive-glass-shadow);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.aihub-has-triangle-bg .aihub-archive {
        background: var(--archive-glass-bg);
        -webkit-backdrop-filter: blur(var(--archive-glass-blur));
        backdrop-filter: blur(var(--archive-glass-blur));
    }
}

.aihub-archive__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.aihub-archive__header h1 {
    margin-top: 0;
    font-size: calc(2rem * var(--archive-text-scale));
}

.aihub-archive__desc {
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-size: calc(1rem * var(--archive-text-scale));
}

.aihub-archive__filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.aihub-archive__filters input[type="search"],
.aihub-archive__filters select {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    min-height: 44px;
}

.aihub-archive__filters input[type="search"] {
    flex: 1 1 14rem;
}

.aihub-archive__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.aihub-archive__checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--accent);
}

.aihub-archive__checkbox:hover,
.aihub-archive__checkbox:focus-within {
    border-color: var(--accent);
}

.aihub-archive__filters.aihub-archive__filters--search-collapsed [data-aihub-search-input] {
    display: none;
}

.aihub-archive__filters button[type="submit"] {
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: var(--bg-page);
    cursor: pointer;
    font-weight: 600;
    min-height: 44px;
}

.aihub-archive__icon-btn {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: pointer;
    padding: 0;
}

.aihub-archive__icon-btn:hover,
.aihub-archive__icon-btn:focus-visible {
    border-color: var(--accent);
}

.aihub-archive__icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.aihub-archive__icon-btn svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.aihub-archive__search-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
}

.aihub-archive__reset svg {
    color: var(--danger);
}

.aihub-archive__reset::before,
.aihub-archive__reset::after {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.aihub-archive__reset::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    transform: translateX(-50%);
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 0.28rem 0.45rem;
    font-size: 0.74rem;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 5;
}

.aihub-archive__reset::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.2rem);
    transform: translateX(-50%) rotate(45deg);
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    z-index: 4;
}

.aihub-archive__reset:hover::before,
.aihub-archive__reset:hover::after,
.aihub-archive__reset:focus-visible::before,
.aihub-archive__reset:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.aihub-archive__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 1.2rem;
    align-items: start;
}

.aihub-archive__grid--masonry {
    grid-auto-rows: 8px;
    grid-auto-flow: row dense;
}

@media (min-width: 768px) {
    .aihub-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .aihub-archive__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.aihub-archive-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

:root[data-theme="light"] .aihub-archive .aihub-archive-card {
    background: #fff;
}

.aihub-archive-card__thumb {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
}

.aihub-archive-card__thumb img,
.aihub-archive-card__thumb .aihub-hero__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}


.aihub-archive-card__title {
    margin: 0;
    font-size: calc(1.1rem * var(--archive-text-scale));
}

.aihub-archive-card__title a {
    color: var(--text-primary);
    text-decoration: none;
}

.aihub-archive-card__title a:hover {
    color: var(--accent);
}

.aihub-archive-card__excerpt {
    color: var(--text-muted);
    margin: 0;
    font-size: calc(1rem * var(--archive-text-scale));
}

.aihub-prompt-snippet {
    border: 1px solid var(--prompt-border);
    border-radius: 10px;
    background: var(--prompt-bg);
    color: var(--prompt-text);
    overflow: hidden;
    font-family: "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;
}

.aihub-prompt-snippet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--prompt-header-bg);
    border-bottom: 1px solid var(--prompt-border);
    font-size: calc(0.8rem * var(--archive-text-scale));
    letter-spacing: 0.02em;
}

.aihub-prompt-snippet__title {
    font-weight: 600;
    color: var(--prompt-text);
}

.aihub-prompt-snippet__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.aihub-prompt-snippet__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--prompt-btn-border);
    background: transparent;
    color: var(--prompt-btn-text);
    cursor: pointer;
    padding: 0;
}

.aihub-prompt-snippet__btn:hover {
    background: var(--prompt-btn-hover-bg);
    border-color: var(--prompt-btn-hover-border);
}

.aihub-provider-icon {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

:root:not([data-theme="light"]) .aihub-prompt-snippet__btn--provider[data-ai-provider="gpt"] .aihub-provider-icon,
:root:not([data-theme="light"]) .aihub-prompt-lightbox__btn--provider[data-ai-provider="gpt"] .aihub-provider-icon {
    background: #f8fafc;
    border-radius: 999px;
    padding: 1px;
    box-sizing: border-box;
}

.aihub-provider-fallback {
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.aihub-provider-fallback[hidden] {
    display: none !important;
}

.aihub-prompt-snippet__btn--provider.has-fallback-text {
    width: auto;
    min-width: 26px;
    padding-inline: 0.35rem;
}

.aihub-prompt-snippet__body {
    margin: 0;
    padding: 0.6rem;
    font-size: calc(0.85rem * var(--archive-text-scale));
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: calc(1.4em * 3 + 1.2rem);
    overflow: auto;
}
.aihub-prompt-snippet--full .aihub-prompt-snippet__body {
    max-height: none;
    overflow: visible;
}

.aihub-prompt-snippet__body .aihub-prompt-placeholder,
.aihub-prompt-lightbox__body .aihub-prompt-placeholder {
    display: inline;
    color: var(--prompt-placeholder-text);
}

.aihub-prompt-snippet__body.is-text .aihub-prompt-placeholder,
.aihub-prompt-lightbox__body.is-text .aihub-prompt-placeholder {
    background: var(--prompt-placeholder-bg);
    border: 1px solid var(--prompt-placeholder-border);
    border-radius: 4px;
    padding: 0 0.15em;
}

.aihub-prompt-snippet__body.is-md .aihub-prompt-placeholder,
.aihub-prompt-lightbox__body.is-md .aihub-prompt-placeholder,
.aihub-prompt-snippet__body.is-json .aihub-prompt-placeholder,
.aihub-prompt-lightbox__body.is-json .aihub-prompt-placeholder {
    background: none;
    border: 0;
    padding: 0;
    border-radius: 0;
    color: var(--prompt-placeholder-inline);
    font-weight: 600;
}

.aihub-prompt-snippet__body.is-md,
.aihub-prompt-lightbox__body.is-md {
    background: var(--prompt-format-md-bg);
    border-inline-start: 3px solid var(--prompt-format-md-border);
    padding-inline-start: calc(0.6rem - 3px);
}

.aihub-prompt-snippet__body.is-json,
.aihub-prompt-lightbox__body.is-json {
    background: var(--prompt-format-json-bg);
    border-inline-start: 3px solid var(--prompt-format-json-border);
    padding-inline-start: calc(0.6rem - 3px);
}

.aihub-prompt-snippet__body.is-md .aihub-md-heading-marker,
.aihub-prompt-lightbox__body.is-md .aihub-md-heading-marker,
.aihub-prompt-snippet__body.is-md .aihub-md-heading-text,
.aihub-prompt-lightbox__body.is-md .aihub-md-heading-text {
    color: var(--prompt-md-heading);
    font-weight: 700;
}

.aihub-prompt-snippet__body.is-md .aihub-md-list-marker,
.aihub-prompt-lightbox__body.is-md .aihub-md-list-marker,
.aihub-prompt-snippet__body.is-md .aihub-md-quote-marker,
.aihub-prompt-lightbox__body.is-md .aihub-md-quote-marker,
.aihub-prompt-snippet__body.is-md .aihub-md-strong-marker,
.aihub-prompt-lightbox__body.is-md .aihub-md-strong-marker,
.aihub-prompt-snippet__body.is-md .aihub-md-em-marker,
.aihub-prompt-lightbox__body.is-md .aihub-md-em-marker {
    color: var(--prompt-md-marker);
}

.aihub-prompt-snippet__body.is-md .aihub-md-link-bracket,
.aihub-prompt-lightbox__body.is-md .aihub-md-link-bracket,
.aihub-prompt-snippet__body.is-md .aihub-md-link-text,
.aihub-prompt-lightbox__body.is-md .aihub-md-link-text {
    color: var(--prompt-md-link-text);
}

.aihub-prompt-snippet__body.is-md .aihub-md-link-paren,
.aihub-prompt-lightbox__body.is-md .aihub-md-link-paren,
.aihub-prompt-snippet__body.is-md .aihub-md-link-url,
.aihub-prompt-lightbox__body.is-md .aihub-md-link-url {
    color: var(--prompt-md-link-url);
}

.aihub-prompt-snippet__body.is-md .aihub-md-code,
.aihub-prompt-lightbox__body.is-md .aihub-md-code,
.aihub-prompt-snippet__body.is-md .aihub-md-code-line,
.aihub-prompt-lightbox__body.is-md .aihub-md-code-line,
.aihub-prompt-snippet__body.is-md .aihub-md-code-fence,
.aihub-prompt-lightbox__body.is-md .aihub-md-code-fence {
    color: var(--prompt-md-code);
}

.aihub-prompt-snippet__body.is-md .aihub-md-strong,
.aihub-prompt-lightbox__body.is-md .aihub-md-strong {
    color: var(--prompt-md-strong);
    font-weight: 700;
}

.aihub-prompt-snippet__body.is-md .aihub-md-em,
.aihub-prompt-lightbox__body.is-md .aihub-md-em {
    color: var(--prompt-md-em);
    font-style: italic;
}

.aihub-prompt-snippet__body.is-json .aihub-json-key,
.aihub-prompt-lightbox__body.is-json .aihub-json-key {
    color: var(--prompt-json-key);
}

.aihub-prompt-snippet__body.is-json .aihub-json-string,
.aihub-prompt-lightbox__body.is-json .aihub-json-string {
    color: var(--prompt-json-string);
}

.aihub-prompt-snippet__body.is-json .aihub-json-number,
.aihub-prompt-lightbox__body.is-json .aihub-json-number {
    color: var(--prompt-json-number);
}

.aihub-prompt-snippet__body.is-json .aihub-json-boolean,
.aihub-prompt-lightbox__body.is-json .aihub-json-boolean {
    color: var(--prompt-json-boolean);
}

.aihub-prompt-snippet__body.is-json .aihub-json-null,
.aihub-prompt-lightbox__body.is-json .aihub-json-null {
    color: var(--prompt-json-null);
}

.aihub-prompt-snippet__body.is-json .aihub-json-punctuation,
.aihub-prompt-lightbox__body.is-json .aihub-json-punctuation {
    color: var(--prompt-json-punctuation);
}

.aihub-kb-layout .aihub-card__title {
    margin-bottom: 0.35rem;
}

.aihub-kb-card__meta-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.aihub-kb-meta-block--link .aihub-kb-link-btn {
    margin-top: 0.1rem;
}

.aihub-prompt-snippet.is-locked .aihub-prompt-snippet__body {
    color: var(--prompt-muted);
    font-style: italic;
}

.aihub-prompt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aihub-prompt-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--prompt-backdrop);
}

.aihub-prompt-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 92vw);
    max-height: 85vh;
    background: var(--prompt-bg);
    border-radius: 12px;
    border: 1px solid var(--prompt-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
}

.aihub-prompt-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--prompt-header-bg);
    border-bottom: 1px solid var(--prompt-border);
}

.aihub-prompt-lightbox__title {
    font-family: "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: calc(0.9rem * var(--archive-text-scale));
    color: var(--prompt-text);
    font-weight: 600;
}

.aihub-prompt-lightbox__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.aihub-prompt-lightbox__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid var(--prompt-btn-border);
    background: transparent;
    color: var(--prompt-btn-text);
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
}

.aihub-prompt-lightbox__btn:hover {
    background: var(--prompt-btn-hover-bg);
    border-color: var(--prompt-btn-hover-border);
}

.aihub-prompt-lightbox__btn--provider.has-fallback-text {
    width: auto;
    min-width: 30px;
    padding-inline: 0.4rem;
}

.aihub-prompt-lightbox__body {
    margin: 0;
    padding: 1rem;
    font-family: "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: calc(0.95rem * var(--archive-text-scale));
    line-height: 1.5;
    color: var(--prompt-text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

@media (hover: hover) and (pointer: fine) {
    .aihub-prompt-snippet__body,
    .aihub-prompt-lightbox__body {
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: var(--prompt-scrollbar-thumb) var(--prompt-scrollbar-track);
    }

    .aihub-prompt-snippet__body::-webkit-scrollbar:vertical,
    .aihub-prompt-lightbox__body::-webkit-scrollbar:vertical {
        width: var(--prompt-scrollbar-size);
    }

    .aihub-prompt-snippet__body::-webkit-scrollbar-track:vertical,
    .aihub-prompt-lightbox__body::-webkit-scrollbar-track:vertical {
        background-color: var(--prompt-scrollbar-track);
        border-radius: 999px;
    }

    .aihub-prompt-snippet__body::-webkit-scrollbar-thumb:vertical,
    .aihub-prompt-lightbox__body::-webkit-scrollbar-thumb:vertical {
        background-color: var(--prompt-scrollbar-thumb);
        border-radius: 999px;
        transition: background-color 0.15s ease;
    }

    .aihub-prompt-snippet__body:hover::-webkit-scrollbar-thumb:vertical,
    .aihub-prompt-lightbox__body:hover::-webkit-scrollbar-thumb:vertical {
        background-color: var(--prompt-scrollbar-thumb-hover);
    }
}

@media (forced-colors: active) {
    .aihub-prompt-snippet__body,
    .aihub-prompt-lightbox__body {
        scrollbar-width: auto;
        scrollbar-color: auto;
        forced-color-adjust: auto;
    }
}

body.aihub-prompt-lightbox-open {
    overflow: hidden;
}


.aihub-archive__pagination {
    margin-top: 1.5rem;
}

.aihub-archive__autoload {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
}

.aihub-archive__autoload-sentinel {
    width: 100%;
    height: 1px;
}

.aihub-archive__load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.aihub-archive__load-more[hidden] {
    display: none !important;
}

.aihub-archive__load-more:hover,
.aihub-archive__load-more:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.aihub-archive__load-more[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.aihub-archive__load-more.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: aihubSpin 0.8s linear infinite;
}

.aihub-archive__autoload-status {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
}

:root:not([data-theme="light"]) .aihub-archive__load-more {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.12);
    color: #a5f3fc;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.2);
}

:root:not([data-theme="light"]) .aihub-archive__load-more:hover,
:root:not([data-theme="light"]) .aihub-archive__load-more:focus-visible {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.2);
    color: #cffafe;
}

@keyframes aihubSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .site-header__inner {
        gap: 0.75rem;
        align-items: center;
    }

    .aihub-prompt-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "media"
            "description";
        gap: 1rem;
    }

    .aihub-prompt-layout--no-image {
        grid-template-areas:
            "title"
            "description";
    }

    .primary-nav {
        display: none;
    }

    .mobile-toggle {
        display: inline-grid;
    }

    .user-popover {
        right: 0;
        left: auto;
        max-width: 90vw;
    }

    .user-popover__settings {
        display: flex;
    }

    .mobile-nav__list .nav__submenu .nav__link {
        padding-left: 1.75rem;
    }

    .mobile-nav__list .nav__submenu .nav__link::before {
        content: '\203A';
        left: 0.9rem;
        color: currentColor;
    }
}

@media (max-width: 768px) {
    :root {
        --site-text-scale: 0.7;
    }

    .site-header__inner {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
    }

    .mobile-toggle {
        margin-left: 0;
    }

    .user-popover {
        top: calc(100% + 10px);
    }

    .nav__submenu {
        position: static;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        padding: 0.25rem 0 0.25rem 0;
        display: none;
    }

    .nav__item--open>.nav__submenu {
        display: block;
    }

    .nav__item {
        align-items: flex-start;
        width: 100%;
    }

    .cta-btn {
        min-height: 44px;
        height: 44px;
    }

    .user-chip {
        min-height: 44px;
        height: 44px;
        box-sizing: border-box;
    }

    .mobile-nav__list .nav__submenu .nav__link {
        padding-left: 3rem !important;
    }

    .aihub-meta-grid {
        grid-template-columns: 1fr;
    }

    .aihub-archive__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .aihub-consent-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .aihub-consent-modal__dialog {
        width: calc(100% - 1.25rem);
        margin-top: 4vh;
    }

    .aihub-consent-modal__actions {
        justify-content: stretch;
    }

    .aihub-consent-modal__actions .cta-btn {
        width: 100%;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --aihub-admin-offset: 46px;
    }
}

/* Sticky Footer */
.site {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
}

/* Compensate WordPress admin bar bump on logged-in frontend sessions. */
body.admin-bar .site {
    padding-top: var(--aihub-admin-offset);
    min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .site {
        min-height: calc(100vh - 46px);
    }
}


.site-content {
    flex-grow: 1;
}

/* Subscriber Content Styling */
.aihub-archive-card {
    position: relative;
    overflow: hidden;
}

.aihub-archive-card--subscriber {
    border-color: #F59E0B;
}

.aihub-subscriber-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    padding: 1.5rem;
    text-align: center;
    pointer-events: none;
}

@media (hover: hover) {
    .aihub-archive-card--subscriber:hover .aihub-subscriber-overlay {
        opacity: 1;
    }
}

.aihub-archive-card--subscriber:active .aihub-subscriber-overlay,
.aihub-archive-card--subscriber:focus-within .aihub-subscriber-overlay {
    opacity: 1;
}

.aihub-subscriber-lock-icon {
    width: 48px;
    height: 48px;
    color: #F59E0B;
}

.aihub-subscriber-lock-icon svg {
    width: 100%;
    height: 100%;
}

.aihub-subscriber-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Auth modal */
.aihub-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aihub-auth-modal[hidden] {
    display: none !important;
}

.aihub-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.aihub-auth-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 92vw);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.aihub-auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
}

.aihub-auth-modal__title {
    margin: 0;
    font-size: 1.2rem;
}

.aihub-auth-modal__notice {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #b91c1c;
}

.aihub-auth-modal__providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-provider-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.auth-provider-btn:hover,
.auth-provider-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.auth-provider-btn__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}

.auth-provider-btn__icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.auth-provider-btn--google {
    background: #fff;
    color: #1f1f1f;
    border-color: #dadce0;
}

.auth-provider-btn--github {
    background: #24292f;
    color: #fff;
    border-color: #24292f;
}

.auth-provider-btn--email {
    background: var(--bg-surface);
    color: var(--text-primary);
}

html[data-theme="dark"] .auth-provider-btn--github {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.auth-provider-btn--telegram {
    background: #2aabee;
    color: #fff;
    border-color: #2aabee;
}

.auth-provider-btn--telegram--gold {
    border: 1px solid var(--subscriber-gold-border);
    box-shadow: 0 0 0 1px var(--subscriber-gold-ring);
}

.auth-provider-btn--telegram .auth-provider-btn__icon,
.auth-provider-btn--telegram .auth-provider-btn__text {
    pointer-events: none;
}

.aihub-auth-modal__email {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aihub-auth-modal__email[hidden] {
    display: none !important;
}

.aihub-auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.aihub-auth-modal__divider::before,
.aihub-auth-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.aihub-auth-modal__tabs {
    display: flex;
    gap: 8px;
}

.aihub-auth-modal__tab {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
}

.aihub-auth-modal__tab.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.aihub-auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aihub-auth-form__label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.aihub-auth-form__input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.aihub-auth-form__hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

body.aihub-auth-modal-open {
    overflow: hidden;
}

body.aihub-consent-modal-open {
    overflow: hidden;
}

/* AIHub first-party tools */
.aihub-archive--tools .aihub-archive__header {
    align-items: flex-start;
}

.aihub-archive__grid--tools {
    align-items: stretch;
}

.aihub-tool-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.aihub-tool-page > .aihub-card__bookmark {
    top: 18px;
    right: 18px;
    z-index: 3;
}

.aihub-tool-hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 20%, transparent), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
}

.aihub-tool-hero__copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 760px;
}

.aihub-tool-hero .aihub-card__title {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(1.225rem, 2.5vw, 1.9rem);
    line-height: 1.08;
}

.aihub-tool-eyebrow {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.aihub-tool-hero__summary {
    margin: 0;
    max-width: 60ch;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.aihub-tool-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.aihub-tool-updated {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.aihub-tool-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.aihub-tool-secondary-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.aihub-tool-secondary-link:hover,
.aihub-tool-secondary-link:focus-visible {
    text-decoration: underline;
}

.aihub-tool-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

.aihub-tool-section__header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: baseline;
}

.aihub-tool-section__header h2,
.aihub-tool-copy__header h3,
.aihub-tool-list__item h3,
.aihub-tool-highlight h3 {
    margin: 0;
}

.aihub-tool-section__header p,
.aihub-tool-section__note,
.aihub-tool-highlight__note,
.aihub-tool-list__item p,
.aihub-tool-content p {
    margin: 0;
    color: var(--text-muted);
}

.aihub-tool-highlight {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}

.aihub-tool-highlight__label {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.aihub-tool-highlight__id,
.aihub-tool-list__id {
    margin: 6px 0 0;
    color: var(--text-primary);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
    word-break: break-word;
}

.aihub-tool-highlight__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

.aihub-tool-highlight__aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aihub-tool-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.1rem;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-card));
    color: var(--accent);
    font-size: clamp(1.2rem, 2.8vw, 1.8rem);
    font-weight: 800;
    line-height: 1;
}

.aihub-tool-score-breakdown {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aihub-tool-score-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    color: var(--text-primary);
}

.aihub-tool-score-breakdown strong {
    color: var(--accent);
    white-space: nowrap;
}

.aihub-tool-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.aihub-tool-copy__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.aihub-tool-copy__btn {
    flex: 0 0 auto;
}

.aihub-tool-copy__btn.aihub-prompt-snippet__btn,
.aihub-tool-inline-copy__btn.aihub-prompt-snippet__btn {
    width: 28px;
    height: 28px;
}

.aihub-tool-copy__code {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #111827;
    color: #e5eef8;
    font-size: 0.9rem;
    line-height: 1.6;
}

:root[data-theme="light"] .aihub-tool-copy__code {
    background: #1f2937;
    color: #e5eef8;
}

.aihub-tool-copy__code .aihub-prompt-placeholder {
    color: var(--prompt-placeholder-inline);
    font-weight: 600;
}

.aihub-tool-copy__code.is-json .aihub-json-key {
    color: var(--prompt-json-key);
}

.aihub-tool-copy__code.is-json .aihub-json-string {
    color: var(--prompt-json-string);
}

.aihub-tool-copy__code.is-json .aihub-json-number {
    color: var(--prompt-json-number);
}

.aihub-tool-copy__code.is-json .aihub-json-boolean {
    color: var(--prompt-json-boolean);
}

.aihub-tool-copy__code.is-json .aihub-json-null {
    color: var(--prompt-json-null);
}

.aihub-tool-copy__code.is-json .aihub-json-punctuation {
    color: var(--prompt-json-punctuation);
}

.aihub-tool-copy__code.is-ts .aihub-code-keyword,
.aihub-tool-copy__code.is-python .aihub-code-keyword,
.aihub-tool-copy__code.is-curl .aihub-code-keyword {
    color: #93c5fd;
    font-weight: 600;
}

.aihub-tool-copy__code.is-ts .aihub-code-string,
.aihub-tool-copy__code.is-python .aihub-code-string,
.aihub-tool-copy__code.is-curl .aihub-code-string {
    color: #34d399;
}

.aihub-tool-copy__code.is-ts .aihub-code-number,
.aihub-tool-copy__code.is-python .aihub-code-number,
.aihub-tool-copy__code.is-curl .aihub-code-number {
    color: #facc15;
}

.aihub-tool-copy__code.is-ts .aihub-code-comment,
.aihub-tool-copy__code.is-python .aihub-code-comment,
.aihub-tool-copy__code.is-curl .aihub-code-comment {
    color: #94a3b8;
}

.aihub-tool-copy__code.is-curl .aihub-code-command {
    color: #fb923c;
    font-weight: 600;
}

.aihub-tool-copy__code.is-curl .aihub-code-flag {
    color: #c084fc;
}

.aihub-tool-copy__code.is-curl .aihub-code-url {
    color: #67e8f9;
}

.aihub-tool-copy__status {
    min-height: 1.2em;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.aihub-tool-key-values {
    display: grid;
    gap: 10px;
}

.aihub-tool-key-values__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.aihub-tool-key-values__row span {
    color: var(--text-muted);
}

.aihub-tool-key-values__value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}

.aihub-tool-key-values__text {
    max-width: 100%;
}

.aihub-tool-key-values__row a {
    color: var(--accent);
    text-decoration: none;
}

.aihub-tool-key-values__row a:hover,
.aihub-tool-key-values__row a:focus-visible {
    text-decoration: underline;
}

.aihub-tool-snippets,
.aihub-tool-list {
    display: grid;
    gap: 16px;
}

.aihub-tool-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.aihub-tool-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.aihub-tool-table th,
.aihub-tool-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}

.aihub-tool-table th {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.aihub-tool-table__score-head,
.aihub-tool-table__score-cell {
    text-align: right !important;
}

.aihub-tool-table tbody tr:last-child td {
    border-bottom: 0;
}

.aihub-tool-table__model-id,
.aihub-tool-table__note {
    display: block;
    margin-top: 6px;
}

.aihub-tool-table__title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.aihub-tool-table__title {
    display: block;
    min-width: 0;
}

.aihub-tool-table__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-top: 6px;
}

.aihub-tool-table__model-id {
    color: var(--text-primary);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.9rem;
    word-break: break-word;
}

.aihub-tool-inline-copy {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

.aihub-tool-inline-copy__btn {
    width: 26px;
    height: 26px;
}

.aihub-tool-table__title-row .aihub-tool-inline-copy {
    flex: 0 0 auto;
    margin-top: 1px;
}

.aihub-tool-table__title-row .aihub-tool-inline-copy__status {
    display: none;
}

.aihub-tool-inline-copy__status {
    min-height: 0;
    font-size: 0.78rem;
}

.aihub-tool-table__score {
    display: inline-block;
    min-width: 2.8ch;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.aihub-tool-table__score--excellent,
.aihub-tool-score-badge--excellent {
    border-color: color-mix(in srgb, #16a34a 42%, var(--border));
    background: color-mix(in srgb, #16a34a 14%, var(--bg-card));
    color: #166534;
}

.aihub-tool-table__score--strong,
.aihub-tool-score-badge--strong {
    border-color: color-mix(in srgb, #22c55e 40%, var(--border));
    background: color-mix(in srgb, #22c55e 12%, var(--bg-card));
    color: #15803d;
}

.aihub-tool-table__score--moderate,
.aihub-tool-score-badge--moderate {
    border-color: color-mix(in srgb, #f59e0b 42%, var(--border));
    background: color-mix(in srgb, #f59e0b 14%, var(--bg-card));
    color: #b45309;
}

.aihub-tool-table__score--low,
.aihub-tool-score-badge--low {
    border-color: color-mix(in srgb, #ea580c 42%, var(--border));
    background: color-mix(in srgb, #ea580c 12%, var(--bg-card));
    color: #c2410c;
}

.aihub-tool-table__note {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.aihub-tool-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
}

.aihub-tool-flag--yes {
    color: #166534;
    border-color: color-mix(in srgb, #22c55e 45%, var(--border));
    background: color-mix(in srgb, #22c55e 12%, var(--bg-card));
}

.aihub-tool-flag--no {
    color: var(--text-muted);
    border-color: var(--border);
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
}

.aihub-tool-list__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.aihub-tool-bullets {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-primary);
}

.aihub-tool-bullets li + li {
    margin-top: 10px;
}

.aihub-tool-content > :first-child,
.aihub-tool-empty > :first-child {
    margin-top: 0;
}

.aihub-tool-content > :last-child,
.aihub-tool-empty > :last-child {
    margin-bottom: 0;
}

.aihub-tool-empty {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aihub-tool-empty h2 {
    margin: 0;
}

.aihub-tool-card__updated {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.aihub-tool-card__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: end;
    margin-top: 14px;
}

.aihub-tool-card__actions .aihub-card__bookmark {
    position: static;
    margin-top: 0;
    align-self: end;
    justify-self: end;
}

@media (max-width: 767px) {
    .aihub-tool-page {
        gap: 18px;
    }

    .aihub-tool-page > .aihub-card__bookmark {
        top: 14px;
        right: 14px;
    }

    .aihub-tool-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .aihub-tool-hero .aihub-card__title {
        max-width: 100%;
        font-size: clamp(0.975rem, 4.5vw, 1.45rem);
        line-height: 1.12;
    }

    .aihub-tool-hero__summary {
        max-width: none;
        font-size: 0.92rem;
        line-height: 1.58;
    }

    .aihub-tool-hero__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .aihub-tool-hero__actions {
        align-items: stretch;
        gap: 10px;
    }

    .aihub-tool-hero__actions .aihub-kb-link-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .aihub-tool-hero__actions .aihub-tool-secondary-link {
        width: auto;
        justify-content: flex-start;
        text-align: left;
    }

    .aihub-tool-section {
        gap: 14px;
        padding: 18px;
        border-radius: 18px;
    }

    .aihub-tool-section__header {
        align-items: flex-start;
    }

    .aihub-tool-highlight {
        padding: 16px;
    }

    .aihub-tool-highlight__stats {
        gap: 8px;
    }

    .aihub-tool-score-badge {
        width: fit-content;
        font-size: clamp(1.25rem, 7vw, 1.9rem);
    }

    .aihub-tool-copy {
        padding: 16px;
    }

    .aihub-tool-copy__header {
        align-items: flex-start;
        gap: 10px;
    }

    .aihub-tool-copy__code {
        font-size: 0.84rem;
        padding: 14px;
    }

    .aihub-tool-key-values__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .aihub-tool-key-values__value {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .aihub-tool-table-wrap {
        overflow-x: visible;
    }

    .aihub-tool-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .aihub-tool-table thead {
        display: none;
    }

    .aihub-tool-table,
    .aihub-tool-table tbody,
    .aihub-tool-table tr,
    .aihub-tool-table td {
        display: block;
        width: 100%;
    }

    .aihub-tool-table tbody {
        display: grid;
        gap: 12px;
    }

    .aihub-tool-table tr {
        padding: 14px;
        border-radius: 16px;
        border: 1px solid var(--border);
        background: var(--bg-card);
    }

    .aihub-tool-table td {
        padding: 0;
        border: 0;
    }

    .aihub-tool-table td + td {
        margin-top: 12px;
    }

    .aihub-tool-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--text-muted);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .aihub-tool-table__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .aihub-tool-table__title-row {
        gap: 8px;
    }

    .aihub-tool-table__score-cell {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .aihub-tool-card__actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .aihub-tool-card__actions .aihub-card__bookmark {
        justify-self: start;
    }
}

@media (max-width: 430px) {
    body.single-aihub_tool .breadcrumb-bar.container,
    body.single-aihub_tool .site-content.container {
        padding-left: 14px;
        padding-right: 14px;
    }

    body.single-aihub_tool .breadcrumb-bar {
        padding-top: 2px;
        padding-bottom: 8px;
    }

    body.single-aihub_tool .breadcrumb {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body.single-aihub_tool .breadcrumb ol {
        gap: 0.2rem 0.35rem;
    }

    body.single-aihub_tool .breadcrumb li[aria-current="page"] {
        flex-basis: 100%;
        overflow-wrap: anywhere;
    }

    body.single-aihub_tool .breadcrumb__sep {
        padding: 0 0.08rem;
    }

    body.single-aihub_tool .aihub-tool-page.aihub-card {
        padding: 10px;
        margin-bottom: 1.25rem;
        border-radius: 16px;
    }

    body.single-aihub_tool .aihub-tool-page {
        gap: 14px;
    }

    body.single-aihub_tool .aihub-tool-page > .aihub-card__bookmark {
        top: 10px;
        right: 10px;
    }

    body.single-aihub_tool .aihub-tool-hero {
        padding: 14px;
        border-radius: 16px;
    }

    body.single-aihub_tool .aihub-tool-hero__copy {
        gap: 10px;
    }

    body.single-aihub_tool .aihub-tool-eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.06em;
    }

    body.single-aihub_tool .aihub-tool-hero .aihub-card__title {
        line-height: 1.05;
        text-wrap: balance;
        overflow-wrap: anywhere;
    }

    body.single-aihub_tool .aihub-tool-hero__summary {
        font-size: 0.84rem;
        line-height: 1.48;
    }

    body.single-aihub_tool .aihub-tool-hero__meta {
        gap: 6px;
    }

    body.single-aihub_tool .aihub-tool-updated {
        font-size: 0.8rem;
    }

    body.single-aihub_tool .aihub-tool-hero__actions {
        gap: 8px;
    }

    body.single-aihub_tool .aihub-tool-hero__actions .aihub-kb-link-btn,
    body.single-aihub_tool .aihub-tool-hero__actions .aihub-tool-secondary-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    body.single-aihub_tool .aihub-tool-secondary-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0.35rem 0.8rem;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
        font-weight: 700;
        text-decoration: none;
    }

    body.single-aihub_tool .aihub-tool-section {
        gap: 12px;
        padding: 14px;
        border-radius: 16px;
    }

    body.single-aihub_tool .aihub-tool-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    body.single-aihub_tool .aihub-tool-section__header h2 {
        font-size: 1.15rem;
        line-height: 1.15;
    }

    body.single-aihub_tool .aihub-tool-section__header p,
    body.single-aihub_tool .aihub-tool-section__note {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    body.single-aihub_tool .aihub-tool-highlight {
        gap: 12px;
        padding: 14px;
    }

    body.single-aihub_tool .aihub-tool-highlight h3 {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    body.single-aihub_tool .aihub-tool-highlight__id,
    body.single-aihub_tool .aihub-tool-list__id {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    body.single-aihub_tool .aihub-tool-highlight__note {
        font-size: 0.84rem;
        line-height: 1.5;
    }

    body.single-aihub_tool .aihub-tool-highlight__stats {
        gap: 6px;
        margin-top: 10px;
    }

    body.single-aihub_tool .aihub-tool-highlight__stats .aihub-badge {
        padding: 0.4rem 0.65rem;
        font-size: 0.76rem;
    }

    body.single-aihub_tool .aihub-tool-score-badge {
        padding: 0.65rem 0.9rem;
        font-size: clamp(1.05rem, 6vw, 1.45rem);
    }

    body.single-aihub_tool .aihub-tool-copy {
        gap: 8px;
        padding: 12px;
    }

    body.single-aihub_tool .aihub-tool-copy__header {
        gap: 8px;
    }

    body.single-aihub_tool .aihub-tool-copy__header h3 {
        font-size: 0.98rem;
        line-height: 1.2;
    }

    body.single-aihub_tool .aihub-tool-copy__code {
        padding: 12px;
        font-size: 0.78rem;
        line-height: 1.5;
    }

    body.single-aihub_tool .aihub-tool-key-values {
        gap: 8px;
    }

    body.single-aihub_tool .aihub-tool-key-values__row {
        gap: 6px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    body.single-aihub_tool .aihub-tool-key-values__row span {
        font-size: 0.78rem;
    }

    body.single-aihub_tool .aihub-tool-key-values__value {
        gap: 8px;
    }

    body.single-aihub_tool .aihub-tool-key-values__text {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    body.single-aihub_tool .aihub-tool-snippets {
        gap: 12px;
    }

    body.single-aihub_tool .aihub-tool-table tbody {
        gap: 10px;
    }

    body.single-aihub_tool .aihub-tool-table tr {
        padding: 12px;
        border-radius: 14px;
    }

    body.single-aihub_tool .aihub-tool-table td + td {
        margin-top: 10px;
    }

    body.single-aihub_tool .aihub-tool-table td::before {
        margin-bottom: 4px;
        font-size: 0.72rem;
    }

    body.single-aihub_tool .aihub-tool-table__title-row {
        gap: 6px;
    }

    body.single-aihub_tool .aihub-tool-table__title {
        font-size: 0.95rem;
        line-height: 1.35;
    }

    body.single-aihub_tool .aihub-tool-table__model-id {
        font-size: 0.78rem;
    }

    body.single-aihub_tool .aihub-tool-table__note {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    body.single-aihub_tool .aihub-tool-table__score-cell {
        justify-content: flex-start;
    }

    body.single-aihub_tool .aihub-tool-table__score {
        font-size: 1.2rem;
    }
}

@media (min-width: 768px) {
    .aihub-tool-page {
        gap: 28px;
    }

    .aihub-tool-hero {
        padding: 36px;
    }

    .aihub-tool-highlight {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: center;
    }

    .aihub-tool-key-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aihub-tool-snippets,
    .aihub-tool-list,
    .aihub-archive__grid--tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .aihub-tool-snippets,
    .aihub-archive__grid--tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aihub-tool-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
