:root {
    --bg: #050607;
    --panel: #080b10;
    --panel-soft: #0d1118;
    --panel-hover: #111720;
    --text: #f4f7fb;
    --muted: #8d97a7;
    --muted-strong: #b8c0cc;
    --border: #232a35;
    --accent: #27a8ff;
    --accent-strong: #6d5cff;
    --danger: #ff5470;
    --success: #20d49b;
    --shadow: 0 24px 80px rgba(0, 0, 0, .38);
    --radius: 8px;
    --sidebar: 278px;
    --rightbar: minmax(360px, 1fr);
    --feed: minmax(560px, 760px);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Speakly design-system normalization layer */
.ui-section,
.settings-card,
.admin-section,
.bookmark-tools,
.side-card {
    border-color: rgba(122, 140, 166, .22);
    background: linear-gradient(180deg, rgba(13, 17, 24, .94), rgba(7, 9, 13, .92));
    box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.settings-card,
.admin-section {
    padding: 22px;
}

.settings-card h2,
.admin-section h2,
.side-card h2 {
    margin-top: 0;
    letter-spacing: 0;
}

.settings-card-head,
.admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.settings-card-head p,
.settings-subcard p,
.moderation-card p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.settings-subcard {
    padding: 16px;
    border: 1px solid rgba(122, 140, 166, .18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
}

.settings-subcard h3 {
    margin: 0;
    font-size: 17px;
}

.settings-subcard .stack-form {
    margin-top: 14px;
}

.settings-subcard-wide {
    grid-column: 1 / -1;
}

.danger-zone {
    border-color: rgba(255, 84, 112, .28);
    background: rgba(255, 84, 112, .045);
}

.status-pill,
.priority-pill {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(122, 140, 166, .25);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.is-good,
.status-resolved {
    border-color: rgba(32, 212, 155, .36);
    color: #8ef2d2;
}

.status-pill.is-warning,
.status-open,
.priority-high {
    border-color: rgba(255, 190, 90, .42);
    color: #ffd18a;
}

.status-rejected,
.priority-medium {
    border-color: rgba(39, 168, 255, .34);
    color: #8ed6ff;
}

.priority-low {
    color: var(--muted-strong);
}

.style-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.style-picker-buttons {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
}

.js-enabled .style-picker-buttons {
    display: flex;
}

.js-enabled .style-picker-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.style-btn {
    min-height: 34px;
    min-width: 38px;
    padding: 0 10px;
    border: 1px solid rgba(122, 140, 166, .25);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .035);
    font-weight: 850;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.style-btn:hover,
.style-btn.is-active {
    color: var(--text);
    border-color: rgba(39, 168, 255, .58);
    background: rgba(39, 168, 255, .12);
}

.style-btn:hover {
    transform: translateY(-1px);
}

.poll-builder {
    min-width: min(100%, 420px);
    border: 1px solid rgba(122, 140, 166, .18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
}

.poll-builder summary {
    min-height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-strong);
    cursor: pointer;
}

.poll-builder[open] {
    padding: 0 10px 10px;
}

.media-alt-grid input {
    border-radius: var(--radius);
}

.dynamic-quote-preview {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.dynamic-quote-preview img {
    width: 74px;
    height: 58px;
    border-radius: var(--radius);
    object-fit: cover;
}

.side-live-post {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(39, 168, 255, .24);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 10px;
    background: rgba(39, 168, 255, .055);
}

.side-live-post strong,
.side-live-post small {
    display: block;
}

.side-live-post strong {
    line-height: 1.28;
}

.side-live-post small {
    margin-top: 6px;
    color: var(--muted);
}

.live-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(32, 212, 155, .12);
}

.moderation-queue {
    display: grid;
    gap: 12px;
}

.moderation-card {
    padding: 16px;
    border: 1px solid rgba(122, 140, 166, .18);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 16px;
    background: rgba(255, 255, 255, .025);
}

.moderation-meta,
.moderation-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.moderation-meta {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.moderation-post {
    display: block;
    color: var(--text);
    font-weight: 800;
    line-height: 1.35;
}

.moderation-details {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.moderation-actions {
    align-self: start;
}

.moderation-actions textarea {
    min-height: 92px;
}

.moderation-actions div {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.empty-state {
    border-color: rgba(122, 140, 166, .2);
    background:
        radial-gradient(circle at 50% 0%, rgba(39, 168, 255, .09), transparent 36%),
        rgba(8, 11, 16, .38);
}

.compact-empty {
    min-height: auto;
    padding: 26px;
}

.btn.is-submitting,
button.is-submitting {
    position: relative;
    opacity: .74;
    cursor: progress;
}

.btn.is-submitting::after,
button.is-submitting::after {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: speakly-spin .7s linear infinite;
}

@keyframes speakly-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    .mobile-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .settings-grid,
    .moderation-card {
        grid-template-columns: 1fr;
    }

    .settings-card,
    .admin-section {
        padding: 16px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .settings-card-head {
        display: grid;
    }

    .style-picker {
        align-items: flex-start;
        flex-direction: column;
    }

    .style-picker-buttons {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .moderation-actions div {
        flex-wrap: wrap;
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, #07090d 0%, var(--bg) 34rem);
}

a {
    color: inherit;
    text-decoration: none;
}

:where(a, button, input, textarea, select, summary, .post-card):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    display: block;
    flex: 0 0 auto;
}

.app-shell {
    width: min(100%, 1660px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar) var(--feed) var(--rightbar);
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 18px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
    width: fit-content;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(145deg, #131a24, #06080d);
    box-shadow: inset 0 0 18px rgba(39, 168, 255, .18);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    min-height: 52px;
    padding: 0 14px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    color: var(--muted-strong);
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-item:hover,
.nav-item.is-active {
    background: var(--panel-hover);
    color: var(--text);
}

.nav-item:hover {
    transform: translateX(2px);
}

.nav-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 25px;
    line-height: 1;
}

.nav-icon .icon,
.mobile-nav-item .icon {
    width: 27px;
    height: 27px;
}

.nav-label {
    font-size: 20px;
    font-weight: 650;
}

.nav-badge {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #00121f;
    font-size: 12px;
    font-weight: 800;
}

.nav-compose {
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    font-size: 17px;
}

.nav-compose .icon {
    width: 21px;
    height: 21px;
}

.sidebar-spacer {
    flex: 1;
}

.mini-profile,
.guest-box {
    min-height: 66px;
    padding: 10px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.mini-profile:hover,
.guest-box:hover {
    background: var(--panel-hover);
}

.mini-profile-text {
    min-width: 0;
    flex: 1;
}

.mini-profile-text strong,
.mini-profile-text span,
.guest-box strong,
.guest-box span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-profile-text strong,
.guest-box strong {
    color: var(--text);
}

.mini-profile-more {
    color: var(--muted);
    font-weight: 900;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

.mini-profile-more:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

.mini-profile-more .icon {
    width: 20px;
    height: 20px;
}

.main-column {
    min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: rgba(5, 6, 7, .72);
}

.feed-header {
    min-height: 68px;
    padding: 14px 22px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(5, 6, 7, .82);
    display: grid;
    gap: 12px;
}

.feed-header.single {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding-bottom: 14px;
}

.feed-header h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.1;
}

.feed-header span {
    color: var(--muted);
    font-size: 13px;
}

.back-link {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 24px;
}

.back-link:hover {
    background: var(--panel-hover);
}

.feed-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 -22px;
}

.feed-tabs a {
    min-height: 46px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
    position: relative;
}

.feed-tabs a:hover {
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.feed-tabs a.is-active {
    color: var(--text);
}

.feed-tabs a.is-active::after {
    content: "";
    width: 68px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    position: absolute;
    bottom: 0;
}

.compose-card {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    background: rgba(8, 11, 16, .48);
}

.main-composer {
    position: relative;
    z-index: 1;
    background: rgba(8, 11, 16, .62);
}

.guest-compose {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.guest-compose p {
    margin: 0;
    color: var(--muted-strong);
}

.compose-avatar {
    padding-top: 3px;
}

.compose-body textarea {
    width: 100%;
    min-height: 84px;
    resize: none;
    border: 0;
    outline: 0;
    padding: 8px 0;
    background: transparent;
    color: var(--text);
    font-size: 21px;
    line-height: 1.45;
}

.compose-advanced {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 12px;
}

.compact-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
}

.compact-control select,
.poll-builder input,
.poll-builder select {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    color: var(--text);
    padding: 0 10px;
}

.poll-builder {
    position: relative;
}

.poll-builder summary {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.poll-builder summary::-webkit-details-marker {
    display: none;
}

.poll-builder[open] {
    display: grid;
    gap: 8px;
    width: min(100%, 420px);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(8, 11, 16, .78);
}

.compose-body textarea::placeholder {
    color: #6e7786;
}

.compose-tools {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 12px;
}

.icon-file,
.file-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.icon-file:hover,
.file-control:hover {
    border-color: rgba(39, 168, 255, .65);
    background: rgba(39, 168, 255, .08);
}

.icon-file input,
.file-control input {
    display: none;
}

.char-counter {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
}

.char-counter.is-warn {
    color: #ffd166;
}

.char-counter.is-danger {
    color: var(--danger);
}

.post-list {
    display: grid;
}

.post-card {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    transition: background .16s ease;
    position: relative;
}

.post-card:hover {
    background: rgba(255, 255, 255, .025);
}

.post-card[data-post-url] {
    cursor: pointer;
}

.post-card[data-post-url]:focus-visible {
    background: rgba(39, 168, 255, .06);
}

.post-card.has-image {
    padding-bottom: 16px;
}

.thread-parent {
    opacity: .72;
    border-bottom: 1px solid var(--border);
}

.thread-parent .post-card {
    border-bottom: 0;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .12);
}

.avatar-small {
    width: 42px;
    height: 42px;
}

.avatar-large {
    width: 116px;
    height: 116px;
    border: 4px solid var(--bg);
}

.avatar-fallback {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 24% 20%, hsla(var(--avatar-hue), 90%, 74%, .42), transparent 34%),
        linear-gradient(145deg, hsl(var(--avatar-hue), 62%, 34%), #0b111b 62%, hsl(calc(var(--avatar-hue) + 54deg), 58%, 26%));
    color: #eaf7ff;
    font-weight: 900;
}

.avatar-fallback::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
}

.avatar-fallback span {
    position: relative;
    z-index: 1;
}

.post-content {
    min-width: 0;
}

.post-topline {
    min-height: 26px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.post-author {
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-author:hover,
.text-link:hover {
    text-decoration: underline;
}

.post-handle,
.post-time {
    color: var(--muted);
    white-space: nowrap;
}

.post-menu {
    margin-left: auto;
    position: relative;
}

.post-menu summary {
    list-style: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
}

.post-menu summary .icon {
    width: 20px;
    height: 20px;
}

.post-menu summary::-webkit-details-marker {
    display: none;
}

.post-menu summary:hover {
    color: var(--accent);
    background: rgba(39, 168, 255, .09);
}

.post-menu-panel {
    position: absolute;
    right: 0;
    top: 36px;
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    z-index: 20;
}

.post-menu-panel form {
    display: grid;
    gap: 10px;
}

.post-menu label,
.stack-form label,
.settings-form label {
    display: grid;
    gap: 7px;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 700;
}

.post-menu textarea {
    min-height: 76px;
}

.post-edit-form textarea {
    min-height: 110px;
}

.post-text {
    margin-top: 2px;
    display: block;
    color: #eef3fb;
    font-size: 16px;
    line-height: 1.52;
    overflow-wrap: anywhere;
}

.post-style-bold {
    font-weight: 800;
}

.post-style-italic {
    font-style: italic;
}

.post-style-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .035);
}

.post-edited {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.text-link {
    color: var(--accent);
}

.post-image-wrap {
    display: block;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.post-image {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
}

.post-video {
    background: #000;
}

.poll-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 9px;
    background: rgba(255, 255, 255, .025);
}

.poll-card > strong {
    font-size: 15px;
}

.poll-card form {
    margin: 0;
}

.poll-option,
.poll-result {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.poll-option:hover {
    border-color: rgba(39, 168, 255, .7);
    background: rgba(39, 168, 255, .08);
}

.poll-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: rgba(39, 168, 255, .18);
}

.poll-label,
.poll-percent {
    position: relative;
    z-index: 1;
}

.poll-result.is-selected {
    border-color: rgba(39, 168, 255, .62);
}

.poll-card small {
    color: var(--muted);
}

.post-actions {
    height: 38px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: min(7vw, 48px);
}

.post-actions form {
    margin: 0;
}

.action-btn {
    min-width: 54px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 0 10px;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.action-btn .icon {
    width: 20px;
    height: 20px;
}

.action-btn strong {
    font-size: 13px;
    font-weight: 700;
}

.action-btn:hover {
    color: var(--accent);
    background: rgba(39, 168, 255, .08);
}

.action-btn.is-liked {
    color: var(--danger);
}

.action-btn.is-liked:hover {
    background: rgba(255, 84, 112, .1);
}

.action-btn.is-reposted {
    color: var(--success);
}

.action-btn.is-reposted:hover {
    background: rgba(32, 212, 155, .1);
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #03111d;
    background: #eff7ff;
    font-weight: 850;
    transition: transform .18s ease, filter .18s ease, background .18s ease, border-color .18s ease;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
}

.btn-secondary {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.btn-danger {
    border: 1px solid rgba(255, 84, 112, .4);
    background: rgba(255, 84, 112, .12);
    color: #ffdce4;
}

.btn-small {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-wide {
    width: 100%;
}

.rightbar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 12px clamp(16px, 1.8vw, 32px) 30px 28px;
    scrollbar-gutter: stable;
}

.search-box,
.search-page-form {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(0, 0, 0, .58);
}

.search-box {
    position: sticky;
    top: 12px;
    z-index: 8;
    margin-bottom: 16px;
}

.search-box > .icon {
    color: var(--muted);
    width: 21px;
    height: 21px;
}

.search-box input,
.search-page-form input,
.stack-form input,
.settings-form input,
.settings-form textarea,
.settings-form select,
.post-menu select,
.post-menu textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: 0;
    background: #080b10;
    color: var(--text);
    padding: 13px 14px;
}

.search-box input {
    border: 0;
    padding: 0;
    background: transparent;
    font-size: 16px;
}

.search-box:focus-within,
.search-page-form:focus-within,
.stack-form input:focus,
.settings-form input:focus,
.settings-form textarea:focus,
.settings-form select:focus,
.post-menu select:focus,
.post-menu textarea:focus {
    border-color: rgba(39, 168, 255, .75);
    box-shadow: 0 0 0 3px rgba(39, 168, 255, .12);
}

.side-card {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .42);
}

.side-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.15;
}

.side-card p {
    color: var(--muted-strong);
    line-height: 1.5;
}

.side-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.side-card-head span {
    color: var(--muted);
}

.side-card-head span .icon {
    width: 20px;
    height: 20px;
}

.policy-card {
    padding: 16px;
}

.policy-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.policy-card-title .icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.policy-card-title h2 {
    margin: 0;
    font-size: 17px;
}

.policy-card p {
    margin: 0 0 10px;
    font-size: 14px;
}

.trend-list,
.suggest-list,
.notification-list {
    display: grid;
}

.trend-item {
    padding: 12px 0;
    display: grid;
    gap: 3px;
}

.trend-item + .trend-item,
.suggest-item + .suggest-item {
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.trend-item span,
.trend-item small,
.muted {
    color: var(--muted);
}

.trend-item strong {
    font-size: 17px;
}

.suggest-item {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggest-text {
    min-width: 0;
    flex: 1;
}

.suggest-text strong,
.suggest-text span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest-text span {
    color: var(--muted);
}

.flash {
    margin: 14px 22px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel-soft);
    color: var(--text);
}

.flash-success {
    border-color: rgba(32, 212, 155, .45);
    background: rgba(32, 212, 155, .1);
}

.flash-error {
    border-color: rgba(255, 84, 112, .5);
    background: rgba(255, 84, 112, .1);
}

.empty-state {
    padding: 44px 22px;
    color: var(--muted);
    text-align: center;
}

.empty-state h1,
.empty-state h2 {
    margin: 0 0 8px;
    color: var(--text);
}

.empty-state p {
    margin: 0;
}

.profile-hero {
    border-bottom: 1px solid var(--border);
}

.profile-cover {
    height: 190px;
    background:
        linear-gradient(130deg, rgba(39, 168, 255, .34), rgba(109, 92, 255, .2) 48%, rgba(32, 212, 155, .14)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 18px);
    background-size: cover;
    background-position: center;
}

.profile-info {
    padding: 0 22px 22px;
    position: relative;
}

.profile-info .avatar-large {
    margin-top: -58px;
}

.profile-actions {
    position: absolute;
    right: 22px;
    top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: min(100% - 44px, 430px);
}

.profile-actions form {
    margin: 0;
}

.profile-info h1 {
    margin: 12px 0 2px;
    font-size: 26px;
}

.profile-username {
    margin: 0;
    color: var(--muted);
}

.profile-bio {
    margin: 14px 0;
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--muted);
}

.profile-stats strong {
    color: var(--text);
}

.status-pill {
    display: inline-flex;
    min-height: 30px;
    padding: 0 10px;
    align-items: center;
    border-radius: 999px;
    color: #ffd166;
    background: rgba(255, 209, 102, .1);
    margin-bottom: 12px;
}

.search-page-form {
    margin: 18px 22px;
    border-radius: var(--radius);
    padding: 12px;
}

.search-page-form input {
    flex: 1;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: 0;
}

.result-section,
.settings-form,
.admin-section {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.result-section h2,
.section-title,
.settings-card h2,
.admin-section h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.user-row,
.notification-item {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.notification-context {
    display: block;
    color: var(--muted-strong);
    font-style: normal;
    line-height: 1.35;
    margin-top: 3px;
}

.user-row span,
.notification-item span {
    display: grid;
    gap: 3px;
}

.user-row small,
.notification-item small {
    color: var(--muted);
}

.notification-item {
    padding: 16px 22px;
    border-top: 0;
    border-bottom: 1px solid var(--border);
}

.notification-item.is-new {
    background: rgba(39, 168, 255, .06);
}

.settings-form {
    display: grid;
    gap: 18px;
}

.settings-card {
    display: grid;
    gap: 14px;
}

.avatar-edit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.check-row {
    grid-template-columns: 20px 1fr;
    align-items: start;
}

.check-row input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

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

.admin-stats {
    padding: 18px 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-stats div {
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-soft);
    display: grid;
    align-content: center;
}

.admin-stats strong {
    font-size: 28px;
}

.admin-stats span {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.auth-body {
    background:
        linear-gradient(140deg, rgba(39, 168, 255, .18), transparent 34rem),
        linear-gradient(220deg, rgba(109, 92, 255, .14), transparent 28rem),
        var(--bg);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(5, 6, 7, .82);
    box-shadow: var(--shadow);
}

.auth-brand {
    padding: 0;
    margin-bottom: 26px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.auth-card p {
    color: var(--muted-strong);
    line-height: 1.5;
}

.stack-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.auth-switch {
    text-align: center;
    margin: 18px 0 0;
}

.mobile-nav {
    display: none;
}

.mobile-compose-fab {
    display: none;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 88px minmax(520px, 720px) minmax(300px, 1fr);
    }

    .sidebar {
        align-items: center;
        padding-left: 8px;
        padding-right: 8px;
    }

    .brand-name,
    .nav-label,
    .mini-profile-text,
    .mini-profile-more,
    .guest-box span,
    .guest-box strong {
        display: none;
    }

    .brand {
        padding: 0;
    }

    .nav-item {
        width: 56px;
        justify-content: center;
        padding: 0;
    }

    .nav-compose {
        width: 56px;
        min-height: 56px;
        padding: 0;
    }

    .nav-compose span {
        display: none;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 88px minmax(0, 720px);
        justify-content: center;
    }

    .rightbar {
        display: none;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: 68px;
    }

    .app-shell {
        display: block;
        width: 100%;
    }

    .sidebar {
        display: none;
    }

    .main-column {
        width: 100%;
        border-left: 0;
        border-right: 0;
    }

    .feed-header {
        min-height: 62px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .feed-tabs {
        margin-left: -16px;
        margin-right: -16px;
    }

    .compose-card,
    .post-card {
        grid-template-columns: 48px 1fr;
        gap: 10px;
        padding: 15px 16px;
    }

    .main-composer {
        position: static;
        top: auto;
    }

    .compose-body textarea {
        font-size: 18px;
    }

    .post-actions {
        justify-content: space-between;
        gap: 0;
    }

    .action-btn {
        min-width: 0;
        flex: 1 1 0;
        padding: 0 5px;
        gap: 5px;
    }

    .action-btn .icon {
        width: 19px;
        height: 19px;
    }

    .action-btn strong {
        font-size: 12px;
    }

    .rightbar {
        display: none;
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        height: 64px;
        border-top: 1px solid var(--border);
        background: rgba(5, 6, 7, .92);
        backdrop-filter: blur(16px);
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    }

    .mobile-nav-item {
        position: relative;
        display: grid;
        place-items: center;
        color: var(--muted);
        font-size: 24px;
    }

    .mobile-nav-item.is-active {
        color: var(--text);
    }

    .mobile-nav-item b {
        position: absolute;
        top: 9px;
        right: 18%;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: var(--accent);
        color: #00121f;
        font-size: 11px;
    }

    .mobile-compose-fab {
        position: fixed;
        left: 50%;
        bottom: 74px;
        z-index: 60;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        color: #fff;
        background: linear-gradient(135deg, var(--accent), var(--accent-strong));
        box-shadow: 0 18px 50px rgba(39, 168, 255, .28);
        transform: translateX(-50%);
    }

    .mobile-compose-fab:hover {
        filter: brightness(1.06);
    }

    .mobile-compose-fab .icon {
        width: 28px;
        height: 28px;
    }

    .post-menu[open]::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(0, 0, 0, .52);
        backdrop-filter: blur(4px);
    }

    .post-menu-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        top: auto;
        width: auto;
        z-index: 80;
        padding: 16px;
        border-radius: 16px;
    }

    .notification-toggles {
        grid-template-columns: 1fr;
    }

    .profile-cover {
        height: 145px;
    }

    .profile-info {
        padding-left: 16px;
        padding-right: 16px;
    }

    .profile-actions {
        right: 16px;
        max-width: calc(100% - 132px);
        gap: 6px;
    }

    .profile-actions .btn {
        min-height: 34px;
        padding: 0 11px;
        font-size: 13px;
    }

    .avatar-large {
        width: 96px;
        height: 96px;
    }

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

    .search-page-form {
        margin-left: 16px;
        margin-right: 16px;
        display: grid;
        border-radius: var(--radius);
    }

    .guest-compose {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .post-topline {
        flex-wrap: wrap;
        gap: 3px 6px;
    }

    .post-menu {
        margin-left: 0;
    }

    .compose-tools {
        flex-wrap: wrap;
    }

    .char-counter {
        margin-left: 0;
    }

    .auth-page {
        padding: 16px;
    }

    .auth-card {
        padding: 22px;
    }
}

@media (max-width: 760px) {
    .mobile-nav {
        grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    }

    .main-composer.is-mobile-open {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        max-height: min(86vh, 720px);
        overflow: auto;
        border-top: 1px solid var(--border);
        border-radius: 18px 18px 0 0;
        background: rgba(8, 11, 16, .98);
        box-shadow: 0 -20px 70px rgba(0, 0, 0, .48);
        padding-top: 48px;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
        animation: composer-sheet-in .2s ease;
    }

    .main-composer.is-mobile-open .mobile-composer-close {
        position: absolute;
        right: 12px;
        top: 10px;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 999px;
        display: grid;
        place-items: center;
        color: var(--muted);
        background: rgba(255, 255, 255, .06);
    }

    .main-composer.is-mobile-open .mobile-composer-close:hover {
        color: var(--text);
    }

    .hashtag-header {
        grid-template-columns: 1fr;
    }

    .header-action-form {
        justify-self: stretch;
    }

    .header-action-form .btn {
        width: 100%;
    }

    .hashtag-summary,
    .privacy-grid {
        grid-template-columns: 1fr;
    }

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

    .quote-thumb {
        width: 100%;
        height: 150px;
    }

    .toast-stack {
        left: 12px;
        right: 12px;
        bottom: 144px;
    }
}

@keyframes composer-sheet-in {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

body.theme-contrast {
    --bg: #000;
    --panel: #05070b;
    --panel-soft: #090c12;
    --panel-hover: #151b25;
    --text: #fff;
    --muted: #aab4c3;
    --border: #364051;
    --accent: #44c8ff;
    --accent-strong: #8b75ff;
}

body.modal-open {
    overflow: hidden;
}

.media-clear {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 10px;
    background: transparent;
    color: var(--muted-strong);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.media-clear .icon {
    width: 16px;
    height: 16px;
}

.media-preview,
.current-media {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, .025);
}

.media-preview img,
.media-preview video,
.current-media img,
.current-media video {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    background: #000;
}

.current-media {
    padding: 10px;
    display: grid;
    gap: 10px;
}

.current-media > span {
    color: var(--muted);
    font-size: 13px;
}

.post-menu-panel .post-edit-form {
    display: none;
}

.menu-action {
    min-height: 38px;
    border: 0;
    border-radius: var(--radius);
    padding: 0 10px;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    text-align: left;
}

.menu-action:hover {
    background: var(--panel-hover);
}

.quote-preview {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    background: rgba(255, 255, 255, .025);
}

.quote-preview:hover {
    border-color: rgba(39, 168, 255, .48);
    background: rgba(39, 168, 255, .05);
}

.quote-author {
    display: flex;
    gap: 6px;
    align-items: baseline;
    min-width: 0;
}

.quote-author small,
.quote-media {
    color: var(--muted);
}

.quote-text {
    display: block;
    color: var(--muted-strong);
    line-height: 1.42;
}

.quote-media {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.quote-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.quote-thumb {
    width: 96px;
    min-height: 76px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
}

.quote-thumb img,
.quote-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-btn.is-bookmarked {
    color: #ffd166;
}

.action-btn.is-bookmarked:hover {
    background: rgba(255, 209, 102, .1);
}

.action-btn.pulse {
    transform: scale(1.08);
}

.verify-badge {
    width: 17px;
    height: 17px;
    display: inline-block;
    margin-left: 5px;
    vertical-align: -3px;
}

.profile-info h1 .verify-badge {
    width: 22px;
    height: 22px;
    vertical-align: -4px;
}

.post-style-serif {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.post-style-accent {
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: rgba(39, 168, 255, .07);
    color: #eaf7ff;
    font-weight: 750;
}

.post-style-large {
    font-size: 24px;
    line-height: 1.28;
    font-weight: 800;
}

.post-style-quote {
    padding-left: 14px;
    border-left: 3px solid rgba(255, 255, 255, .28);
    color: var(--muted-strong);
    font-style: italic;
}

.load-more {
    min-height: 52px;
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-weight: 800;
}

.load-more:hover {
    background: rgba(39, 168, 255, .06);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    padding: 18px;
}

.modal-shell.is-open {
    display: grid;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(7px);
}

.post-modal {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: min(86vh, 760px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.post-modal h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.post-modal form,
.post-edit-modal-form {
    display: grid;
    gap: 12px;
}

.post-modal textarea {
    width: 100%;
    min-height: 126px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    color: var(--text);
    padding: 13px 14px;
    resize: vertical;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
}

.modal-close:hover {
    color: var(--text);
    background: var(--panel-hover);
}

.profile-tabs,
.notification-tabs {
    position: static;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 11, 16, .44);
}

.profile-tabs {
    grid-template-columns: repeat(3, 1fr);
}

.profile-tabs.has-bookmarks {
    grid-template-columns: repeat(4, 1fr);
}

.notification-tabs {
    grid-template-columns: repeat(4, 1fr);
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-filters a {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: var(--muted-strong);
}

.admin-filters a.is-active,
.admin-filters a:hover {
    color: var(--text);
    border-color: rgba(39, 168, 255, .6);
    background: rgba(39, 168, 255, .08);
}

.admin-action-form {
    min-width: 220px;
    display: grid;
    gap: 8px;
}

.admin-action-form textarea,
td input[name="resolution"] {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    color: var(--text);
    padding: 9px 10px;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.thread-parent,
.post-list.replies .post-card {
    position: relative;
}

.thread-parent::after,
.post-list.replies .post-card::before {
    content: "";
    position: absolute;
    left: 45px;
    top: 70px;
    bottom: -1px;
    width: 2px;
    background: var(--border);
}

@media (max-width: 760px) {
    .mobile-nav {
        grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    }

    .modal-shell {
        align-items: end;
        padding: 0;
    }

    .post-modal {
        width: 100%;
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }
}

.sr-live {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.feed-header .feed-tabs {
    grid-template-columns: repeat(3, 1fr);
}

.feed-header .notification-tabs,
.feed-header .search-tabs,
.notification-tabs,
.search-tabs {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
}

.post-media-grid {
    margin-top: 12px;
    display: grid;
    gap: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--border);
}

.post-media-grid .post-image-wrap {
    margin: 0;
    border: 0;
    border-radius: 0;
    min-height: 170px;
    position: relative;
}

.post-media-grid.media-count-2,
.post-media-grid.media-count-4 {
    grid-template-columns: repeat(2, 1fr);
}

.post-media-grid.media-count-3 {
    grid-template-columns: 1.25fr .9fr;
}

.post-media-grid.media-count-3 .post-image-wrap:first-child {
    grid-row: span 2;
}

.post-media-grid .post-image {
    height: 100%;
    min-height: 170px;
    max-height: 520px;
    object-fit: cover;
}

.media-more {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.repost-context {
    margin: 3px 0 5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.repost-context .icon {
    width: 15px;
    height: 15px;
}

.media-preview.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
}

.media-preview-item {
    min-height: 120px;
    background: #000;
}

.media-preview-item img,
.media-preview-item video {
    height: 100%;
}

.media-alt-grid {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.media-alt-grid input,
.current-media-row input,
.inline-form input,
.folder-create input,
.bookmark-move-form select,
.bookmark-folder-quick select,
.user-mini-action input,
.admin-action-form input,
.stack-form textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    color: var(--text);
    padding: 9px 10px;
}

.bookmark-folder-quick label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
}

.bookmark-folder-quick select {
    grid-column: 1 / -1;
}

.current-media-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px;
    align-items: center;
}

.current-media-row img,
.current-media-row video {
    width: 90px;
    height: 72px;
    border-radius: var(--radius);
    object-fit: cover;
}

.compose-card.is-dragging,
.post-modal.is-dragging {
    outline: 2px dashed var(--accent);
    outline-offset: -8px;
    background: rgba(39, 168, 255, .08);
}

.upload-progress {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    opacity: 0;
}

.upload-progress.is-visible {
    opacity: 1;
}

.upload-progress span {
    display: block;
    width: 18%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width .16s ease;
}

.autocomplete-popover {
    position: absolute;
    z-index: 200;
    display: none;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    box-shadow: var(--shadow);
}

.autocomplete-popover.is-open {
    display: grid;
    gap: 4px;
}

.autocomplete-popover button {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    padding: 6px 10px;
    display: grid;
    gap: 2px;
    text-align: left;
    background: transparent;
    color: var(--text);
}

.autocomplete-popover button:hover,
.autocomplete-popover button.is-active {
    background: var(--panel-hover);
}

.autocomplete-popover small {
    color: var(--muted);
}

.thread-reply {
    position: relative;
}

.thread-reply.depth-2,
.thread-reply.depth-3,
.thread-reply.depth-4,
.thread-reply.depth-5,
.thread-reply.depth-6 {
    margin-left: clamp(10px, 3vw, 42px);
    border-left: 2px solid var(--border);
}

.thread-reply.depth-3,
.thread-reply.depth-4,
.thread-reply.depth-5,
.thread-reply.depth-6 {
    margin-left: clamp(18px, 5vw, 62px);
}

.thread-reply .post-card {
    border-left: 0;
}

.bookmark-tools,
.mute-user-list,
.muted-terms,
.interest-cloud {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 12px;
}

.folder-create,
.inline-form,
.bookmark-move-form,
.user-mini-action {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bookmark-move-form {
    margin: -1px 22px 14px 84px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .022);
}

.bookmark-move-form label {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.folder-tabs,
.search-tabs,
.suggestions-strip,
.interest-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.folder-tabs a,
.interest-cloud span,
.tag-form button {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-strong);
    background: transparent;
}

.folder-tabs a.is-active,
.folder-tabs a:hover,
.tag-form button:hover {
    color: var(--text);
    border-color: rgba(39, 168, 255, .55);
    background: rgba(39, 168, 255, .08);
}

.search-tabs.feed-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(8, 11, 16, .44);
}

.search-tabs.feed-tabs a {
    min-height: 48px;
    border-radius: 0;
    text-align: center;
}

.search-page-form .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.suggestions-strip {
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
}

.post-list > .section-title {
    margin: 0;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 22px;
    line-height: 1.2;
}

.search-empty {
    min-height: 250px;
    display: grid;
    place-content: center;
    gap: 12px;
}

.search-empty p {
    max-width: 430px;
}

.notification-toolbar {
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.security-code,
.recovery-code-list code {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080b10;
    color: var(--text);
    overflow-wrap: anywhere;
}

.recovery-code-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(39, 168, 255, .35);
    border-radius: var(--radius);
    background: rgba(39, 168, 255, .06);
}

.skip-onboarding-form {
    margin-top: 12px;
    text-align: center;
}

.skip-onboarding-form button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.rightbar .trend-list {
    max-height: calc(100vh - 230px);
    overflow: auto;
    padding-right: 4px;
}

.side-more {
    display: inline-flex;
    margin-top: 12px;
}

.header-action-form {
    align-self: start;
    justify-self: end;
}

.hashtag-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: 14px;
}

.hashtag-summary,
.hot-topic-strip {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .018);
}

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

.hashtag-summary h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.compact-suggest-list {
    gap: 4px;
}

.hot-topic-strip,
.profile-interest-row,
.interest-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .025);
    font-weight: 800;
}

.tag-chip:hover {
    color: var(--text);
    border-color: rgba(39, 168, 255, .56);
    background: rgba(39, 168, 255, .08);
}

.tag-chip small {
    color: var(--muted);
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
    color: var(--muted-strong);
}

.profile-meta span,
.profile-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-meta .icon {
    width: 16px;
    height: 16px;
}

.pinned-post-block {
    border-bottom: 1px solid var(--border);
    background: rgba(39, 168, 255, .025);
}

.pinned-post-block .post-card {
    border-bottom: 0;
}

.section-kicker {
    padding: 12px 22px 0 84px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 140;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(8, 11, 16, .96);
    color: var(--text);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    border-color: rgba(255, 84, 112, .55);
}

.toast-info {
    border-color: rgba(39, 168, 255, .55);
}

.skeleton-block {
    display: grid;
}

.skeleton-post {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
}

.skeleton-post span,
.skeleton-post b,
.skeleton-post p {
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06));
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.25s linear infinite;
}

.skeleton-post span {
    width: 48px;
    height: 48px;
}

.skeleton-post b {
    width: 42%;
    height: 16px;
    margin-bottom: 12px;
}

.skeleton-post p {
    height: 12px;
    margin: 8px 0;
}

.skeleton-post p:last-child {
    width: 68%;
}

@keyframes skeleton-shimmer {
    to {
        background-position: -200% 0;
    }
}

.mobile-composer-close {
    display: none;
}

.composer-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(0, 0, 0, .58);
}

body.composer-sheet-open {
    overflow: hidden;
}

.compact-feed .post-card {
    padding-top: 12px;
    padding-bottom: 12px;
}

.compact-feed .post-text {
    line-height: 1.35;
}

.compact-feed .post-media-grid .post-image {
    max-height: 340px;
}

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

.choice-grid,
.follow-choice-list {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 10px;
}

.choice-grid legend,
.follow-choice-list legend {
    margin-bottom: 8px;
    color: var(--muted-strong);
    font-weight: 850;
}

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

.choice-grid label,
.follow-choice-list label {
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .025);
}

.follow-choice-list label span {
    display: grid;
}

.follow-choice-list small {
    color: var(--muted);
}

.onboarding-card {
    width: min(100%, 760px);
}

.onboarding-skip {
    justify-self: center;
}

.auth-page:has(.onboarding-card) {
    place-items: start center;
    min-height: 100dvh;
    padding: clamp(28px, 6vh, 72px) 24px 48px;
}

.onboarding-card {
    padding: clamp(28px, 4vw, 44px);
    border-color: rgba(148, 163, 184, .24);
    background:
        linear-gradient(180deg, rgba(14, 18, 27, .92), rgba(5, 6, 7, .9)),
        radial-gradient(circle at 15% 0%, rgba(39, 168, 255, .14), transparent 28rem);
    overflow: hidden;
}

.onboarding-card .auth-brand {
    margin-bottom: clamp(24px, 4vw, 36px);
}

.onboarding-card h1 {
    max-width: 680px;
    font-size: clamp(34px, 5vw, 46px);
    line-height: 1.05;
}

.onboarding-card > p {
    max-width: 680px;
    margin-bottom: 22px;
    font-size: 17px;
}

.onboarding-card .stack-form {
    gap: 18px;
}

.onboarding-avatar {
    min-height: 58px;
    padding: 0 16px;
    border-radius: 999px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .025);
}

.choice-grid legend,
.follow-choice-list legend {
    grid-column: 1 / -1;
    margin: 0 0 2px;
    color: #dfe8f5;
    font-size: 16px;
}

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

.follow-choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid label,
.follow-choice-list label {
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.choice-grid label {
    min-height: 52px;
    padding: 12px 14px;
}

.follow-choice-list label {
    min-height: 78px;
    padding: 12px 14px;
}

.choice-grid label:hover,
.follow-choice-list label:hover,
.choice-grid label:has(input:checked),
.follow-choice-list label:has(input:checked) {
    border-color: rgba(39, 168, 255, .54);
    background: rgba(39, 168, 255, .08);
}

.choice-grid label:active,
.follow-choice-list label:active {
    transform: translateY(1px);
}

.choice-grid input[type="checkbox"],
.follow-choice-list input[type="checkbox"],
.settings-form input[type="checkbox"],
.stack-form input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    flex: 0 0 18px;
    border-radius: 5px;
    accent-color: var(--accent);
    box-shadow: none;
}

.choice-grid label span,
.follow-choice-list label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.follow-choice-list .avatar {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.follow-choice-list label strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-form {
    padding: 20px 22px 22px;
    background: linear-gradient(180deg, rgba(13, 17, 24, .38), rgba(5, 6, 7, .18));
}

.settings-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: var(--radius);
    background: rgba(8, 11, 16, .72);
}

.settings-card h2 {
    margin-bottom: 2px;
    font-size: 21px;
    letter-spacing: 0;
}

.settings-card label:not(.check-row) {
    gap: 8px;
}

.settings-card .check-row {
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    background: rgba(255, 255, 255, .025);
}

.settings-card .check-row:hover {
    border-color: rgba(39, 168, 255, .32);
    background: rgba(39, 168, 255, .045);
}

.settings-card > .stack-form {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.avatar-edit {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
}

.notification-toggles {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.security-code {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(39, 168, 255, .34);
    border-radius: var(--radius);
    color: #dceeff;
    background: rgba(39, 168, 255, .08);
    overflow-wrap: anywhere;
}

.session-row,
.appeal-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

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

.user-mini-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.bookmark-tools {
    padding: 18px 22px 16px;
    background:
        linear-gradient(180deg, rgba(13, 17, 24, .58), rgba(5, 6, 7, .18)),
        rgba(5, 6, 7, .52);
}

.bookmark-tools .search-page-form {
    margin: 0;
    min-height: 56px;
    padding: 8px 10px 8px 16px;
    border-radius: 999px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    background: rgba(0, 0, 0, .36);
}

.bookmark-tools .search-page-form input {
    min-height: 40px;
}

.folder-create {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
}

.folder-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.folder-tabs::-webkit-scrollbar {
    display: none;
}

.folder-tabs a {
    flex: 0 0 auto;
}

.bookmark-move-form {
    background: rgba(8, 11, 16, .68);
}

.rightbar .search-box,
.rightbar .side-card {
    width: 100%;
}

.side-card {
    background:
        linear-gradient(180deg, rgba(13, 17, 24, .72), rgba(5, 6, 7, .7)),
        rgba(0, 0, 0, .42);
}

.trend-item,
.suggest-item {
    border-radius: var(--radius);
    transition: background .16s ease;
}

.trend-item:hover,
.suggest-item:hover {
    background: rgba(255, 255, 255, .035);
}

@media (max-width: 760px) {
    .auth-page:has(.onboarding-card) {
        padding: 14px 12px 28px;
    }

    .onboarding-card {
        padding: 22px 16px;
    }

    .choice-grid,
    .follow-choice-list {
        grid-template-columns: 1fr;
    }

    .settings-form,
    .bookmark-tools {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bookmark-tools .search-page-form,
    .folder-create {
        grid-template-columns: 1fr;
        border-radius: var(--radius);
    }

    .bookmark-move-form {
        margin-left: 64px;
        margin-right: 16px;
    }
}

.tag-form {
    display: inline-flex;
}

.user-mini-action,
.session-row,
.appeal-row {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .025);
}

.user-mini-action span,
.session-row span,
.appeal-row {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.user-mini-action small,
.appeal-row small {
    color: var(--muted);
}

.post-card.is-removing {
    opacity: 0;
    transform: translateX(-12px);
}

.load-more.is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 2px solid rgba(39, 168, 255, .25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.pull-refresh {
    position: fixed;
    top: 10px;
    left: 50%;
    z-index: 180;
    transform: translate(-50%, -60px);
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #080b10;
    color: var(--muted-strong);
    box-shadow: var(--shadow);
    transition: transform .18s ease;
}

.pull-refresh.is-visible {
    transform: translate(-50%, 0);
}

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

@media (max-width: 760px) {
    .post-media-grid.media-count-2,
    .post-media-grid.media-count-3,
    .post-media-grid.media-count-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-media-grid .post-image-wrap,
    .post-media-grid .post-image {
        min-height: 138px;
    }

    .bookmark-move-form {
        margin: -1px 14px 12px 62px;
    }

    .folder-create,
    .inline-form,
    .user-mini-action,
    .current-media-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .autocomplete-popover {
        left: 12px !important;
        right: 12px;
        width: auto !important;
        max-width: none;
    }
}

/* UI system polish */
:where(.btn, .menu-action, .action-btn, .nav-item, .mobile-nav-item, .tag-chip, .folder-tabs a, .settings-tabs button) {
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

:where(.btn, .menu-action, .action-btn) {
    max-width: 100%;
}

:where(.btn span, .menu-action span, .action-btn strong, .nav-label, .folder-tabs a, .tag-chip, .profile-meta span, .profile-meta a, .suggest-text, .user-row span, .notification-item span) {
    min-width: 0;
    overflow-wrap: anywhere;
}

:where(input, textarea, select) {
    min-width: 0;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

:where(.stack-form, .settings-form, .post-modal, .admin-section, .bookmark-tools) :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):hover {
    border-color: rgba(148, 163, 184, .34);
}

.empty-state {
    margin: 20px 22px;
    padding: 38px 24px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(39, 168, 255, .08), transparent 18rem),
        rgba(8, 11, 16, .48);
}

.empty-state p {
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.55;
}

.empty-actions {
    margin-top: 14px;
}

.table-wrap {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: var(--radius);
    background: rgba(8, 11, 16, .5);
}

table {
    background: transparent;
}

th {
    background: rgba(13, 17, 24, .82);
    letter-spacing: 0;
}

td {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.admin-section {
    background: linear-gradient(180deg, rgba(13, 17, 24, .34), rgba(5, 6, 7, .08));
}

.admin-action-form {
    min-width: min(260px, 100%);
}

.profile-hero {
    overflow: hidden;
    background: rgba(5, 6, 7, .78);
}

.profile-info {
    padding: 0 clamp(18px, 3vw, 30px) 28px;
    display: grid;
    gap: 8px;
}

.profile-info .avatar-large {
    width: clamp(96px, 16vw, 136px);
    height: clamp(96px, 16vw, 136px);
    margin-top: clamp(-68px, -8vw, -52px);
    border: 4px solid var(--bg);
}

.profile-info h1 {
    max-width: min(100%, 660px);
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: clamp(27px, 4vw, 34px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.profile-username,
.profile-bio,
.profile-meta,
.profile-interest-row,
.profile-stats {
    max-width: min(100%, 660px);
}

.profile-bio {
    margin: 12px 0 2px;
    color: #eef3fb;
    line-height: 1.58;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-meta {
    gap: 10px 14px;
    line-height: 1.4;
}

.profile-meta span,
.profile-meta a {
    max-width: 100%;
}

.profile-interest-row {
    margin-top: 4px;
}

.profile-stats {
    gap: 10px 18px;
    line-height: 1.35;
}

.profile-actions {
    top: 16px;
    right: clamp(16px, 3vw, 30px);
    max-width: min(100% - 32px, 520px);
}

.profile-actions .btn {
    min-height: 40px;
    padding-inline: 18px;
    background: rgba(8, 11, 16, .54);
    backdrop-filter: blur(12px);
}

.profile-tabs a {
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
}

.settings-tabs {
    position: sticky;
    top: 68px;
    z-index: 9;
    padding: 10px 22px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    background: rgba(5, 6, 7, .84);
    backdrop-filter: blur(18px);
}

.settings-tabs button {
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    padding: 0 12px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .025);
    font-weight: 850;
}

.settings-tabs button:hover,
.settings-tabs button.is-active {
    color: var(--text);
    border-color: rgba(39, 168, 255, .58);
    background: rgba(39, 168, 255, .1);
}

.js-enabled .settings-panel[hidden],
.js-enabled .settings-root-form[hidden] {
    display: none !important;
}

.settings-root-form {
    border-bottom: 0;
}

.settings-save {
    justify-self: start;
    margin-top: 4px;
}

.settings-card {
    max-width: 100%;
}

.settings-card .muted,
.settings-card p {
    line-height: 1.55;
}

.onboarding-card {
    width: min(100%, 1060px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: clamp(22px, 4vw, 38px);
    align-items: start;
}

.onboarding-main {
    min-width: 0;
}

.onboarding-preview {
    position: sticky;
    top: 28px;
    min-width: 0;
}

.preview-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.onboarding-preview-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: rgba(5, 6, 7, .82);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

.onboarding-preview-cover {
    height: 116px;
    background:
        linear-gradient(135deg, rgba(39, 168, 255, .34), rgba(109, 92, 255, .2), rgba(32, 212, 155, .18)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 16px);
}

.onboarding-preview-body {
    padding: 0 18px 18px;
    display: grid;
    gap: 7px;
}

.onboarding-preview-avatar {
    width: 86px;
    height: 86px;
    margin-top: -43px;
}

.onboarding-preview-avatar .avatar {
    width: 86px;
    height: 86px;
    border: 4px solid var(--bg);
}

.onboarding-preview-body strong {
    font-size: 20px;
    overflow-wrap: anywhere;
}

.onboarding-preview-body small {
    color: var(--muted);
}

.onboarding-preview-body p {
    margin: 4px 0;
    color: var(--muted-strong);
    line-height: 1.45;
}

.onboarding-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.onboarding-preview-tags span {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .025);
    font-weight: 800;
}

.onboarding-preview-stats {
    display: flex;
    gap: 14px;
    color: var(--muted);
}

.onboarding-preview-stats b {
    color: var(--text);
}

@media (max-width: 760px) {
    .settings-tabs {
        top: 62px;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
        padding: 10px 16px;
        scrollbar-width: none;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tabs button {
        padding-inline: 16px;
    }

    .empty-state {
        margin: 14px 16px;
        padding: 30px 18px;
    }

    .profile-cover {
        height: 170px;
    }

    .profile-info {
        padding-bottom: 24px;
    }

    .profile-actions {
        position: static;
        order: 2;
        justify-content: flex-start;
        max-width: 100%;
        margin-top: 4px;
    }

    .profile-actions .btn,
    .profile-actions form {
        flex: 1 1 auto;
    }

    .profile-actions .btn {
        width: 100%;
    }

    .profile-stats {
        gap: 8px 12px;
    }

    .onboarding-card {
        grid-template-columns: 1fr;
    }

    .onboarding-preview {
        position: static;
        order: -1;
    }

    .onboarding-preview-cover {
        height: 92px;
    }

    .main-composer.is-mobile-open,
    .post-modal,
    .post-menu[open] .post-menu-panel {
        border-radius: 22px 22px 0 0;
    }

    .main-composer.is-mobile-open::before,
    .post-modal::before,
    .post-menu[open] .post-menu-panel::before {
        content: "";
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .24);
        position: absolute;
        left: 50%;
        top: 10px;
        transform: translateX(-50%);
    }

    .main-composer.is-mobile-open {
        padding-top: 54px;
        max-height: min(88dvh, 740px);
    }

    .post-modal {
        padding: 34px 16px calc(18px + env(safe-area-inset-bottom));
        max-height: 88dvh;
        animation: composer-sheet-in .2s ease;
    }

    .post-modal h2 {
        padding-right: 40px;
    }

    .modal-close {
        top: 14px;
        right: 14px;
    }

    .post-menu[open]::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 110;
        background: rgba(0, 0, 0, .62);
        backdrop-filter: blur(7px);
    }

    .post-menu[open] .post-menu-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 121;
        width: 100%;
        max-height: 84dvh;
        overflow: auto;
        padding: 32px 16px calc(18px + env(safe-area-inset-bottom));
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        background: var(--panel);
        animation: composer-sheet-in .2s ease;
    }

    .post-menu-panel form,
    .post-menu-panel .menu-action,
    .post-menu-panel .btn {
        width: 100%;
    }
}

/* Final UI consistency overrides. Keep this at the end of the stylesheet. */
.settings-card,
.admin-section,
.bookmark-tools,
.side-card {
    border-color: rgba(122, 140, 166, .22);
    background: linear-gradient(180deg, rgba(13, 17, 24, .94), rgba(7, 9, 13, .92));
    box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.settings-card,
.admin-section {
    padding: 22px;
}

.empty-state {
    border-color: rgba(122, 140, 166, .2);
    background:
        radial-gradient(circle at 50% 0%, rgba(39, 168, 255, .09), transparent 36%),
        rgba(8, 11, 16, .38);
}

.search-page-form,
.bookmark-tools,
.admin-filters,
.settings-tabs {
    border-color: rgba(122, 140, 166, .22);
}

@media (max-width: 760px) {
    .mobile-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .settings-card,
    .admin-section {
        padding: 16px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
}
