/* ============================================
   Creator Help Hub — Theme v3
   ============================================ */

:root {
    --ink: #0d0e10;
    --ink-2: #16181c;
    --ink-3: #1d2026;
    --line: #2a2e36;
    --line-soft: #20232a;
    --paper: #f1ecdf;
    --paper-dim: #d5cdbd;
    --paper-mute: #a79e8e;
    --accent: #d4a24c;
    --accent-warm: #e6b95e;
    --accent-soft: rgba(212, 162, 76, 0.12);
    --danger: #d96b5c;
    --danger-soft: rgba(217, 107, 92, 0.12);
    --success: #7fa86b;
    --success-soft: rgba(127, 168, 107, 0.12);
    --admin: #8a7fff;
    --admin-soft: rgba(138, 127, 255, 0.12);

    --font-ui: Aptos, 'Aptos Display', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --font-display: 'Aptos Display', Aptos, 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --font-body: var(--font-ui);
    --font-sans: var(--font-ui);
    --font-mono: var(--font-ui);

    --side-w: 260px;
    --side-collapsed-w: 74px;
    --scrollbar-track: rgba(255,255,255,0.025);
    --scrollbar-thumb: rgba(212, 162, 76, 0.36);
    --scrollbar-thumb-hover: rgba(230, 185, 94, 0.68);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(230,185,94,0.72), rgba(138,106,48,0.45));
    border: 3px solid var(--ink);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(245,205,117,0.92), rgba(212,162,76,0.65));
}
::-webkit-scrollbar-corner { background: var(--ink); }

html, body {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    background-image:
        radial-gradient(ellipse at top left, rgba(212, 162, 76, 0.06), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(120, 90, 50, 0.04), transparent 50%);
    background-attachment: fixed;
}

/* ============================================
   PAGE PRELOADER
   ============================================ */
.page-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 100vh;
    color: var(--paper);
    background:
        radial-gradient(circle at center, rgba(212, 162, 76, 0.12), transparent 34%),
        rgba(13, 14, 16, 0.96);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    /* CSS fallback: force-hide after 5s even if JS never runs */
    animation: preloader-auto-hide 0.4s ease 5s forwards;
}

@keyframes preloader-auto-hide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.page-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    animation: none;
}

.page-preloader-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
}

.page-preloader-mark span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(212, 162, 76, 0.35);
    animation: preloader-pulse 0.9s ease-in-out infinite;
}

.page-preloader-mark span:nth-child(2) { animation-delay: 0.12s; }
.page-preloader-mark span:nth-child(3) { animation-delay: 0.24s; }

.page-preloader-text {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-dim);
}

@keyframes preloader-pulse {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.72);
        opacity: 0.48;
    }
    40% {
        transform: translateY(-10px) scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-preloader,
    .page-preloader-mark span {
        animation: none;
        transition: none;
    }
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0;
    color: var(--paper);
}

h1 { font-size: 2.4rem; line-height: 1.1; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

/* ============================================
   LAYOUT (signed-in shell)
   ============================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--side-w);
    background: var(--ink-2);
    border-right: 1px solid var(--line);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
    scrollbar-gutter: stable;
    transition: width 0.22s ease, padding 0.22s ease, transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 162, 76, 0.24);
    border: 2px solid var(--ink-2);
    border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(230, 185, 94, 0.55); }

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line-soft);
}

.sidebar-top .brand {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--paper-dim);
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sidebar-collapse-btn svg { width: 17px; height: 17px; }
.sidebar-collapse-btn:hover { color: var(--accent-warm); border-color: rgba(212, 162, 76, 0.5); background: #22252c; }
.sidebar-collapse-btn:active { transform: scale(0.96); }

.sidebar.collapsed {
    width: var(--side-collapsed-w);
    padding-left: 14px;
    padding-right: 14px;
}

.sidebar.collapsed .sidebar-top {
    flex-direction: column;
    gap: 12px;
}

.sidebar.collapsed .brand {
    justify-content: center;
    width: 100%;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand img,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-tag > div,
.sidebar.collapsed .role-badge {
    display: none;
}

.sidebar.collapsed .brand-mark-fallback {
    display: inline-flex;
}

.sidebar.collapsed .brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
    transform: scaleX(-1);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    gap: 0;
    padding: 11px;
    font-size: 0;
}

.sidebar.collapsed .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.95;
}

.sidebar.collapsed .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar.collapsed .user-tag {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .user-avatar {
    width: 34px;
    height: 34px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 20;
}
.sidebar-overlay.show { display: block; }

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    z-index: 40;
    padding: 0;
}
.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--paper);
    border-radius: 2px;
    transition: all 0.2s ease;
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line-soft);
    text-decoration: none;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent);
    letter-spacing: 0;
}

.brand-mark-fallback { display: none; }

.brand-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--paper);
    letter-spacing: 0.02em;
}

/* ── Section titles ───────────────────────────────────────────────────────── */
.nav-section-title {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-mute);
    padding: 20px 14px 5px;
    margin-top: 2px;
    position: relative;
}
.nav-section-title::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    top: 10px;
    height: 1px;
    background: var(--line-soft);
}

/* ── Nav items ────────────────────────────────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--paper-dim);
    font-size: 0.93rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.nav-item:hover { background: var(--ink-3); color: var(--paper); }
/* Tool items → gold active */
.nav-item.active { background: var(--accent-soft); color: var(--accent-warm); border-color: rgba(212, 162, 76, 0.18); }
/* Admin/platform items → purple active */
.nav-item.admin.active { background: var(--admin-soft); color: #b8b0ff; border-color: rgba(138, 127, 255, 0.18); }

.nav-icon { width: 16px; height: 16px; opacity: 0.8; flex-shrink: 0; }

/* ── Collapsible nav groups ───────────────────────────────────────────────── */
.nav-group { position: relative; }
.nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    justify-content: flex-start;
}
.nav-group-chevron {
    width: 12px; height: 12px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.45;
}
.nav-group.open .nav-group-chevron { transform: rotate(180deg); }

.nav-group-items {
    display: none;
    padding-left: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
}
.nav-group.open .nav-group-items { display: block; }

/* ── Sub-items ────────────────────────────────────────────────────────────── */
.nav-sub {
    font-size: 0.87rem;
    padding: 7px 10px 7px 28px;
    color: var(--paper-mute);
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.nav-sub:hover { background: var(--ink-3); color: var(--paper); }
/* Admin/blog subs → purple active */
.nav-sub.active { background: var(--admin-soft); color: #b8b0ff; border-color: rgba(138, 127, 255, 0.18); }
/* Tool subs → gold active */
.nav-sub.tool-sub.active { background: var(--accent-soft); color: var(--accent-warm); border-color: rgba(212, 162, 76, 0.18); }

.nav-sub-icon { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.65; }

/* Mini divider label inside a nav-group (e.g. "Tool Settings") */
.nav-sub-divider {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-mute);
    padding: 10px 10px 3px 28px;
    opacity: 0.7;
}

/* Collapsed sidebar — hide group contents and extras */
.sidebar.collapsed .nav-group-items,
.sidebar.collapsed .nav-group-chevron,
.sidebar.collapsed .nav-sub-divider { display: none; }

/* Blog AI assistant */
.blog-ai-panel {
    background: linear-gradient(135deg, var(--ink-3) 0%, var(--ink) 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
}
.blog-ai-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.blog-ai-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, #7c6fcd, #5a4fa8);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.blog-ai-icon svg { width: 20px; height: 20px; stroke: #fff; }
.blog-ai-messages {
    min-height: 60px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.blog-ai-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 90%;
}
.blog-ai-msg.user {
    background: var(--accent-soft);
    color: var(--accent-warm);
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}
.blog-ai-msg.assistant {
    background: var(--ink-3);
    color: var(--paper-dim);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}
.blog-ai-msg.error { background: rgba(220,60,60,0.12); color: #e06060; }
.blog-ai-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.blog-ai-input-row textarea {
    flex: 1;
    min-height: 72px;
    resize: vertical;
    font-size: 0.92rem;
}
.blog-ai-image-prompt {
    background: var(--ink-3);
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
}
.blog-ai-image-prompt p { font-size: 0.82rem; color: var(--paper-mute); margin-bottom: 6px; }
.blog-ai-image-prompt code {
    display: block;
    font-size: 0.83rem;
    color: var(--paper-dim);
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Bulk AI topic rows */
.ai-topic-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.ai-topic-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c6fcd, #5a4fa8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 9px;
}
.ai-topic-textarea {
    flex: 1;
    min-height: 64px;
    resize: vertical;
    font-size: 0.9rem;
}
.ai-topic-remove {
    background: none;
    border: none;
    color: var(--paper-mute);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px 6px;
    line-height: 1;
    margin-top: 7px;
    flex-shrink: 0;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.ai-topic-remove:hover { color: var(--danger); background: rgba(220,60,60,0.1); }
.ai-topic-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.ai-progress-track {
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
}
.ai-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c6fcd, #5a4fa8);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.ai-result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--ink);
}
.ai-result-row.ai-result-error { border-color: rgba(220,60,60,0.4); }
.ai-result-num {
    width: 22px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--paper-mute);
    flex-shrink: 0;
}
.ai-result-title {
    flex: 1;
    font-size: 0.88rem;
    color: var(--paper-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* AI writing animation stage */
.ai-writer-stage {
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 22px 20px;
    margin: 16px 0 4px;
    min-height: 108px;
    position: relative;
    overflow: hidden;
}
.ai-writer-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7c6fcd, #a78bfa, #5a4fa8, transparent);
    background-size: 300% 100%;
    animation: ai-shimmer 2.2s linear infinite;
}
@keyframes ai-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.ai-writer-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--paper-mute);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ai-writer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7c6fcd;
    flex-shrink: 0;
    animation: ai-pulse-dot 1.4s ease-in-out infinite;
}
@keyframes ai-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.65); }
}
.ai-writer-body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.87rem;
    color: var(--paper-dim);
    line-height: 1.8;
    min-height: 56px;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-writer-cursor {
    display: inline-block;
    width: 2px;
    height: 0.95em;
    background: var(--accent-warm, #f5a623);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: ai-blink 0.65s step-end infinite;
}
@keyframes ai-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Tag chip input */
.tag-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: text;
    min-height: 42px;
    align-items: center;
}
.tag-chip-wrap:focus-within { border-color: var(--accent); }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--admin-soft);
    color: #b8b0ff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
}
.tag-chip button {
    background: none; border: none; color: inherit;
    cursor: pointer; padding: 0; font-size: 0.9rem; line-height: 1;
    opacity: 0.7;
}
.tag-chip button:hover { opacity: 1; }
.tag-chip-input {
    border: none; background: none; outline: none;
    color: var(--paper); font-size: 0.9rem;
    min-width: 80px; flex: 1;
    padding: 2px 4px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.user-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--ink-3);
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.user-tag:hover { background: #23262d; color: inherit; }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8a6b30);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink); font-weight: 600; font-size: 0.85rem;
    overflow: hidden; flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar.admin { background: linear-gradient(135deg, var(--admin), #5b50d4); color: var(--paper); }

.user-name-small { color: var(--paper); font-size: 0.88rem; line-height: 1.2; }
.user-email-small { font-size: 0.74rem; color: var(--paper-mute); }

.role-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-left: 6px;
}
.role-badge.admin { background: var(--admin-soft); color: #b8b0ff; }
.role-badge.moderator { background: rgba(127, 168, 107, 0.12); color: #b8d4a8; }
.role-badge.user { background: var(--accent-soft); color: var(--accent-warm); }

.main { flex: 1; padding: 40px 56px; max-width: 1180px; min-width: 0; margin-left: var(--side-w); transition: margin-left 0.22s ease; }

.shell:has(.sidebar.collapsed) .main { margin-left: var(--side-collapsed-w); }

/* ============================================
   AUTH
   ============================================ */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-card .brand { justify-content: center; border: none; margin-bottom: 6px; padding-bottom: 0; }
.auth-title {
    text-align: center;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--paper-dim);
    font-size: 1rem;
    margin-bottom: 30px;
    letter-spacing: 0.04em;
}

.auth-page {
    min-height: 58vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 18px 0 34px;
}
.auth-panel {
    width: 100%;
    max-width: 460px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
}
.auth-panel-wide { max-width: 620px; }
.auth-panel h1 { margin-bottom: 8px; }
.auth-panel > p {
    color: var(--paper-dim);
    margin-bottom: 24px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--paper-mute);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=url], input[type=color], textarea, select {
    width: 100%;
    padding: 11px 14px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

input[type=file] { width: 100%; padding: 8px 0; color: var(--paper-dim); font-size: 0.85rem; }
input[type=file]::file-selector-button {
    background: var(--ink-3); border: 1px solid var(--line); color: var(--paper-dim);
    padding: 8px 14px; border-radius: 6px; cursor: pointer; font-family: var(--font-body); margin-right: 12px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--ink-3);
}

textarea { resize: vertical; min-height: 110px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field-hint { font-size: 0.78rem; color: var(--paper-mute); margin-top: 6px; font-style: italic; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
    color: var(--paper);
    cursor: pointer;
    margin-bottom: 0;
}
.checkbox-row input { width: auto; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px;
    background: var(--accent);
    color: var(--ink);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.btn:hover { background: var(--accent-warm); transform: translateY(-1px); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--ink-3); color: var(--paper); }

.btn-ghost { background: transparent; color: var(--paper-dim); border: none; padding: 8px 14px; }
.btn-ghost:hover { color: var(--paper); background: var(--ink-3); }

.btn-danger { background: var(--danger); color: var(--paper); }
.btn-danger:hover { background: #c45a4b; color: var(--paper); }

.btn-success { background: var(--success); color: var(--ink); border: none; }
.btn-success:hover { background: #8fba78; color: var(--ink); transform: translateY(-1px); }

.btn-danger-ghost { background: transparent; color: var(--danger); border: none; }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); transform: none; }

.btn-warning-ghost { background: transparent; color: var(--accent-warm); border: none; }
.btn-warning-ghost:hover { background: var(--accent-soft); color: var(--accent-warm); transform: none; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   HEADER BELL — notification dropdown
   ============================================ */
.header-bell-wrap { position: relative; display: inline-flex; }
.header-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--paper, #efeae0);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.header-bell-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--line-soft);
}
.header-bell-btn.is-open {
    background: rgba(212,162,76,0.10);
    border-color: rgba(212,162,76,0.4);
    color: var(--accent, #d4a24c);
}
.header-bell-btn .unread-bubble {
    position: absolute;
    top: -2px; right: -4px;
    margin-left: 0;
}

.header-bell-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 100px));
    overflow-y: auto;
    background: var(--ink-2, #1c1d22);
    border: 1px solid var(--line, #2a2b30);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 8px 22px rgba(0,0,0,0.35);
    z-index: 1100;
    animation: bellPanelIn .18s ease;
}
@keyframes bellPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.header-bell-panel[hidden] { display: none; }

.bell-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line-soft, #232427);
}
.bell-panel-head strong {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-mute, #8a8881);
    font-weight: 700;
}
.bell-see-all {
    font-size: 0.78rem;
    color: var(--accent, #d4a24c);
    text-decoration: none;
    font-weight: 600;
}
.bell-see-all:hover { text-decoration: underline; }

.bell-panel-body { padding: 4px 0; }
.bell-panel-loading,
.bell-panel-empty {
    padding: 18px 18px;
    text-align: center;
    color: var(--paper-mute, #8a8881);
    font-size: 0.85rem;
}

.bell-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft, #232427);
    color: var(--paper, #efeae0);
    text-decoration: none;
    transition: background .12s;
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: rgba(255,255,255,0.04); }
.bell-item.is-unread { background: rgba(212,162,76,0.05); }
.bell-item.is-unread:hover { background: rgba(212,162,76,0.09); }
.bell-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.bell-item-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--paper, #efeae0);
    line-height: 1.3;
}
.bell-item.is-unread .bell-item-title { color: var(--accent-warm, #d4a24c); }
.bell-item-time {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--paper-mute, #8a8881);
}
.bell-item-snippet {
    font-size: 0.8rem;
    color: var(--paper-dim, #c9c7c2);
    line-height: 1.45;
    margin: 0;
}
.bell-item-from {
    font-size: 0.74rem;
    color: var(--paper-mute, #8a8881);
    margin-top: 4px;
}
.bell-unread-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #e53935;
    margin-right: 6px;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .header-bell-panel {
        position: fixed;
        top: auto;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

/* ============================================
   UNREAD BUBBLE — Facebook-style red badge
   ============================================ */
.unread-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #e53935;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--ink, #14151a);
    font-family: var(--font-mono, ui-monospace, monospace);
    letter-spacing: 0;
    vertical-align: middle;
    transition: transform .18s ease, opacity .18s ease;
}
.unread-bubble[hidden] { display: none !important; }
.unread-bubble.bump { animation: bubbleBump .45s cubic-bezier(.3,1.5,.5,1); }
@keyframes bubbleBump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}
/* In sidebar nav-items the bubble sits at the far right */
.nav-item .unread-bubble { margin-left: auto; }

/* ============================================
   FLASH / TOAST — centered overlay
   ============================================ */
.flash-stack {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9000;
    width: min(92vw, 440px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}
.flash {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.45;
    border: 1px solid;
    pointer-events: all;
    background: var(--ink-2, #1c1d22);
    box-shadow:
        0 24px 60px rgba(0,0,0,0.55),
        0 8px 22px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: flashIn .25s cubic-bezier(.2,.9,.3,1.2);
    text-align: left;
}
@keyframes flashIn {
    from { opacity: 0; transform: scale(0.92) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.flash.is-leaving { animation: flashOut .22s ease forwards; }
@keyframes flashOut {
    to { opacity: 0; transform: scale(0.96) translateY(-6px); }
}
.flash-icon {
    flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; font-weight: 700;
    background: rgba(255,255,255,0.08);
}
.flash-body { flex: 1; min-width: 0; word-wrap: break-word; }
.flash.success {
    border-color: rgba(127, 168, 107, 0.45);
    color: #cfe6c0;
}
.flash.success .flash-icon { background: rgba(127, 168, 107, 0.18); color: #b8d4a8; }
.flash.error {
    border-color: rgba(217, 107, 92, 0.45);
    color: #f5b8ac;
}
.flash.error .flash-icon { background: rgba(217, 107, 92, 0.18); color: #f0a89c; }
.flash.info {
    border-color: rgba(212, 162, 76, 0.4);
    color: var(--accent-warm, #d4a24c);
}
.flash.info .flash-icon { background: rgba(212, 162, 76, 0.18); color: var(--accent-warm, #d4a24c); }
.flash-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.55;
    padding: 4px;
    color: inherit;
    line-height: 1;
    align-self: flex-start;
}
.flash-close:hover { opacity: 1; }

/* ============================================
   CONTENT-GUARD VIOLATION MODAL (centered, blocking)
   ============================================ */
.cg-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9500;
    padding: 20px;
    animation: cgOverlayIn .2s ease;
}
@keyframes cgOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.cg-modal {
    background: var(--ink-2, #1c1d22);
    border: 1px solid rgba(217, 107, 92, 0.4);
    border-radius: 16px;
    max-width: 520px; width: 100%;
    padding: 30px 28px 24px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: cgModalIn .28s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes cgModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cg-modal-icon { font-size: 2.6rem; margin-bottom: 10px; color: var(--danger, #d96b5c); }
.cg-modal-title {
    font-size: 1.3rem; color: var(--danger, #d96b5c);
    margin: 0 0 12px;
}
.cg-modal-body {
    color: var(--paper-dim, #c9c7c2); font-size: 0.95rem;
    line-height: 1.6; margin: 0 0 16px;
}
.cg-modal-warning-box {
    background: rgba(217, 107, 92, 0.08);
    border: 1px solid rgba(217, 107, 92, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f5b8ac;
    font-size: 0.92rem;
    margin: 0 0 14px;
}
.cg-modal-foot {
    font-size: 0.83rem;
    color: var(--paper-mute, #8a8881);
    margin: 0 0 20px;
    line-height: 1.55;
}
.cg-modal .btn { min-width: 240px; }

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    --page-header-copy-max: 100%;
    margin-bottom: 32px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line-soft);
}
.page-header-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-eyebrow { font-family: var(--font-mono); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.18em; color: var(--accent); margin-bottom: 10px; }
.page-eyebrow.admin { color: #b8b0ff; }
.page-header h1 { margin-bottom: 6px; }
.page-header p {
    color: var(--paper-dim);
    max-width: var(--page-header-copy-max);
}

/* ============================================
   WIZARD
   ============================================ */
.wizard-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--paper-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.progress-bar { flex: 1; height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; max-width: 320px; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }

.wizard-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px; margin-bottom: 14px; }

.q-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 8px; }
.q-title { font-family: var(--font-display); font-style: italic; color: var(--paper-dim); font-size: 1rem; margin-bottom: 18px; }
.q-question { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; margin-bottom: 26px; color: var(--paper); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 7px; margin-bottom: 16px; }
.choice-pill {
    display: block;
    padding: 9px 12px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--paper-dim);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    user-select: none;
    line-height: 1.3;
}
.choice-pill input { display: none; }
.choice-pill:hover { border-color: var(--accent); color: var(--paper); }
.choice-pill.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-warm); }
.choice-pill.custom { border-style: dashed; color: var(--paper-mute); font-style: italic; }

.custom-input-wrapper { margin-top: 14px; display: none; }
.custom-input-wrapper.show { display: block; }

.setup-question-list { display: flex; flex-direction: column; gap: 24px; }
.setup-question { padding: 0 0 24px; border-bottom: 1px solid var(--line-soft); }
.setup-question:last-child { padding-bottom: 0; border-bottom: 0; }
.setup-question h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--paper); }
.setup-question p { margin: 0 0 14px; color: var(--paper-dim); line-height: 1.45; }
.choice-grid.compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }

.idea-preview {
    padding: 14px 16px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--paper);
    line-height: 1.5;
}
.dynamic-compact-list { display: flex; flex-direction: column; gap: 12px; }
.dynamic-compact-item {
    padding: 14px 0 16px;
    border-bottom: 1px solid var(--line-soft);
}
.dynamic-compact-item:last-child { border-bottom: 0; padding-bottom: 0; }
.dynamic-compact-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.dynamic-compact-head span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.12em;
}
.dynamic-compact-head strong { color: var(--paper); font-size: 0.98rem; }
.dynamic-compact-item p {
    margin: 0 0 10px;
    color: var(--paper-dim);
    font-size: 0.92rem;
    line-height: 1.4;
}
.dynamic-options { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-bottom: 0; }
.dynamic-options .choice-pill { padding: 7px 10px; font-size: 0.75rem; border-radius: 6px; }

.form-loading-panel {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--accent-soft);
    border: 1px solid rgba(212, 162, 76, 0.28);
    border-radius: 8px;
    color: var(--accent-warm);
    font-size: 0.92rem;
}
.loading-form.is-loading .form-loading-panel { display: flex; }
.loading-form.is-loading .loading-submit { opacity: 0.72; pointer-events: none; }
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(212, 162, 76, 0.24);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wizard-actions .right-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Review summary */
.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.review-q { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.review-a { color: var(--paper); font-size: 0.95rem; line-height: 1.4; }

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    transition: all 0.18s ease;
    display: flex; flex-direction: column; gap: 10px;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card .status { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); }
.project-card .status.completed { color: var(--success); }
.project-card .status.in_progress { color: var(--accent); }
.project-card .status.generating { color: #b8b0ff; }
.project-card .status.failed { color: var(--danger); }
.status.published { color: var(--success); }
.status.draft { color: var(--accent); }
.status.archived { color: var(--paper-mute); }
.status.pending { color: var(--accent); }
.status.approved { color: var(--success); }
.status.rejected { color: var(--danger); }
.status.hidden,
.status.dismissed { color: var(--paper-mute); }
.status.reviewed { color: var(--success); }
.project-card h3 { font-size: 1.05rem; line-height: 1.3; }
.project-card .meta { color: var(--paper-mute); font-size: 0.82rem; margin-top: auto; }
.project-card .card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.project-card h3 a { color: inherit; text-decoration: none; }
.project-card h3 a:hover { color: var(--accent-warm); }
.project-community-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.project-community-stats span {
    padding: 5px 8px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    color: var(--paper-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}
.project-feedback-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -10px 0 24px;
    padding: 16px 18px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.project-feedback-panel strong,
.project-feedback-panel span { display: block; }
.project-feedback-panel span {
    margin-top: 3px;
    color: var(--paper-mute);
    font-size: 0.82rem;
}
.project-feedback-form {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}
.project-feedback-form label {
    margin: 0;
    color: var(--paper-mute);
    font-size: 0.78rem;
}
.project-feedback-form select {
    width: auto;
    min-width: 130px;
    margin-top: 4px;
}
.project-feedback-form .btn.active {
    border-color: var(--accent);
    color: var(--accent-warm);
}
.account-status-panel .access-approved {
    color: var(--success);
}

.public-projects-header {
    position: relative;
}
.public-projects-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}
.public-project-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -8px auto 30px;
}
.public-project-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--ink-2);
    color: var(--paper-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.public-project-tabs a.active,
.public-project-tabs a:hover {
    border-color: var(--accent);
    color: var(--accent-warm);
    background: var(--accent-soft);
}
.public-project-list {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}
.public-project-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 22px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(245, 239, 228, 0.025), rgba(245, 239, 228, 0)),
        var(--ink-2);
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.public-project-item:hover {
    border-color: rgba(212, 162, 76, 0.55);
    transform: translateY(-1px);
    background:
        linear-gradient(180deg, rgba(212, 162, 76, 0.055), rgba(245, 239, 228, 0)),
        var(--ink-2);
}
.public-project-meta,
.public-project-details {
    display: flex;
    gap: 8px 12px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--paper-mute);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.public-project-meta span,
.public-project-details span {
    display: inline-flex;
    align-items: center;
}
.public-project-meta span + span::before,
.public-project-details span + span::before {
    content: "";
    width: 4px;
    height: 4px;
    margin-right: 12px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.8;
}
.public-project-item h2 {
    margin: 10px 0 8px;
    font-size: clamp(1.24rem, 2vw, 1.62rem);
    line-height: 1.18;
}
.public-project-item h2 a {
    color: var(--paper);
}
.public-project-item h2 a:hover {
    color: var(--accent-warm);
}
.public-project-item p {
    max-width: 680px;
    margin-bottom: 13px;
    color: var(--paper-dim);
    line-height: 1.58;
}
.public-project-score {
    align-self: stretch;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid var(--line-soft);
    text-align: center;
}
.public-project-score strong {
    display: block;
    color: var(--accent-warm);
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
}
.public-project-score span {
    color: var(--paper-mute);
    font-size: 0.76rem;
}
.public-project-score div {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.public-project-score small {
    padding: 4px 7px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--paper-dim);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}
.public-project-score .btn {
    margin-top: 4px;
    justify-content: center;
}
.public-project-pagination {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}
.public-project-pagination span {
    color: var(--paper-mute);
    padding: 0 2px;
}

.draft-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    background: var(--ink-3);
    color: var(--paper-dim);
    text-transform: uppercase;
}

/* ============================================
   OUTPUT PANE
   ============================================ */
.output-pane { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; line-height: 1.65; }
.output-pane h1, .output-pane h2, .output-pane h3 { margin-top: 1.8em; margin-bottom: 0.6em; }
.output-pane h1:first-child, .output-pane h2:first-child, .output-pane h3:first-child { margin-top: 0; }
.output-pane h2 { color: var(--accent-warm); font-size: 1.35rem; }
.output-pane h3 { color: var(--paper); font-size: 1.05rem; }
.output-pane .scene-heading {
    margin-top: 2.2em;
    padding: 12px 14px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.output-pane p { margin-bottom: 1em; color: var(--paper-dim); }
.output-pane ul, .output-pane ol { margin: 0.6em 0 1em 1.4em; color: var(--paper-dim); }
.output-pane li { margin-bottom: 0.3em; }
.output-pane strong { color: var(--paper); font-weight: 600; }
.output-pane code { background: var(--ink-3); padding: 1px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 0.88em; color: var(--accent-warm); }
.output-pane hr { border: none; border-top: 1px solid var(--line-soft); margin: 2em 0; }
.output-pane .md-table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: 0.84rem; overflow-x: auto; display: block; }
.output-pane .md-table th, .output-pane .md-table td { padding: 7px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.output-pane .md-table th { background: var(--ink-3); color: var(--paper); font-weight: 600; white-space: nowrap; }
.output-pane .md-table td { color: var(--paper-dim); }
.output-pane .md-table tbody tr:hover td { background: var(--ink-3); }

/* Character cards (replaces wide pipe-tables like the Character Bible) */
.output-pane .char-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin: 1em 0 1.8em;
}
.output-pane .char-card {
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.output-pane .char-card-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--ink-3);
    border-bottom: 1px solid var(--line);
}
.output-pane .char-num {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-family: var(--font-display);
    white-space: nowrap;
    flex-shrink: 0;
}
.output-pane .char-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--paper);
    line-height: 1.2;
}
.output-pane .char-card-bd {
    padding: 4px 0;
}
.output-pane .char-prop {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--line-soft);
    align-items: start;
}
.output-pane .char-prop:last-child { border-bottom: none; }
.output-pane .char-key {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--paper-mute);
    padding-top: 2px;
}
.output-pane .char-val {
    font-size: 0.86rem;
    color: var(--paper-dim);
    line-height: 1.5;
}

.prompt-block {
    margin: 10px 0 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--ink);
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.prompt-block.is-open {
    border-color: rgba(220, 166, 74, 0.42);
    background: rgba(255,255,255,0.02);
}
.prompt-block-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
    padding: 8px 14px; background: var(--ink-3); border-bottom: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--paper-mute);
}
.prompt-block-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}
.prompt-block-toggle span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prompt-block-caret {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.22s ease;
    opacity: 0.85;
}
.prompt-block.is-open .prompt-block-caret {
    transform: rotate(225deg);
}

.copy-btn {
    background: transparent; border: 1px solid var(--line); color: var(--paper-dim);
    padding: 4px 12px; border-radius: 5px;
    font-family: var(--font-mono); font-size: 0.72rem;
    cursor: pointer; transition: all 0.15s ease; letter-spacing: 0.08em;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.prompt-block-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.prompt-block.is-open .prompt-block-panel {
    grid-template-rows: 1fr;
    opacity: 1;
}
.prompt-block-panel-inner {
    min-height: 0;
    overflow: hidden;
}

.prompt-block pre {
    box-sizing: border-box;
    max-width: 100%;
    margin: 0; padding: 16px 18px;
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.55;
    color: var(--paper);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
}

.scene-anchor { scroll-margin-top: 20px; }

.prompt-scene-slider {
    margin-top: 12px;
    min-width: 0;
}
.sc-slider-track {
    min-width: 0;
}
.sc-slide {
    display: none;
    background: var(--ink);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}
.sc-slide.active { display: block; }

@keyframes scSlideInRight { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scSlideInLeft { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: translateX(0); } }
.sc-slide.anim-in-right { animation: scSlideInRight 0.32s cubic-bezier(0.4, 0, 0.2, 1) both; }
.sc-slide.anim-in-left { animation: scSlideInLeft 0.32s cubic-bezier(0.4, 0, 0.2, 1) both; }

.sc-slide-header {
    background: rgba(255,255,255,0.025);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
}
.sc-slide-tag {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
}
.sc-slide-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--paper);
    font-weight: 600;
    font-size: 0.92rem;
}
.sc-slide-count {
    font-size: 0.75rem;
    color: var(--paper-mute);
    margin-left: auto;
    white-space: nowrap;
}
.sc-scene-body {
    padding: 20px;
    min-width: 0;
}
.sc-scene-body .output-pane {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
}
.sc-scene-body .output-pane .scene-heading:first-child {
    margin-top: 0;
}
.sc-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: nowrap;
}
.sc-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    color: var(--paper);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    flex-shrink: 0;
}
.sc-nav-btn:hover:not(:disabled) {
    background: var(--ink-3);
    border-color: var(--accent);
    color: var(--accent);
}
.sc-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.sc-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    min-width: 0;
}
.sc-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background: var(--line);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    appearance: none;
    line-height: 1;
}
.sc-dot.active {
    background: var(--accent);
    transform: scale(1.4);
}
.sc-progress-wrap {
    flex: 1;
    max-width: 340px;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.sc-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.sc-counter {
    font-size: 0.82rem;
    color: var(--paper-mute);
    white-space: nowrap;
    min-width: 72px;
    text-align: center;
}

.vp-accordion {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}
.vp-item { border-bottom: 1px solid var(--line-soft); }
.vp-item:last-child { border-bottom: none; }
.vp-item-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s;
}
.vp-item-hd:hover,
.vp-item.open > .vp-item-hd { background: var(--ink-2); }
.vp-item-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.vp-scene-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-family: var(--font-display);
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--accent);
}
.vp-scene-tag.muted { color: var(--paper-mute); }
.vp-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--paper);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.vp-item.open > .vp-item-hd .vp-item-title { color: var(--accent-warm); }
.vp-item-plus {
    font-size: 1.45rem;
    font-weight: 200;
    line-height: 1;
    color: var(--paper-mute);
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    transition: transform 0.3s ease, color 0.2s;
    user-select: none;
}
.vp-item.open > .vp-item-hd .vp-item-plus {
    transform: rotate(45deg);
    color: var(--accent);
}
.vp-item-body {
    overflow: hidden;
    height: 0;
    transition: height 0.38s ease;
}
.vp-item-inner {
    padding: 8px 24px 34px;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding-top: 8px !important;
}

.regenerate-panel {
    margin: 0 0 20px;
    padding: 16px 18px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.regenerate-panel summary {
    cursor: pointer;
    color: var(--accent-warm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.regenerate-form { margin-top: 16px; }
.regenerate-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.regen-provider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.regen-provider input { display: none; }
.regen-provider span { flex: 0 0 auto; min-width: 90px; display: flex; align-items: center; gap: 6px; color: var(--paper); font-size: 0.88rem; font-weight: 600; }
.regen-provider select { flex: 1; }
.regen-provider em { color: var(--danger); font-size: 0.74rem; font-style: normal; font-weight: 400; }
.regen-provider.selected { border-color: var(--accent); background: var(--accent-soft); }
.regen-provider.disabled { opacity: 0.55; cursor: default; }

/* ============================================
   GENERATION STATUS / BATCH PROGRESS
   ============================================ */
.generating { text-align: center; padding: 40px 20px; }
.spinner {
    width: 44px; height: 44px;
    border: 2px solid var(--line); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.9s linear infinite; margin: 0 auto 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.batch-progress { max-width: 480px; margin: 20px auto 0; text-align: left; }
.batch-progress h3 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); margin-bottom: 14px; font-weight: 500; }

.batch-bar { height: 6px; background: var(--ink-3); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.batch-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-warm)); transition: width 0.4s ease; }
.batch-status-line { font-family: var(--font-mono); font-size: 0.82rem; color: var(--paper-dim); }

/* ============================================
   PROVIDER PICKER
   ============================================ */
.provider-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.provider-tile {
    padding: 12px 14px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 7px;
    cursor: pointer; transition: all 0.15s ease;
}
.provider-tile.selected { background: var(--accent-soft); border-color: var(--accent); }
.provider-tile h3 { color: var(--paper); margin-bottom: 2px; font-family: var(--font-display); font-size: 0.95rem; }
.provider-tile p { color: var(--paper-mute); font-size: 0.8rem; margin: 0; }
.provider-tile input { display: none; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--paper-mute); }
.empty-state h2 { font-family: var(--font-display); font-style: italic; margin-bottom: 8px; color: var(--paper-dim); }
.empty-state p { margin-bottom: 22px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 36px; }
.stat-tile { background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.stat-tile .label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); margin-bottom: 6px; }
.stat-tile .value { font-family: var(--font-display); font-size: 1.65rem; color: var(--paper); line-height: 1; }

/* Admin tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; font-size: 0.9rem; border-bottom: 1px solid var(--line-soft); }
.data-table th { background: var(--ink-3); color: var(--paper-mute); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }
.data-table .row-actions { display: flex; gap: 6px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: var(--success); }
.status-dot.disabled { background: var(--danger); }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.avatar-large {
    width: 180px; height: 180px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8a6b30);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink); font-weight: 600; font-size: 4rem;
    font-family: var(--font-display); overflow: hidden; margin-bottom: 14px;
    border: 2px solid var(--line);
}
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }

/* Previous answers */
details { margin-top: 14px; }
details summary {
    cursor: pointer; padding: 12px 16px;
    background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px;
    color: var(--paper-dim); font-size: 0.88rem; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸ '; color: var(--accent); margin-right: 6px; transition: transform 0.2s ease; display: inline-block; }
details[open] summary::before { content: '▾ '; }
.previous-answers {
    background: var(--ink-2); border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 8px 8px; padding: 18px 22px; margin-top: -8px;
    font-size: 0.88rem; color: var(--paper-dim);
}
.previous-answers p { margin-bottom: 8px; }
.previous-answers strong { color: var(--paper); }

/* ============================================
   PUBLIC PAGES (landing, legal, contact, errors)
   ============================================ */
.public-body {
    background: var(--ink);
    padding-top: 68px;
    overflow-x: hidden;
}

.public-header {
    padding: 16px 28px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(22, 24, 28, 0.94);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    backdrop-filter: blur(16px);
    transition: padding .22s ease, background-color .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.public-header-inner {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
}

.public-header.is-shrunk {
    padding-top: 10px;
    padding-bottom: 10px;
    background: rgba(13, 14, 16, 0.96);
    border-bottom-color: rgba(212, 162, 76, 0.18);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-right: auto;
    transform-origin: left center;
    transition: transform .22s ease;
}
.public-header.is-shrunk .public-brand { transform: scale(0.94); }

.public-nav { display: flex; gap: 22px; align-items: center; }
.public-nav a { color: var(--paper-dim); font-size: 0.92rem; }
.public-nav a:hover { color: var(--paper); }
.public-nav a.btn { color: var(--ink); }

.public-nav-backdrop { display: none; }

.public-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}
.public-menu-toggle span { display: block; width: 18px; height: 2px; background: var(--paper); margin: 3px 0; }

.public-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 50px 36px 80px;
}

.hero { padding: 40px 0 30px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 3.2rem; line-height: 1.05; margin: 8px 0 14px; }
.hero-tagline { font-family: var(--font-display); font-style: italic; color: var(--paper-dim); font-size: 1.25rem; margin-bottom: 14px; }
.hero-tagline-secondary { color: var(--paper-mute); font-size: 0.95rem; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-top: 50px;
}
.feature {
    padding: 24px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.feature h3 { color: var(--accent-warm); margin-bottom: 8px; }
.feature p { color: var(--paper-dim); font-size: 0.92rem; }

.cta {
    margin-top: 60px; padding: 36px;
    border: 1px dashed var(--line);
    border-radius: 12px; text-align: center;
}
.cta h2 { margin-bottom: 8px; }
.cta p { color: var(--paper-dim); }

/* ============================================
   SEARCH
   ============================================ */

/* Header search button */
.header-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    color: var(--paper-dim);
    transition: color .15s, border-color .15s, background .15s, transform .15s;
    flex-shrink: 0;
}
.header-search-btn:hover {
    color: var(--paper);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

/* Search overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s;
}
.search-overlay.open {
    pointer-events: auto;
    opacity: 1;
}
.search-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 14, 16, 0.82);
    backdrop-filter: blur(4px);
}
.search-overlay-box {
    position: relative;
    width: min(660px, calc(100vw - 32px));
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    overflow: hidden;
    transform: translateY(-12px);
    transition: transform .18s;
}
.search-overlay.open .search-overlay-box {
    transform: translateY(0);
}
.search-overlay-form {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
}
.search-overlay-icon {
    color: var(--paper-mute);
    flex-shrink: 0;
    margin-right: 10px;
}
.search-overlay-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 18px 0;
    appearance: none;
}
.search-overlay-input::placeholder { color: var(--paper-mute); }
.search-overlay-input::-webkit-search-cancel-button { display: none; }
.search-overlay-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    color: var(--paper-mute);
    flex-shrink: 0;
    transition: color .12s, border-color .12s;
}
.search-overlay-close:hover { color: var(--paper); border-color: var(--paper-dim); }
.search-overlay-hint {
    padding: 10px 18px;
    font-size: 0.78rem;
    color: var(--paper-mute);
    font-family: var(--font-mono);
}
.search-overlay-hint kbd {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--paper-dim);
}

/* Search hero (results page top bar) */
.search-hero {
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 0;
}
.search-hero-form {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: 700px;
}
.search-hero-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color .15s, box-shadow .15s;
}
.search-hero-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-hero-icon {
    color: var(--paper-mute);
    flex-shrink: 0;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    min-width: 18px;
}
.search-hero-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 12px 0;
    appearance: none;
    min-width: 0;
}
.search-hero-input::placeholder { color: var(--paper-mute); }
.search-hero-input::-webkit-search-cancel-button { display: none; }
.search-clear-btn {
    display: inline-flex;
    align-items: center;
    color: var(--paper-mute);
    padding: 4px;
    border-radius: 4px;
    transition: color .12s;
    flex-shrink: 0;
}
.search-clear-btn:hover { color: var(--paper); }

/* Filter tabs */
.search-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 14px 0 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line-soft);
}
.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.88rem;
    color: var(--paper-dim);
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    text-decoration: none;
    transition: color .12s, background .12s;
    position: relative;
    bottom: -1px;
}
.search-tab:hover { color: var(--paper); background: var(--ink-3); }
.search-tab.active {
    color: var(--accent);
    background: var(--ink);
    border-color: var(--line-soft);
    border-bottom-color: var(--ink);
}
.search-tab-count {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--paper-mute);
}
.search-tab.active .search-tab-count { color: var(--accent); border-color: var(--accent-soft); }

/* Stats line */
.search-stats {
    font-size: 0.82rem;
    color: var(--paper-mute);
    padding: 12px 0 18px;
    font-family: var(--font-mono);
}
.search-stats strong { color: var(--paper-dim); }

/* Results list */
.search-results {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.search-result {
    padding: 22px 0;
    border-bottom: 1px solid var(--line-soft);
}
.search-result:last-child { border-bottom: none; }

.search-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.search-result-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.search-result-badge--blog {
    background: var(--accent-soft);
    color: var(--accent-warm);
    border: 1px solid rgba(212,162,76,.25);
}
.search-result-badge--tip {
    background: var(--success-soft);
    color: #a8d498;
    border: 1px solid rgba(127,168,107,.25);
}
.search-result-badge--question {
    background: var(--admin-soft);
    color: #b8b0ff;
    border: 1px solid rgba(138,127,255,.25);
}
.search-result-breadcrumb {
    font-size: 0.78rem;
    color: var(--paper-mute);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-title {
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 6px;
}
.search-result-title a {
    color: var(--paper);
    text-decoration: none;
    transition: color .12s;
}
.search-result-title a:hover { color: var(--accent-warm); text-decoration: underline; text-underline-offset: 3px; }
.search-result-snippet {
    font-size: 0.9rem;
    color: var(--paper-dim);
    line-height: 1.55;
    margin-bottom: 8px;
}
.search-result-meta {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--paper-mute);
    font-family: var(--font-mono);
}

/* Highlight */
mark {
    background: rgba(212, 162, 76, 0.22);
    color: var(--accent-warm);
    border-radius: 2px;
    padding: 0 1px;
}

/* Pagination ellipsis */
.search-pg-ellipsis {
    display: inline-flex;
    align-items: center;
    color: var(--paper-mute);
    padding: 0 4px;
    font-size: 0.9rem;
}
.search-pagination { margin-top: 32px; }

/* Empty + landing states */
.search-empty { padding: 60px 20px; }
.search-landing {
    padding: 60px 0 40px;
    text-align: center;
}
.search-landing-hint {
    color: var(--paper-mute);
    margin-bottom: 32px;
    font-size: 0.95rem;
}
.search-landing-cats {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.search-landing-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 36px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--paper-dim);
    text-decoration: none;
    min-width: 140px;
    transition: border-color .15s, color .15s, background .15s;
}
.search-landing-cat:hover {
    border-color: var(--accent);
    color: var(--paper);
    background: var(--ink-3);
}
.search-landing-cat span {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--paper);
}
.search-landing-cat small {
    color: var(--paper-mute);
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .search-hero-form { max-width: 100%; }
}
@media (max-width: 640px) {
    .search-result-title { font-size: 1.05rem; }
    .search-tabs { gap: 2px; }
    .search-tab { padding: 7px 12px; font-size: 0.82rem; }
    .search-landing-cats { flex-direction: column; align-items: center; }
    .search-landing-cat { width: 100%; max-width: 260px; }
}

/* Homepage news front */
.home-news-main {
    --home-box-radius: 8px;
    --home-box-border: 1px solid var(--line);
    --home-soft-border: 1px solid var(--line-soft);
    max-width: none;
    width: 100%;
    padding: 0;
    background: var(--ink);
    color: var(--paper);
}
.home-news-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 36px 64px;
}
.home-news-shell a {
    color: inherit;
}
.home-news-shell a:hover {
    color: var(--accent-warm);
}
.home-news-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 44px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--paper-mute);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
.home-news-strip-label,
.home-news-strip-more {
    color: var(--paper);
}
.home-news-strip-label::after,
.home-module-title h1::after,
.home-module-title h2::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 3px;
    margin-left: 10px;
    vertical-align: middle;
    background: var(--accent);
}
.home-news-strip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    min-width: 0;
}
.home-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 28px;
    align-items: start;
}
.home-news-content,
.home-news-sidebar {
    min-width: 0;
}
.home-news-module,
.home-side-widget {
    margin-bottom: 32px;
}
.home-side-widget {
    padding: 18px;
    background: var(--ink-2);
    border: var(--home-box-border);
    border-radius: var(--home-box-radius);
}
.home-news-sidebar .home-side-widget {
    padding: 20px;
}
.home-module-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.home-module-title h1,
.home-module-title h2 {
    margin: 0;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}
.home-module-title a {
    color: var(--paper-mute);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}
.home-trending-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) repeat(2, minmax(180px, 0.72fr));
    grid-auto-rows: minmax(170px, 1fr);
    gap: 12px;
}
.home-overlay-card {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    background: var(--ink-3);
    border: var(--home-soft-border);
    border-radius: var(--home-box-radius);
}
.home-overlay-card.is-lead {
    grid-row: span 2;
    min-height: 360px;
}
.home-overlay-media {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--ink-3), #2a2e36);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 2.7rem;
}
.home-overlay-media span {
    opacity: 0.16;
    transform: translateY(-18px);
}
.home-overlay-card.is-lead .home-overlay-media span {
    font-size: 4.8rem;
    opacity: 0.12;
    transform: translate(78px, -34px);
}
.home-overlay-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-overlay-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.36) 42%, rgba(0,0,0,0.9) 100%),
        linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.48) 48%, rgba(0,0,0,0) 78%);
    pointer-events: none;
}
.home-overlay-copy {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 1;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.home-overlay-copy h2 {
    margin: 7px 0 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.18;
}
.home-overlay-card.is-lead .home-overlay-copy {
    left: 22px;
    right: 22px;
    bottom: 20px;
}
.home-overlay-card.is-lead h2 {
    max-width: 620px;
    font-size: clamp(1.55rem, 2.7vw, 2rem);
    font-weight: 600;
    line-height: 1.14;
}
.home-overlay-copy p {
    max-width: 640px;
    margin: 0 0 8px;
    color: rgba(255,255,255,0.92);
    line-height: 1.48;
}
.home-news-meta {
    color: var(--paper-mute);
    font-size: 0.66rem;
    font-weight: 550;
    letter-spacing: 0.045em;
}
.home-overlay-copy .home-news-meta {
    color: rgba(255,255,255,0.9);
}
.home-news-meta span + span::before {
    background: currentColor;
    opacity: 0.55;
}
.home-news-main .post-flag-row {
    margin: 0 0 5px;
}
.home-news-main .post-flag {
    min-height: 18px;
    padding: 3px 7px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.045em;
}
.home-news-main .post-flag.featured {
    background: var(--ink-3);
    color: var(--accent-warm);
}
.home-news-main .post-flag.sticky {
    background: var(--admin-soft);
    color: #b8b0ff;
}
.home-category-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
    gap: 22px;
}
.home-category-image,
.home-latest-image,
.home-list-thumb {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ink-3), #2a2e36);
    border: var(--home-soft-border);
    border-radius: var(--home-box-radius);
    color: var(--accent);
    font-family: var(--font-display);
}
.home-category-image {
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
}
.home-category-image img,
.home-latest-image img,
.home-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-category-lead h3,
.home-latest-card h3,
.home-list-item h3,
.home-plain-item h3 {
    margin: 7px 0 0;
    color: var(--paper);
    font-weight: 600;
    line-height: 1.22;
}
.home-category-lead h3 {
    font-size: 1.35rem;
}
.home-category-lead p,
.home-latest-card p {
    margin: 8px 0 0;
    color: var(--paper-dim);
    line-height: 1.55;
}
.home-category-list,
.home-side-list {
    display: grid;
    gap: 14px;
}
.home-list-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
}
.home-news-sidebar .home-list-item {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    padding-bottom: 12px;
}
.home-list-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.home-list-thumb {
    width: 96px;
    height: 72px;
    font-size: 1.35rem;
}
.home-news-sidebar .home-list-thumb {
    width: 78px;
    height: 58px;
    font-size: 1.18rem;
}
.home-list-item h3 {
    font-size: 0.92rem;
}
.home-news-sidebar .home-list-item h3,
.home-news-sidebar .home-plain-item h3 {
    font-size: 0.86rem;
    line-height: 1.24;
}
.home-news-sidebar .home-news-meta {
    gap: 6px 9px;
    font-size: 0.58rem;
}
.home-latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.home-latest-card {
    background: var(--ink-2);
    border: var(--home-box-border);
    border-radius: var(--home-box-radius);
    overflow: hidden;
}
.home-latest-image {
    aspect-ratio: 16 / 10;
    border-width: 0 0 1px;
    border-radius: 0;
    font-size: 1.8rem;
}
.home-latest-body {
    padding: 14px;
}
.home-latest-card h3 {
    font-size: 1.04rem;
}
.home-latest-card p {
    font-size: 0.9rem;
}
.home-follow-widget {
    display: grid;
    gap: 8px;
}
.home-follow-widget .home-module-title {
    margin-bottom: 6px;
}
.home-follow-widget a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--ink-3);
    color: var(--paper);
    border: var(--home-soft-border);
    border-radius: var(--home-box-radius);
    font-weight: 600;
}
.home-follow-widget a:nth-of-type(2) { background: rgba(138,127,255,0.12); color: #d7d2ff; }
.home-follow-widget a:nth-of-type(3) { background: rgba(217,107,92,0.12); color: #f0b0a7; }
.home-follow-widget a:nth-of-type(4) { background: rgba(127,168,107,0.12); color: #c6ddb9; }
.home-follow-widget span {
    color: rgba(255,255,255,0.78);
    font-size: 0.74rem;
    font-weight: 600;
}
.home-plain-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}
.home-news-sidebar .home-plain-item {
    padding: 12px 0 13px;
}
.home-plain-item:last-child {
    border-bottom: 0;
}
.home-plain-item h3 {
    font-size: 0.92rem;
}
.home-category-pills {
    display: grid;
    gap: 8px;
}
.home-category-pills a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--ink-3);
    color: var(--paper-dim);
    border: var(--home-soft-border);
    border-radius: var(--home-box-radius);
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}
.home-category-pills span {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 24px;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.72rem;
}

@media (max-width: 1100px) {
    .home-news-layout {
        grid-template-columns: 1fr;
    }
    .home-news-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
    .home-side-widget {
        margin-bottom: 0;
    }
    .detail-page-layout {
        grid-template-columns: 1fr;
    }
    .detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
    .detail-sidebar .home-side-widget {
        margin-bottom: 0;
    }
}
@media (max-width: 860px) {
    .home-news-shell {
        padding: 20px 20px 48px;
    }
    .home-news-strip {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 14px;
    }
    .home-trending-grid {
        grid-template-columns: 1fr 1fr;
    }
    .home-overlay-card.is-lead {
        grid-column: 1 / -1;
        min-height: 330px;
    }
    .home-category-layout,
    .home-latest-grid,
    .home-news-sidebar {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .home-news-shell {
        padding-left: 14px;
        padding-right: 14px;
    }
    .home-trending-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .home-overlay-card,
    .home-overlay-card.is-lead {
        min-height: 245px;
    }
    .home-overlay-card.is-lead h2 {
        font-size: 1.35rem;
    }
    .home-list-item {
        grid-template-columns: 84px minmax(0, 1fr);
    }
    .home-list-thumb {
        width: 84px;
        height: 64px;
    }
    .home-side-widget {
        padding: 14px;
    }
}

/* News-style homepage and blog */
.news-home-hero { padding: 10px 0 28px; }
.news-home-kicker {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--line);
    color: var(--paper-mute);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.news-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
    gap: 30px;
}
.top-story {
    display: grid;
    gap: 14px;
}
.top-story-image,
.news-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1d2026, #2e3240);
    border: 1px solid var(--line);
    color: var(--accent-warm);
    position: relative;
}
.news-card-image .post-flag-row {
    position: absolute;
    top: 8px;
    left: 8px;
    margin: 0;
    gap: 4px;
    z-index: 2;
}
.news-card-image .post-flag {
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,.55);
    border-color: rgba(255,255,255,.15);
    color: #fff;
    font-size: 0.62rem;
}
.news-card-image .post-flag.breaking { background: rgba(255,94,80,.75); color: #fff; border-color: transparent; }
.news-card-image .post-flag.featured { background: rgba(222,169,77,.75); color: #0d0d11; border-color: transparent; }
.news-card-image .post-flag.sticky   { background: rgba(99,120,255,.75); color: #fff; border-color: transparent; }
.top-story-image {
    min-height: 330px;
    border-radius: 8px;
}
.top-story-image img,
.news-card-image img,
.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.top-story-image span,
.news-card-image span {
    font-family: var(--font-display);
    font-size: 2rem;
}
.top-story h1 {
    font-size: 3rem;
    max-width: 820px;
}
.top-story h1 a,
.news-card h2 a,
.editor-picks h3 a { color: var(--paper); }
.top-story h1 a:hover,
.news-card h2 a:hover,
.editor-picks h3 a:hover { color: var(--accent-warm); }
.top-story p,
.editor-picks p,
.news-card p,
.news-page-header p,
.article-header p { color: var(--paper-dim); }
.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: #c7bea9;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
.news-meta span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 10px 1px 0;
    border-radius: 50%;
    background: var(--accent);
}
.post-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 2px;
}
.post-flag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid rgba(222, 169, 77, 0.32);
    border-radius: 999px;
    background: rgba(222, 169, 77, 0.12);
    color: var(--accent-warm);
    font-family: var(--font-body);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1;
    text-transform: uppercase;
}
.post-flag.breaking {
    border-color: rgba(255, 94, 80, 0.42);
    background: rgba(255, 94, 80, 0.13);
    color: #ff887d;
}
.post-flag.sticky {
    border-color: rgba(126, 156, 255, 0.38);
    background: rgba(126, 156, 255, 0.12);
    color: #aebdff;
}
.status.active,
.status.sent {
    background: rgba(37, 211, 102, 0.12);
    color: #7ee0a0;
}
.status.unsubscribed,
.status.draft {
    background: rgba(170, 160, 141, 0.12);
    color: var(--paper-mute);
}
.editor-picks {
    border-left: 1px solid var(--line-soft);
    padding-left: 24px;
}
.editor-picks h2 {
    font-size: 1rem;
    font-family: var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c7bea9;
    margin-bottom: 12px;
}
.editor-picks article {
    padding: 16px 0;
    border-top: 1px solid var(--line-soft);
}
.editor-picks h3 {
    font-size: 1.2rem;
    margin: 8px 0;
}
.tool-strip,
.homepage-cta,
.news-empty-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 36px 0;
    padding: 26px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.tool-strip p,
.homepage-cta p,
.news-empty-panel p { color: var(--paper-dim); }
.tool-strip h2,
.homepage-cta h2 { margin-bottom: 6px; }
.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 46px 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
}
.news-page-header {
    padding-bottom: 22px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 28px;
}
.news-page-header h1 { font-size: 3rem; margin-bottom: 8px; }
.custom-page-shell {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 58px 0 76px;
}
.custom-page-hero {
    padding: 36px 0 28px;
    border-bottom: 1px solid var(--line);
}
.custom-page-hero h1 {
    max-width: 860px;
    margin: 12px 0 10px;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.95;
}
.custom-page-hero p {
    max-width: 680px;
    color: var(--paper-dim);
    font-size: 1.05rem;
    line-height: 1.7;
}
.custom-page-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 28px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.custom-page-empty h2 {
    margin-bottom: 6px;
    font-size: 1.35rem;
}
.custom-page-empty p {
    max-width: 620px;
    color: var(--paper-mute);
}
.custom-page-empty-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    color: var(--accent-warm);
    background: rgba(212, 162, 76, 0.1);
    border: 1px solid rgba(212, 162, 76, 0.28);
    border-radius: 8px;
}
.custom-page-empty-icon svg {
    width: 22px;
    height: 22px;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.news-grid.compact { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.news-card {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.news-card-image {
    aspect-ratio: 16 / 9;
    border: 0;
    border-bottom: 1px solid var(--line);
}
.news-card-body { padding: 18px; }
.news-card h2 {
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 10px 0 8px;
}
.news-card .prompt-gallery-excerpt {
    margin: 0 0 10px;
    color: var(--paper-dim);
    font-size: 0.94rem;
    line-height: 1.5;
}
.news-card .community-index-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: #c7bea9;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
.news-card .community-index-meta span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 10px 1px 0;
    border-radius: 50%;
    background: var(--accent);
}
.news-card-body > div[style*="align-items:flex-start"] {
    display: block !important;
}
.news-card-body > div[style*="flex-wrap:wrap"] span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border: 1px solid rgba(222, 169, 77, 0.32);
    background: rgba(222, 169, 77, 0.12) !important;
    color: var(--accent-warm);
    font-family: var(--font-body) !important;
    font-size: 0.66rem !important;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
/* ── Detail page layout: individual item pages with sidebar ── */
.detail-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}
.detail-main,
.detail-sidebar {
    min-width: 0;
}
.detail-sidebar .home-side-widget {
    margin-bottom: 24px;
}
.detail-sidebar .home-side-widget:last-child {
    margin-bottom: 0;
}

.article-shell {
    max-width: 820px;
    margin: 0 auto;
}
.article-back {
    display: inline-flex;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.article-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line-soft);
}
.article-header h1 {
    font-size: 3.1rem;
    margin: 12px 0;
}
.article-hero-image {
    aspect-ratio: 16 / 9;
    margin: 28px 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.article-content {
    color: var(--paper-dim);
    font-size: 1.04rem;
    line-height: 1.8;
}
.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.7em 0 0.5em;
    color: var(--paper);
}
.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre { margin-bottom: 1.1em; }
.article-content ul,
.article-content ol { margin-left: 1.3em; }
.article-content blockquote {
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: var(--ink-2);
    color: var(--paper);
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
}
.article-tags span {
    padding: 5px 10px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--paper-dim);
    font-size: 0.82rem;
}
.related-news {
    margin-top: 54px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
}
.related-news h2 { margin-bottom: 18px; }

@media (max-width: 1100px) {
    .detail-page-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
    .detail-sidebar .home-side-widget {
        margin-bottom: 0;
    }
}

@media (max-width: 760px) {
    .detail-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Frontend account area */
.account-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.account-nav {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 6px;
    padding: 18px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.account-nav a {
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--paper-dim);
}
.account-nav a:hover,
.account-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-warm);
}
.account-nav a.locked {
    opacity: 0.55;
}
.account-mini-profile {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}
.account-mini-profile strong,
.account-mini-profile span {
    display: block;
    line-height: 1.25;
}
.account-mini-profile span {
    color: var(--paper-mute);
    font-size: 0.8rem;
}
.account-content { min-width: 0; }
.account-status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 26px;
    margin-bottom: 24px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.account-status-panel p { color: var(--paper-dim); }
.account-status-panel h2 { margin-bottom: 6px; }
.account-tool-strip { margin-top: 10px; }

/* ── Fair Use Rules panel ───────────────────────────────────────────────── */
.fair-use-panel {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px 26px;
    margin-top: 8px;
    margin-bottom: 14px;
}
.fair-use-rules { flex: 1; min-width: 200px; }
.fair-use-rules-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--paper);
    margin: 8px 0 12px;
}
.fair-use-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fair-use-list li {
    display: grid;
    grid-template-columns: 7px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 0.82rem;
    color: var(--paper-mute);
    line-height: 1.55;
}
.fair-use-list li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 7px;
}
.fair-use-counter {
    text-align: center;
    min-width: 118px;
    flex-shrink: 0;
    padding: 18px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--line-soft);
    border-radius: 9px;
}
.fair-use-counter-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--paper-mute);
    margin-bottom: 8px;
}
.fair-use-counter-num {
    font-family: var(--font-display);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.fair-use-counter-num sup {
    font-size: 1rem;
    font-weight: 400;
    color: var(--paper-mute);
    vertical-align: baseline;
    margin-left: 1px;
}
.fair-use-counter-sub {
    font-size: 0.74rem;
    color: var(--paper-mute);
    line-height: 1.45;
    margin-bottom: 12px;
    min-height: 2.1em;
}
.fair-use-pips {
    display: flex;
    gap: 4px;
    justify-content: center;
}
.fair-use-pip {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--line-soft);
    transition: background 0.2s;
}
.fair-use-pip.used  { background: var(--accent); }
.fair-use-pip.limit { background: var(--danger); }

.quota-request-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: 9px;
}
.quota-request-form { display: flex; flex-direction: column; gap: 8px; }
.quota-request-form textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--paper);
    font-size: 0.83rem;
    resize: vertical;
    min-height: 58px;
    box-sizing: border-box;
}
.quota-request-pending {
    border-color: rgba(212,162,76,0.4);
    background: rgba(212,162,76,0.06);
}
.quota-request-approved {
    border-color: rgba(76,185,128,0.4);
    background: rgba(76,185,128,0.06);
}

.prompt-access-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    color: var(--paper-mute);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.prompt-access-badge.approved { color: var(--success); border-color: rgba(127,168,107,0.4); background: var(--success-soft); }
.prompt-access-badge.safe { color: var(--success); border-color: rgba(127,168,107,0.4); background: var(--success-soft); }
.prompt-access-badge.warning { color: var(--accent); border-color: rgba(212,162,76,0.4); background: rgba(212,162,76,0.1); }
.prompt-access-badge.needs_review { color: #b8b0ff; border-color: rgba(138,127,255,0.35); background: var(--admin-soft); }
.prompt-access-badge.likely_abuse,
.prompt-access-badge.error { color: var(--danger); border-color: rgba(211,95,95,0.4); background: var(--danger-soft); }
.prompt-access-badge.requested { color: var(--accent-warm); border-color: rgba(212,162,76,0.4); background: var(--accent-soft); }
.prompt-access-badge.rejected { color: var(--danger); border-color: rgba(217,107,92,0.4); background: var(--danger-soft); }

/* Blog comments */
.comments-section {
    max-width: 820px;
    margin: 52px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
}
.comment-form {
    padding: 20px;
    margin-bottom: 24px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.comment-form textarea { min-height: 120px; margin-bottom: 12px; }
.comment-list {
    display: grid;
    gap: 16px;
}
.comment-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line-soft);
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.comment-head span,
.comment-manage-link { color: var(--paper-mute); font-size: 0.82rem; }
.comment-item p { color: var(--paper-dim); }
.comment-manage-list {
    display: grid;
    gap: 16px;
}
.comment-manage-item h2 {
    font-size: 1.15rem;
    margin: 8px 0 14px;
}
.comment-manage-item textarea { min-height: 110px; }

.public-content-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 0 60px;
}

.community-index-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.community-index-item {
    display: block;
    padding: 12px 18px;
    background: var(--ink-2);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
    border: 1px solid var(--line);
}
.community-index-item:hover { background: var(--ink-3); }
.community-index-title {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--paper);
    margin-bottom: 5px;
    line-height: 1.4;
}
.prompt-gallery-excerpt {
    margin: -1px 0 7px;
    color: var(--paper-dim);
    font-size: 0.88rem;
    line-height: 1.5;
}
.prompt-gallery-shell .community-index-list {
    gap: 8px;
}
.prompt-gallery-shell .page-header {
    margin-bottom: 18px;
}
.prompt-gallery-item {
    padding: 16px 18px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
        var(--ink-2);
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.prompt-gallery-item.has-thumb {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 18px;
}
.prompt-gallery-item:hover {
    border-color: rgba(230, 185, 94, 0.34);
    background:
        linear-gradient(180deg, rgba(230,185,94,0.055), rgba(255,255,255,0.018)),
        var(--ink-2);
    box-shadow: 0 14px 34px rgba(0,0,0,0.20);
    transform: translateY(-1px);
}
.pg-thumb {
    flex-shrink: 0;
    width: 132px;
    aspect-ratio: 16 / 10;
    height: auto;
    border-radius: 7px;
    overflow: hidden;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
}
.pg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pg-text { flex: 1; min-width: 0; }
.prompt-gallery-item .community-index-title {
    font-size: 1.02rem;
    margin-bottom: 7px;
    max-width: 100%;
}
.prompt-gallery-item:hover .community-index-title {
    color: var(--accent-warm);
}

/* Prompt cover image — view_project.php owner UI */
.prompt-cover-box {
    margin: 0 0 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.prompt-cover-preview img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
}
.prompt-cover-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
}
.prompt-cover-upload { display: block; }
.prompt-cover-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 20px;
    cursor: pointer;
    color: var(--paper-mute);
    transition: background .15s, color .15s;
}
.prompt-cover-dropzone:hover { background: var(--ink-3); color: var(--paper-dim); }
.prompt-cover-dropzone span { font-size: .88rem; }
.prompt-cover-dropzone .field-hint { font-size: .78rem; }

/* Prompt detail page — prompt.php */
.prompt-page-shell {
    width: min(100% - 48px, 1180px);
    margin: 0 auto;
    padding: 54px 0 80px;
}
.prompt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent-warm);
    margin-bottom: 18px;
    font-weight: 650;
    text-decoration: none;
}
.prompt-back-link::before { content: '←'; }
.prompt-detail-page {
    display: grid;
    gap: 22px;
}
.prompt-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.026), rgba(255,255,255,0.012)),
        var(--ink-2);
}
.prompt-detail-hero:not(.has-cover) {
    grid-template-columns: 1fr;
}
.prompt-detail-cover {
    min-height: 360px;
    background: var(--ink-3);
    overflow: hidden;
    line-height: 0;
}
.prompt-detail-cover img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}
.prompt-detail-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    min-width: 0;
}
.prompt-detail-intro h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.05;
    margin: 6px 0 12px;
    max-width: 12ch;
}
.prompt-detail-byline {
    color: var(--paper-mute);
    margin: 0;
}

/* ── Layout toggle button group ─────────────────────────────────────────── */
.layout-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px;
    margin-left: auto;
    flex-shrink: 0;
}
.layout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--paper-mute);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    min-height: 0;
}
.layout-btn:hover { background: var(--ink-3); color: var(--paper); }
.layout-btn.active { background: var(--accent); color: #000; }

/* ── Community cards layout ──────────────────────────────────────────────── */
.community-index-list.layout-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.community-index-list.layout-cards .community-index-item {
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
}
.community-index-list.layout-cards .prompt-gallery-item.has-thumb {
    gap: 14px;
    align-items: stretch;
}
.community-index-list.layout-cards .prompt-gallery-item .pg-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}
.community-index-list.layout-cards .community-index-title {
    font-size: 1.05rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 2px 0 10px;
}
.community-index-list.layout-cards .prompt-gallery-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.community-index-list.layout-cards .community-index-meta { flex-wrap: wrap; gap: 4px 10px; margin-top: auto; }

/* ── Blog layout classes ──────────────────────────────────────────────────── */
.news-grid.layout-list {
    grid-template-columns: 1fr !important;
    gap: 10px;
}
.news-grid.layout-list .news-card {
    display: flex;
    flex-direction: row;
    min-height: 0;
}
.news-grid.layout-list .news-card-image {
    width: 180px;
    min-width: 180px;
    height: 118px;
    aspect-ratio: unset;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
}
.news-grid.layout-list .news-card-body { padding: 12px 16px; flex: 1; }
.news-grid.layout-list .news-card h2 { font-size: 1rem; margin: 4px 0 6px; }
.news-grid.layout-list .news-card p {
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-grid.layout-list  { grid-template-columns: 1fr !important; }
.news-grid.layout-grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
.news-grid.layout-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
.my-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}
.my-prompt-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.my-prompt-item:hover {
    background: var(--ink-3);
    border-color: rgba(212, 162, 76, 0.42);
    transform: translateY(-1px);
}
.my-prompt-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.my-prompt-status span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: 1px;
}
.my-prompt-main h2 {
    margin: 0 0 8px;
    color: var(--paper);
    font-size: 1.08rem;
    line-height: 1.25;
}
.my-prompt-main p {
    margin: 0 0 10px;
    color: var(--paper-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}
.my-prompt-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--paper-mute);
    font-size: 0.8rem;
}
.my-prompt-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.community-index-meta {
    display: flex;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--paper-mute);
    flex-wrap: wrap;
}

.community-login-hint {
    font-size: 0.86rem;
    color: var(--paper-mute);
    margin: 12px 0 0;
}
.community-login-hint a { color: var(--accent); }

/* Community tips and questions */
.community-form textarea { min-height: 120px; }
.community-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--paper-mute);
    font-size: 0.86rem;
}
.community-list {
    display: grid;
    gap: 18px;
}
.community-card {
    padding: 22px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.community-card.is-unread {
    border-color: rgba(212, 162, 76, 0.55);
    background: linear-gradient(180deg, rgba(212, 162, 76, 0.08), var(--ink-2));
}
.community-card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.community-card-head strong,
.community-card-head span {
    display: block;
}
.community-card-head span {
    color: var(--paper-mute);
    font-size: 0.82rem;
}
.community-card p {
    color: var(--paper-dim);
    white-space: pre-line;
}
.tip-rating {
    flex-shrink: 0;
    font-family: var(--font-mono);
    color: var(--accent-warm);
    font-size: 0.82rem;
}
.tip-rating span { color: var(--paper-mute); }
.prompt-detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0 0;
}
.prompt-detail-meta span {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--paper-dim);
    background: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}
.prompt-summary-box {
    margin: 0;
    padding: 22px 24px;
    background:
        linear-gradient(180deg, rgba(230,185,94,0.055), rgba(255,255,255,0.014)),
        var(--ink-2);
    border: 1px solid rgba(230,185,94,0.18);
    border-radius: 8px;
}
.prompt-summary-box p:last-child {
    margin: 0;
    color: var(--paper-dim);
    line-height: 1.65;
}
.prompt-full-box {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink-2);
    overflow: hidden;
}
.prompt-full-box pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper-dim);
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.7;
}
.prompt-full-box .prompt-block pre {
    box-sizing: border-box;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
    padding: 16px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--paper);
    line-height: 1.55;
}
.community-inline-form {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0 0;
}
.community-inline-form label {
    margin: 0;
    align-self: center;
}
.community-inline-form select {
    width: auto;
    min-width: 78px;
}
.community-inline-form input[type="text"] {
    min-width: min(320px, 100%);
}
.community-comments {
    margin-top: 18px;
}
.community-comments summary {
    background: var(--ink-3);
}
.report-box {
    margin-top: 12px;
}
.report-box summary {
    color: var(--paper-mute);
    font-size: 0.82rem;
    background: transparent;
    border: 0;
    padding: 0;
}
.community-comment,
.community-answer {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}
.community-comment strong,
.community-answer strong {
    color: var(--paper);
}
.community-answer > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.community-answer span {
    color: var(--accent-warm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.community-comment-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.community-comment-form textarea {
    min-height: 90px;
}

.menu-page-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.menu-quick-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}
.menu-drag-handle {
    cursor: grab;
}
.menu-item.menu-dragging {
    opacity: .55;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.menu-drag-placeholder {
    margin-bottom: 5px;
    border: 1px dashed var(--accent);
    border-radius: 8px;
    background: var(--accent-soft);
    list-style: none;
}

/* Blog editor */
.blog-admin-tabs,
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.pagination { justify-content: center; margin-top: 22px; }
.pagination-ellipsis { display:flex; align-items:center; padding: 0 4px; color: var(--paper-mute); font-size: 0.9rem; }
.blog-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.blog-editor-main textarea[name="content"] { min-height: 520px; }
.blog-editor-sidebar {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 22px;
}
.blog-editor-sidebar .wizard-card,
.blog-editor-main.wizard-card { padding: 24px; }
.blog-editor-sidebar h2 {
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.blog-feature-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.blog-seo-box summary {
    background: var(--ink-3);
}
.blog-seo-fields {
    padding: 18px 0 0;
}
.rich-editor {
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.rich-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--ink-3);
    border-bottom: 1px solid var(--line);
}
.rich-editor-toolbar button,
.rich-format-select {
    min-height: 34px;
    padding: 7px 10px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--paper-dim);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
}
.rich-format-select {
    width: auto;
    min-width: 138px;
}
.rich-editor-toolbar button:hover,
.rich-format-select:hover,
.rich-editor-toolbar button.active {
    color: var(--accent-warm);
    border-color: rgba(212, 162, 76, 0.45);
}
.rich-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
    margin: 0 2px;
}
.rich-editor-surface {
    min-height: 520px;
    padding: 18px;
    color: var(--paper);
    line-height: 1.75;
    outline: none;
    overflow-y: auto;
}
.rich-editor-surface:focus {
    box-shadow: inset 0 0 0 1px rgba(212, 162, 76, 0.38);
}
.rich-editor-surface h2,
.rich-editor-surface h3,
.rich-editor-surface h4 {
    margin: 1em 0 0.45em;
}
.rich-editor-surface p,
.rich-editor-surface ul,
.rich-editor-surface ol,
.rich-editor-surface blockquote,
.rich-editor-surface pre { margin-bottom: 1em; }
.rich-editor-surface ul,
.rich-editor-surface ol { margin-left: 1.4em; }
.rich-editor-surface blockquote {
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    background: var(--ink-2);
    color: var(--paper-dim);
}
.rich-editor-surface pre {
    padding: 14px;
    background: #090a0c;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--font-mono);
    white-space: pre-wrap;
}
.rich-editor-surface a { text-decoration: underline; }
.rich-editor-surface img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.rich-editor textarea[data-rich-source] {
    display: none;
    min-height: 520px;
    border: 0;
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.rich-editor.source-mode .rich-editor-surface { display: none; }
.rich-editor.source-mode textarea[data-rich-source] { display: block; }

.static-page-hero {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -50px;
    background: var(--ink-3);
    border-bottom: 1px solid var(--line);
    padding: 52px 24px 44px;
    text-align: center;
    margin-bottom: 40px;
}
.static-page-hero h1 { margin: 0 0 8px; font-size: 2rem; }
.static-page-hero .muted { color: var(--paper-mute); font-size: 0.88rem; margin: 0; }
.legal { max-width: 760px; margin: 0 auto; line-height: 1.75; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { margin-top: 1.8em; margin-bottom: 0.4em; color: var(--accent-warm); font-size: 1.25rem; }
.legal p, .legal li { color: var(--paper-dim); }
.legal ul, .legal ol { margin: 0.4em 0 1em 1.4em; }
.legal .muted { color: var(--paper-mute); font-size: 0.85rem; }

.contact-form { margin-top: 20px; }

.public-footer { border-top: 1px solid var(--line-soft); padding: 48px 36px 24px; background: var(--ink-2); margin-top: 40px; }
.public-footer-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: start; }
.public-footer-brand { display: flex; flex-direction: column; gap: 8px; }
.public-footer-brand-name { font-size: 1.05rem; font-weight: 700; color: var(--paper); }
.public-footer p { color: var(--paper-mute); font-size: 0.85rem; margin: 0; line-height: 1.55; }
.public-footer-cols { display: flex; gap: 48px; }
.public-footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 90px; }
.public-footer-col-label { font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-mute); margin-bottom: 2px; }
.public-footer-col a { color: var(--paper-dim); font-size: 0.88rem; text-decoration: none; transition: color .15s; }
.public-footer-col a:hover { color: var(--paper); }
.public-footer-bottom { max-width: 1080px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--paper-mute); font-size: 0.8rem; text-align: center; }

.iad-home-banner,
.iad-home-bottom {
    max-width: 1080px;
}
.iad-blog-list-mid {
    grid-column: 1 / -1;
    width: 100%;
}

.support-probe-box {
    position: absolute !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 300px !important;
    height: 250px !important;
    pointer-events: none !important;
}
.adblock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(8, 9, 11, 0.64);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.adblock-overlay[hidden] { display: none; }
.adblock-overlay.is-visible { opacity: 1; }
.adblock-modal {
    width: min(100%, 430px);
    padding: 26px 28px 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 20, 24, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    text-align: center;
}
.adblock-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--accent-warm);
    background: rgba(212, 162, 76, 0.11);
    border: 1px solid rgba(212, 162, 76, 0.24);
}
.adblock-modal h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    letter-spacing: 0;
}
.adblock-modal p {
    margin: 0 0 20px;
    color: var(--paper-dim);
    line-height: 1.6;
    font-size: 0.95rem;
}
.adblock-modal .adblock-debug {
    margin-top: -8px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--paper-mute);
    overflow-wrap: anywhere;
}
.adblock-recheck-btn { min-width: 170px; justify-content: center; }
body.adblock-lock { overflow: hidden; }

/* ============================================
   COMPACT APP POLISH
   ============================================ */
.main,
.account-shell {
    font-size: 14px;
}

.main h1,
.account-content h1 { font-size: clamp(1.75rem, 2.2vw, 2.15rem); letter-spacing: 0; }
.main h2,
.account-content h2 { font-size: 1.28rem; }
.main h3,
.account-content h3 { font-size: 1rem; }

.main {
    padding: 28px 40px;
    max-width: 1120px;
}

.sidebar {
    padding: 20px 16px;
    gap: 2px;
}
.sidebar-top {
    margin-bottom: 12px;
    padding-bottom: 12px;
}
.nav-section-title {
    padding: 14px 10px 4px;
    font-size: 0.58rem;
}
.nav-section-title::before { left: 10px; right: 10px; top: 7px; }
.nav-item {
    padding: 8px 10px;
    font-size: 0.86rem;
    border-radius: 6px;
}
.nav-sub {
    padding: 6px 8px 6px 24px;
    font-size: 0.8rem;
}
.nav-sub-divider { padding: 8px 8px 2px 24px; }
.sidebar-footer { padding-top: 12px; }
.user-tag { padding: 8px 9px; }

.page-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
}
.page-header-row { gap: 12px; }
.page-eyebrow {
    font-size: 0.62rem;
    margin-bottom: 6px;
}
.page-header h1 { margin-bottom: 3px; }
.page-header p {
    font-size: 0.94rem;
    line-height: 1.45;
}


.wizard-progress {
    gap: 10px;
    margin-bottom: 18px;
    font-size: 0.68rem;
}
.progress-bar { max-width: 220px; }
.wizard-card {
    padding: 18px 20px !important;
    margin-bottom: 12px;
    border-radius: 7px;
    background: rgba(22, 24, 28, 0.82);
}
.wizard-card h2 { margin-bottom: 10px !important; }
.wizard-card h3 { margin-bottom: 8px !important; }
.wizard-card p {
    font-size: 0.88rem;
    line-height: 1.45;
}
.q-num { font-size: 0.68rem; margin-bottom: 5px; }
.q-title { font-size: 0.9rem; margin-bottom: 10px; }
.q-question {
    font-size: 1.25rem;
    margin-bottom: 16px;
}
.setup-question-list { gap: 14px; }
.setup-question { padding-bottom: 14px; }
.choice-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}
.choice-pill {
    padding: 7px 9px;
    border-radius: 5px;
    font-size: 0.74rem;
}
.dynamic-compact-list { gap: 8px; }
.dynamic-compact-item { padding: 10px 0 12px; }
.dynamic-compact-head strong { font-size: 0.9rem; }
.dynamic-options .choice-pill { padding: 6px 8px; }
.form-loading-panel {
    margin-top: 12px;
    padding: 11px 13px;
}
.wizard-actions { gap: 10px; }
.regenerate-grid { gap: 4px; }
.regen-provider { padding: 6px 10px; border-radius: 5px; }
.regen-provider span { font-size: 0.82rem; min-width: 82px; }
.regen-provider select { font-size: 0.82rem; padding: 4px 6px; }
.provider-picker { gap: 6px; margin-bottom: 14px; }
.provider-tile { padding: 10px 12px; border-radius: 6px; }
.provider-tile h3 { font-size: 0.88rem; }
.provider-tile p { font-size: 0.75rem; }

.main .form-group,
.account-shell .form-group { margin-bottom: 12px; }
.main label,
.account-shell label {
    font-size: 0.68rem;
    margin-bottom: 6px;
}
.main input[type=text],
.main input[type=email],
.main input[type=password],
.main input[type=tel],
.main input[type=number],
.main input[type=url],
.main input[type=color],
.main textarea,
.main select,
.account-shell input[type=text],
.account-shell input[type=email],
.account-shell input[type=password],
.account-shell input[type=tel],
.account-shell input[type=number],
.account-shell input[type=url],
.account-shell input[type=color],
.account-shell textarea,
.account-shell select {
    padding: 9px 11px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.main textarea,
.account-shell textarea { min-height: 92px; }
.main .form-row,
.account-shell .form-row { gap: 12px; }
.main .field-hint,
.account-shell .field-hint { font-size: 0.78rem; margin-top: 5px; }
.main .btn,
.account-shell .btn {
    min-height: 34px;
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 0.86rem;
}
.main .btn-sm,
.account-shell .btn-sm {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.78rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}
.stat-tile {
    padding: 13px 15px;
    border-radius: 7px;
    min-height: 76px;
}
.stat-tile .label {
    font-size: 0.61rem;
    margin-bottom: 6px;
}
.stat-tile .value {
    font-size: 1.55rem;
}
.stat-tile > div[style*="font-size:2rem"] {
    font-size: 1.55rem !important;
    line-height: 1 !important;
}
.stat-tile > div[style*="font-size:0.88rem"] {
    font-family: var(--font-mono);
    font-size: 0.61rem !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-mute) !important;
    margin-top: 0 !important;
    margin-bottom: 6px;
}
.stat-tile > div[style*="font-size:0.8rem"],
.stat-note,
.stat-link {
    display: block;
    margin-top: 5px !important;
    color: var(--paper-mute) !important;
    font-size: 0.74rem !important;
    line-height: 1.25;
}
.stat-link { color: var(--accent-warm) !important; }

.data-table {
    border-radius: 7px;
}
.data-table th,
.data-table td {
    padding: 9px 12px;
    font-size: 0.84rem;
}
.data-table th { font-size: 0.62rem; }

.project-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.project-card {
    padding: 14px;
    border-radius: 7px;
    gap: 7px;
}
.project-card:hover { transform: translateY(-1px); }
.project-card .status {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}
.project-card h3 {
    font-size: 0.95rem;
    line-height: 1.25;
}
.project-card .meta {
    font-size: 0.76rem;
    line-height: 1.4;
}
.project-card .card-actions {
    margin-top: 6px;
}

.empty-state {
    padding: 34px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(22, 24, 28, 0.55);
}

.account-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
}
.account-nav {
    top: 70px;
    gap: 3px;
    padding: 12px;
    border-radius: 7px;
}
.account-nav a {
    padding: 7px 9px;
    border-radius: 5px;
    font-size: 0.86rem;
}
.account-mini-profile {
    padding-bottom: 10px;
    margin-bottom: 6px;
}
.account-status-panel {
    padding: 16px;
    margin-bottom: 16px;
    gap: 14px;
    border-radius: 7px;
}
.account-status-panel h2 { font-size: 1.12rem; }
.account-status-panel p { font-size: 0.88rem; }
.prompt-access-badge { font-size: 0.64rem; }

.community-card,
.comment-form,
.auth-panel,
.output-pane {
    border-radius: 7px;
}
.community-card { padding: 15px; }
.community-list { gap: 10px; }
.community-card-head {
    gap: 12px;
    margin-bottom: 9px;
}
.comment-form { padding: 15px; }
.output-pane { padding: 22px 24px; }

.profile-grid {
    grid-template-columns: 190px 1fr;
    gap: 20px;
}
.avatar-large {
    width: 132px;
    height: 132px;
    font-size: 3rem;
}

.blog-admin-tabs,
.pagination {
    gap: 6px;
    margin-bottom: 14px;
}
.blog-editor-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
}
.blog-editor-sidebar {
    gap: 10px;
}
.blog-editor-sidebar .wizard-card,
.blog-editor-main.wizard-card {
    padding: 16px !important;
}
.rich-editor-toolbar { padding: 7px; }
.rich-editor-surface { padding: 14px; }


/* ============================================
   ADS
   ============================================ */
.ads-slot { margin: 24px 0; text-align: center; }
.public-ad-header { text-align: center; margin: 10px auto 0; max-width: 970px; overflow: hidden; }
.ads-wizard { text-align: center; margin: 20px auto 0; max-width: 728px; overflow: hidden; }
.ads-placeholder {
    border: 1px dashed var(--line);
    color: var(--paper-mute);
    padding: 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.02);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 980px) {
    .main { padding: 70px 24px 30px; margin-left: 0; }
    .mobile-menu-btn { display: flex; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    .sidebar.collapsed {
        width: var(--side-w);
        padding: 28px 22px;
    }
    .sidebar.collapsed .sidebar-top {
        flex-direction: row;
    }
    .sidebar.collapsed .brand {
        justify-content: flex-start;
    }
    .sidebar.collapsed .brand-name,
    .sidebar.collapsed .brand img,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .user-tag > div {
        display: block;
    }
    .sidebar.collapsed .brand-mark-fallback {
        display: none;
    }
    .sidebar.collapsed .role-badge {
        display: inline-block;
    }
    .sidebar.collapsed .brand-mark {
        width: auto;
        height: auto;
        background: transparent;
        border: none;
        border-radius: 0;
    }
    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 14px;
        font-size: 0.93rem;
    }
    .sidebar.collapsed .sidebar-footer {
        display: block;
    }
    .sidebar.collapsed .user-tag {
        width: auto;
        height: auto;
        justify-content: flex-start;
        padding: 10px 12px;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.6); }

    .public-header {
        padding: 12px 14px;
    }
    .public-header-inner {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 10px;
        align-items: center;
    }
    .public-body { padding-top: 63px; }
    .public-header.is-shrunk {
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .public-brand {
        grid-column: 2;
        justify-self: center;
        margin: 0;
        transform-origin: center;
        max-width: min(58vw, 260px);
        min-width: 0;
    }
    .public-brand img { max-width: 100%; object-fit: contain; }
    .public-brand .brand-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-search-btn {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        width: 38px;
        height: 38px;
        padding: 0;
    }
    .public-menu-toggle {
        display: inline-flex;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        background: var(--ink-3);
        border-color: var(--line);
        position: relative;
        z-index: 221;
    }
    .public-menu-toggle.is-open {
        position: fixed;
        top: 12px;
        right: 18px;
        background: rgba(29, 32, 38, 0.96);
        border-color: rgba(230, 185, 94, 0.32);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    }
    body.public-menu-open .public-header {
        z-index: 230;
    }
    .public-menu-toggle span { background: var(--accent-warm); }
    .public-menu-toggle span {
        transition: transform .2s ease, opacity .2s ease;
        transform-origin: center;
    }
    .public-menu-toggle.is-open span {
        position: absolute;
        margin: 0;
        width: 16px;
    }
    .public-menu-toggle.is-open span:nth-child(1) { transform: rotate(45deg); }
    .public-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
    .public-menu-toggle.is-open span:nth-child(3) { transform: rotate(-45deg); }
    .public-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82vw, 340px);
        height: 100vh;
        height: 100dvh;
        padding: 76px 18px 24px;
        background: rgba(22, 24, 28, 0.98);
        border-left: 1px solid var(--line);
        box-shadow: -24px 0 50px rgba(0, 0, 0, 0.38);
        transform: translateX(105%);
        transition: transform .24s ease;
        z-index: 220;
        overflow-y: auto;
    }
    .public-nav.open { transform: translateX(0); }
    .public-nav a {
        display: flex;
        align-items: center;
        min-height: 42px;
        padding: 9px 12px;
        border-radius: 7px;
        border: 1px solid transparent;
        font-size: 0.96rem;
    }
    .public-nav a:hover {
        background: var(--ink-3);
        border-color: var(--line-soft);
    }
    .public-nav a.btn {
        justify-content: center;
        margin-top: 6px;
    }
    .public-nav-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 219;
    }
    .public-nav-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }
    body.public-menu-open { overflow: hidden; }
}

@media (max-width: 760px) {
    .wizard-card { padding: 26px 22px; }
    .output-pane { padding: 22px 18px; }
    .public-project-item {
        grid-template-columns: 1fr;
        padding: 20px 18px;
        gap: 16px;
    }
    .public-project-score {
        min-height: auto;
        padding: 14px 0 0;
        border-left: none;
        border-top: 1px solid var(--line-soft);
    }
    .public-project-score strong { font-size: 1.6rem; }
    .public-project-tabs,
    .public-projects-actions { justify-content: flex-start; }
    .my-prompt-item {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .my-prompt-actions {
        justify-content: flex-start;
    }
    .provider-picker { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .avatar-large { width: 140px; height: 140px; font-size: 3rem; }
    .form-row { grid-template-columns: 1fr; }
    h1 { font-size: 1.8rem; }
    .hero h1 { font-size: 2.1rem; }
    .hero-tagline { font-size: 1rem; }
    .q-question { font-size: 1.25rem; }
    .data-table { font-size: 0.82rem; display: block; overflow-x: auto; }
    .data-table th, .data-table td { padding: 10px 12px; white-space: nowrap; }
    .public-main { padding: 30px 20px 60px; }
    .static-page-hero { margin-top: -30px; }
    .public-header { padding: 12px 14px; }
    .public-footer { padding: 24px 18px 16px; }
    .custom-page-shell {
        width: min(100% - 32px, 1120px);
        padding: 34px 0 54px;
    }
    .custom-page-hero {
        padding-top: 20px;
    }
    .custom-page-empty {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .wizard-progress { font-size: 0.7rem; }
    .news-home-grid,
    .blog-editor-layout,
    .account-shell { grid-template-columns: 1fr; }
    .account-nav { position: static; }
    .editor-picks { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); padding-top: 16px; }
    .top-story h1,
    .news-page-header h1,
    .article-header h1 { font-size: 2.1rem; }
    .top-story-image { min-height: 220px; }
    .tool-strip,
    .homepage-cta,
    .news-empty-panel,
    .account-status-panel,
    .community-form-footer,
    .community-card-head { align-items: flex-start; flex-direction: column; }
    .blog-editor-sidebar { position: static; }
}

@media (max-width: 640px) {
    body { font-size: 14px; }
    .main { padding: 70px 16px 24px; }
    .wizard-card { padding: 22px 16px; }
    .auth-card { padding: 32px 22px; }
    .choice-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    .wizard-actions { flex-direction: column; align-items: stretch; }
    .wizard-actions .right-actions { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .review-item { flex-direction: column; align-items: stretch; }
}

/* ============================================
   BLOG TAXONOMY LINKS
   ============================================ */
.news-meta-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color .15s;
}
.news-meta-link:hover { color: var(--accent-warm); }

.article-tag-link {
    display: inline-block;
    padding: 5px 10px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.article-tag-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-warm);
}

.tag-eyebrow-mark {
    color: var(--accent);
    margin-right: 2px;
}

/* ============================================
   AI GENERATION OVERLAY SPINNER
   ============================================ */
#aiGeneratingOverlay { display: none; }

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}
.ai-gen-spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    animation: ai-spin .8s linear infinite;
}

/* ============================================
   LIVE SEARCH RESULTS
   ============================================ */
.search-live-results {
    border-top: 1px solid var(--line-soft);
    max-height: 420px;
    overflow-y: auto;
}
.search-live-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    text-decoration: none;
    color: var(--paper);
    border-bottom: 1px solid var(--line-soft);
    transition: background .12s;
}
.search-live-item:last-of-type { border-bottom: 0; }
.search-live-item:hover { background: var(--ink-3); }
.search-live-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: var(--ink-3);
}
.search-live-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--line);
}
.search-live-body { flex: 1; min-width: 0; }
.search-live-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--paper);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-live-snippet {
    font-size: 0.78rem;
    color: var(--paper-mute);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-live-badge {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}
.search-live-badge--blog     { background: var(--accent-soft);  color: var(--accent-warm); }
.search-live-badge--tip      { background: var(--success-soft); color: var(--success); }
.search-live-badge--question { background: var(--admin-soft);   color: var(--admin); }
.search-live-badge--prompt   { background: rgba(236,72,153,.12); color: #f0a0cc; }
.search-result-badge--prompt { background: rgba(236,72,153,.12); color: #f0a0cc; border: 1px solid rgba(236,72,153,.22); }
.search-live-all {
    display: block;
    padding: 10px 16px;
    font-size: 0.84rem;
    color: var(--accent);
    text-decoration: none;
    border-top: 1px solid var(--line-soft);
    text-align: center;
}
.search-live-all:hover { background: var(--ink-3); color: var(--accent-warm); }
.search-live-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--paper-mute);
}

/* ============================================
   PASSWORD SHOW/HIDE TOGGLE
   ============================================ */
.pw-wrap {
    position: relative;
}
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
    padding-right: 44px;
}
.pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--paper-mute);
    padding: 0;
    transition: color 0.15s;
    border-radius: 0 6px 6px 0;
}
.pw-toggle:hover { color: var(--paper); }
.pw-toggle svg { pointer-events: none; }
.pw-icon-hide { display: none; }
.pw-toggle.pw-shown .pw-icon-show { display: none; }
.pw-toggle.pw-shown .pw-icon-hide { display: inline; }

/* ============================================
   LOCAL SEARCH BAR
   ============================================ */
.local-search-bar {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Row 1 — full-width search input */
.local-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.local-search-icon {
    position: absolute;
    left: 13px;
    color: var(--paper-mute);
    pointer-events: none;
}
.local-search-input {
    width: 100%;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 40px 11px 40px;
    font-size: 0.95rem;
    color: var(--paper);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}
.local-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.local-search-input::placeholder { color: var(--paper-mute); }
.local-search-input::-webkit-search-cancel-button { display: none; }
.local-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--paper-mute);
    padding: 5px;
    line-height: 0;
    border-radius: 4px;
    transition: color 0.12s;
}
.local-search-clear:hover { color: var(--paper); }
/* Row 2 — filters + sort as equal columns */
.local-search-filters-row {
    display: flex;
    gap: 8px;
}
.local-search-select {
    flex: 1;
    min-width: 0;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 28px 8px 12px;
    font-size: 0.84rem;
    color: var(--paper-dim);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.local-search-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
/* Row 3 — result count */
.local-search-stats {
    font-size: 0.82rem;
    color: var(--paper-mute);
}
/* Results area */
.local-search-results-wrap {
    transition: opacity 0.18s;
    min-height: 40px;
}
.local-search-results-wrap.ls-loading {
    opacity: 0.4;
    pointer-events: none;
}
.ls-pagination { margin-top: 32px; }
.ls-pagination button { cursor: pointer; }

.front-filter-wrap {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.front-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink-2);
    color: var(--paper-dim);
    font-weight: 700;
    cursor: pointer;
}
.front-filter-toggle:hover,
.front-filter-toggle[aria-expanded="true"] {
    color: var(--paper);
    border-color: rgba(230,185,94,.42);
    background: var(--ink-3);
}
.front-filter-toggle svg { color: var(--accent-warm); }
.front-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    width: min(520px, 100%);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(22,24,28,.98);
    box-shadow: 0 22px 52px rgba(0,0,0,.34);
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.front-filter-panel.is-closing,
.front-filter-panel[hidden] {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    visibility: hidden;
    pointer-events: none;
}
.front-filter-panel .local-search-filters-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.front-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0,0,0,.58);
    opacity: 1;
    transition: opacity .2s ease, visibility .2s ease;
}
.front-filter-backdrop.is-closing,
.front-filter-backdrop[hidden] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
body.front-filter-open { overflow: hidden; }
.front-filter-wrap > .layout-toggle { margin-left: 0; }

@media (min-width: 641px) {
    .front-filter-backdrop,
    .vp-filter-backdrop {
        display: none !important;
    }
    body.front-filter-open,
    body.vp-filter-open {
        overflow: auto;
    }
}

@media (max-width: 640px) {
    .local-search-filters-row { flex-wrap: wrap; }
    .local-search-select { flex: 1 1 calc(50% - 4px); min-width: 120px; }
    .front-filter-wrap {
        justify-content: stretch;
        flex-direction: row;
        width: 100%;
    }
    .front-filter-toggle { flex: 1; }
    .front-filter-wrap > .layout-toggle { display: none; }
    .front-filter-panel {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 50%;
        z-index: 260;
        width: auto;
        max-height: min(76vh, 560px);
        margin: 0;
        overflow: auto;
        transform: translateY(-50%) scale(1);
        transform-origin: center;
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    }
    .front-filter-panel.is-closing,
    .front-filter-panel[hidden] {
        transform: translateY(-46%) scale(.94);
    }
    .front-filter-panel .local-search-filters-row {
        grid-template-columns: 1fr;
    }
}

/* ── Newsletter CTA block ─────────────────────────────────────────────────── */
.nl-cta {
    background: var(--ink-3);
    border-top: 1px solid var(--line-soft);
    padding: 26px 24px;
    text-align: center;
}
.nl-cta-inner {
    max-width: 480px;
    margin: 0 auto;
}
.nl-cta-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.nl-cta h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--paper);
    line-height: 1.3;
}
.nl-cta > .nl-cta-inner > p {
    font-size: 0.93rem;
    margin: 0 0 24px;
    color: var(--paper-mute);
}
.nl-cta-form {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}
.nl-cta-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    font-size: 0.93rem;
    background: var(--ink-3);
    color: var(--paper);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.nl-cta-input::placeholder { color: var(--paper-mute); }
.nl-cta-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.nl-cta-btn {
    padding: 11px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.nl-cta-btn:hover { opacity: 0.85; }
.nl-cta-note {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--paper-mute);
}
/* Kill the footer's top margin so no gap appears between CTA and footer */
.nl-cta + .public-footer { margin-top: 0; border-top: none; }
@media (max-width: 480px) {
    .nl-cta-form { flex-direction: column; }
    .nl-cta-btn { width: 100%; }
}

/* ── Scroll to top button ────────────────────────────────────────────────── */
.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 800;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(14px) scale(0.8);
    transition: opacity 0.3s cubic-bezier(0.16,1,0.3,1),
                transform 0.3s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.2s;
    pointer-events: none;
    min-height: 0;
    outline-offset: 3px;
}
.scroll-top-btn.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.scroll-top-btn:hover {
    background: var(--accent-warm, var(--accent));
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.25);
}
.scroll-top-btn:active {
    transform: translateY(0) scale(0.93);
    transition-duration: 0.08s;
}
.scroll-top-btn svg { flex-shrink: 0; }
@media (max-width: 640px) {
    .scroll-top-btn { bottom: 20px; right: 16px; width: 40px; height: 40px; }
}
@media (max-width: 380px) {
    .scroll-top-btn { bottom: 14px; right: 12px; width: 36px; height: 36px; }
    .scroll-top-btn svg { width: 15px; height: 15px; }
}

/* ── Cookie consent banner ────────────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--ink-2);
    border-top: 1px solid var(--line-soft);
    padding: 18px 24px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
}
.cookie-banner.is-visible {
    transform: translateY(0);
}
.cookie-banner-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1;
    min-width: 220px;
}
.cookie-banner-text strong {
    display: block;
    font-size: 0.93rem;
    color: var(--paper);
    margin-bottom: 4px;
}
.cookie-banner-text p {
    font-size: 0.82rem;
    color: var(--paper-mute);
    margin: 0;
    line-height: 1.5;
}
.cookie-banner-text a {
    color: var(--accent);
    text-decoration: underline;
}
.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.cookie-btn-accept {
    padding: 9px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.cookie-btn-accept:hover { opacity: 0.85; }
.cookie-btn-essential {
    padding: 9px 20px;
    background: transparent;
    color: var(--paper-dim);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.cookie-btn-essential:hover { border-color: var(--paper-mute); color: var(--paper); }
@media (max-width: 600px) {
    .cookie-banner-inner { gap: 14px; }
    .cookie-banner-actions { width: 100%; }
    .cookie-btn-accept, .cookie-btn-essential { flex: 1; text-align: center; }
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS
   Breakpoints: 980 · 760 · 640 · 480 · 380
   ============================================================ */

/* ── Shared: make data-tables always scrollable ──────────────────────────── */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.data-table-wrap .data-table { border-radius: 0; }

/* ── Shared: touch-target minimums ──────────────────────────────────────── */
.btn, button, [role="button"] { min-height: 36px; }
.btn-sm { min-height: 30px; }
.community-index-item { min-height: 0; }

/* ── Admin: details/accordion summary ───────────────────────────────────── */
details.wizard-card > summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 22px;
    font-weight: 600;
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
}
details.wizard-card > summary::-webkit-details-marker { display: none; }
details.wizard-card > summary::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--paper-mute);
    border-bottom: 2px solid var(--paper-mute);
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}
details.wizard-card[open] > summary::after { transform: rotate(-135deg); }
details.wizard-card > summary ~ * { padding: 0 22px 22px; }

/* ── Admin: filter tab bars (All / Pending / Active …) ──────────────────── */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

/* ── Public: article images never overflow ───────────────────────────────── */
.article-content img,
.output-pane img { max-width: 100%; height: auto; }

/* ── 980px and below ─────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    /* Admin main content loses sidebar width */
    .main { min-height: 100vh; }

    /* Make wide tables scroll on tablets too */
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }

    /* Stats grid: 3 columns on tablet */
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid.compact { grid-template-columns: repeat(2, 1fr); }

    /* Admin page header: let buttons wrap cleanly */
    .page-header-row { align-items: flex-start; }
}

/* ── 760px and below ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    /* ── ADMIN ── */

    /* Page header: stack title + actions vertically */
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-header-row > div:last-child,
    .page-header-row > .btn-row { width: 100%; }
    .page-header-row .btn-row { flex-wrap: wrap; }

    /* Admin stats: 2-column grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
    .stat-tile { padding: 16px; }
    .stat-tile .value { font-size: 1.6rem; }

    /* Blog editor / newsletter compose sidebar goes below */
    .blog-editor-layout { grid-template-columns: 1fr; gap: 16px; }
    .blog-editor-sidebar { position: static; top: auto; }

    /* Account profile grid */
    .profile-grid { grid-template-columns: 1fr; }

    /* Wizard card inner padding */
    .wizard-card { padding: 22px 18px; }

    /* Newsletter filter bar */
    .nl-filter-bar { flex-direction: column !important; gap: 8px !important; }
    .nl-filter-bar .local-search-input-wrap { min-width: 0 !important; }

    /* details accordion inner body padding */
    details.wizard-card > summary ~ * { padding: 0 16px 18px; }
    details.wizard-card > summary { padding: 14px 16px; }

    /* Inline form flex rows that aren't form-row grid */
    .form-inline-row { flex-direction: column; }

    /* ── PUBLIC ── */

    /* Public content shell side padding */
    .public-content-shell { padding: 0 4px; }

    /* Community pages header: stack buttons below text */
    .page-header .btn-row { margin-top: 12px; }

    /* Footer: stack vertically */
    .public-footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .public-footer-cols { gap: 28px; }
    .public-footer { padding: 32px 18px 16px; margin-top: 0; }

    /* Auth pages */
    .auth-page { padding: 24px 16px 48px; }

    /* News grid: 2 columns on tablet */
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid.layout-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }

    /* Card image: cap height on tablet so cards aren't too tall */
    .news-card-image { aspect-ratio: unset; height: 200px; }

    /* Hide 3-col layout button on tablet — useless at this width */
    .layout-btn[data-layout="grid-3"] { display: none; }

    /* Article header */
    .article-header h1, .news-page-header h1 { font-size: 1.9rem; }
    .article-header { padding: 20px 0 14px; }

    /* Search result cards */
    .search-result-item { flex-direction: column; gap: 10px; }
}

/* ── 640px and below ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* ── ADMIN ── */

    /* Main content padding reduction */
    .main { padding: 70px 16px 28px; }

    /* Stats: 2 columns still OK */
    .stats-grid.compact { grid-template-columns: repeat(2, 1fr); }

    /* Wizard card: tighter */
    .wizard-card { padding: 18px 14px; }

    /* form-row: single column */
    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* Row actions wrap neatly */
    .row-actions { flex-wrap: wrap; gap: 4px; }

    /* Admin btn-row: full width on tight screens */
    .page-header-row .btn { flex: 1; justify-content: center; min-width: 100px; }

    /* data-table: smaller font + tighter cells */
    .data-table th, .data-table td { padding: 9px 10px; font-size: 0.82rem; }
    .data-table th { font-size: 0.68rem; }

    /* provider picker */
    .provider-picker { grid-template-columns: 1fr; }

    /* ── PUBLIC ── */

    /* Heading scale */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.35rem; }

    .prompt-page-shell {
        width: min(100% - 28px, 1180px);
        padding: 30px 0 56px;
    }
    .prompt-detail-hero {
        grid-template-columns: 1fr;
    }
    .prompt-detail-cover,
    .prompt-detail-cover img {
        min-height: 0;
    }
    .prompt-detail-cover img {
        aspect-ratio: 16 / 10;
    }
    .prompt-detail-intro {
        padding: 20px 18px;
    }
    .prompt-detail-intro h1 {
        max-width: none;
        font-size: 1.85rem;
    }
    .prompt-summary-box,
    .prompt-full-box {
        padding: 18px 16px;
    }
    .sc-slide-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .sc-slide-title {
        flex-basis: 100%;
        white-space: normal;
        order: 3;
    }
    .sc-scene-body {
        padding: 16px 14px;
    }
    .prompt-block-bar {
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }
    .prompt-block-toggle span:first-child {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* Homepage hero */
    .hero h1 { font-size: 2rem; }
    .hero-tagline { font-size: 0.97rem; }

    /* Blog/news cards: single column on mobile */
    .news-grid { grid-template-columns: 1fr; }
    .news-grid.layout-grid-2, .news-grid.layout-grid-3 { grid-template-columns: 1fr !important; }

    /* Card image: fixed height on mobile — no more giant aspect-ratio blocks */
    .news-card-image { aspect-ratio: unset; height: 170px; }

    /* List layout image: narrower on mobile */
    .news-grid.layout-list .news-card { flex-direction: row; }
    .news-grid.layout-list .news-card-image { width: 120px; min-width: 120px; height: 90px; }
    .news-grid.layout-list .news-card-body { padding: 10px 12px; }
    .news-grid.layout-list .news-card h2 { font-size: 0.9rem; margin: 2px 0 4px; }
    .news-grid.layout-list .news-card p { display: none; }

    /* Community cards: single column on mobile */
    .community-index-list.layout-cards { grid-template-columns: 1fr; }

    /* Community items: tighter on mobile */
    .community-index-item { padding: 10px 14px; }
    .community-index-list.layout-cards .prompt-gallery-item.has-thumb,
    .prompt-gallery-item.has-thumb {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }
    .community-index-list.layout-cards .prompt-gallery-item .pg-thumb,
    .prompt-gallery-item .pg-thumb {
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 8px;
    }
    .prompt-gallery-item .community-index-title {
        font-size: 1.05rem;
        line-height: 1.25;
        margin-bottom: 8px;
    }
    .prompt-gallery-item .prompt-gallery-excerpt {
        font-size: 0.93rem;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Hide multi-col layout buttons on mobile — grid always collapses to 1-col */
    .layout-btn[data-layout="grid-2"],
    .layout-btn[data-layout="grid-3"] { display: none; }

    /* Prompt gallery / tip / question excerpts */
    .prompt-gallery-excerpt { font-size: 0.85rem; }
    .community-index-title { font-size: 0.98rem; }

    /* Auth panel */
    .auth-panel, .auth-panel-wide { padding: 28px 18px; max-width: 100%; }

    /* Pagination: smaller */
    .pagination button, .ls-pagination button,
    .public-project-pagination a { padding: 6px 10px; font-size: 0.82rem; }

    /* Newsletter CTA: tighter padding */
    .nl-cta { padding: 32px 16px; }
    .nl-cta h2 { font-size: 1.2rem; }

    /* Detail page layout: single column, sidebar stacks below */
    .detail-sidebar { grid-template-columns: 1fr; }
}

/* ── 480px and below ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    /* ── ADMIN ── */

    /* Stats: single column */
    .stats-grid, .stats-grid.compact { grid-template-columns: 1fr; gap: 8px; }
    .stat-tile { padding: 14px; display: flex; align-items: center; justify-content: space-between; }
    .stat-tile .label { margin-bottom: 0; }
    .stat-tile .value { font-size: 1.4rem; }

    /* Sidebar overlay covers full width on very small screens */
    .sidebar.open { width: 100%; }

    /* Admin page header h1 */
    .main .page-header h1 { font-size: 1.5rem; }

    /* details accordion: minimal padding */
    details.wizard-card > summary { padding: 12px 14px; font-size: 0.95rem; }
    details.wizard-card > summary ~ * { padding: 0 14px 16px; }

    /* ── PUBLIC ── */

    /* Public main */
    .public-main { padding: 24px 14px 52px; }
    .static-page-hero { margin-top: -24px; }

    /* Headings */
    h1 { font-size: 1.55rem; }
    .top-story h1, .article-header h1, .news-page-header h1 { font-size: 1.65rem; }

    /* Footer bottom */
    .public-footer-bottom { font-size: 0.76rem; }
    .public-footer-cols { flex-wrap: wrap; gap: 20px 32px; }

    /* Auth */
    .auth-panel, .auth-panel-wide { padding: 22px 14px; }

    /* Hero actions full width */
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    /* Btn-row: allow wrapping, full-width items on very small */
    .btn-row { gap: 8px; }

    /* community-index-meta: allow wrapping */
    .community-index-meta { flex-wrap: wrap; gap: 4px 10px; }

    /* Search overlay: full width input */
    .search-overlay-box { border-radius: 0; }

    /* Cookie banner: stack */
    .cookie-banner { padding: 14px 16px; }

    /* Card image: shorter on small phones */
    .news-card-image { height: 150px; }

    /* List layout: narrower image on small phones */
    .news-grid.layout-list .news-card-image { width: 100px; min-width: 100px; height: 80px; }

    /* Layout toggle: hide on phones — grid always collapses to 1-col anyway */
    .layout-toggle { display: none; }

    /* Card body */
    .news-card-body { padding: 12px 14px; }
    .news-card h2 { font-size: 1rem; margin: 4px 0 6px; }
}

/* ── 380px and below — extreme small (older iPhones, budget Androids) ───── */
@media (max-width: 380px) {
    /* Admin sidebar: full width when open */
    .sidebar.open { width: 100vw; }

    /* Headings */
    h1 { font-size: 1.4rem; }

    /* Admin main padding */
    .main { padding: 66px 12px 24px; }

    /* Wizard card */
    .wizard-card { padding: 16px 12px; }

    /* Table cells: minimal */
    .data-table th, .data-table td { padding: 8px; font-size: 0.78rem; }

    /* Public main */
    .public-main { padding: 20px 12px 48px; }
    .static-page-hero { margin-top: -20px; }

    /* Buttons: smaller padding on tiny screens */
    .btn { padding: 10px 14px; font-size: 0.88rem; }
    .btn-sm { padding: 5px 10px; font-size: 0.78rem; }

    /* Form inputs */
    input[type=text], input[type=email], input[type=password],
    input[type=tel], input[type=number], input[type=url],
    textarea, select { padding: 9px 11px; font-size: 0.9rem; }

    /* News card body */
    .news-card-body { padding: 10px 12px; }
    .news-card h2 { font-size: 0.95rem; }
    /* Card image: smallest phones */
    .news-card-image { height: 130px; }

    /* Footer */
    .public-footer-cols { gap: 16px 24px; }

    /* nl-cta */
    .nl-cta { padding: 24px 12px; }
    .nl-cta h2 { font-size: 1.1rem; }
    .nl-cta-input, .nl-cta-btn { padding: 10px 12px; }
}

/* ============================================
   GLOBAL ADMIN / UI POLISH  (appended)
   ============================================ */

/* ── Admin page — consistent section spacing ─────────────────────────────── */
.wizard-card + .wizard-card { margin-top: 20px; }

/* ── Data-table: scrollable wrapper (prevents layout blowout on narrow admin) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Data-table: improve row visual separation globally ─────────────────── */
.data-table tbody tr {
    transition: background 0.12s;
}
.data-table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--line);
}
.data-table tbody td {
    vertical-align: middle;
}

/* ── Row-actions — consistent alignment and gap ──────────────────────────── */
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Page header — prevent wrapping title from touching action button ────── */
.page-header-row h1 { min-width: 0; }

/* ── Wizard card — remove double bottom margin when stacked ─────────────── */
.wizard-card:last-child { margin-bottom: 0; }

/* ── Form row — collapse to 1 col at 600px consistently ─────────────────── */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ── Empty state — more visual hierarchy ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state h2 { color: var(--paper-mute); font-size: 1.1rem; font-weight: 500; }


/* ── data-table on mobile — allow horizontal scroll, don't squash ───────── */
@media (max-width: 860px) {
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .data-table th, .data-table td { white-space: nowrap; }
}

/* ── uv-layout responsive — graceful collapse ──────────────────────────── */
@media (max-width: 860px) {
    .uv-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
    .uv-stats { grid-template-columns: repeat(2, 1fr); }
    .uv-quota-actions { grid-template-columns: 1fr; }
}
