:root {
    --bg: #07111f;
    --bg-soft: #0d1728;
    --surface: rgba(13, 23, 40, 0.88);
    --surface-strong: #111d31;
    --surface-light: rgba(18, 31, 52, 0.72);
    --text: #edf3ff;
    --muted: #8fa3c2;
    --line: rgba(151, 182, 230, 0.16);
    --primary: #55c6ff;
    --primary-dark: #34a7e7;
    --secondary: #7df5c8;
    --accent: #7f8cff;
    --danger: #ff6777;
    --gold: #ffd76c;
    --shadow: 0 24px 60px rgba(1, 6, 16, 0.45);
    --radius: 24px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
    background: var(--bg);
}

body {
    width: 100%;
    min-width: 0;
    margin: 0;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(85, 198, 255, 0.16), transparent 24%),
        radial-gradient(circle at 80% 0%, rgba(127, 140, 255, 0.18), transparent 20%),
        radial-gradient(circle at bottom right, rgba(125, 245, 200, 0.12), transparent 24%),
        linear-gradient(180deg, #050c18 0%, #091221 45%, #07111f 100%);
    color: var(--text);
    overflow-x: hidden;
}

img, video, canvas, svg {
    max-width: 100%;
}

h1, h2, h3, h4, p, a, span, small, strong, button, input, select, textarea, pre, code {
    min-width: 0;
}

h1, h2, h3, h4, p, a, button, small, strong {
    overflow-wrap: anywhere;
}

a { color: inherit; text-decoration: none; }
main { padding-bottom: 88px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: rgba(5, 12, 24, 0.72);
    border-bottom: 1px solid rgba(151, 182, 230, 0.08);
    padding-top: env(safe-area-inset-top);
}

.nav-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 24px;
}

.brand {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: 0;
}

.main-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.nav-shell > * {
    min-width: 0;
}

.nav-link, .nav-button {
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    transition: 0.2s ease;
}

.nav-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--muted);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-logout-form {
    margin: 0;
}

.nav-button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #04101c;
    box-shadow: 0 14px 30px rgba(85, 198, 255, 0.2);
}

.nav-button.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.hero-section {
    padding: 34px 0 6px;
}

.hero-shell {
    display: grid;
    gap: 22px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hero-stat,
.detail-card,
.filter-card,
.form-card,
.auth-card,
.mini-card,
.comment-card,
.empty-box,
.category-card,
.prompt-card,
.comment-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-stat {
    padding: 18px 20px;
    background:
        linear-gradient(120deg, rgba(85, 198, 255, 0.08), rgba(127, 140, 255, 0.08)),
        var(--surface);
}

.hero-stat span {
    display: block;
    margin-bottom: 6px;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0;
}

.hero-stat small {
    color: var(--muted);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 22px;
    align-items: stretch;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(14, 25, 44, 0.96), rgba(10, 19, 34, 0.92));
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(125, 245, 200, 0.09);
    border: 1px solid rgba(125, 245, 200, 0.14);
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-section h1 {
    margin: 0 0 16px;
    max-width: 760px;
    font-size: clamp(2.6rem, 5vw, 5rem);
    line-height: 0.94;
    letter-spacing: 0;
}

.hero-text {
    max-width: 720px;
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--muted);
}

.hero-actions, .detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.primary-btn, .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.98rem;
    transition: 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #04101c;
    box-shadow: 0 14px 28px rgba(85, 198, 255, 0.22);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(85, 198, 255, 0.26);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    border: 1px solid var(--line);
}

.hero-tools {
    position: relative;
    min-height: 138px;
    margin-top: 24px;
    overflow: hidden;
}

.hero-tools span,
.prompt-meta span,
.prompt-meta a,
.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.hero-tools span {
    position: absolute;
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c8d8f2;
    box-shadow: 0 14px 30px rgba(1, 6, 16, 0.18);
    animation: bubble-float 6s ease-in-out infinite;
}

.hero-tools span:nth-child(1) { left: 0; top: 8px; animation-delay: -0.8s; }
.hero-tools span:nth-child(2) { left: 24%; top: 54px; animation-delay: -2.1s; }
.hero-tools span:nth-child(3) { left: 52%; top: 14px; animation-delay: -1.4s; }
.hero-tools span:nth-child(4) { left: 10%; top: 96px; animation-delay: -3.2s; }
.hero-tools span:nth-child(5) { left: 44%; top: 92px; animation-delay: -0.2s; }
.hero-tools span:nth-child(6) { left: 70%; top: 56px; animation-delay: -2.7s; }

.hero-preview {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 14px;
    min-height: 100%;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(125, 245, 200, 0.1);
    background:
        linear-gradient(180deg, rgba(8, 14, 27, 0.96), rgba(8, 14, 27, 0.82));
}

.hero-preview-bar {
    display: flex;
    gap: 8px;
}

.hero-preview-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.hero-preview-bar span:first-child { background: #ff6777; }
.hero-preview-bar span:nth-child(2) { background: #ffd76c; }
.hero-preview-bar span:nth-child(3) { background: #7df5c8; }

.hero-preview-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
}

.hero-code {
    margin: 0;
    padding: 18px;
    overflow: auto;
    border-radius: 20px;
    background: rgba(13, 24, 42, 0.95);
    color: #d8ecff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.87rem;
    line-height: 1.7;
    border: 1px solid rgba(151, 182, 230, 0.1);
}

.section-space {
    margin-top: 48px;
}

.section-head, .catalog-head, .profile-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

.profile-header {
    align-items: center;
    justify-content: flex-start;
}

.section-head h2, .catalog-head h1, .profile-header h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: 0;
}

.section-head a,
.catalog-head a {
    color: var(--muted);
}

.catalog-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.catalog-summary span,
.catalog-summary a,
.catalog-toolbar span {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.catalog-summary a {
    color: #cde6ff;
}

.category-grid, .prompt-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-grid-showcase {
    grid-auto-rows: minmax(210px, auto);
}

.category-showcase {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: space-between;
    min-height: 220px;
    padding: 22px;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    background: linear-gradient(160deg, rgba(16, 28, 47, 0.98), rgba(10, 19, 34, 0.92));
}

.category-showcase::before,
.category-showcase::after,
.prompt-card::before,
.prompt-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.category-showcase::before {
    inset: auto -46px -62px auto;
    width: 170px;
    height: 170px;
    border-radius: 50%;
}

.category-showcase::after {
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
}

.category-showcase:hover,
.prompt-card:hover {
    transform: translateY(-4px);
    border-color: rgba(85, 198, 255, 0.28);
    box-shadow: 0 28px 70px rgba(1, 6, 16, 0.55);
}

.category-wide {
    grid-column: span 2;
    min-height: 250px;
}

.category-tall {
    min-height: 250px;
}

.category-panel {
    background: linear-gradient(180deg, rgba(12, 23, 41, 0.95), rgba(8, 17, 31, 0.98));
}

.category-cardinal {
    background: linear-gradient(145deg, rgba(14, 22, 38, 0.96), rgba(15, 24, 45, 0.92));
}

.category-terminal {
    background: linear-gradient(145deg, rgba(8, 16, 29, 0.98), rgba(10, 20, 38, 0.93));
}

.tone-cyan::before { background: radial-gradient(circle, rgba(85, 198, 255, 0.24), transparent 68%); }
.tone-violet::before { background: radial-gradient(circle, rgba(127, 140, 255, 0.28), transparent 68%); }
.tone-mint::before { background: radial-gradient(circle, rgba(125, 245, 200, 0.24), transparent 68%); }
.tone-coral::before { background: radial-gradient(circle, rgba(255, 103, 119, 0.22), transparent 68%); }
.tone-blue::before { background: radial-gradient(circle, rgba(102, 183, 255, 0.2), transparent 68%); }
.tone-lime::before { background: radial-gradient(circle, rgba(186, 255, 124, 0.18), transparent 68%); }
.tone-pink::before { background: radial-gradient(circle, rgba(255, 135, 187, 0.2), transparent 68%); }
.tone-sky::before { background: radial-gradient(circle, rgba(87, 220, 255, 0.22), transparent 68%); }

.category-card-top,
.category-card-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-card-body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.category-index,
.category-arrow,
.category-card-bottom span {
    display: inline-flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.category-index {
    color: var(--secondary);
}

.category-arrow {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-showcase strong {
    font-size: clamp(1.3rem, 2.2vw, 2rem);
    line-height: 1;
    letter-spacing: 0;
}

.category-showcase .category-card-body span {
    max-width: 480px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.category-dotline {
    flex: 1;
    max-width: 72px;
    height: 1px;
    margin-left: 12px;
    background: linear-gradient(90deg, rgba(151, 182, 230, 0.5), transparent);
}

.category-card-bottom span {
    color: #a8bdf0;
}

.prompt-grid-editorial {
    grid-auto-rows: minmax(210px, auto);
}

.prompt-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-card::before {
    inset: auto -40px -40px auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
}

.prompt-card::after {
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 46%);
}

.prompt-card > * {
    position: relative;
    z-index: 1;
}

.prompt-hero {
    grid-column: span 2;
    min-height: 270px;
    padding: 26px;
}

.prompt-stack {
    min-height: 270px;
    background: linear-gradient(180deg, rgba(12, 23, 41, 0.98), rgba(9, 18, 33, 0.92));
}

.prompt-note {
    min-height: 220px;
}

.prompt-band {
    padding-top: 72px;
}

.prompt-band::after {
    inset: 0 auto auto 0;
    width: 100%;
    height: 44px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
}

.prompt-cyan::before { background: radial-gradient(circle, rgba(85, 198, 255, 0.20), transparent 68%); }
.prompt-violet::before { background: radial-gradient(circle, rgba(127, 140, 255, 0.24), transparent 68%); }
.prompt-mint::before { background: radial-gradient(circle, rgba(125, 245, 200, 0.18), transparent 68%); }
.prompt-rose::before { background: radial-gradient(circle, rgba(255, 103, 119, 0.18), transparent 68%); }
.prompt-blue::before { background: radial-gradient(circle, rgba(102, 183, 255, 0.16), transparent 68%); }
.prompt-gold::before { background: radial-gradient(circle, rgba(255, 215, 108, 0.18), transparent 68%); }

.prompt-card.accent {
    background: linear-gradient(180deg, rgba(85, 198, 255, 0.06), rgba(13, 23, 40, 0.92));
}

.prompt-meta, .prompt-footer, .detail-toolbar, .tag-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.prompt-meta span,
.prompt-meta a {
    background: rgba(85, 198, 255, 0.1);
    color: #9cdfff;
    border: 1px solid rgba(85, 198, 255, 0.12);
}

.tag-chip {
    background: rgba(127, 140, 255, 0.12);
    color: #b3bcff;
    border: 1px solid rgba(127, 140, 255, 0.12);
}

.prompt-meta a,
.tag-chip,
.catalog-summary a,
.pagination a {
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.prompt-meta a:hover,
.tag-chip:hover,
.catalog-summary a:hover {
    color: var(--text);
    border-color: rgba(125, 245, 200, 0.28);
}

.prompt-card h3, .mini-card h3 {
    margin: 14px 0 10px;
    font-size: 1.2rem;
}

.prompt-hero h3 {
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    max-width: 640px;
}

.prompt-footer, .detail-toolbar {
    justify-content: space-between;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.catalog-layout, .dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
}

.catalog-content {
    display: grid;
    gap: 18px;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.prompt-grid .empty-box {
    grid-column: 1 / -1;
}

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.pagination a,
.pagination span {
    min-width: 42px;
    padding: 10px 13px;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.pagination a:hover,
.pagination .is-current {
    color: #061321;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}

.pagination .is-disabled {
    color: rgba(143, 163, 194, 0.48);
}

.filter-card, .form-card, .auth-card, .detail-card, .comment-block {
    padding: 24px;
}

.filter-card form, .auth-card form {
    display: grid;
    gap: 12px;
}

.filter-card label, .form-card label, .auth-card label {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.form-control, .form-select, textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
}

.form-checkbox {
    width: auto;
    accent-color: var(--secondary);
}

.form-control::placeholder,
textarea::placeholder {
    color: #6f83a5;
}

.prompt-box {
    min-height: 220px;
}

.full {
    width: 100%;
}

.detail-card {
    display: grid;
    gap: 18px;
}

.prompt-text-box {
    background: #08111f;
    color: #edf6ff;
    padding: 24px;
    border-radius: 20px;
    line-height: 1.7;
    white-space: normal;
    border: 1px solid rgba(151, 182, 230, 0.12);
}

.comment-block {
    margin-top: 26px;
}

.comment-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.comment-list, .stack-list {
    display: grid;
    gap: 14px;
}

.comment-card p, .mini-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.muted-box, .empty-box, .flash-message {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.flash-wrap {
    padding-top: 16px;
}

.flash-message {
    border-style: solid;
    background: rgba(125, 245, 200, 0.08);
    color: #bffbe8;
}

.narrow-section, .auth-section {
    width: min(800px, calc(100% - 32px));
    margin: 42px auto 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.full-row {
    grid-column: 1 / -1;
}

.tags-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tags-panel li {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(151, 182, 230, 0.08);
}

.error-text {
    color: #ff9ca6;
    font-size: 0.85rem;
    margin-top: 6px;
}

.danger-btn {
    background: rgba(255, 103, 119, 0.14);
    color: #ffd8dd;
    border-color: rgba(255, 103, 119, 0.24);
}

.site-footer {
    border-top: 1px solid rgba(151, 182, 230, 0.08);
    padding: 34px 0 46px;
    background: rgba(5, 12, 24, 0.4);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 980px) {
    .hero-stats,
    .hero-grid,
    .catalog-layout,
    .dashboard-grid,
    .category-grid,
    .prompt-grid,
    .footer-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .category-wide,
    .prompt-hero {
        grid-column: auto;
    }

    .tags-panel ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container, .narrow-section, .auth-section {
        width: min(100% - 24px, 1000px);
    }

    .nav-shell, .section-head, .catalog-head, .profile-header {
        align-items: start;
        flex-direction: column;
    }

    .profile-header-actions {
        margin-left: 0;
    }

    .hero-section h1 {
        font-size: 2.4rem;
    }

    .tags-panel ul {
        grid-template-columns: 1fr;
    }
}

.category-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.category-tile {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: space-between;
    min-height: 220px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(151, 182, 230, 0.14);
    background: linear-gradient(160deg, rgba(14, 25, 44, 0.98), rgba(9, 18, 32, 0.92));
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.category-tile::before {
    content: '';
    position: absolute;
    inset: auto -50px -70px auto;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    opacity: 0.9;
}

.category-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 44%);
    pointer-events: none;
}

.category-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(85, 198, 255, 0.28);
    box-shadow: 0 30px 72px rgba(1, 6, 16, 0.55);
}

.category-tile > * {
    position: relative;
    z-index: 1;
}

.category-tile-top,
.category-tile-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.category-tile-body {
    display: grid;
    gap: 12px;
}

.category-tile-body strong {
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.category-tile-body p {
    margin: 0;
    max-width: 470px;
    color: var(--muted);
    line-height: 1.58;
}

.category-code,
.category-hint,
.category-tile-bottom span,
.fresh-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}

.category-code {
    color: var(--text);
}

.category-hint {
    padding: 8px 12px;
    color: rgba(237, 243, 255, 0.72);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-tile-bottom span {
    color: #a9bdf3;
}

.category-tile.spotlight { grid-column: span 5; min-height: 310px; }
.category-tile.compact { grid-column: span 3; }
.category-tile.wide { grid-column: span 6; min-height: 200px; }
.category-tile.tall { grid-column: span 4; min-height: 280px; }

.category-tile.tone-cyan::before { background: radial-gradient(circle, rgba(85, 198, 255, 0.26), transparent 68%); }
.category-tile.tone-violet::before { background: radial-gradient(circle, rgba(127, 140, 255, 0.28), transparent 68%); }
.category-tile.tone-coral::before { background: radial-gradient(circle, rgba(255, 103, 119, 0.22), transparent 68%); }
.category-tile.tone-mint::before { background: radial-gradient(circle, rgba(125, 245, 200, 0.22), transparent 68%); }
.category-tile.tone-blue::before { background: radial-gradient(circle, rgba(102, 183, 255, 0.18), transparent 68%); }
.category-tile.tone-gold::before { background: radial-gradient(circle, rgba(255, 215, 108, 0.22), transparent 68%); }
.category-tile.tone-pink::before { background: radial-gradient(circle, rgba(255, 135, 187, 0.20), transparent 68%); }
.category-tile.tone-lime::before { background: radial-gradient(circle, rgba(186, 255, 124, 0.18), transparent 68%); }

.fresh-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.fresh-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    min-height: 230px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(151, 182, 230, 0.14);
    background: linear-gradient(180deg, rgba(12, 22, 39, 0.96), rgba(9, 17, 31, 0.92));
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.fresh-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    opacity: 0.95;
}

.fresh-card::after {
    content: '';
    position: absolute;
    inset: auto -34px -42px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.fresh-card:hover {
    transform: translateY(-5px);
    border-color: rgba(151, 182, 230, 0.24);
    box-shadow: 0 30px 72px rgba(1, 6, 16, 0.55);
}

.fresh-card > * {
    position: relative;
    z-index: 1;
}

.fresh-card-top,
.fresh-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.fresh-card-body {
    display: grid;
    gap: 12px;
}

.fresh-card h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.85rem);
    letter-spacing: 0;
    line-height: 1.05;
}

.fresh-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.fresh-card-bottom {
    color: var(--muted);
    font-size: 0.95rem;
}

.fresh-badge {
    padding: 8px 12px;
    color: rgba(237, 243, 255, 0.74);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fresh-card.featured { grid-column: span 7; min-height: 290px; }
.fresh-card.stack { grid-column: span 5; min-height: 290px; }
.fresh-card.standard { grid-column: span 4; }

.fresh-card.fresh-cyan::before { background: linear-gradient(90deg, #55c6ff, #7df5c8); }
.fresh-card.fresh-cyan::after { background: radial-gradient(circle, rgba(85, 198, 255, 0.20), transparent 70%); }
.fresh-card.fresh-violet::before { background: linear-gradient(90deg, #7f8cff, #55c6ff); }
.fresh-card.fresh-violet::after { background: radial-gradient(circle, rgba(127, 140, 255, 0.22), transparent 70%); }
.fresh-card.fresh-mint::before { background: linear-gradient(90deg, #7df5c8, #55c6ff); }
.fresh-card.fresh-mint::after { background: radial-gradient(circle, rgba(125, 245, 200, 0.18), transparent 70%); }
.fresh-card.fresh-rose::before { background: linear-gradient(90deg, #ff6777, #7f8cff); }
.fresh-card.fresh-rose::after { background: radial-gradient(circle, rgba(255, 103, 119, 0.16), transparent 70%); }
.fresh-card.fresh-blue::before { background: linear-gradient(90deg, #66b7ff, #55c6ff); }
.fresh-card.fresh-blue::after { background: radial-gradient(circle, rgba(102, 183, 255, 0.18), transparent 70%); }
.fresh-card.fresh-gold::before { background: linear-gradient(90deg, #ffd76c, #55c6ff); }
.fresh-card.fresh-gold::after { background: radial-gradient(circle, rgba(255, 215, 108, 0.18), transparent 70%); }

.trending-shell {
    display: grid;
    border: 1px solid rgba(151, 182, 230, 0.14);
    border-radius: 30px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(11, 21, 37, 0.96), rgba(8, 16, 29, 0.92));
    box-shadow: var(--shadow);
}

.trend-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 220px;
    gap: 20px;
    align-items: center;
    padding: 24px 26px;
    border-bottom: 1px solid rgba(151, 182, 230, 0.09);
    transition: background 0.2s ease;
}

.trend-row:last-child {
    border-bottom: none;
}

.trend-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.trend-rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    color: rgba(125, 245, 200, 0.9);
    letter-spacing: 0;
}

.trend-main {
    display: grid;
    gap: 10px;
}

.trend-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.trend-meta span,
.trend-meta a {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b5c8e8;
    font-size: 0.8rem;
    font-weight: 700;
}

.trend-meta a:hover,
.trend-author:hover,
.prompt-footer a:hover,
.detail-toolbar a:hover,
.author-meta a:hover {
    color: var(--secondary);
}

.trend-main h3 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    letter-spacing: 0;
}

.trend-main p {
    margin: 0;
    color: var(--muted);
    line-height: 1.58;
}

.trend-side {
    display: grid;
    gap: 12px;
    justify-items: end;
}

.trend-author {
    color: #c9d8f6;
    font-weight: 700;
}

.trend-stats {
    display: grid;
    gap: 8px;
    justify-items: end;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 980px) {
    .category-bento,
    .fresh-grid {
        grid-template-columns: 1fr;
    }

    .category-bento .category-tile,
    .fresh-grid .fresh-card {
        grid-column: auto;
    }

    .trend-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .trend-side {
        justify-items: start;
    }

    .trend-stats {
        justify-items: start;
    }
}

.orbit-scene {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.orbit-card {
    --orbit-size: min(100%, 300px);
    --orbit-pad: 86px;
    --orbit-ring-inset: 14px;
    --orbit-edge-width: 84%;
    --orbit-gap: 8px;
    --orbit-title-size: 1rem;
    --orbit-title-lines: 3;
    --orbit-desc-size: 0.78rem;
    --orbit-desc-lines: 2;
    --orbit-meta-size: 0.62rem;
    --orbit-bottom-size: 0.68rem;
    position: relative;
    display: grid;
    place-items: center;
    width: var(--orbit-size);
    min-width: 0;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(151, 182, 230, 0.14);
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), rgba(9,18,31,0.96) 62%);
    box-shadow: var(--shadow);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.orbit-card::before {
    content: '';
    position: absolute;
    inset: var(--orbit-ring-inset);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: inherit;
    pointer-events: none;
}

.orbit-card::after {
    content: '';
    position: absolute;
    inset: auto -18px -24px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    pointer-events: none;
}

.orbit-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(85, 198, 255, 0.3);
    box-shadow: 0 34px 80px rgba(1, 6, 16, 0.58);
}

.orbit-card > * {
    position: relative;
    z-index: 1;
}

.orbit-card-inner {
    width: calc(100% - var(--orbit-pad));
    height: calc(100% - var(--orbit-pad));
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--orbit-gap);
    text-align: center;
}

.orbit-top {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    max-width: var(--orbit-edge-width);
    min-width: 0;
    justify-self: center;
}

.orbit-tool,
.orbit-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 6px 9px;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--orbit-meta-size);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orbit-tool {
    max-width: calc(100% - 54px);
    background: rgba(255,255,255,0.06);
    color: #cde6ff;
}

.orbit-status {
    flex: 0 0 auto;
    background: rgba(125, 245, 200, 0.12);
    color: #aef6dc;
}

.orbit-body {
    display: grid;
    gap: 8px;
    align-content: center;
    min-width: 0;
    width: 100%;
}

.orbit-body h3 {
    margin: 0;
    font-size: var(--orbit-title-size);
    line-height: 1.06;
    letter-spacing: 0;
}

.orbit-body h3 a,
.orbit-body p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: normal;
}

.orbit-body h3 a {
    -webkit-line-clamp: var(--orbit-title-lines);
    line-clamp: var(--orbit-title-lines);
}

.orbit-body p {
    margin: 0;
    color: var(--muted);
    font-size: var(--orbit-desc-size);
    line-height: 1.34;
    -webkit-line-clamp: var(--orbit-desc-lines);
    line-clamp: var(--orbit-desc-lines);
}

.orbit-bottom {
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 100%;
    max-width: var(--orbit-edge-width);
    justify-self: center;
    color: var(--muted);
    font-size: var(--orbit-bottom-size);
    line-height: 1.22;
    min-width: 0;
}

.orbit-bottom span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orbit-xl {
    --orbit-size: min(100%, 420px);
    --orbit-pad: 116px;
    --orbit-ring-inset: 16px;
    --orbit-edge-width: 78%;
    --orbit-title-size: clamp(1.35rem, 1.9vw, 1.72rem);
    --orbit-title-lines: 2;
    --orbit-desc-size: 0.95rem;
    --orbit-desc-lines: 2;
    --orbit-meta-size: 0.7rem;
    --orbit-bottom-size: 0.8rem;
    grid-column: span 5;
    justify-self: start;
}

.orbit-lg {
    --orbit-size: min(100%, 330px);
    --orbit-pad: 98px;
    --orbit-ring-inset: 14px;
    --orbit-edge-width: 80%;
    --orbit-title-size: clamp(1.05rem, 1.35vw, 1.26rem);
    --orbit-title-lines: 3;
    --orbit-desc-size: 0.82rem;
    --orbit-desc-lines: 2;
    --orbit-meta-size: 0.62rem;
    --orbit-bottom-size: 0.72rem;
    grid-column: span 4;
    justify-self: center;
}

.orbit-md {
    --orbit-size: min(100%, 270px);
    --orbit-pad: 88px;
    --orbit-gap: 6px;
    --orbit-ring-inset: 12px;
    --orbit-edge-width: 74%;
    --orbit-title-size: 0.9rem;
    --orbit-title-lines: 3;
    --orbit-desc-size: 0.68rem;
    --orbit-desc-lines: 2;
    --orbit-meta-size: 0.54rem;
    --orbit-bottom-size: 0.62rem;
    grid-column: span 3;
    justify-self: center;
}

.orbit-sm {
    --orbit-size: min(100%, 250px);
    --orbit-pad: 82px;
    --orbit-gap: 5px;
    --orbit-ring-inset: 12px;
    --orbit-edge-width: 74%;
    --orbit-title-size: 0.82rem;
    --orbit-title-lines: 3;
    --orbit-desc-size: 0.62rem;
    --orbit-desc-lines: 1;
    --orbit-meta-size: 0.5rem;
    --orbit-bottom-size: 0.58rem;
    grid-column: span 4;
    justify-self: end;
}

.orbit-cyan::after { background: radial-gradient(circle, rgba(85, 198, 255, 0.24), transparent 70%); }
.orbit-violet::after { background: radial-gradient(circle, rgba(127, 140, 255, 0.24), transparent 70%); }
.orbit-mint::after { background: radial-gradient(circle, rgba(125, 245, 200, 0.22), transparent 70%); }
.orbit-rose::after { background: radial-gradient(circle, rgba(255, 103, 119, 0.18), transparent 70%); }
.orbit-blue::after { background: radial-gradient(circle, rgba(102, 183, 255, 0.20), transparent 70%); }
.orbit-gold::after { background: radial-gradient(circle, rgba(255, 215, 108, 0.22), transparent 70%); }

@media (max-width: 980px) {
    .orbit-scene {
        grid-template-columns: 1fr 1fr;
        justify-items: center;
    }

    .orbit-card {
        --orbit-size: min(100%, 300px);
        --orbit-pad: 92px;
        --orbit-title-size: 0.96rem;
        --orbit-title-lines: 3;
        --orbit-desc-size: 0.72rem;
        --orbit-desc-lines: 2;
        grid-column: auto;
        justify-self: center;
    }
}

@media (max-width: 640px) {
    .orbit-scene {
        grid-template-columns: 1fr;
    }

    .orbit-card {
        --orbit-size: min(100%, 320px);
        --orbit-pad: 96px;
        --orbit-title-size: 1rem;
        --orbit-desc-size: 0.76rem;
        justify-self: center;
    }
}

/* ── Comment card ── */
.comment-card {
    padding: 20px 22px;
    display: grid;
    gap: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-header strong {
    display: block;
    margin-bottom: 4px;
}

.comment-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.small-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 10px;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

/* ── Related prompts ── */
.related-block {
    margin-top: 26px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 980px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Profile stats ── */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.author-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(85, 198, 255, 0.06), rgba(127, 140, 255, 0.06)),
        var(--surface);
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    margin-bottom: 6px;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--primary);
}

.stat-card small {
    color: var(--muted);
    font-size: 0.88rem;
}

@media (max-width: 980px) {
    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Profile bio ── */
.profile-bio {
    max-width: 540px;
    color: var(--muted);
    line-height: 1.65;
    margin: 8px 0 0;
}

.profile-bio.muted {
    font-size: 0.95rem;
}

.profile-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: auto;
}

.profile-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    color: #061321;
    font-weight: 800;
    background:
        linear-gradient(135deg, rgba(125, 245, 200, 0.98), rgba(85, 198, 255, 0.92) 52%, rgba(255, 215, 108, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 34px rgba(1, 6, 16, 0.32);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xl {
    width: 104px;
    height: 104px;
    font-size: 2.2rem;
}

.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 1.05rem;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
    box-shadow: none;
}

.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0 12px;
    color: #c9d8f6;
    font-weight: 700;
}

.author-chip > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-author-chip {
    margin: 0;
}

.comment-author-chip {
    margin: 0 0 4px;
}

.author-meta,
.author-links,
.status-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.author-meta,
.author-links {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 700;
}

.author-meta span,
.author-meta a,
.author-links span,
.author-links a,
.status-strip span {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid rgba(151, 182, 230, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.status-strip {
    margin: 8px 0 24px;
    color: var(--muted);
}

.dashboard-grid-wide {
    align-items: start;
}

.dashboard-grid h2 {
    margin: 0 0 14px;
}

.dashboard-grid h2:not(:first-child) {
    margin-top: 24px;
}

.author-catalog-head {
    margin-top: 30px;
}

.inline-filter {
    min-width: min(100%, 220px);
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-info {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.detail-info span {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary);
    font-weight: 700;
}

.detail-info p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 980px) {
    .author-stats,
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Profile edit form ── */
.profile-edit-form {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    font-size: 0.9rem;
    font-weight: 700;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Trending week badge ── */
.week-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(125, 245, 200, 0.1);
    border: 1px solid rgba(125, 245, 200, 0.16);
    color: #9ef6d8;
    font-size: 0.8rem;
    font-weight: 700;
}


/* ── Responsive polish ── */
.avatar-edit-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0 6px;
    color: var(--muted);
    line-height: 1.55;
}

.avatar-edit-preview p {
    margin: 0;
}

@media (max-width: 760px) {
    main {
        padding-bottom: 56px;
    }

    .site-header {
        position: static;
    }

    .nav-shell {
        gap: 14px;
        padding: 14px 0;
    }

    .main-nav {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .nav-link,
    .nav-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .hero-section {
        padding-top: 22px;
    }

    .hero-grid,
    .hero-preview,
    .filter-card,
    .form-card,
    .auth-card,
    .detail-card,
    .comment-block,
    .prompt-card,
    .category-tile,
    .fresh-card,
    .stat-card {
        padding: 18px;
    }

    .hero-grid,
    .trending-shell,
    .category-tile,
    .fresh-card,
    .filter-card,
    .form-card,
    .auth-card,
    .detail-card,
    .comment-block,
    .prompt-card,
    .stat-card {
        border-radius: 18px;
    }

    .hero-section h1 {
        font-size: 2.15rem;
        line-height: 1.02;
    }

    .section-head h2,
    .catalog-head h1,
    .profile-header h1 {
        font-size: 1.72rem;
        line-height: 1.08;
    }

    .hero-text,
    .catalog-head p,
    .profile-bio {
        font-size: 1rem;
        line-height: 1.58;
    }

    .hero-code {
        padding: 14px;
        font-size: 0.76rem;
        line-height: 1.6;
    }

    .catalog-summary,
    .catalog-toolbar,
    .detail-toolbar,
    .prompt-footer,
    .fresh-card-bottom,
    .trend-side,
    .trend-stats {
        justify-content: flex-start;
        justify-items: start;
    }

    .profile-stats,
    .author-stats {
        grid-template-columns: 1fr;
    }

    .detail-info-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .trend-row {
        padding: 18px;
    }

    .avatar-edit-preview {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .container,
    .narrow-section,
    .auth-section {
        width: min(100% - 18px, 1000px);
    }

    .brand {
        font-size: 1.12rem;
    }

    .hero-section h1 {
        font-size: 1.9rem;
    }

    .hero-actions,
    .detail-actions,
    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .orbit-card {
        --orbit-size: min(100%, 292px);
        --orbit-pad: 86px;
        --orbit-title-size: 0.94rem;
        --orbit-desc-size: 0.7rem;
    }

    .avatar-xl {
        width: 86px;
        height: 86px;
        font-size: 1.8rem;
    }

    .avatar-edit-preview {
        display: grid;
        justify-items: start;
    }
}


/* ── Header metrics ── */
.site-metrics-section {
    padding: 18px 0 0;
}

.site-metrics-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(151, 182, 230, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(120deg, rgba(85, 198, 255, 0.10), rgba(127, 140, 255, 0.08)),
        rgba(10, 19, 34, 0.84);
    box-shadow: 0 18px 46px rgba(1, 6, 16, 0.32);
}

.site-metrics-panel::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -32%;
    width: 28%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: metrics-scan 4.8s linear infinite;
    pointer-events: none;
}

.metrics-live {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #aef6dc;
    background: rgba(125, 245, 200, 0.08);
    border: 1px solid rgba(125, 245, 200, 0.14);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.metrics-live span,
.ai-composer-status span,
.footer-signal span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 0 rgba(125, 245, 200, 0.4);
    animation: live-pulse 1.8s ease-out infinite;
}

.metrics-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(151, 182, 230, 0.10);
}

.metric-value {
    color: var(--text);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
    animation: metric-pop 0.7s ease both;
}

.metric-label {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.25;
}

/* ── Hero AI composer ── */
.hero-ai-preview {
    position: relative;
    overflow: hidden;
}

.hero-ai-preview::after {
    content: '';
    position: absolute;
    inset: auto -40px -40px auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(125, 245, 200, 0.15), transparent 70%);
    pointer-events: none;
}

.ai-composer-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 11px;
    border-radius: 999px;
    color: #bffbe8;
    background: rgba(125, 245, 200, 0.08);
    border: 1px solid rgba(125, 245, 200, 0.12);
    font-size: 0.78rem;
    font-weight: 700;
}

.hero-code-animated {
    position: relative;
    min-height: 334px;
    display: block;
}

.typing-caret {
    display: inline-block;
    width: 9px;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: -0.18em;
    border-radius: 2px;
    background: var(--secondary);
    animation: caret-blink 0.9s steps(2, start) infinite;
}

.ai-response-line {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(85, 198, 255, 0.06);
    border: 1px solid rgba(85, 198, 255, 0.12);
}

.ai-response-line span {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #061321;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-weight: 800;
    font-size: 0.72rem;
}

.ai-response-line p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* ── Overflow hardening ── */
.dashboard-grid > *,
.stack-list,
.mini-card,
.prompt-card,
.category-card,
.category-tile,
.fresh-card,
.comment-card,
.detail-card,
.stat-card,
.empty-box {
    min-width: 0;
}

.mini-card {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px 20px;
    overflow: hidden;
}

.mini-card h3 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.18;
}

.mini-card h3 a,
.mini-card p,
.prompt-card h3 a,
.prompt-card p,
.trend-main h3 a,
.trend-main p,
.detail-card,
.comment-card,
.empty-box {
    overflow-wrap: anywhere;
}

.mini-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.36;
}

.stack-list {
    align-items: stretch;
}

/* ── Mature footer ── */
.site-footer {
    margin-top: 78px;
    padding: 0;
    border-top: 1px solid rgba(151, 182, 230, 0.12);
    background:
        linear-gradient(135deg, rgba(13, 23, 40, 0.96), rgba(6, 13, 25, 0.98)),
        var(--bg);
}

.footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.45fr) minmax(240px, 0.65fr);
    gap: 28px;
    padding: 34px 0 28px;
}

.footer-brand-panel,
.footer-column {
    min-width: 0;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 1.12rem;
    font-weight: 800;
}

.footer-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #061321;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 14px 32px rgba(85, 198, 255, 0.18);
}

.footer-brand-panel p,
.footer-column p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
}

.footer-signal {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #bffbe8;
    background: rgba(125, 245, 200, 0.07);
    border: 1px solid rgba(125, 245, 200, 0.13);
    font-size: 0.86rem;
    font-weight: 700;
}

.footer-column {
    display: grid;
    align-content: start;
    gap: 10px;
}

.footer-column h4 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 0.95rem;
}

.footer-column a {
    width: fit-content;
    color: var(--muted);
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-column a:hover {
    color: var(--secondary);
    transform: translateX(2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 0 24px;
    border-top: 1px solid rgba(151, 182, 230, 0.08);
    color: rgba(143, 163, 194, 0.72);
    font-size: 0.88rem;
}

@keyframes metrics-scan {
    0% { transform: translateX(0); }
    100% { transform: translateX(480%); }
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(125, 245, 200, 0.38); }
    70% { box-shadow: 0 0 0 9px rgba(125, 245, 200, 0); }
    100% { box-shadow: 0 0 0 0 rgba(125, 245, 200, 0); }
}

@keyframes metric-pop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes caret-blink {
    50% { opacity: 0; }
}

@media (max-width: 980px) {
    .site-metrics-panel,
    .footer-shell {
        grid-template-columns: 1fr;
    }

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

    .hero-code-animated {
        min-height: 290px;
    }
}

@media (max-width: 640px) {
    .site-metrics-section {
        padding-top: 12px;
    }

    .site-metrics-panel {
        padding: 12px;
        border-radius: 16px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metrics-live {
        white-space: normal;
    }

    .metric-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        gap: 10px;
    }

    .hero-code-animated {
        min-height: 250px;
    }

    .footer-shell {
        padding-top: 28px;
    }

    .footer-bottom {
        display: grid;
    }
}


/* ── iPhone / narrow viewport polish ── */
@keyframes bubble-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(8px, -8px, 0); }
    66% { transform: translate3d(-6px, 6px, 0); }
}

@media (max-width: 560px) {
    .site-header {
        background: rgba(5, 12, 24, 0.94);
    }

    .nav-shell {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .brand {
        width: fit-content;
        font-size: 1.42rem;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
        gap: 10px;
        padding-bottom: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form,
    .nav-logout-form .nav-button {
        width: 100%;
        min-width: 0;
    }

    .nav-link,
    .nav-button {
        justify-content: center;
        padding: 12px 10px;
        white-space: normal;
        text-align: center;
        line-height: 1.16;
    }

    .nav-profile-link {
        justify-content: center;
    }

    .site-metrics-panel {
        overflow: hidden;
    }

    .metric-card {
        overflow: hidden;
    }

    .metric-value,
    .stat-value {
        flex: 0 0 auto;
    }

    .metric-label {
        align-self: center;
    }

    .hero-grid {
        overflow: hidden;
    }

    .hero-tools {
        min-height: 154px;
        margin-top: 22px;
    }

    .hero-tools span {
        max-width: 48%;
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .hero-tools span:nth-child(1) { left: 0; top: 4px; }
    .hero-tools span:nth-child(2) { left: 32%; top: 38px; }
    .hero-tools span:nth-child(3) { left: 4%; top: 76px; }
    .hero-tools span:nth-child(4) { left: 53%; top: 82px; }
    .hero-tools span:nth-child(5) { left: 10%; top: 120px; }
    .hero-tools span:nth-child(6) { left: 58%; top: 22px; }
}

@media (max-width: 380px) {
    .container,
    .narrow-section,
    .auth-section {
        width: min(100% - 16px, 1000px);
    }

    .brand {
        font-size: 1.28rem;
    }

    .nav-link,
    .nav-button {
        font-size: 0.9rem;
        padding: 11px 8px;
    }

    .hero-section h1 {
        font-size: 1.72rem;
    }

    .hero-text {
        font-size: 0.95rem;
    }

    .hero-tools span {
        max-width: 50%;
        font-size: 0.74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-tools span,
    .site-metrics-panel::after,
    .metrics-live span,
    .ai-composer-status span,
    .footer-signal span,
    .typing-caret {
        animation: none;
    }
}


/* ── Voltaris identity refresh ── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: fit-content;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(85, 198, 255, 0.98), rgba(125, 245, 200, 0.92) 52%, rgba(255, 215, 108, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 16px 38px rgba(85, 198, 255, 0.22);
}

.brand-mark::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 9px;
    background: rgba(6, 19, 33, 0.88);
}

.brand-mark::after {
    content: '';
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(237, 243, 255, 0.22);
    animation: core-spin 9s linear infinite;
}

.brand-mark span {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 24px;
    background: linear-gradient(180deg, #7df5c8, #55c6ff 54%, #ffd76c);
    clip-path: polygon(0 0, 44% 0, 57% 52%, 100% 0, 100% 34%, 62% 100%, 38% 100%, 0 34%);
    filter: drop-shadow(0 0 10px rgba(125, 245, 200, 0.38));
}

.brand-copy {
    display: grid;
    gap: 2px;
    line-height: 1;
}

.brand-name {
    color: var(--text);
    font-size: 1.08rem;
}

.brand-sub {
    color: var(--secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-header {
    box-shadow: 0 16px 48px rgba(1, 6, 16, 0.18);
}

.nav-link,
.nav-button,
.primary-btn,
.secondary-btn {
    min-height: 44px;
}

.nav-link:focus-visible,
.nav-button:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.footer-column a:focus-visible,
.prompt-card a:focus-visible,
.category-tile:focus-visible {
    outline: 2px solid rgba(125, 245, 200, 0.9);
    outline-offset: 3px;
}

.hero-grid {
    position: relative;
    overflow: hidden;
}

.hero-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(125, 245, 200, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 48%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.hero-brandline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    color: var(--muted);
    font-weight: 700;
}

.core-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #bffbe8;
    background: rgba(125, 245, 200, 0.09);
    border: 1px solid rgba(125, 245, 200, 0.16);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.core-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 0 rgba(125, 245, 200, 0.42);
    animation: live-pulse 1.8s ease-out infinite;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.hero-proof span {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    color: #cfe0f8;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(151, 182, 230, 0.10);
    font-size: 0.86rem;
    font-weight: 700;
}

.hero-core-mark {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(8, 17, 31, 0.92);
    border: 1px solid rgba(125, 245, 200, 0.16);
    box-shadow: 0 18px 38px rgba(1, 6, 16, 0.28);
}

.hero-core-mark::before,
.hero-core-mark::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(125, 245, 200, 0.20);
}

.hero-core-mark::before {
    inset: 8px;
    animation: core-spin 8s linear infinite;
}

.hero-core-mark::after {
    inset: 14px;
    border-color: rgba(85, 198, 255, 0.24);
    animation: core-spin 6s linear reverse infinite;
}

.hero-core-mark span {
    position: relative;
    z-index: 1;
    color: var(--secondary);
    font-weight: 900;
    font-size: 1.08rem;
}

.pulse-strip {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(40px, 1fr) auto minmax(40px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 3px 2px 0;
    color: rgba(196, 215, 244, 0.78);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pulse-line {
    position: relative;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(151, 182, 230, 0.12);
}

.pulse-line i {
    position: absolute;
    top: 0;
    width: 18%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    animation: pulse-run 2.6s ease-in-out infinite;
}

.pulse-line i:nth-child(2) { animation-delay: 0.45s; }
.pulse-line i:nth-child(3) { animation-delay: 0.9s; }

.category-tile,
.fresh-card,
.prompt-card,
.mini-card,
.stat-card,
.detail-card,
.comment-card,
.filter-card,
.form-card,
.auth-card {
    transform: translateZ(0);
}

.category-tile:hover,
.fresh-card:hover,
.prompt-card:hover,
.mini-card:hover {
    border-color: rgba(125, 245, 200, 0.24);
}

.footer-mark {
    width: 38px;
    height: 38px;
}

@keyframes core-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-run {
    0% { left: -22%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 104%; opacity: 0; }
}

@media (max-width: 760px) {
    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .hero-brandline {
        margin-bottom: 12px;
    }

    .hero-proof {
        gap: 8px;
    }

    .hero-proof span {
        flex: 1 1 150px;
        justify-content: center;
        text-align: center;
    }

    .hero-core-mark {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .pulse-strip {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    .pulse-line {
        height: 3px;
    }
}

@media (max-width: 560px) {
    .brand {
        justify-self: start;
    }

    .brand-sub {
        font-size: 0.58rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-actions .primary-btn,
    .hero-actions .secondary-btn {
        width: 100%;
    }

    .hero-core-mark {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
    }

    .hero-preview-label,
    .ai-composer-status {
        max-width: calc(100% - 58px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark::after,
    .hero-core-mark::before,
    .hero-core-mark::after,
    .pulse-line i,
    .core-dot {
        animation: none;
    }
}

/* ── Final production polish ── */
.hero-section {
    padding-top: 28px;
}

.hero-brandline {
    margin-bottom: 18px;
}

.hero-brandline > span:last-child {
    color: #a7bbd9;
}

.hero-actions {
    margin-top: 24px;
}

.ai-composer-status {
    min-height: 0;
    height: auto;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    line-height: 1.2;
    background: rgba(125, 245, 200, 0.075);
    box-shadow: none;
}

.ai-composer-status span {
    width: 7px;
    height: 7px;
}

.site-metrics-panel {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
}

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

.metric-card {
    min-height: 72px;
}

.site-metrics-panel .pulse-strip,
.hero-proof {
    display: none;
}

.footer-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.45fr) minmax(240px, 0.65fr);
}

/* New prompts become a living bubble field when JS is available. */
.orbit-scene.is-physics {
    position: relative;
    display: block;
    min-height: 720px;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 20% 20%, rgba(85, 198, 255, 0.10), transparent 28%),
        radial-gradient(circle at 80% 76%, rgba(125, 245, 200, 0.08), transparent 28%),
        rgba(7, 17, 31, 0.40);
}

.orbit-scene.is-physics .orbit-card {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    will-change: transform;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.orbit-scene.is-physics .orbit-xl {
    --orbit-size: 360px;
    --orbit-pad: 104px;
    --orbit-title-size: 1.35rem;
}

.orbit-scene.is-physics .orbit-lg {
    --orbit-size: 292px;
    --orbit-pad: 88px;
    --orbit-title-size: 1.05rem;
}

.orbit-scene.is-physics .orbit-md {
    --orbit-size: 238px;
    --orbit-pad: 76px;
    --orbit-title-size: 0.82rem;
}

.orbit-scene.is-physics .orbit-sm {
    --orbit-size: 220px;
    --orbit-pad: 72px;
    --orbit-title-size: 0.78rem;
}

.orbit-scene.is-physics .orbit-card:hover {
    border-color: rgba(125, 245, 200, 0.34);
    box-shadow: 0 30px 72px rgba(1, 6, 16, 0.62);
}

@media (max-width: 760px) {
    .site-header {
        position: sticky;
        background: rgba(5, 12, 24, 0.96);
    }

    .nav-shell {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 0 10px;
    }

    .brand {
        gap: 9px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand-mark::before {
        inset: 7px;
    }

    .brand-mark::after {
        width: 28px;
        height: 28px;
    }

    .brand-mark span {
        width: 15px;
        height: 20px;
    }

    .brand-name {
        font-size: 0.98rem;
    }

    .brand-sub {
        font-size: 0.54rem;
    }

    .main-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        padding: 1px 1px 4px;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        flex: 0 0 auto;
        width: auto;
        min-width: 86px;
        min-height: 40px;
        padding: 10px 13px;
        border-radius: 12px;
        font-size: 0.92rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .nav-button {
        min-width: 128px;
    }

    .site-metrics-section {
        padding-top: 10px;
    }

    .site-metrics-panel {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        border-radius: 16px;
    }

    .metrics-live {
        justify-content: center;
        width: 100%;
        padding: 8px 10px;
        font-size: 0.68rem;
        white-space: nowrap;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-card {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 72px;
        padding: 10px 7px;
        text-align: center;
    }

    .metric-value {
        font-size: 1.45rem;
    }

    .metric-label {
        font-size: 0.68rem;
        line-height: 1.18;
    }

    .hero-grid {
        padding: 20px;
    }

    .hero-brandline {
        display: grid;
        gap: 8px;
        margin-bottom: 16px;
    }

    .core-badge {
        width: fit-content;
        padding: 7px 10px;
        font-size: 0.68rem;
    }

    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.04;
    }

    .hero-text {
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .ai-composer-status {
        max-width: calc(100% - 58px);
        padding: 6px 8px;
        font-size: 0.66rem;
        border-radius: 9px;
    }

    .hero-preview-label {
        max-width: calc(100% - 58px);
    }

    .orbit-scene.is-physics {
        min-height: 620px;
        border-radius: 20px;
    }

    .orbit-scene.is-physics .orbit-xl {
        --orbit-size: 210px;
        --orbit-pad: 68px;
        --orbit-title-size: 0.82rem;
        --orbit-desc-size: 0.62rem;
        --orbit-bottom-size: 0.56rem;
        --orbit-meta-size: 0.48rem;
    }

    .orbit-scene.is-physics .orbit-lg {
        --orbit-size: 188px;
        --orbit-pad: 62px;
        --orbit-title-size: 0.74rem;
        --orbit-desc-size: 0.56rem;
        --orbit-bottom-size: 0.52rem;
        --orbit-meta-size: 0.46rem;
    }

    .orbit-scene.is-physics .orbit-md,
    .orbit-scene.is-physics .orbit-sm {
        --orbit-size: 166px;
        --orbit-pad: 56px;
        --orbit-title-size: 0.66rem;
        --orbit-desc-size: 0.5rem;
        --orbit-bottom-size: 0.48rem;
        --orbit-meta-size: 0.42rem;
    }

    .orbit-scene.is-physics .orbit-body {
        gap: 5px;
    }

    .orbit-scene.is-physics .orbit-body p {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .footer-shell {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

@media (max-width: 420px) {
    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        min-width: 78px;
        padding: 9px 11px;
        font-size: 0.86rem;
    }

    .nav-button {
        min-width: 116px;
    }

    .metrics-grid {
        gap: 6px;
    }

    .metric-card {
        min-height: 66px;
    }

    .metric-value {
        font-size: 1.28rem;
    }

    .metric-label {
        font-size: 0.62rem;
    }

    .hero-section h1 {
        font-size: 1.82rem;
    }

    .orbit-scene.is-physics {
        min-height: 560px;
    }

    .orbit-scene.is-physics .orbit-xl {
        --orbit-size: 190px;
        --orbit-pad: 62px;
    }

    .orbit-scene.is-physics .orbit-lg {
        --orbit-size: 172px;
        --orbit-pad: 56px;
    }

    .orbit-scene.is-physics .orbit-md,
    .orbit-scene.is-physics .orbit-sm {
        --orbit-size: 150px;
        --orbit-pad: 50px;
    }
}

/* Mobile bubble legibility pass: keep tool labels readable inside small circles. */
.orbit-scene.is-physics .orbit-card-inner {
    overflow: visible;
}

.orbit-scene.is-physics .orbit-top {
    --orbit-edge-width: 92%;
    gap: 4px;
}

.orbit-scene.is-physics .orbit-tool,
.orbit-scene.is-physics .orbit-status {
    padding: 4px 7px;
    letter-spacing: 0;
    overflow: visible;
    text-overflow: clip;
}

.orbit-scene.is-physics .orbit-tool {
    flex: 0 1 auto;
    max-width: calc(100% - 42px);
}

@media (max-width: 760px) {
    .orbit-scene.is-physics {
        min-height: 680px;
    }

    .orbit-scene.is-physics .orbit-xl {
        --orbit-size: 202px;
        --orbit-pad: 42px;
        --orbit-title-size: 0.86rem;
        --orbit-desc-size: 0.62rem;
        --orbit-bottom-size: 0.56rem;
        --orbit-meta-size: 0.52rem;
    }

    .orbit-scene.is-physics .orbit-lg {
        --orbit-size: 184px;
        --orbit-pad: 38px;
        --orbit-title-size: 0.76rem;
        --orbit-desc-size: 0.56rem;
        --orbit-bottom-size: 0.52rem;
        --orbit-meta-size: 0.5rem;
    }

    .orbit-scene.is-physics .orbit-md,
    .orbit-scene.is-physics .orbit-sm {
        --orbit-size: 166px;
        --orbit-pad: 34px;
        --orbit-title-size: 0.68rem;
        --orbit-desc-size: 0.5rem;
        --orbit-bottom-size: 0.48rem;
        --orbit-meta-size: 0.48rem;
    }
}

@media (max-width: 420px) {
    .orbit-scene.is-physics {
        min-height: 640px;
    }

    .orbit-scene.is-physics .orbit-xl {
        --orbit-size: 188px;
        --orbit-pad: 38px;
    }

    .orbit-scene.is-physics .orbit-lg {
        --orbit-size: 176px;
        --orbit-pad: 36px;
    }

    .orbit-scene.is-physics .orbit-md,
    .orbit-scene.is-physics .orbit-sm {
        --orbit-size: 162px;
        --orbit-pad: 32px;
        --orbit-meta-size: 0.46rem;
    }
}

/* Keep orbit tool badges inside the dashed guide ring on narrow screens. */
.orbit-scene.is-physics .orbit-card-inner {
    overflow: hidden;
}

.orbit-scene.is-physics .orbit-tool,
.orbit-scene.is-physics .orbit-status {
    overflow: hidden;
    text-overflow: clip;
}

@media (max-width: 760px) {
    .orbit-scene.is-physics .orbit-top {
        max-width: 84%;
        gap: 3px;
        margin-top: 12px;
    }

    .orbit-scene.is-physics .orbit-tool,
    .orbit-scene.is-physics .orbit-status {
        padding: 3px 6px;
        line-height: 1.15;
    }

    .orbit-scene.is-physics .orbit-tool {
        max-width: calc(100% - 35px);
    }

    .orbit-scene.is-physics .orbit-status {
        min-width: 31px;
    }
}

@media (max-width: 420px) {
    .orbit-scene.is-physics .orbit-top {
        max-width: 86%;
        margin-top: 13px;
    }

    .orbit-scene.is-physics .orbit-tool {
        max-width: calc(100% - 34px);
    }
}

/* Admin moderation dashboard */
.moderation-page {
    display: grid;
    gap: 24px;
}

.moderation-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 14% 18%, rgba(125, 245, 200, 0.14), transparent 30%),
        linear-gradient(135deg, rgba(18, 38, 67, 0.92), rgba(7, 15, 29, 0.94));
    box-shadow: var(--shadow);
}

.moderation-hero h1 {
    margin: 10px 0 8px;
    font-size: clamp(2.25rem, 6vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.moderation-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.moderation-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 11px;
    border: 1px solid rgba(125, 245, 200, 0.24);
    border-radius: 999px;
    background: rgba(125, 245, 200, 0.10);
    color: var(--mint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.moderation-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.moderation-stat {
    min-height: 118px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(14, 28, 50, 0.86);
}

.moderation-stat.is-hot {
    border-color: rgba(125, 245, 200, 0.28);
    background: linear-gradient(135deg, rgba(31, 90, 87, 0.54), rgba(14, 28, 50, 0.88));
}

.moderation-stat span {
    display: block;
    color: var(--text);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.moderation-stat p {
    margin: 10px 0 0;
    color: var(--muted);
}

.moderation-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
    gap: 20px;
    align-items: start;
}

.moderation-section-head {
    align-items: center;
}

.moderation-section-head span {
    color: var(--mint);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.review-list,
.review-sidebar,
.review-history-list {
    display: grid;
    gap: 14px;
}

.review-card,
.review-side-card,
.moderation-inline-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(10, 22, 39, 0.92);
    box-shadow: var(--shadow);
}

.review-card {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.review-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.review-card h3 {
    margin: 10px 0 8px;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.review-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.review-prompt-preview {
    max-height: 230px;
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(151, 182, 230, 0.14);
    border-radius: 16px;
    background: rgba(4, 11, 23, 0.66);
    color: #dceaff;
    line-height: 1.55;
}

.review-prompt-preview p {
    margin: 0 0 12px;
    color: inherit;
}

.review-prompt-preview p:last-child {
    margin-bottom: 0;
}

.review-actions,
.moderation-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.compact-btn {
    min-height: 42px;
    padding: 11px 15px;
    font-size: 0.9rem;
}

.review-side-card {
    padding: 20px;
}

.review-side-card h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.review-history-item {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(151, 182, 230, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.review-history-item span,
.review-history-item small,
.muted-text {
    color: var(--muted);
}

.review-history-item span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.review-history-item strong {
    color: var(--text);
    line-height: 1.25;
}

.review-guide p,
.moderation-empty p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.moderation-empty {
    display: grid;
    gap: 8px;
}

.moderation-inline-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin: 22px 0;
    padding: 18px;
}

.moderation-inline-panel strong {
    display: block;
    margin: 10px 0 4px;
    font-size: 1.15rem;
}

.moderation-inline-panel p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 980px) {
    .moderation-layout {
        grid-template-columns: 1fr;
    }

    .review-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .moderation-hero,
    .review-card-head,
    .moderation-inline-panel {
        grid-template-columns: 1fr;
    }

    .moderation-hero {
        display: grid;
        padding: 22px;
        border-radius: 18px;
    }

    .moderation-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .moderation-stat {
        min-height: 96px;
        padding: 16px;
        border-radius: 16px;
    }

    .moderation-stat span {
        font-size: 1.8rem;
    }

    .review-card {
        padding: 16px;
        border-radius: 18px;
    }

    .review-sidebar {
        grid-template-columns: 1fr;
    }

    .review-actions,
    .moderation-inline-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .review-actions .primary-btn,
    .review-actions .secondary-btn,
    .moderation-inline-actions .primary-btn,
    .moderation-inline-actions .secondary-btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .moderation-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin block inside profile dashboard */
.admin-profile-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.46fr);
    gap: 18px;
    align-items: start;
    margin: 24px 0;
    padding: 22px;
    border: 1px solid rgba(125, 245, 200, 0.22);
    border-radius: 22px;
    background:
        radial-gradient(circle at 10% 10%, rgba(125, 245, 200, 0.12), transparent 28%),
        rgba(10, 22, 39, 0.92);
    box-shadow: var(--shadow);
}

.admin-profile-panel h2 {
    margin: 12px 0 8px;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    letter-spacing: 0;
}

.admin-profile-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.admin-profile-panel-side,
.admin-mini-list {
    display: grid;
    gap: 10px;
}

.admin-mini-list a {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid rgba(151, 182, 230, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-mini-list strong {
    color: var(--text);
    line-height: 1.25;
}

.admin-mini-list span {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .admin-profile-panel {
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: 18px;
    }
}

.muted-chip {
    color: var(--muted);
    opacity: 0.72;
}

/* Frontend refinement pass: calmer branding and cleaner catalog layout */
.site-metrics-panel {
    grid-template-columns: minmax(148px, auto) minmax(0, 1fr);
}

.metrics-live {
    justify-content: center;
    min-width: 148px;
    padding-inline: 14px;
}

.hero-brandline {
    gap: 12px;
}

.hero-brandline > span:last-child {
    max-width: 420px;
    color: #b3c7e3;
    font-size: 0.96rem;
}

.core-badge {
    color: #bffbe8;
}

.hero-text {
    max-width: 680px;
}

.catalog-page-shell {
    display: grid;
    gap: 22px;
}

.catalog-copy {
    display: grid;
    gap: 12px;
    max-width: 760px;
}

.catalog-copy .eyebrow {
    margin-bottom: 0;
}

.catalog-head {
    margin-bottom: 0;
    align-items: flex-end;
}

.catalog-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
}

.catalog-summary {
    align-items: stretch;
    gap: 12px;
}

.catalog-summary-stat {
    display: grid;
    gap: 4px;
    min-width: 190px;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(18, 30, 51, 0.94), rgba(13, 22, 38, 0.88));
    border: 1px solid rgba(151, 182, 230, 0.12);
    box-shadow: 0 18px 44px rgba(1, 6, 16, 0.28);
}

.catalog-summary-stat strong {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text);
}

.catalog-summary-stat span,
.catalog-toolbar-label {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.catalog-summary .catalog-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 16px;
    color: #d6e8ff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(151, 182, 230, 0.12);
}

.catalog-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.catalog-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(125, 245, 200, 0.07);
    border: 1px solid rgba(125, 245, 200, 0.14);
    color: #c8f8e5;
    font-size: 0.84rem;
    font-weight: 700;
}

.catalog-filter-card {
    position: sticky;
    top: 108px;
    align-self: start;
}

.filter-card-head h2 {
    margin: 0 0 6px;
    font-size: 1.12rem;
}

.filter-card-head p {
    margin: 0 0 8px;
    color: var(--muted);
    line-height: 1.55;
}

.filter-card-actions {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.catalog-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    color: var(--text);
}

.catalog-toolbar span {
    padding: 0;
    border: 0;
    background: transparent;
}

.catalog-toolbar-card {
    display: grid;
    gap: 6px;
    min-height: 86px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(17, 28, 47, 0.88);
    border: 1px solid rgba(151, 182, 230, 0.12);
}

.catalog-toolbar-card strong {
    font-size: 1.18rem;
    line-height: 1.2;
}

.catalog-prompt-grid {
    align-items: stretch;
}

.prompt-card.large-card {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 100%;
}

.prompt-card.large-card h3 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.12;
}

.prompt-card.large-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.prompt-card.large-card .prompt-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(151, 182, 230, 0.08);
}

.catalog-empty {
    display: grid;
    gap: 14px;
    min-height: 320px;
    align-content: center;
    padding: 34px;
    background: linear-gradient(160deg, rgba(16, 28, 47, 0.9), rgba(11, 19, 33, 0.86));
}

.catalog-empty strong {
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1.1;
}

.catalog-empty p {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    line-height: 1.65;
}

.catalog-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 980px) {
    .catalog-filter-card {
        position: static;
    }

    .catalog-toolbar {
        grid-template-columns: 1fr;
    }

    .catalog-summary {
        width: 100%;
        justify-content: flex-start;
    }

    .catalog-summary-stat {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .hero-brandline > span:last-child {
        font-size: 0.9rem;
    }

    .catalog-empty {
        min-height: 260px;
        padding: 24px;
    }

    .catalog-empty-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* Final frontend finish: auth cleanup, calmer catalog, balanced hero preview */
.auth-section {
    width: min(760px, calc(100% - 28px));
    margin-top: 34px;
}

.auth-card {
    padding: clamp(24px, 3vw, 40px);
}

.auth-card-head {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-card-head .eyebrow {
    width: fit-content;
    margin-bottom: 0;
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.94;
}

.auth-card-head p {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    color: var(--muted);
}

.auth-card-footer a {
    color: #d8ecff;
    font-weight: 700;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(520px, 0.98fr);
    gap: 26px;
}

.hero-preview {
    position: relative;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 22px;
    row-gap: 18px;
    align-items: start;
    padding: 24px;
}

.hero-preview-bar,
.hero-preview-label {
    grid-column: 1 / -1;
}

.hero-preview-label {
    font-size: 0.86rem;
}

.ai-composer-status {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    align-self: stretch;
    min-height: 210px;
    padding: 24px 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 35, 46, 0.94), rgba(13, 26, 36, 0.88));
    border: 1px solid rgba(125, 245, 200, 0.16);
    font-size: clamp(1.02rem, 1.45vw, 1.48rem);
    font-weight: 800;
    line-height: 1.22;
}

.ai-composer-status span {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    box-shadow: 0 0 0 7px rgba(125, 245, 200, 0.12);
}

.hero-code {
    grid-column: 2;
    grid-row: 3 / span 2;
    min-height: 100%;
    margin: 0;
    padding: 26px 28px;
    font-size: clamp(1rem, 1.35vw, 1.28rem);
    line-height: 1.72;
}

.ai-response-line {
    grid-column: 1;
    align-self: end;
    min-height: 124px;
    padding: 20px 18px;
}

.ai-response-line p {
    font-size: 1.06rem;
    line-height: 1.48;
}

.catalog-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
}

.catalog-summary {
    min-width: min(100%, 248px);
}

.catalog-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.catalog-summary-meta span {
    color: var(--muted);
    font-size: 0.88rem;
}

.catalog-toolbar {
    display: none;
}

.catalog-prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.catalog-filter-card {
    top: 104px;
}

.catalog-filter-card .secondary-btn {
    min-height: 52px;
}

@media (max-width: 1180px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-preview {
        grid-template-columns: 1fr;
    }

    .ai-composer-status,
    .hero-code,
    .ai-response-line {
        grid-column: 1;
        grid-row: auto;
    }

    .ai-composer-status,
    .ai-response-line {
        min-height: 0;
    }

    .catalog-head {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .catalog-summary-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .catalog-prompt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-section {
        width: min(100% - 24px, 760px);
    }
}

@media (max-width: 760px) {
    .auth-card {
        padding: 22px 18px;
    }

    .auth-card h1 {
        font-size: 2.2rem;
        line-height: 1;
    }

    .hero-preview {
        padding: 20px;
    }

    .ai-composer-status {
        padding: 18px 16px;
        font-size: 1rem;
    }

    .hero-code {
        padding: 20px 18px;
        font-size: 0.92rem;
    }

    .catalog-prompt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .catalog-summary-meta {
        display: grid;
        justify-content: stretch;
    }

    .catalog-summary .catalog-reset {
        width: 100%;
    }

    .auth-card-head p {
        font-size: 0.95rem;
    }
}

/* Mobile and icon polish */
html {
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 640px) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }

    .nav-shell {
        gap: 14px;
        padding: 14px 0 16px;
    }

    .brand {
        gap: 10px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .brand-name {
        font-size: 0.98rem;
    }

    .brand-sub {
        font-size: 0.52rem;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        overflow: visible;
        padding: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form,
    .nav-logout-form .nav-button {
        width: 100%;
        min-width: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        justify-content: center;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 0.92rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    .site-metrics-panel {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .metrics-live {
        min-width: 0;
        width: 100%;
        justify-content: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .metric-card {
        min-height: 92px;
        padding: 12px 8px;
    }

    .metric-value {
        font-size: 1.9rem;
    }

    .metric-label {
        font-size: 0.72rem;
        line-height: 1.18;
    }

    .hero-grid {
        padding: 18px;
        border-radius: 22px;
    }

    .hero-brandline {
        display: grid;
        gap: 10px;
    }

    .hero-brandline > span:last-child {
        max-width: 100%;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .hero-section h1 {
        font-size: clamp(2.35rem, 11vw, 3.4rem);
        line-height: 0.96;
        letter-spacing: -0.02em;
    }

    .hero-text {
        font-size: 0.98rem;
        line-height: 1.58;
    }

    .hero-actions {
        gap: 10px;
    }

    .hero-tools {
        min-height: 120px;
        margin-top: 18px;
    }

    .hero-tools span {
        max-width: 54%;
        font-size: 0.74rem;
    }

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

    .hero-preview-label {
        max-width: calc(100% - 56px);
        font-size: 0.8rem;
    }

    .ai-composer-status {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    .ai-response-line {
        grid-template-columns: auto 1fr;
        gap: 12px;
        padding: 16px;
    }

    .ai-response-line p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

@media (max-width: 420px) {
    .brand-copy {
        gap: 1px;
    }

    .brand-name {
        font-size: 0.92rem;
    }

    .brand-sub {
        font-size: 0.48rem;
        letter-spacing: 0.06em;
    }

    .main-nav {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        min-height: 42px;
        padding: 9px 10px;
        font-size: 0.86rem;
    }

    .metric-card {
        min-height: 84px;
    }

    .metric-value {
        font-size: 1.6rem;
    }

    .metric-label {
        font-size: 0.66rem;
    }

    .hero-section h1 {
        font-size: clamp(2.05rem, 10.8vw, 2.8rem);
    }

    .hero-text {
        font-size: 0.94rem;
    }

    .hero-tools span {
        max-width: 58%;
        font-size: 0.7rem;
        padding: 7px 10px;
    }
}

/* Final cohesive frontend pass */
.hero-section h1 {
    max-width: 11ch;
    font-size: clamp(3.05rem, 4.95vw, 4.75rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
}

.hero-text {
    max-width: 620px;
    font-size: 1.04rem;
}

.hero-actions {
    margin-top: 22px;
}

.hero-actions .primary-btn,
.hero-actions .secondary-btn {
    min-width: 210px;
}

.hero-tools {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
    margin-top: 20px;
    overflow: visible;
}

.hero-tools span {
    position: static;
    max-width: none;
    animation: none;
}

.home-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 0.92fr);
    gap: 28px;
}

.hero-preview {
    gap: 18px;
    padding: 22px;
    border-radius: 28px;
}

.hero-preview-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.hero-preview-meta {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.hero-preview-stage {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.preview-status-card {
    display: grid;
    align-content: space-between;
    gap: 18px;
    min-height: 228px;
    padding: 22px 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 35, 46, 0.94), rgba(13, 26, 36, 0.88));
    border: 1px solid rgba(125, 245, 200, 0.16);
}

.preview-status-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #d9fff2;
    font-size: clamp(1rem, 1.35vw, 1.36rem);
    font-weight: 800;
    line-height: 1.2;
}

.preview-status-badge span {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 7px rgba(125, 245, 200, 0.12);
}

.preview-status-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.ai-composer-status {
    display: none;
}

.hero-code {
    min-height: 228px;
    padding: 24px 24px 26px;
    font-size: clamp(0.98rem, 1.2vw, 1.18rem);
    line-height: 1.7;
}

.hero-code code {
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-response-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 0;
    padding: 18px 18px 20px;
    border-radius: 22px;
    background: rgba(13, 24, 42, 0.92);
    border: 1px solid rgba(151, 182, 230, 0.12);
}

.ai-response-line span {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

.ai-response-line p {
    font-size: 1rem;
    line-height: 1.55;
}

.catalog-head {
    grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
    gap: 20px;
}

.catalog-summary {
    display: grid;
    gap: 10px;
}

.catalog-summary-meta {
    justify-content: flex-start;
}

.catalog-prompt-grid,
.author-prompt-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.auth-card,
.form-card,
.detail-card,
.comment-block {
    padding: clamp(24px, 3vw, 38px);
}

.form-card-head {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.form-card-head h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4.6vw, 3.8rem);
    line-height: 0.96;
}

.form-card-head p {
    margin: 0;
    max-width: 640px;
    color: var(--muted);
    line-height: 1.6;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.form-actions .primary-btn,
.form-actions .secondary-btn {
    min-width: 190px;
}

.profile-surface {
    padding: 24px;
    border: 1px solid rgba(151, 182, 230, 0.14);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(14, 25, 44, 0.94), rgba(10, 19, 34, 0.9));
    box-shadow: var(--shadow);
}

.profile-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
}

.profile-copy {
    min-width: 0;
}

.profile-copy .eyebrow {
    width: fit-content;
    margin-bottom: 12px;
}

.profile-header-actions {
    justify-content: flex-end;
}

.profile-stats {
    margin-top: 20px;
}

.status-strip {
    margin: 2px 0 24px;
}

.dashboard-grid-wide {
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.84fr);
}

.mini-card {
    padding: 18px 18px 16px;
    border-radius: 18px;
}

.detail-card {
    border-radius: 28px;
}

.detail-card h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4.6vw, 3.8rem);
    line-height: 0.98;
}

.detail-lead {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.65;
}

.detail-toolbar {
    gap: 10px;
    justify-content: flex-start;
}

.detail-toolbar span {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(151, 182, 230, 0.1);
}

.prompt-text-box {
    font-size: 1rem;
    line-height: 1.78;
}

.comment-card {
    padding: 18px;
    border-radius: 18px;
}

.comment-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.related-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 1180px) {
    .home-hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        max-width: 10ch;
    }

    .hero-preview-stage {
        grid-template-columns: 1fr;
    }

    .preview-status-card,
    .hero-code {
        min-height: 0;
    }

    .profile-header,
    .dashboard-grid-wide {
        grid-template-columns: 1fr;
    }

    .profile-header-actions {
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .hero-section h1,
    .auth-card h1,
    .form-card-head h1,
    .detail-card h1 {
        font-size: clamp(2.15rem, 8.4vw, 3rem);
        line-height: 1;
    }

    .hero-actions .primary-btn,
    .hero-actions .secondary-btn,
    .form-actions .primary-btn,
    .form-actions .secondary-btn {
        min-width: 0;
        width: 100%;
    }

    .hero-tools {
        gap: 8px;
    }

    .hero-tools span {
        font-size: 0.72rem;
        padding: 8px 10px;
    }

    .profile-surface,
    .detail-card,
    .comment-block,
    .form-card,
    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }

    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    .status-strip {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .nav-shell {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .brand {
        justify-self: start;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        overflow: visible;
        padding: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form,
    .nav-logout-form .nav-button {
        width: 100%;
        min-width: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        justify-content: center;
        min-height: 42px;
        padding: 10px 12px;
        border-radius: 14px;
        font-size: 0.9rem;
        white-space: normal;
        text-align: center;
    }

    .site-metrics-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .metrics-live {
        min-width: 0;
        width: 100%;
        justify-content: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-card {
        min-height: 84px;
        padding: 10px 8px;
    }

    .metric-value {
        font-size: 1.56rem;
    }

    .metric-label {
        font-size: 0.68rem;
        line-height: 1.16;
    }

    .hero-grid {
        padding: 18px;
        border-radius: 22px;
    }

    .hero-brandline {
        display: grid;
        gap: 8px;
    }

    .hero-brandline > span:last-child {
        max-width: 100%;
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .hero-text {
        font-size: 0.96rem;
        line-height: 1.58;
    }

    .hero-preview {
        padding: 18px;
        border-radius: 22px;
    }

    .hero-preview-top {
        gap: 12px;
    }

    .hero-preview-label {
        font-size: 0.78rem;
    }

    .preview-status-card {
        min-height: 0;
        padding: 18px 16px;
        border-radius: 20px;
    }

    .preview-status-badge {
        font-size: 0.98rem;
    }

    .hero-code {
        padding: 18px 16px;
        font-size: 0.88rem;
    }

    .ai-response-line {
        padding: 16px;
    }

    .ai-response-line p {
        font-size: 0.94rem;
    }

    .catalog-head,
    .catalog-summary,
    .catalog-summary-meta {
        justify-content: flex-start;
    }

    .catalog-summary-stat {
        width: 100%;
        min-width: 0;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .comment-header {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .brand-name {
        font-size: 0.92rem;
    }

    .brand-sub {
        font-size: 0.48rem;
    }

    .main-nav {
        gap: 8px;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        font-size: 0.84rem;
        padding: 9px 10px;
    }

    .hero-section h1,
    .auth-card h1,
    .form-card-head h1,
    .detail-card h1 {
        font-size: clamp(1.96rem, 10vw, 2.5rem);
    }

    .hero-tools span {
        font-size: 0.68rem;
    }
}


/* Stable home hero rebuild: floating tools, reliable automation panel */
.hero-section {
    padding: 28px 0 8px;
}

.hero-shell,
.home-hero-grid,
.hero-copy {
    overflow: visible;
}

.home-hero-grid {
    grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.74fr);
    gap: 32px;
    align-items: center;
    padding: 34px;
    border-radius: 28px;
}

.hero-section h1 {
    max-width: 12ch;
    font-size: 4rem;
    line-height: 1;
    letter-spacing: 0;
}

.hero-text {
    max-width: 650px;
    font-size: 1.05rem;
    line-height: 1.65;
}

.hero-actions {
    margin-top: 24px;
}

.hero-actions .primary-btn,
.hero-actions .secondary-btn {
    min-width: 190px;
}

.hero-tools {
    position: relative;
    min-height: 154px;
    margin-top: 24px;
    padding: 8px 16px 26px 6px;
    overflow: visible;
}

.hero-tools span {
    position: absolute;
    max-width: min(210px, calc(100% - 20px));
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    animation: tool-float 7.5s ease-in-out infinite;
    will-change: transform;
}

.hero-tools span:nth-child(1) { left: 0; top: 8px; animation-delay: -0.8s; }
.hero-tools span:nth-child(2) { left: 21%; top: 56px; animation-delay: -2.1s; }
.hero-tools span:nth-child(3) { left: 42%; top: 12px; animation-delay: -1.4s; }
.hero-tools span:nth-child(4) { left: 7%; top: 108px; animation-delay: -3.2s; }
.hero-tools span:nth-child(5) { left: 48%; top: 96px; animation-delay: -0.2s; }
.hero-tools span:nth-child(6) { right: 0; top: 50px; animation-delay: -2.7s; }

.hero-automation {
    min-width: 0;
    align-self: stretch;
    display: flex;
}

.automation-window {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    width: 100%;
    min-height: 420px;
    padding: 24px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(151, 182, 230, 0.16);
    background:
        linear-gradient(180deg, rgba(6, 12, 24, 0.98), rgba(10, 20, 36, 0.94)),
        var(--surface);
    box-shadow: 0 24px 64px rgba(1, 6, 16, 0.42);
}

.automation-window::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(125, 245, 200, 0.08), transparent 38%),
        linear-gradient(180deg, rgba(85, 198, 255, 0.05), transparent 56%);
    pointer-events: none;
}

.automation-window > * {
    position: relative;
    z-index: 1;
}

.automation-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
    font-weight: 700;
}

.automation-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: var(--secondary);
    border: 1px solid rgba(125, 245, 200, 0.22);
    background: rgba(8, 17, 31, 0.9);
    box-shadow: inset 0 0 0 8px rgba(125, 245, 200, 0.04);
    font-weight: 900;
}

.automation-flow {
    display: grid;
    gap: 12px;
    align-content: center;
}

.flow-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 14px;
    align-items: start;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(151, 182, 230, 0.12);
    background: rgba(17, 29, 49, 0.72);
    animation: flow-card-pulse 8s ease-in-out infinite;
}

.flow-card:nth-child(2) { animation-delay: -2.6s; }
.flow-card:nth-child(3) { animation-delay: -5.2s; }

.flow-card span {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #061321;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 800;
}

.flow-card strong {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.18;
}

.flow-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.automation-code {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(7, 15, 28, 0.88);
    border: 1px solid rgba(151, 182, 230, 0.12);
    color: #d8ecff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    line-height: 1.45;
}

.automation-code span {
    overflow-wrap: anywhere;
    animation: code-line-glow 6s ease-in-out infinite;
}

.automation-code span:nth-child(2) { animation-delay: -2s; }
.automation-code span:nth-child(3) { animation-delay: -4s; }

@keyframes tool-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(8px, -10px, 0); }
}

@keyframes flow-card-pulse {
    0%, 100% {
        border-color: rgba(151, 182, 230, 0.12);
        background: rgba(17, 29, 49, 0.72);
        transform: translateY(0);
    }
    45%, 55% {
        border-color: rgba(125, 245, 200, 0.26);
        background: rgba(18, 37, 46, 0.9);
        transform: translateY(-3px);
    }
}

@keyframes code-line-glow {
    0%, 100% { color: #d8ecff; }
    50% { color: #bffbe8; }
}

@media (min-width: 1480px) {
    .hero-section h1 {
        font-size: 4.35rem;
    }

    .automation-window {
        min-height: 460px;
    }
}

@media (max-width: 1180px) {
    .home-hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        max-width: 13ch;
        font-size: 3.55rem;
    }

    .hero-automation {
        max-width: 760px;
    }
}

@media (max-width: 760px) {
    .home-hero-grid {
        padding: 20px;
        gap: 24px;
        border-radius: 22px;
    }

    .hero-section h1 {
        max-width: 100%;
        font-size: 2.6rem;
        line-height: 1.04;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-actions .primary-btn,
    .hero-actions .secondary-btn {
        width: 100%;
        min-width: 0;
    }

    .hero-tools {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        min-height: 0;
        padding: 0;
        overflow: visible;
    }

    .hero-tools span {
        position: static;
        max-width: 100%;
        animation: tool-float 7.5s ease-in-out infinite;
        font-size: 0.72rem;
        padding: 8px 10px;
    }

    .automation-window {
        min-height: 0;
        padding: 18px;
        border-radius: 20px;
    }

    .automation-top {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .automation-top .hero-preview-bar {
        display: none;
    }

    .automation-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .flow-card {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .flow-card span {
        grid-row: auto;
    }

    .automation-code {
        font-size: 0.76rem;
    }
}

@media (max-width: 420px) {
    .hero-section h1 {
        font-size: 2.22rem;
    }

    .hero-text {
        font-size: 0.94rem;
    }

    .automation-code {
        display: none;
    }
}

/* Mobile hero chip choreography: keep the tools floating across the whole card. */
.hero-tools span {
    width: max-content;
    min-width: 0;
    max-width: none;
    line-height: 1;
}

.hero-tools span:nth-child(6) {
    right: auto;
    left: 68%;
}

@media (max-width: 760px) {
    .hero-tools {
        position: relative;
        display: block;
        width: 100%;
        min-height: 210px;
        margin: 24px 0 16px;
        padding: 0;
        overflow: visible;
    }

    .hero-tools span {
        position: absolute;
        display: inline-flex;
        width: max-content;
        max-width: 48%;
        padding: 10px 14px;
        border-radius: 999px;
        font-size: clamp(0.72rem, 3vw, 0.84rem);
        white-space: nowrap;
        animation: tool-mobile-float 8s ease-in-out infinite;
    }

    .hero-tools span:nth-child(1) { left: 2%; top: 4px; animation-delay: -0.4s; }
    .hero-tools span:nth-child(2) { left: 27%; top: 58px; animation-delay: -2.2s; }
    .hero-tools span:nth-child(3) { right: 4%; left: auto; top: 8px; animation-delay: -1.2s; }
    .hero-tools span:nth-child(4) { right: 8%; left: auto; top: 82px; animation-delay: -3.6s; }
    .hero-tools span:nth-child(5) { left: 0; top: 136px; animation-delay: -0.9s; }
    .hero-tools span:nth-child(6) { right: 19%; left: auto; top: 148px; animation-delay: -2.8s; }

    .automation-window {
        margin-top: 4px;
    }
}

@media (max-width: 420px) {
    .hero-tools {
        min-height: 198px;
    }

    .hero-tools span {
        padding: 9px 12px;
        max-width: 52%;
    }

    .hero-tools span:nth-child(2) { left: 25%; top: 54px; }
    .hero-tools span:nth-child(4) { right: 6%; top: 78px; }
    .hero-tools span:nth-child(5) { top: 128px; }
    .hero-tools span:nth-child(6) { right: 15%; top: 140px; }
}

@keyframes tool-mobile-float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    35% {
        transform: translate3d(7px, -8px, 0);
    }
    70% {
        transform: translate3d(-5px, 6px, 0);
    }
}

/* Final mobile navigation and hero polish. */
.home-hero-grid {
    overflow: hidden;
}

.home-hero-grid::before {
    border-radius: inherit;
}

@media (max-width: 640px) {
    .site-header {
        overflow: hidden;
    }

    .nav-shell {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: start;
        padding: 14px 0 12px;
    }

    .brand {
        justify-self: start;
    }

    .main-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 2px 10px;
        margin: 0 -2px -4px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form,
    .nav-logout-form .nav-button {
        flex: 0 0 auto;
        width: auto;
        min-width: max-content;
    }

    .nav-logout-form {
        display: inline-flex;
        margin: 0;
    }

    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 11px 18px;
        border-radius: 18px;
        white-space: nowrap;
        text-align: center;
        scroll-snap-align: start;
    }

    .nav-profile-link {
        gap: 8px;
    }

    .home-hero-grid {
        padding: 18px;
    }

    .hero-section h1 {
        max-width: 100%;
        font-size: clamp(2.35rem, 12vw, 3.25rem);
        line-height: 1.02;
        letter-spacing: -0.025em;
        overflow-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 420px) {
    .nav-link,
    .nav-button,
    .nav-logout-form .nav-button {
        min-height: 42px;
        padding: 10px 16px;
        font-size: 0.88rem;
    }

    .hero-section h1 {
        font-size: clamp(2.28rem, 11.2vw, 2.9rem);
    }
}
