/* ════════════════════════════════════════════════════════════════════════
   DE123 — public landing pages
   CSS only (no JS) so the static cached pages stay fast. Auto dark-mode via
   prefers-color-scheme. Shared by all ~2M generated pages.
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    --accent:          #6366f1;
    --accent-hover:    #4f46e5;
    --accent-soft:     rgba(99, 102, 241, 0.1);
    --accent-grad:     linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --bg:              #f4f6fb;
    --surface:         #ffffff;
    --surface-2:       #f1f5f9;
    --border:          #e3e8ef;
    --border-strong:   #cbd5e1;

    --text:            #0f172a;
    --text-muted:      #64748b;
    --text-faint:      #94a3b8;

    --code-bg:         #0d1117;
    --code-text:       #e6edf3;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    --radius:    8px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow:    0 4px 14px rgba(15, 23, 42, 0.08);
    --ease:      cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1140px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:            #0b1120;
        --surface:       #161e2e;
        --surface-2:     #1e293b;
        --border:        #283449;
        --border-strong: #3b4a63;
        --text:          #e8edf5;
        --text-muted:    #94a3b8;
        --text-faint:    #64748b;
        --accent-soft:   rgba(99, 102, 241, 0.16);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow:    0 4px 14px rgba(0, 0, 0, 0.5);
    }
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; }
::selection { background: var(--accent-soft); }

/* ─── Layout helpers ─────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* ─── Site header ────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    padding-block: 0.85rem;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.site-logo:hover { color: var(--text); text-decoration: none; }
.site-logo::before {
    content: 'DE';
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--accent-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* ─── Header search ──────────────────────────────────────────────────────── */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 220px;
    max-width: 460px;
    margin-inline: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.header-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.header-search__icon { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.header-search__input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text);
    font-family: inherit;
}
.header-search__input::placeholder { color: var(--text-faint); }

/* Right-side header group: dev page/prompt toggle + language switcher */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
/* Compact the page/prompt toggle to match the language switcher in the header */
.site-header .view-toggle {
    margin-bottom: 0;
    gap: 0.15rem;
    padding: 0.15rem;
    border-radius: 8px;
    background: var(--surface);
    align-self: center;
}
.site-header .view-toggle__btn {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .header-search { order: 3; flex-basis: 100%; max-width: none; margin-inline: 0; }
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.main-content .breadcrumb { margin-bottom: 0.85rem; }
.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    font-size: 0.85rem;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.3rem; }
.breadcrumb li + li::before {
    content: '›';
    color: var(--text-faint);
    font-size: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span { color: var(--text); font-weight: 600; }

/* ─── Page body (main + sidebar) ─────────────────────────────────────────── */
.page-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.25rem;
    padding-block: 2.25rem;
    flex: 1;
    align-items: start;
}

/* Pages without a sidebar (e.g. generated statistik pages) span full width. */
.page-body--full {
    grid-template-columns: 1fr;
}

@media (max-width: 820px) {
    .page-body { grid-template-columns: 1fr; gap: 1.5rem; }
    .sidebar { order: -1; }
}

/* ─── Main content card ──────────────────────────────────────────────────── */
.main-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-sm);
    animation: fade-in 0.4s var(--ease);
    min-width: 0;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 0.35rem;
}

/* Title row: the heading, the level badge and the data-source info icon
   all sit on one line (wrapping on narrow screens). */
.page-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}

.page-header .page-title {
    margin-bottom: 0;
}

.community-type-label {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 0.2rem 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

/* Static data-source info icon + hover/focus tooltip (no JS). */
.page-source {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    color: var(--text-faint);
    cursor: help;
    outline: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.page-source__icon {
    width: 1.1rem;
    height: 1.1rem;
}

.page-source:hover,
.page-source:focus-visible {
    color: var(--accent);
    background: var(--accent-soft);
}

.page-source__tip {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(0.25rem);
    z-index: 30;
    width: max-content;
    max-width: 260px;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--code-text);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.page-source:hover .page-source__tip,
.page-source:focus-visible .page-source__tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* AI-generated article body */
.main-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
}
.main-content h3 { font-size: 1.12rem; font-weight: 700; margin-top: 1.6rem; margin-bottom: 0.45rem; }
.main-content p  { color: var(--text); }
.main-content ul, .main-content ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.main-content li { margin-bottom: 0.35rem; }
.main-content strong { font-weight: 700; }

.main-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.main-content th,
.main-content td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
}
.main-content th {
    background: var(--surface-2);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.main-content tbody tr:last-child td { border-bottom: none; }
.main-content tbody tr { transition: background 0.12s var(--ease); }
.main-content tbody tr:hover td { background: var(--accent-soft); }
.main-content td:first-child, .main-content th:first-child { padding-left: 1.1rem; }

.placeholder-notice {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 1.25rem;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar { font-size: 0.9rem; position: sticky; top: 80px; }

.sidebar-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-section h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-section p { margin-bottom: 0.45rem; }
.sidebar-section ul { padding-left: 1rem; list-style: none; }
.sidebar-section ul li { position: relative; padding-left: 0.9rem; margin-bottom: 0.4rem; }
.sidebar-section ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.6em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* ─── Disambiguation page ────────────────────────────────────────────────── */
.disambiguation-list {
    list-style: none;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.disambiguation-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}
.disambiguation-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.disambiguation-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    color: var(--text);
}
.disambiguation-link:hover { background: var(--accent-soft); text-decoration: none; }
.disambiguation-link strong { font-size: 1.05rem; font-weight: 700; }
.disambiguation-context { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Parameter-count card (category preview) ────────────────────────────── */
.param-count-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}
.param-count-card__value {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.param-count-card__label {
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.param-count-card__sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ─── Generation preview (cache-miss, no API configured) ─────────────────── */
.generation-preview h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.85rem;
}
.generation-preview h2:first-child { margin-top: 0; }

.generation-status {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}
.generation-status li {
    counter-increment: step;
    position: relative;
    padding: 0.85rem 1.1rem 0.85rem 3.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.generation-status li::before {
    content: counter(step);
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.65rem;
    height: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-grad);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}
.generation-status strong { color: var(--text); font-weight: 700; }

.generation-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.generation-meta > div { background: var(--surface); padding: 0.85rem 1.1rem; }
.generation-meta dt {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.generation-meta dd { font-size: 0.95rem; font-weight: 500; }

.prompt-preview-text {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: var(--radius);
    padding: 1.35rem;
    overflow: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 620px;
    border: 1px solid #1f2937;
}
.prompt-preview-text code { font-family: var(--font-mono); background: none; border: none; color: inherit; padding: 0; }

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    color: var(--accent);
}

/* ─── Home / landing search ──────────────────────────────────────────────── */
.home-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background:
        radial-gradient(1100px 480px at 50% -8%, var(--accent-soft), transparent),
        var(--bg);
}
.home-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
}
.home-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 2.5rem;
}
.home-logo:hover { color: var(--text); text-decoration: none; }
.home-logo__mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--accent-grad);
    color: #fff; font-weight: 800; font-size: 0.85rem;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.45);
}
.home-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.6rem;
}
.home-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.home-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    box-shadow: var(--shadow);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.home-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}
.home-search__icon { width: 20px; height: 20px; color: var(--text-faint); flex-shrink: 0; }
.home-search__input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
    padding: 0.5rem 0.25rem;
    min-width: 0;
}
.home-search__btn {
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    transition: background 0.15s var(--ease), transform 0.12s var(--ease);
}
.home-search__btn:hover { background: var(--accent-hover); }
.home-search__btn:active { transform: translateY(1px); }

/* Autocomplete dropdown */
.home-suggest {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 20;
    text-align: left;
}
.home-suggest__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.home-suggest__item:last-child { border-bottom: none; }
.home-suggest__item:hover,
.home-suggest__item.is-active { background: var(--accent-soft); }
.home-suggest__name { font-weight: 600; color: var(--text); }
.home-suggest__type {
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}
/* Category × community pairs stack name over context, with an accent edge */
.home-suggest__item.is-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    border-left: 3px solid var(--accent);
}
.home-suggest__item.is-category .home-suggest__name { font-weight: 600; }
.home-suggest__item.is-category .home-suggest__type {
    background: none;
    color: var(--text-muted);
    padding: 0;
    font-size: 0.8rem;
}

.home-examples {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    justify-content: center;
}
.home-examples a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
}
.home-examples a:hover { border-color: var(--accent); text-decoration: none; }

.home-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Search results page ────────────────────────────────────────────────── */
.results-search {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}
.results-search .form-input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.results-search .form-input::placeholder { color: var(--text-faint); }
.results-search .form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.results-search__btn {
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius);
    padding: 0.75rem 1.4rem;
    white-space: nowrap;
    transition: background 0.15s var(--ease);
}
.results-search__btn:hover { background: var(--accent-hover); }

/* ─── Search results (cards) ─────────────────────────────────────────────── */
.search-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.75rem 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}
.search-heading__count {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.05rem 0.55rem;
    color: var(--text-muted);
}
.search-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.search-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    height: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.search-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    text-decoration: none;
}
.search-card__name { font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.search-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.search-badge {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    white-space: nowrap;
}
.search-card__slug {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-block: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 2rem; text-align: center; }
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

/* ─── Generated content (Markdown → HTML) ────────────────────────────────── */
.generated-content {
    color: var(--text);
    line-height: 1.7;
}
.generated-content > :first-child { margin-top: 0; }
.generated-content > :last-child { margin-bottom: 0; }

.generated-content h2,
.generated-content h3,
.generated-content h4 {
    color: var(--text);
    line-height: 1.25;
    margin: 2rem 0 0.75rem;
}
.generated-content h2 {
    font-size: 1.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.generated-content h3 { font-size: 1.2rem; }
.generated-content h4 { font-size: 1.05rem; }

.generated-content p { margin: 0 0 1rem; }

.generated-content ul,
.generated-content ol {
    margin: 0 0 1rem;
    padding-left: 0;
    list-style-position: inside;
}
.generated-content li { margin-bottom: 0.4rem; }

.generated-content a { text-decoration: underline; }

.generated-content blockquote {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
}

.generated-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.generated-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
    background: var(--accent-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}
.generated-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 0 0 1rem;
}
.generated-content pre code { background: none; padding: 0; }

/* Tables — the AI emits GitHub-flavoured Markdown tables for the statistics */
.generated-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    display: block;
    overflow-x: auto;
    margin: 0 0 1.25rem;
}
.generated-content thead th {
    text-align: left;
    background: var(--surface);
    border-bottom: 2px solid var(--border-strong);
    padding: 0.6rem 0.8rem;
    white-space: nowrap;
}
.generated-content tbody td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
}
.generated-content tbody tr:hover td { background: var(--accent-soft); }

/* ─── Overview hub (available statistics) ────────────────────────────────── */
.hub-block { margin-bottom: 1.75rem; }
.hub-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.hub-cat {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.hub-cat:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ─── Generating (loading) screen ────────────────────────────────────────── */
.generating {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
}
.generating__box {
    max-width: 32rem;
}
.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.75rem;
    border: 4px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}
.generating__title {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
}
.generating__sub {
    color: var(--text-muted);
    line-height: 1.6;
}
@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 1.8s; }
}

/* ─── View toggle (rendered page ⇄ prompt) ───────────────────────────────── */
.view-toggle {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.view-toggle__btn {
    padding: 0.35rem 0.9rem;
    border-radius: calc(var(--radius) - 3px);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.view-toggle__btn:hover { color: var(--text); text-decoration: none; }
.view-toggle__btn.is-active {
    background: var(--accent);
    color: #fff;
}

.prompt-preview-intro {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Language switcher ──────────────────────────────────────────────────── */
.lang-switch {
    display: inline-flex;
    gap: 0.15rem;
    margin-left: auto;
    align-self: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.15rem;
    background: var(--surface);
}
.lang-switch__btn {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.4;
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn.is-active {
    background: var(--accent);
    color: #fff;
}
.home-topbar { width: 100%; display: flex; justify-content: flex-end; padding: 1rem 1.25rem 0; }
