
:root {
    --bg: #071019;
    --bg-elevated: #0c1522;
    --bg-soft: #101b2d;
    --panel: rgba(14, 23, 38, 0.92);
    --panel-strong: rgba(9, 15, 26, 0.98);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #eef5ff;
    --muted: #95a6c4;
    --muted-strong: #b8c5da;
    --accent: #61bcff;
    --accent-strong: #78d0ff;
    --accent-2: #8b76ff;
    --success: #5ddd93;
    --warning: #f3b64e;
    --danger: #ff7285;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 12px;
    --shadow-lg: 0 18px 46px rgba(0, 0, 0, 0.26);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.18);
    --shell: 1200px;
    --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    font: 16px/1.62 var(--font-body);
    background:
        radial-gradient(circle at top left, rgba(97, 188, 255, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(139, 118, 255, 0.14), transparent 32%),
        linear-gradient(180deg, #071019 0%, #0a1220 100%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
img[loading="lazy"] { content-visibility: auto; }
button, input, select, textarea { font: inherit; }
.shell { width: min(var(--shell), calc(100% - 32px)); margin: 0 auto; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
    opacity: .28;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 11, 20, 0.72);
    backdrop-filter: blur(18px) saturate(120%);
}
.header-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 0 0 8px rgba(97, 188, 255, 0.08);
}
.brand strong {
    display: block;
    font: 700 1.05rem/1 var(--font-heading);
    letter-spacing: -0.03em;
}
.brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.main-nav > a {
    color: var(--muted);
    padding: 9px 13px;
    border-radius: 999px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.main-nav > a:not(.button):hover,
.main-nav > a:not(.button).active {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}
.main-nav > a.button {
    color: var(--text);
}
.main-nav > a.button.button-primary {
    color: #08111e;
}
.main-nav > a.button.button-muted,
.main-nav > a.button.button-soft {
    color: var(--text);
}
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
}
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    position: relative;
}
.nav-toggle span + span { margin-top: 4px; }

.flash-wrap { padding-top: 14px; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}
.flash.success { border-color: rgba(93, 221, 147, 0.28); background: rgba(17, 39, 31, 0.95); }
.flash.error { border-color: rgba(255, 114, 133, 0.28); background: rgba(45, 16, 24, 0.95); }
.flash button {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.15rem;
    cursor: pointer;
}

.hero {
    padding: 60px 0 26px;
}
.hero-grid,
.split-grid,
.two-col,
.item-layout,
.profile-grid,
.admin-grid,
.auth-grid,
.settings-grid,
.stats-grid,
.card-grid,
.comment-list,
.notifications-list,
.report-list {
    display: grid;
    gap: 20px;
}
.hero-grid,
.split-grid,
.item-layout,
.profile-grid,
.settings-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.two-col,
.auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid { grid-template-columns: 1.1fr .9fr; }

.hero-copy h1,
.page-head h1,
.surface h2,
.item-main h1,
.profile-hero h1,
.admin-head h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 5vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}
.item-main h1, .profile-hero h1, .surface h2, .admin-head h1 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.18em;
}
.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.lede, .muted, .surface p, .item-description, .archive-card p, .profile-hero p { color: var(--muted); }
.hero-copy .lede { max-width: 62ch; font-size: 1.02rem; }
.hero-actions, .button-row, .status-row, .card-meta, .archive-footer, .meta-row, .item-stats, .info-row, .vote-form, .inline-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-actions { margin-top: 26px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); background: rgba(255,255,255,0.09); }
.button-primary {
    border-color: transparent;
    color: #f7fbff;
    background: linear-gradient(135deg, #4c96ff, #7d72ff);
    box-shadow: 0 12px 24px rgba(77, 135, 255, 0.16);
}
.button-primary:visited { color: #f7fbff; }
.button-primary:hover { filter: brightness(1.04); }
.button-muted { background: rgba(255,255,255,0.04); }
.button-danger { background: rgba(255, 114, 133, 0.12); border-color: rgba(255, 114, 133, 0.26); color: #ffd9df; }
.button-soft { background: rgba(97, 188, 255, 0.10); border-color: rgba(97, 188, 255, 0.20); color: #cde8ff; }
.button-sm { min-height: 38px; padding-inline: 16px; font-size: 0.92rem; }

.hero-panel,
.sidebar-stack,
.stack,
.list-stack { display: grid; gap: 16px; }
.surface,
.metric-card,
.archive-card,
.panel-table,
.auth-panel,
.empty-state,
.hero-preview,
.hero-highlight,
.comment-card,
.notification-card,
.moderation-card,
.sidebar-card,
.info-banner,
.hero-copy-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.surface, .auth-panel, .empty-state, .notification-card, .moderation-card, .sidebar-card, .hero-copy-card { padding: 20px; }
.hero-preview { overflow: hidden; }
.hero-graphic {
    position: relative;
    min-height: 258px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(97, 188, 255, 0.18), rgba(139, 118, 255, 0.14));
}
.hero-graphic img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .95;
    object-position: center top;
}
.hero-highlight {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 15px 16px;
    backdrop-filter: blur(10px);
    background: rgba(6, 11, 20, 0.68);
}
.hero-highlight strong { display: block; font-size: 1rem; margin-bottom: 4px; }

.metric-card {
    padding: 15px 16px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.metric-card strong {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}
.metric-card span { color: var(--muted); }
.metric-card .tag-row { margin-top: 10px; }

.section { padding: 22px 0 40px; }
.section-head, .page-head, .profile-hero, .admin-head, .table-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}
.section-head h2, .page-head h1, .profile-hero h1, .admin-head h1 {
    margin-bottom: 6px;
}
.section-head p, .page-head p, .profile-hero p, .admin-head p { margin: 0; color: var(--muted); }

.archive-card { overflow: hidden; display: flex; flex-direction: column; }
.archive-thumb {
    display: block;
    background: linear-gradient(145deg, rgba(97, 188, 255, 0.16), rgba(139, 118, 255, 0.12));
}
.archive-thumb img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: rgba(255,255,255,0.03);
}
.archive-body {
    display: grid;
    gap: 12px;
    padding: 16px;
    flex: 1;
}
.archive-body h3 { margin: 0; font-size: 1.1rem; }
.archive-body p { margin: 0; }
.card-meta {
    color: var(--muted);
    font-size: .84rem;
    text-transform: uppercase;
    letter-spacing: .09em;
}
.card-meta span { display: inline-flex; align-items: center; gap: 8px; }
.card-meta span + span::before {
    content: "•";
    opacity: .45;
    margin-right: 4px;
}
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag, .status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--muted-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 700;
}
.status-pill.success { background: rgba(93, 221, 147, 0.14); color: #d5ffe7; border-color: rgba(93, 221, 147, 0.28); }
.status-pill.warn { background: rgba(243, 182, 78, 0.14); color: #ffe3ad; border-color: rgba(243, 182, 78, 0.28); }
.status-pill.danger { background: rgba(255, 114, 133, 0.14); color: #ffd1d8; border-color: rgba(255, 114, 133, 0.28); }
.archive-footer { justify-content: space-between; }
.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}
.author-chip img, .profile-avatar, .comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
}
.profile-avatar { width: 84px; height: 84px; }
.item-layout { align-items: start; }
.item-main, .item-sidebar { display: grid; gap: 18px; }
.item-cover {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.item-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: rgba(255,255,255,0.03); }
.item-description { font-size: 1rem; }
.info-grid { display: grid; gap: 12px; }
.info-chip {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
}
.info-chip span { color: var(--muted); }
.info-chip strong { font-size: .96rem; }
.item-stats { color: var(--muted); font-size: .9rem; }
.vote-form { gap: 10px; }
.vote-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-radius: 999px;
    min-height: 44px;
    padding: 0 16px;
    cursor: pointer;
}
.vote-button.active.like { border-color: rgba(93,221,147,.36); background: rgba(93,221,147,.14); }
.vote-button.active.dislike { border-color: rgba(255,114,133,.36); background: rgba(255,114,133,.14); }
.notice {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--muted-strong);
}

.field,
.textarea,
.select,
.file-input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field:focus,
.textarea:focus,
.select:focus,
.file-input:focus {
    border-color: rgba(97, 188, 255, 0.40);
    box-shadow: 0 0 0 5px rgba(97, 188, 255, 0.12);
    background: rgba(255,255,255,0.06);
}
.textarea { min-height: 140px; resize: vertical; }
label.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: .84rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted-strong);
    font-weight: 700;
}
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.help-text { color: var(--muted); font-size: .9rem; }

.empty-state {
    text-align: center;
    color: var(--muted);
}
.empty-state strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 8px; }

.comment-card, .notification-card {
    display: grid;
    gap: 10px;
    padding: 16px;
}
.comment-top, .notification-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}
.comment-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.comment-body, .notification-body { color: var(--muted-strong); }
.notification-card.unread { border-color: rgba(97,188,255,0.24); background: rgba(19, 35, 58, 0.95); }

.profile-hero { align-items: center; }
.profile-hero .summary {
    display: flex;
    align-items: center;
    gap: 16px;
}
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
.profile-stats strong { display: block; color: var(--text); font-size: 1.15rem; }

.filters {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}
.filters-row { display: grid; grid-template-columns: 1.4fr repeat(3, .8fr); gap: 12px; }
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 24px;
}
.pagination a, .pagination span {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}
.pagination .current { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #09111d; border-color: transparent; font-weight: 700; }

.panel-table {
    overflow: hidden;
}
.table-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted-strong); font-size: .76rem; text-transform: uppercase; letter-spacing: .16em; }
tr:hover td { background: rgba(255,255,255,0.02); }
.table-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.admin-card { padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.admin-card strong { display: block; font-family: var(--font-heading); font-size: 1.45rem; }
.admin-card span { color: var(--muted); }

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: rgba(4, 9, 16, 0.96);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr .8fr .8fr .9fr;
    gap: 18px;
    padding: 22px 0;
}
.footer-grid h3, .footer-grid h4 { margin: 0 0 8px; }
.footer-grid p, .footer-grid a { color: var(--muted); }
.footer-grid a { display: block; margin: 6px 0; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 16px 0 24px;
    color: var(--muted);
    font-size: .92rem;
}

.center-page {
    min-height: calc(100vh - 170px);
    display: flex;
    align-items: center;
    padding: 40px 0;
}

@media (max-width: 1080px) {
    .card-grid.cols-4, .card-grid.cols-3, .stats-grid, .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; flex-direction: column; }
    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(100% + 10px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 12px;
        border-radius: 18px;
        border: 1px solid var(--line);
        background: rgba(7, 12, 22, 0.96);
        box-shadow: var(--shadow-lg);
    }
    .main-nav.is-open { display: flex; }
    .main-nav > a, .main-nav .button { width: 100%; justify-content: center; }
    .hero-grid, .split-grid, .item-layout, .profile-grid, .admin-grid, .settings-grid, .two-col, .auth-grid, .footer-grid {
        grid-template-columns: 1fr;
    }
    .filters-row { grid-template-columns: 1fr; }
    .section-head, .page-head, .profile-hero, .admin-head, .table-head { flex-direction: column; align-items: start; }
}

@media (max-width: 720px) {
    .card-grid.cols-4, .card-grid.cols-3, .card-grid.cols-2, .stats-grid, .admin-metrics, .form-grid.two { grid-template-columns: 1fr; }
    .hero { padding-top: 56px; }
    .hero-copy h1 { font-size: 2.8rem; }
    .hero-graphic { min-height: 220px; }
    .shell { width: min(var(--shell), calc(100% - 24px)); }
}


.archive-body h3 a,
.item-main h1,
.profile-hero h1 {
    overflow-wrap: anywhere;
}

.item-main .page-head {
    margin-bottom: 10px;
}

.item-main .tag-row {
    margin-bottom: 12px;
}

.item-main h1 {
    line-height: 1.08;
}

.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.8) 50%), linear-gradient(135deg, rgba(255,255,255,.8) 50%, transparent 50%);
    background-position: calc(100% - 22px) calc(50% - 3px), calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

.select option,
.select optgroup {
    color: #102033 !important;
    background: #eef4ff !important;
}

.select option:disabled {
    color: #5b6a82;
}

.file-input::file-selector-button {
    margin-right: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.file-input:hover::file-selector-button {
    background: rgba(255,255,255,0.12);
}

.filters {
    padding: 16px;
}

.filters-row {
    grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(160px, 0.85fr));
}

.surface, .auth-panel, .empty-state, .notification-card, .moderation-card, .sidebar-card, .hero-copy-card {
    padding: 20px;
}

.archive-body {
    gap: 12px;
    padding: 16px;
}

.notice {
    line-height: 1.55;
}

.hero-copy .lede,
.surface > p.muted,
.hero-copy-card .muted,
.auth-panel .muted {
    line-height: 1.7;
}

@media (max-width: 1180px) {
    .filters-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .main-nav > a.button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .item-main h1 {
        font-size: clamp(1.8rem, 8vw, 2.35rem);
    }

    .page-head {
        gap: 12px;
    }
}


input::placeholder,
textarea::placeholder {
    color: #7f92b0;
}

.main-nav > a.button.button-primary,
.main-nav > a.button.button-primary:visited {
    color: #f7fbff;
}

.main-nav > a.button.button-muted,
.main-nav > a.button.button-soft,
.main-nav > a.button.button-muted:visited,
.main-nav > a.button.button-soft:visited {
    color: var(--text);
}

.hero-copy .notice,
.sidebar-card .notice,
.surface .notice {
    border-radius: 14px;
}

.split-grid,
.two-col,
.item-layout,
.profile-grid,
.admin-grid,
.settings-grid,
.auth-grid {
    align-items: start;
}

.page-head-tight {
    align-items: center;
}

.notification-top {
    gap: 14px;
}

.notification-body {
    line-height: 1.6;
}

.comment-card,
.notification-card,
.notice,
.admin-card,
.metric-card,
.archive-card,
.panel-table,
.sidebar-card,
.surface,
.auth-panel,
.hero-copy-card {
    backdrop-filter: blur(10px);
}

.notice {
    padding: 12px 14px;
    border-radius: 14px;
}

.table-actions {
    gap: 8px;
}

.table-actions.inline {
    align-items: center;
}

.table-actions.inline form {
    margin: 0;
}

.quick-link-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.quick-link {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}

.quick-link strong {
    font-size: 1rem;
}

.compact-stack,
.stack-compact {
    display: grid;
    gap: 10px;
}

.panel-table table .muted-inline {
    color: var(--muted);
    font-size: .92rem;
}

.moderation-inline-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.moderation-inline-form .field {
    min-height: 38px;
    padding: 10px 12px;
    font-size: .92rem;
}

.admin-users-table .button,
.panel-table .button {
    min-height: 36px;
}

.admin-users-table .button-row {
    gap: 8px;
}

.admin-users-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.profile-stats {
    gap: 14px;
}

.item-main .page-head > div {
    display: grid;
    gap: 10px;
}

.item-main .tag-row {
    margin-bottom: 0;
}

.item-main h1 {
    margin-top: 2px;
    line-height: 1.04;
}

.card-meta.tight {
    gap: 8px;
    row-gap: 6px;
}

@media (max-width: 900px) {
    .page-head-tight {
        align-items: start;
    }
}

@media (max-width: 720px) {
    .button {
        min-height: 40px;
    }

    .metric-card,
    .admin-card,
    .surface,
    .sidebar-card,
    .auth-panel,
    .hero-copy-card,
    .notification-card,
    .comment-card {
        padding: 16px;
    }

    th, td {
        padding: 12px 12px;
    }
}


.toast-stack {
    position: fixed;
    top: 88px;
    right: 18px;
    z-index: 120;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 28px));
    pointer-events: none;
}
.toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 14px 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(8, 14, 24, 0.96);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}
.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}
.toast strong {
    display: block;
    margin-bottom: 4px;
    font-size: .88rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.toast-body {
    min-width: 0;
}
.toast-body div {
    color: var(--muted-strong);
    line-height: 1.45;
}
.toast-close {
    border: 0;
    background: transparent;
    color: var(--muted-strong);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
}
.toast-success {
    border-color: rgba(93, 221, 147, 0.30);
    background: rgba(14, 31, 23, 0.96);
}
.toast-success strong { color: #d9ffe8; }
.toast-error {
    border-color: rgba(255, 114, 133, 0.32);
    background: rgba(40, 16, 23, 0.96);
}
.toast-error strong { color: #ffd7dd; }
.toast-warning {
    border-color: rgba(243, 182, 78, 0.30);
    background: rgba(42, 29, 10, 0.96);
}
.toast-warning strong { color: #ffe7b8; }
.toast-info {
    border-color: rgba(97, 188, 255, 0.30);
    background: rgba(14, 27, 43, 0.96);
}
.toast-info strong { color: #d7ebff; }

.hero-preview {
    max-width: 390px;
    width: 100%;
    justify-self: end;
}
.hero-highlight {
    left: 16px;
    right: 16px;
    bottom: 16px;
    padding: 13px 14px;
}
.hero-highlight .muted {
    line-height: 1.55;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--muted-strong);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 700;
}
.role-pill.role-admin {
    border-color: rgba(255, 114, 133, 0.28);
    background: rgba(255, 114, 133, 0.14);
    color: #ffd6dc;
}
.role-pill.role-moderator {
    border-color: rgba(97, 188, 255, 0.28);
    background: rgba(97, 188, 255, 0.12);
    color: #d7eeff;
}
.role-pill.role-verified {
    border-color: rgba(93, 221, 147, 0.28);
    background: rgba(93, 221, 147, 0.12);
    color: #d8ffe7;
}
.role-pill.role-user {
    border-color: rgba(255, 255, 255, 0.10);
}

.upload-progress-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(8, 14, 24, 0.88);
    box-shadow: var(--shadow-sm);
}
.upload-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}
.upload-progress-top strong {
    font-size: 1rem;
}
.upload-progress-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: .92rem;
}
.progress-track {
    position: relative;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}
.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #4c96ff, #7d72ff);
    box-shadow: 0 0 18px rgba(97, 188, 255, 0.25);
    transition: width .16s ease;
}
.progress-bar.is-indeterminate {
    width: 38%;
    position: relative;
    animation: upload-indeterminate 1.2s linear infinite;
}
@keyframes upload-indeterminate {
    0% {
        transform: translateX(-80%);
    }
    100% {
        transform: translateX(260%);
    }
}
.upload-help-grid {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.upload-note-list {
    display: grid;
    gap: 10px;
}
.upload-note-list .notice {
    min-height: 0;
}
.form-meta-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.info-chip.role-chip {
    align-items: center;
}
.info-chip.role-chip strong {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 900px) {
    .toast-stack {
        top: 82px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .hero-preview {
        max-width: none;
        justify-self: stretch;
    }
}

@media (max-width: 720px) {
    .upload-progress-top,
    .upload-progress-meta {
        flex-direction: column;
        align-items: start;
    }
}

.item-media-stack {
    display: grid;
    gap: 16px;
}
.item-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}
.item-gallery-thumb {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.item-gallery-thumb img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .18s ease;
    background: rgba(255,255,255,0.03);
}
.item-gallery-thumb:hover img {
    transform: scale(1.02);
}
.media-video-card {
    overflow: hidden;
}
.item-video-player {
    width: 100%;
    display: block;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,0.35);
}

.profile-upload-list {
    display: grid;
    gap: 16px;
}
.profile-upload-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}
.profile-upload-thumb {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.profile-upload-thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: rgba(255,255,255,0.03);
}
.profile-upload-main {
    display: grid;
    gap: 12px;
    min-width: 0;
}
.profile-upload-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}
.profile-upload-top h3 {
    margin: 10px 0 0;
    font-size: 1.12rem;
}
.profile-upload-top h3 a {
    color: var(--text);
}
.profile-upload-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.profile-upload-main p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 900px) {
    .profile-upload-row {
        grid-template-columns: 1fr;
    }

    .profile-upload-thumb {
        max-width: 360px;
    }

    .profile-upload-top {
        flex-direction: column;
    }

    .profile-upload-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .item-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

:root {
    --shell: 1380px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 11px;
}

.hero-shell {
    max-width: 1160px;
}

.hero-copy-wide {
    max-width: 980px;
}

.hero-copy-wide .lede {
    max-width: 72ch;
}

.split-grid,
.item-layout,
.settings-grid {
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
}

.surface,
.auth-panel,
.empty-state,
.notification-card,
.moderation-card,
.sidebar-card,
.hero-copy-card {
    padding: 18px;
}

.archive-body {
    gap: 10px;
    padding: 15px;
}

.metric-card {
    min-height: 90px;
    padding: 14px 15px;
}

.button:disabled,
.button.is-disabled,
.button[aria-disabled="true"] {
    opacity: 0.62;
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
}

.download-wait-card {
    display: grid;
    gap: 18px;
    text-align: center;
}

.download-wait-number {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.download-wait-track {
    max-width: 560px;
    margin: 0 auto;
}

.download-wait-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.94rem;
}

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

.profile-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.profile-uploads-panel {
    padding: 0;
    overflow: hidden;
}

.profile-uploads-panel .section-head {
    padding: 20px 20px 16px;
    margin-bottom: 0;
}

.profile-upload-list {
    display: grid;
    gap: 0;
}

.profile-upload-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.profile-upload-thumb {
    border-radius: 14px;
}

.profile-upload-thumb img {
    aspect-ratio: 16 / 10;
    height: 100%;
}

.profile-upload-main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-upload-header {
    display: grid;
    gap: 10px;
}

.profile-upload-main p {
    line-height: 1.55;
}

.profile-upload-side {
    display: grid;
    gap: 12px;
    align-content: center;
    justify-items: end;
    min-width: 190px;
}

.profile-upload-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 0.93rem;
}

.profile-upload-stats strong {
    color: var(--text);
    font-weight: 700;
}

.profile-upload-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-like-list .quick-link {
    padding: 12px 14px;
}

.moderation-inline-form {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.moderation-inline-form .button {
    width: auto;
}

.admin-create-form-grid {
    gap: 12px;
}

@media (max-width: 1100px) {
    .profile-top-grid {
        grid-template-columns: 1fr;
    }

    .profile-upload-row {
        grid-template-columns: 130px minmax(0, 1fr);
        align-items: start;
    }

    .profile-upload-side {
        grid-column: 2;
        justify-items: start;
        min-width: 0;
    }

    .profile-upload-stats,
    .profile-upload-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .profile-upload-row {
        grid-template-columns: 1fr;
    }

    .profile-upload-thumb {
        max-width: 300px;
    }

    .profile-upload-side {
        grid-column: auto;
    }

    .download-wait-meta {
        flex-direction: column;
    }

    .moderation-inline-form {
        grid-template-columns: 1fr;
    }
}

/* Presence, avatar zoom, and mobile refinements */
.header-shell {
    position: relative;
}

body {
    overflow-x: hidden;
}

.site-shell {
    overflow-x: clip;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.table-wrap table {
    min-width: 640px;
}

.author-chip,
.comment-user,
.button-row,
.card-meta,
.archive-footer,
.profile-upload-actions,
.table-actions,
.form-meta-inline {
    min-width: 0;
}

.author-chip {
    flex-wrap: wrap;
}

.author-chip > div,
.comment-user > div,
.profile-upload-main,
.profile-upload-side,
.info-chip,
.notice,
.empty-state,
.sidebar-card,
.surface,
.archive-body {
    min-width: 0;
}

.card-meta,
.profile-upload-main p,
.notice,
.empty-state,
.muted-inline,
.item-description,
.upload-progress-meta,
.download-wait-meta {
    overflow-wrap: anywhere;
}

.avatar-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
    border-radius: 999px;
    flex-shrink: 0;
}

.avatar-view-button img {
    pointer-events: none;
}

.avatar-view-button:focus-visible {
    outline: 2px solid rgba(97, 188, 255, 0.55);
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

.avatar-viewer {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 8, 15, 0.82);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity .16s ease;
    pointer-events: none;
}

.avatar-viewer.is-open {
    opacity: 1;
    pointer-events: auto;
}


.avatar-viewer-dialog {
    position: relative;
    width: min(92vw, 860px);
    max-height: 92vh;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(8, 14, 24, 0.98);
    box-shadow: var(--shadow-lg);
}

.avatar-viewer-dialog img {
    width: 100%;
    max-height: calc(92vh - 110px);
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
}

.avatar-viewer-caption {
    margin-top: 12px;
    color: var(--muted-strong);
    text-align: center;
    overflow-wrap: anywhere;
}

.avatar-viewer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

body.avatar-viewer-open {
    overflow: hidden;
}

.presence-stack {
    display: grid;
    gap: 8px;
}

.presence-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--muted-strong);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

.presence-pill.presence-online {
    border-color: rgba(93, 221, 147, 0.30);
    background: rgba(93, 221, 147, 0.12);
    color: #d8ffe7;
}

.presence-pill.presence-recent {
    border-color: rgba(243, 182, 78, 0.30);
    background: rgba(243, 182, 78, 0.12);
    color: #ffe4b4;
}

.presence-pill.presence-offline {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #dbe7f8;
}

.presence-detail {
    color: var(--muted);
    font-size: 0.93rem;
    overflow-wrap: anywhere;
}

.profile-presence {
    margin-top: 10px;
}

@media (max-width: 900px) {
    .profile-hero .summary {
        align-items: flex-start;
    }

    .main-nav {
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
    }
}

@media (max-width: 720px) {
    .hero-actions,
    .vote-form,
    .sidebar-card .button-row,
    .profile-upload-actions,
    .table-actions,
    .download-wait-meta,
    .upload-progress-meta,
    .item-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions > *,
    .vote-form > *,
    .sidebar-card .button-row > *,
    .profile-upload-actions > *,
    .table-actions > * {
        width: 100%;
    }

    .hero-actions .button,
    .vote-form .vote-button,
    .sidebar-card .button-row .button,
    .profile-upload-actions .button,
    .table-actions .button,
    .table-actions form .button {
        width: 100%;
        justify-content: center;
    }

    .profile-hero .summary,
    .comment-user {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-chip {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-chip strong {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .avatar-viewer {
        padding: 12px;
    }

    .avatar-viewer-dialog {
        width: 100%;
        padding: 14px;
        border-radius: 18px;
    }
}

@media (max-width: 560px) {
    body[data-nav-open="1"] {
        overflow: hidden;
    }

    .shell {
        width: min(var(--shell), calc(100% - 20px));
    }

    .surface,
    .sidebar-card,
    .hero-copy-card,
    .auth-panel,
    .notification-card,
    .comment-card,
    .empty-state {
        padding: 15px;
    }

    .table-head,
    .profile-uploads-panel .section-head,
    .profile-upload-row {
        padding-left: 15px;
        padding-right: 15px;
    }

    .table-wrap table {
        min-width: 560px;
    }
}

.footer-bottom-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-tabs-panel {
    padding: 0;
    overflow: hidden;
}

.profile-tabs-panel .section-head {
    padding: 20px 20px 10px;
    margin-bottom: 0;
}

.profile-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--line);
}

.profile-tab,
.profile-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-decoration: none;
}

.profile-tab strong,
.profile-tab-link strong {
    color: var(--muted-strong);
    font-size: 0.95rem;
}

.profile-tab.is-active,
.profile-tab-link.is-active {
    border-color: rgba(97, 188, 255, 0.24);
    background: rgba(97, 188, 255, 0.10);
}

.profile-tab-links {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.profile-tab-link {
    width: 100%;
}

.profile-activity-list {
    display: grid;
    gap: 0;
}

.profile-activity-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.profile-activity-thumb {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}

.profile-activity-thumb img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: rgba(255,255,255,0.03);
}

.profile-activity-main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-activity-main h3 {
    margin: 0;
    font-size: 1.08rem;
}

.profile-activity-main h3 a {
    color: var(--text);
}

.profile-activity-main p,
.profile-activity-quote {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.profile-activity-quote {
    font-style: italic;
}

.profile-activity-side {
    display: grid;
    gap: 10px;
    justify-items: end;
    min-width: 150px;
}

@media (max-width: 1100px) {
    .profile-activity-row {
        grid-template-columns: 110px minmax(0, 1fr);
        align-items: start;
    }

    .profile-activity-side {
        grid-column: 2;
        justify-items: start;
        min-width: 0;
    }
}

@media (max-width: 820px) {
    .profile-tabs {
        padding-left: 15px;
        padding-right: 15px;
    }

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

    .profile-activity-thumb {
        max-width: 300px;
    }

    .profile-activity-side {
        grid-column: auto;
    }
}

/* Final responsive overrides to prevent later desktop rules from re-breaking mobile layouts. */
@media (max-width: 1180px) {
    .filters-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .split-grid,
    .item-layout,
    .settings-grid {
        grid-template-columns: 1fr !important;
    }

    .filters-row {
        grid-template-columns: 1fr !important;
    }

    .item-sidebar,
    .sidebar-stack,
    .profile-upload-side,
    .profile-activity-side {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .profile-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-tab,
    .profile-tab-link {
        width: 100%;
    }

    .profile-upload-row,
    .profile-activity-row,
    .profile-tabs-panel .section-head {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 560px) {
    .profile-upload-row,
    .profile-activity-row {
        grid-template-columns: 1fr !important;
    }

    .profile-upload-thumb,
    .profile-activity-thumb {
        max-width: 100%;
    }

    .profile-upload-side,
    .profile-activity-side {
        grid-column: auto;
        justify-items: stretch;
    }

    .profile-upload-stats,
    .profile-upload-actions {
        justify-content: flex-start;
    }

    .footer-bottom-actions {
        align-items: flex-start;
    }
}


/* --- Home refresh, remember-me checkbox, and profile pagination --- */
.home-hero {
    position: relative;
    min-height: clamp(460px, 74vh, 760px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: #040b13;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.home-hero::before,
.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-hero::before {
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(4, 10, 18, 0.92) 0%, rgba(4, 10, 18, 0.72) 34%, rgba(4, 10, 18, 0.3) 58%, rgba(4, 10, 18, 0.6) 100%),
        linear-gradient(180deg, rgba(4, 10, 18, 0.18) 0%, rgba(4, 10, 18, 0.2) 45%, rgba(4, 10, 18, 0.88) 100%);
}

.home-hero::after {
    z-index: 2;
    background:
        radial-gradient(circle at 18% 24%, rgba(97, 188, 255, 0.26), transparent 24%),
        radial-gradient(circle at 78% 18%, rgba(139, 118, 255, 0.18), transparent 28%);
}

.home-hero-media,
.home-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.home-hero-image {
    object-fit: cover;
    object-position: center center;
    transform: scale(1.02);
    will-change: transform;
    image-rendering: auto;
}

.home-hero-shell {
    position: relative;
    z-index: 3;
    width: min(var(--shell), calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(92px, 18vh, 170px) 0 clamp(34px, 7vh, 68px);
}

.home-hero-copy {
    display: grid;
    gap: 18px;
    max-width: 760px;
}

.home-hero-copy h1 {
    margin: 0;
    max-width: 12ch;
    font-family: var(--font-heading);
    font-size: clamp(2.55rem, 5vw, 4.7rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.home-hero-copy .lede {
    margin: 0;
    max-width: 62ch;
    font-size: 1.05rem;
    color: rgba(238, 245, 255, 0.78);
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.home-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: rgba(238, 245, 255, 0.84);
}

.home-stat-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.home-stat-pill strong {
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.home-hero-note {
    margin: 4px 0 0;
    max-width: 58ch;
    color: rgba(238, 245, 255, 0.72);
    font-size: 0.95rem;
}

.home-hero-note strong {
    color: var(--text);
}

.home-recent {
    padding-top: 26px;
}

.home-recent .section-head {
    margin-bottom: 20px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--muted-strong);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: #78d0ff;
}

.form-check-copy {
    display: grid;
    gap: 4px;
}

.form-check-copy small {
    color: var(--muted);
    line-height: 1.45;
}

.profile-tab-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.profile-tab-summary {
    display: flex;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.93rem;
}

.profile-tab-pagination {
    margin-left: auto;
}

.profile-tab-pagination .pagination {
    margin-top: 0;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .home-hero {
        min-height: clamp(420px, 62vh, 640px);
    }

    .home-hero::before {
        background:
            linear-gradient(90deg, rgba(4, 10, 18, 0.92) 0%, rgba(4, 10, 18, 0.8) 46%, rgba(4, 10, 18, 0.54) 70%, rgba(4, 10, 18, 0.7) 100%),
            linear-gradient(180deg, rgba(4, 10, 18, 0.18) 0%, rgba(4, 10, 18, 0.18) 38%, rgba(4, 10, 18, 0.9) 100%);
    }
}

@media (max-width: 820px) {
    .home-hero-shell {
        padding-top: clamp(72px, 16vh, 130px);
        padding-bottom: 28px;
    }

    .home-hero-copy {
        max-width: 100%;
        gap: 16px;
    }

    .home-hero-copy h1 {
        max-width: 100%;
        font-size: clamp(2.15rem, 9vw, 3.4rem);
    }

    .home-hero-copy .lede {
        max-width: 100%;
        font-size: 1rem;
    }

    .profile-tab-footer {
        align-items: flex-start;
    }

    .profile-tab-pagination {
        margin-left: 0;
        width: 100%;
    }

    .profile-tab-pagination .pagination {
        justify-content: flex-start;
    }
}

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

    .home-hero::before {
        background:
            linear-gradient(180deg, rgba(4, 10, 18, 0.28) 0%, rgba(4, 10, 18, 0.42) 30%, rgba(4, 10, 18, 0.92) 100%),
            linear-gradient(90deg, rgba(4, 10, 18, 0.78), rgba(4, 10, 18, 0.42));
    }

    .home-hero-shell {
        width: min(var(--shell), calc(100% - 30px));
        padding-top: 74px;
        padding-bottom: 24px;
    }

    .home-hero-stats {
        gap: 6px 14px;
    }

    .home-stat-pill {
        font-size: 0.92rem;
    }

    .profile-tab-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ── Image rendering & mobile polish ── */

a, button, .button, .vote-button, .nav-toggle, .profile-tab, .profile-tab-link, .pagination a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.archive-card,
.profile-upload-row,
.profile-activity-row,
.comment-card,
.notification-card,
.sidebar-card,
.surface {
    contain: layout style;
}

.archive-thumb,
.item-cover,
.item-gallery-thumb,
.profile-upload-thumb,
.profile-activity-thumb {
    overflow: hidden;
    background: linear-gradient(145deg, rgba(97, 188, 255, 0.06), rgba(139, 118, 255, 0.05));
}

@media (max-width: 720px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .archive-card {
        min-width: 0;
    }

    .filters .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters .button-row .button {
        width: 100%;
        justify-content: center;
    }

    .filters .button-row .muted {
        text-align: center;
    }

    .home-hero-copy .hero-actions {
        gap: 10px;
    }

    .home-hero-copy .hero-actions .button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .badge-count {
        min-width: 17px;
        height: 17px;
        font-size: 0.68rem;
    }

    .tag, .status-pill, .role-pill {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    .card-meta {
        font-size: 0.78rem;
    }

    .profile-hero h1 {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    .archive-body h3 {
        font-size: 1rem;
    }

    .section-head h2 {
        font-size: clamp(1.3rem, 6vw, 1.8rem);
    }

    .metric-card strong, .admin-card strong {
        font-size: 1.3rem;
    }

    .hero-copy h1 {
        font-size: clamp(1.8rem, 8vw, 2.8rem);
    }

    .home-hero-copy h1 {
        font-size: clamp(1.9rem, 8vw, 2.8rem);
    }
}
