:root {
    --bg: #f2f4f8;
    --panel: #ffffff;
    --panel-soft: #eef3f7;
    --text: #132739;
    --muted: #607183;
    --line: #d7e0e9;
    --brand: #102437;
    --brand-strong: #224766;
    --accent: #c05a27;
    --accent-soft: #f7e4da;
    --success: #177245;
    --danger: #a13232;
    --shadow: 0 18px 45px rgba(16, 36, 55, 0.08);
    --radius: 20px;
    --surface-static: #ffffff;
    --card-highlight: #ffffff;
    --header-bg: rgba(242, 244, 248, 0.88);
    --header-bg-mobile: rgba(242, 244, 248, 0.96);
    --toast-bg: rgba(255, 255, 255, 0.92);
    --body-grad-1: #f8fafc;
    --body-grad-2: #eef3f7;
    --body-grad-3: #f6f8fb;
    --on-brand: #ffffff;
    --on-brand-soft: #f6f8fb;
    --mobile-dock-bg: rgba(16, 36, 55, 0.94);
}

:root[data-theme="dark"] {
    --bg: #0e1722;
    --panel: #142131;
    --panel-soft: #1b2b3f;
    --text: #e6edf5;
    --muted: #9eb1c6;
    --line: #2a3e55;
    --brand: #2a5f8e;
    --brand-strong: #3b79ad;
    --accent: #d3824c;
    --accent-soft: rgba(211, 130, 76, 0.2);
    --success: #2b9d63;
    --danger: #d95c5c;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    --surface-static: #162637;
    --card-highlight: #162637;
    --header-bg: rgba(9, 15, 23, 0.86);
    --header-bg-mobile: rgba(9, 15, 23, 0.95);
    --toast-bg: rgba(12, 19, 29, 0.92);
    --body-grad-1: #132131;
    --body-grad-2: #0f1a29;
    --body-grad-3: #0d1725;
    --on-brand: #f3f8ff;
    --on-brand-soft: #e6edf5;
    --mobile-dock-bg: rgba(7, 12, 18, 0.94);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(192, 90, 39, 0.08), transparent 25%),
        linear-gradient(180deg, var(--body-grad-1) 0%, var(--body-grad-2) 55%, var(--body-grad-3) 100%);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.6;
}

.redirect-layout-body {
    min-height: 100vh;
}

.redirect-layout-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

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

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

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

.container {
    width: min(1540px, calc(100% - 24px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.header-inner,
.top-nav,
.header-actions,
.brand,
.feed-head,
.detail-meta,
.detail-actions,
.form-row,
.inline-actions,
.thread-head,
.section-heading,
.profile-hero-inner,
.profile-stats,
.wallet-item {
    display: flex;
    align-items: center;
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(320px, 720px) auto;
    gap: 18px;
    justify-content: space-between;
    padding: 14px 0;
}

.brand {
    gap: 12px;
    min-width: 0;
    max-width: 250px;
}

.brand img {
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.brand span {
    display: grid;
}

.brand-text {
    min-width: 0;
}

.brand-text strong,
.brand-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small,
.muted-text,
.feed-meta,
.detail-meta,
.mini-item small,
.dev-note,
.result-box span,
.wallet-item small,
.notification-item small {
    color: var(--muted);
}

.top-nav,
.header-actions {
    gap: 10px;
    flex-wrap: wrap;
}

.header-actions {
    justify-content: flex-end;
    min-width: 0;
}

.top-nav a,
.ghost-link,
.notification-pill,
.user-chip,
.menu-panel a {
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-link,
.menu-link,
.icon-button,
.profile-menu a,
.profile-menu-button,
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-link i,
.menu-link i,
.icon-button i,
.button i,
.profile-menu a i,
.profile-menu-button i {
    font-size: 1rem;
    line-height: 1;
}

.top-nav a.active,
.top-nav a:hover,
.ghost-link:hover,
.notification-pill:hover,
.user-chip:hover,
.menu-panel a:hover,
.menu-panel a.active {
    background: var(--panel-soft);
}

.notification-pill span {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 0;
    font-size: 0.78rem;
}

.icon-button-has-badge .icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.icon-button {
    position: relative;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.theme-toggle i {
    font-size: 1.08rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
    min-width: 0;
}

.user-chip-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 6px;
    vertical-align: middle;
}

.user-chip .user-badges {
    margin-left: 0;
}

.user-badges.is-compact {
    gap: 4px;
    margin-left: 4px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
}

.user-badge i {
    font-size: 0.76rem;
}

.user-badge.is-icon-only {
    padding: 2px 6px;
}

.user-badge--admin {
    background: rgba(192, 90, 39, 0.14);
    border-color: rgba(192, 90, 39, 0.3);
    color: var(--accent);
}

.user-badge--verified {
    background: rgba(42, 95, 142, 0.16);
    border-color: rgba(42, 95, 142, 0.34);
    color: var(--brand-strong);
}

:root[data-theme="dark"] .user-badge--admin {
    background: rgba(211, 130, 76, 0.18);
    border-color: rgba(211, 130, 76, 0.34);
    color: #f2b080;
}

:root[data-theme="dark"] .user-badge--verified {
    background: rgba(108, 167, 214, 0.18);
    border-color: rgba(108, 167, 214, 0.34);
    color: #8ac8ff;
}

.user-chip img,
.feed-author img,
.profile-mini img,
.story-card img,
.comment-author img,
.conversation-item img,
.profile-avatar,
.notification-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.button,
.link-button {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    transition: 0.2s ease;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    color: var(--brand);
}

.button-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: var(--on-brand);
}

.button-outline {
    background: var(--surface-static);
    color: var(--brand);
    border: 1px solid var(--line);
}

.button-danger {
    background: var(--danger);
    color: #fff;
}

.button span,
.nav-link span,
.menu-link span,
.profile-menu a span,
.profile-menu-button span {
    white-space: nowrap;
}

.button:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.flash,
.panel,
.feed-card,
.story-card,
.single-column-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.flash {
    margin: 18px 0 0;
    padding: 14px 18px;
}

.flash-success {
    border-left: 4px solid var(--success);
}

.flash-error {
    border-left: 4px solid var(--danger);
}

.toast-stack {
    position: fixed;
    top: 108px;
    right: 18px;
    z-index: 120;
    display: grid;
    gap: 12px;
    width: min(380px, calc(100vw - 24px));
    pointer-events: none;
}

.app-toast {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--toast-bg);
    box-shadow: 0 20px 44px rgba(16, 36, 55, 0.16);
    backdrop-filter: blur(18px);
    transform: translateY(-12px) scale(0.96);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    pointer-events: auto;
    overflow: hidden;
}

.app-toast::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    opacity: 0.9;
}

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

.app-toast.is-success::after {
    background: linear-gradient(90deg, #1d8c58, #4ec08a);
}

.app-toast.is-error::after {
    background: linear-gradient(90deg, #a13232, #da6a55);
}

.app-toast.is-warning::after {
    background: linear-gradient(90deg, #b07a12, #e4ad3a);
}

.app-toast.is-info::after {
    background: linear-gradient(90deg, #29537b, #4e84b6);
}

.app-toast__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.app-toast.is-success .app-toast__icon {
    background: rgba(23, 114, 69, 0.12);
    color: var(--success);
}

.app-toast.is-error .app-toast__icon {
    background: rgba(161, 50, 50, 0.12);
    color: var(--danger);
}

.app-toast.is-warning .app-toast__icon {
    background: rgba(176, 122, 18, 0.14);
    color: #9a6a0d;
}

.app-toast.is-info .app-toast__icon {
    background: rgba(41, 83, 123, 0.12);
    color: #29537b;
}

.app-toast__body {
    min-width: 0;
}

.app-toast__title {
    display: block;
    margin-bottom: 4px;
    line-height: 1.2;
}

.app-toast__message {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    word-break: break-word;
}

.app-toast__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: 0.2s ease;
}

.app-toast__close:hover {
    background: var(--panel-soft);
    color: var(--brand);
}

.page-grid {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr) 320px;
    grid-template-areas: "left content right";
    align-items: start;
    gap: 24px;
    padding: 24px 0 38px;
}

.page-grid.page-grid--no-left {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "content right";
}

.page-grid.page-grid--no-right {
    grid-template-columns: 276px minmax(0, 1fr);
    grid-template-areas: "left content";
}

.page-grid.page-grid--no-left.page-grid--no-right {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "content";
}

.page-grid.page-grid--messages-shell {
    padding-top: 20px;
}

.sidebar {
    display: grid;
    gap: 18px;
    align-self: start;
    position: sticky;
    top: 112px;
}

.page-grid > .sidebar-left {
    grid-area: left;
}

.page-grid > .page-content {
    grid-area: content;
}

.page-grid > .sidebar-right {
    grid-area: right;
}

.page-content,
.section-block,
.stack-cards,
.grid-cards,
.stories-strip,
.tools-grid,
.stats-grid,
.tool-card-grid,
.result-grid,
.tools-listing {
    display: grid;
    gap: 18px;
}

.page-content {
    align-self: start;
    align-content: start;
    min-width: 0;
}

.panel,
.feed-card,
.single-column-card {
    padding: 22px;
}

.menu-panel {
    display: grid;
    gap: 8px;
}

.menu-link {
    width: 100%;
    justify-content: flex-start;
}

.profile-mini {
    gap: 14px;
}

.section-heading {
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.section-heading h1,
.section-heading h2,
.panel h1,
.panel h2,
.panel h3,
.detail-head h1 {
    margin: 0;
    line-height: 1.2;
}

.section-heading > p {
    flex: 1 1 100%;
    max-width: 760px;
    margin: -4px 0 0;
}

.stories-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.story-card {
    padding: 18px;
    display: grid;
    gap: 10px;
    min-height: 160px;
    background:
        linear-gradient(180deg, rgba(16, 36, 55, 0.04), rgba(192, 90, 39, 0.08)),
        var(--card-highlight);
}

.story-card img {
    width: 56px;
    height: 56px;
}

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

.tool-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

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

.tool-card {
    display: grid;
    gap: 10px;
    transition: 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
}

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

.feed-cover img,
.detail-cover {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
}

.feed-cover.feed-cover-compact {
    display: block;
    border-radius: 16px;
    overflow: hidden;
}

.feed-cover.feed-cover-compact img {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}

.detail-cover {
    max-height: 420px;
    margin: 20px 0;
}

.detail-head,
.comment-surface,
.reply-list,
.search-panel {
    display: grid;
    gap: 14px;
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-title-row h1 {
    flex: 1 1 360px;
}

.detail-actions-bottom {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    justify-content: space-between;
    flex-wrap: wrap;
}

.promote-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.promote-form input {
    width: 88px;
}

.feed-author {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.84rem;
}

.badge {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.tag-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--panel-soft);
    color: var(--brand);
}

:root[data-theme="dark"] .tag {
    background: rgba(42, 95, 142, 0.24);
    color: #9ec8ed;
}

.feed-meta,
.detail-meta,
.profile-stats {
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.94rem;
}

.mini-item,
.notification-item,
.conversation-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.header-dropdown {
    position: relative;
}

.header-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.header-dropdown summary::-webkit-details-marker {
    display: none;
}

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(390px, calc(100vw - 24px));
    max-height: 420px;
    overflow: hidden auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    display: grid;
    z-index: 90;
}

.header-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.header-dropdown-head a {
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 700;
}

.header-dropdown-list {
    display: grid;
}

.header-dropdown-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    transition: 0.2s ease;
}

.header-dropdown-item:first-child {
    border-top: 0;
}

.header-dropdown-item:hover {
    background: var(--panel-soft);
}

.header-dropdown-item img,
.header-dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    object-fit: cover;
}

.header-dropdown-icon {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--brand);
}

.header-dropdown-item > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.header-dropdown-item strong,
.header-dropdown-item small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.header-dropdown-item small {
    color: var(--muted);
}

.header-dropdown-item.is-unread {
    background: linear-gradient(90deg, rgba(192, 90, 39, 0.1), transparent 52%);
}

.header-dropdown-empty {
    margin: 0;
    padding: 14px;
    color: var(--muted);
}

.profile-dropdown {
    position: relative;
}

.profile-dropdown summary {
    list-style: none;
}

.profile-dropdown summary::-webkit-details-marker {
    display: none;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: grid;
    gap: 4px;
}

.profile-menu a,
.profile-menu-button {
    width: 100%;
    border-radius: 14px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text);
    border: 0;
    text-align: left;
    cursor: pointer;
}

.profile-menu a:hover,
.profile-menu-button:hover {
    background: var(--panel-soft);
}

.notification-item.is-unread {
    background: linear-gradient(90deg, rgba(192, 90, 39, 0.08), transparent);
    border-radius: 14px;
    padding-left: 10px;
    padding-right: 10px;
}

.panel .mini-item:first-of-type,
.panel .notification-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.stat-list {
    display: grid;
    gap: 12px;
}

.stat-list div,
.result-box div,
.wallet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-shell {
    display: grid;
    place-items: center;
    min-height: 65vh;
}

.auth-panel,
.form-panel,
.detail-panel,
.comments-panel {
    width: 100%;
}

.auth-panel,
.form-panel {
    max-width: 820px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.checkbox-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 15px;
    background: var(--surface-static);
    color: var(--text);
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(192, 90, 39, 0.24);
    border-color: var(--accent);
}

.fr-box.fr-basic {
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: none;
}

.fr-toolbar.fr-top,
.fr-second-toolbar,
.fr-wrapper {
    border-color: var(--line);
}

.fr-toolbar.fr-top {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.fr-wrapper {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

.fr-box .fr-element.fr-view {
    color: var(--text);
}

.tox.tox-tinymce {
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: none;
    overflow: hidden;
}

.tox .tox-editor-header {
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-menubar {
    background: var(--surface-static);
}

.tox .tox-statusbar {
    border-top: 1px solid var(--line);
}

.error-text {
    color: var(--danger);
}

.turnstile-box,
.locked-box,
.result-box,
.empty-state,
.debug-box,
.code-box {
    background: var(--panel-soft);
    border-radius: 18px;
    padding: 18px;
}

.code-box {
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.rich-content {
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rich-content a,
.mention {
    color: var(--accent);
    font-weight: 700;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 12px 0;
}

.rich-content iframe,
.rich-content video,
.rich-content canvas,
.rich-content svg,
.rich-content table,
.rich-content pre {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.rich-content pre code {
    white-space: inherit;
    word-break: inherit;
}

.rich-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.detail-panel,
.comments-panel {
    min-width: 0;
}

.engagement-blur {
    position: relative;
    filter: blur(5px);
    user-select: none;
}

.engagement-blur,
.engagement-blur * {
    pointer-events: none;
}

.locked-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 0.84rem;
}

.engagement-lock-note {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    color: var(--muted);
    background: var(--panel-soft);
}

.header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
    max-width: 720px;
    justify-self: center;
    padding: 8px 10px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--toast-bg);
    box-shadow: var(--shadow);
}

.header-search input {
    border: 0;
    background: transparent;
    padding: 8px 6px;
    min-width: 0;
}

.header-search input:focus {
    outline: none;
    border-color: transparent;
}

.search-submit {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--on-brand);
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.search-page-form {
    box-shadow: none;
    background: var(--panel-soft);
}

.search-hint {
    margin: 0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
}

.quality-box,
.duplicate-box {
    margin: 0 0 18px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.quality-head,
.comment-headline,
.comment-flags,
.quality-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-head {
    justify-content: space-between;
    flex-wrap: wrap;
}

.quality-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.quality-pill.is-good {
    background: rgba(23, 114, 69, 0.14);
    color: var(--success);
}

.quality-pill.is-medium {
    background: rgba(176, 122, 18, 0.15);
    color: #9a6a0d;
}

.quality-pill.is-low {
    background: rgba(161, 50, 50, 0.14);
    color: var(--danger);
}

.quality-checks {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.quality-check {
    justify-content: space-between;
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface-static);
}

.quality-check.is-pass {
    border: 1px solid rgba(23, 114, 69, 0.24);
}

.quality-check.is-fail {
    border: 1px solid rgba(161, 50, 50, 0.22);
}

.quality-check small,
.quality-warnings p {
    color: var(--muted);
}

.quality-warnings {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.quality-warnings p {
    margin: 0;
}

.duplicate-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.duplicate-list a {
    color: var(--brand);
    font-weight: 700;
}

.copy-button {
    padding: 10px 14px;
}

.comment-list,
.reply-form,
.messages-layout,
.split-showcase,
.blog-grid {
    display: grid;
    gap: 16px;
}

.forum-detail-shell {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    min-width: 0;
}

.forum-detail-main {
    flex: 1 1 auto;
    display: grid;
    gap: 18px;
    min-width: 0;
}

.forum-detail-side {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    display: grid;
    gap: 18px;
    align-self: flex-start;
    position: sticky;
    top: 112px;
}

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

.settings-nav {
    display: grid;
    gap: 14px;
    align-content: start;
}

.settings-nav h2,
.settings-nav h3 {
    margin: 0;
    line-height: 1.2;
}

.settings-nav h3 {
    font-size: 0.9rem;
    color: var(--muted);
}

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

.settings-nav-link {
    width: 100%;
    border-radius: 14px;
    padding: 11px 12px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    transition: 0.2s ease;
}

.settings-nav-link:hover,
.settings-nav-link.is-active {
    background: var(--panel-soft);
}

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

.settings-panel h1 {
    margin: 0 0 8px;
}

.settings-fieldset {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.settings-fieldset legend {
    padding: 0 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.settings-preview-avatar {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.settings-preview-cover {
    width: 100%;
    min-height: 150px;
    max-height: 230px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.blog-grid {
    align-items: start;
}

.blog-grid .feed-card {
    align-self: start;
    align-content: start;
}

.blog-grid .feed-cover {
    display: block;
    border-radius: 18px;
    overflow: hidden;
}

.blog-grid .feed-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-grid .feed-card h2,
.blog-grid .feed-card p {
    margin: 0;
}

.comment {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-static);
    box-shadow: 0 14px 34px rgba(16, 36, 55, 0.06);
}

.comment-headline {
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.comment-flags {
    flex-wrap: wrap;
}

.comment-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
}

.comment-flag--pinned {
    background: rgba(16, 36, 55, 0.12);
    color: var(--brand);
}

.comment-flag--solution {
    background: rgba(23, 114, 69, 0.14);
    color: var(--success);
}

.comment--pinned {
    border-color: rgba(16, 36, 55, 0.34);
}

.comment--solution {
    border-color: rgba(23, 114, 69, 0.4);
}

.comment-author {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-body {
    margin: 0;
}

.comment-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.reply-toggle {
    display: inline-block;
}

.reply-toggle summary {
    list-style: none;
    cursor: pointer;
}

.reply-toggle summary::-webkit-details-marker {
    display: none;
}

.reply-toggle[open] {
    width: 100%;
    flex-basis: 100%;
}

.reply-toggle .reply-form {
    margin-top: 10px;
}

.reply-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.reply-form textarea {
    min-height: 104px;
}

.reply-form .button {
    min-height: 56px;
}

.reply-list {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 2px solid rgba(16, 36, 55, 0.08);
}

.reply {
    margin-left: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--panel-soft);
}

.reply--solution {
    border: 1px solid rgba(23, 114, 69, 0.35);
}

.comment-compose {
    margin-bottom: 6px;
}

.messages-layout {
    grid-template-columns: 320px minmax(0, 1fr);
}

.inbox-panel,
.thread-panel {
    min-height: 65vh;
}

.conversation-item.is-active {
    background: var(--panel-soft);
    border-radius: 16px;
    padding: 12px;
}

.conversation-item.is-unread {
    background: linear-gradient(90deg, rgba(192, 90, 39, 0.08), transparent 58%);
    border-radius: 16px;
    padding: 12px;
}

.conversation-group-title {
    margin: 10px 0 6px;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.conversation-item--request {
    border-left: 3px solid rgba(192, 90, 39, 0.32);
    padding-left: 10px;
}

.conversation-empty {
    margin: 6px 0 2px;
    font-size: 0.9rem;
}

.conversation-title,
.thread-user-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(19, 39, 57, 0.18);
    flex-shrink: 0;
}

.online-dot.is-online {
    background: #1ec46a;
    box-shadow: 0 0 0 4px rgba(30, 196, 106, 0.18);
}

.online-dot.is-offline {
    background: #9aa7b5;
}

:root[data-theme="dark"] .online-dot {
    border-color: rgba(230, 237, 245, 0.28);
}

.message-list {
    display: grid;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 0;
}

.message-bubble {
    max-width: 72%;
    padding: 14px;
    border-radius: 18px 18px 18px 6px;
    background: var(--panel-soft);
}

.message-bubble.is-mine {
    margin-left: auto;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: var(--on-brand);
    border-radius: 18px 18px 6px 18px;
}

.message-bubble.is-mine small,
.message-bubble.is-mine .rich-content {
    color: var(--on-brand-soft);
}

.thread-form {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.thread-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.thread-help {
    margin: 0;
}

.emoji-toggle-button {
    min-width: 120px;
    justify-content: center;
}

.emoji-picker {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    max-height: 190px;
    overflow-y: auto;
}

.emoji-picker[hidden] {
    display: none;
}

.emoji-picker-button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    min-height: 34px;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}

.emoji-picker-button:hover {
    background: var(--surface-static);
}

.mobile-dock {
    display: none;
}

.mobile-search-tray {
    display: none;
}

.redirect-shell {
    min-height: calc(100vh - 180px);
}

.redirect-card {
    max-width: 520px;
    margin: 0 auto;
    display: grid;
    gap: 12px;
    text-align: center;
}

.redirect-emoji {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    border: 2px solid var(--line);
    display: grid;
    place-items: center;
    margin: 0 auto 8px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
}

.redirect-card h1 {
    margin: 0;
}

.redirect-host {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
}

.redirect-actions {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.redirect-actions .button {
    justify-content: center;
    width: 100%;
}

.profile-hero {
    border-radius: 28px;
    overflow: hidden;
    color: var(--on-brand);
    min-height: 320px;
    background-size: cover;
    background-position: center;
}

.profile-hero-inner {
    min-height: 320px;
    padding: 28px;
    justify-content: space-between;
    gap: 22px;
}

.profile-avatar {
    width: 104px;
    height: 104px;
    border: 4px solid rgba(255, 255, 255, 0.5);
}

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

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

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

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

.wallet-item,
.notification-item {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}

.wallet-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.amount-positive {
    color: var(--success);
}

.amount-negative {
    color: var(--danger);
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    width: fit-content;
}

.trust-pill--high {
    background: rgba(23, 114, 69, 0.16);
    color: var(--success);
}

.trust-pill--good {
    background: rgba(42, 95, 142, 0.16);
    color: var(--brand-strong);
}

.trust-pill--medium {
    background: rgba(176, 122, 18, 0.14);
    color: #9a6a0d;
}

.trust-pill--new {
    background: rgba(96, 113, 131, 0.16);
    color: var(--muted);
}

:root[data-theme="dark"] .quality-box,
:root[data-theme="dark"] .duplicate-box {
    background: rgba(15, 26, 41, 0.68);
}

:root[data-theme="dark"] .quality-check {
    background: rgba(22, 38, 55, 0.8);
}

:root[data-theme="dark"] .comment-flag--pinned {
    background: rgba(108, 167, 214, 0.2);
    color: #9ec8ed;
}

:root[data-theme="dark"] .comment-flag--solution {
    background: rgba(43, 157, 99, 0.24);
    color: #89d7ad;
}

:root[data-theme="dark"] .trust-pill--medium {
    color: #e1bd6f;
}

:root[data-theme="dark"] .trust-pill--new {
    color: #c1cddb;
}

.copyright-panel {
    text-align: center;
}

@media (max-width: 1180px) {
    .page-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
        grid-template-areas: "content right";
    }

    .page-grid.page-grid--no-right,
    .page-grid.page-grid--no-left.page-grid--no-right {
        grid-template-columns: 1fr;
        grid-template-areas: "content";
    }

    .page-content {
        order: 1;
    }

    .sidebar-left {
        display: none;
    }

    .sidebar-right {
        order: 2;
    }

    .messages-layout,
    .split-showcase,
    .tools-grid,
    .stats-grid,
    .tool-card-grid,
    .result-grid,
    .grid-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .page-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "right";
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 980px) {
    .forum-detail-shell {
        flex-direction: column;
    }

    .forum-detail-side {
        position: static;
        width: 100%;
        max-width: none;
        flex: 1 1 auto;
    }
}

@media (max-width: 920px) {
    .brand-text {
        display: none;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .container {
        width: min(100% - 20px, 1000px);
    }

    .header-inner {
        grid-template-columns: auto auto;
        grid-template-areas: "brand actions";
        justify-content: space-between;
        align-items: center;
    }

    .profile-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav,
    .form-row {
        width: 100%;
    }

    .top-nav {
        display: none;
    }

    .brand {
        grid-area: brand;
    }

    .brand-text {
        display: none;
    }

    .header-search {
        display: none;
    }

    .header-actions {
        grid-area: actions;
        width: auto;
        justify-self: end;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .brand span small {
        display: none;
    }

    .header-actions .ghost-link,
    .header-actions > .button {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 14px;
    }

    .header-actions .ghost-link span,
    .header-actions > .button span {
        display: none;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .header-dropdown-menu {
        position: fixed;
        top: calc(70px + env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: min(68vh, 420px);
    }

    .header-dropdown-item {
        padding: 11px 12px;
    }

    .user-chip {
        padding: 7px 8px;
        gap: 6px;
    }

    .user-chip img {
        width: 32px;
        height: 32px;
    }

    .user-chip-name {
        display: none;
    }

    .user-chip .bi-chevron-down {
        display: none;
    }

    .user-chip .user-badges {
        margin-left: 0;
    }

    .message-bubble {
        max-width: 90%;
    }

    .thread-form-actions {
        width: 100%;
    }

    .thread-form-actions .button {
        flex: 1 1 auto;
    }

    .emoji-picker {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .site-header {
        background: var(--header-bg-mobile);
    }

    .toast-stack {
        top: 104px;
        left: 10px;
        right: 10px;
        width: auto;
    }

    .page-grid {
        gap: 16px;
        padding-top: 16px;
    }

    .panel,
    .feed-card,
    .single-column-card {
        border-radius: 18px;
        padding: 18px;
    }

    .mobile-dock {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 10px;
        background: var(--mobile-dock-bg);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 22px;
        box-shadow: 0 22px 55px rgba(16, 36, 55, 0.24);
        z-index: 70;
    }

    .mobile-search-tray {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(92px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border-radius: 22px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(16, 36, 55, 0.96);
        box-shadow: 0 22px 55px rgba(16, 36, 55, 0.22);
        backdrop-filter: blur(20px);
        z-index: 75;
        opacity: 0;
        pointer-events: none;
        transform: translateY(18px) scale(0.96);
        transform-origin: bottom center;
        transition: transform 0.24s ease, opacity 0.24s ease;
    }

    .mobile-search-tray.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .mobile-search-field {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        padding: 0 14px;
        min-height: 48px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.82);
    }

    .mobile-search-field i {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .mobile-search-field input {
        border: 0;
        padding: 0;
        background: transparent;
        color: #fff;
    }

    .mobile-search-field input::placeholder {
        color: rgba(255, 255, 255, 0.56);
    }

    .mobile-search-field input:focus {
        outline: none;
        border-color: transparent;
    }

    .mobile-search-tray .search-submit {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    .mobile-dock a {
        min-height: 54px;
        color: rgba(255, 255, 255, 0.78);
        border-radius: 16px;
        display: grid;
        place-items: center;
        gap: 4px;
        text-align: center;
        font-size: 0.72rem;
    }

    .mobile-dock a i {
        font-size: 1.1rem;
    }

    .mobile-dock a span {
        line-height: 1.15;
    }

    .mobile-dock a.active {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .mobile-dock a.is-toggled {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }

    .profile-menu {
        position: fixed;
        top: calc(70px + env(safe-area-inset-top));
        right: 10px;
        min-width: 220px;
        max-width: calc(100vw - 20px);
    }

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

    .detail-actions-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .reply-list {
        padding-left: 14px;
    }
}
