:root {
    --color-primary: #292524;
    --color-primary-active: #0c0a09;
    --color-on-primary: #ffffff;
    --color-ink: #0c0a09;
    --color-body: #4e4e4e;
    --color-muted: #777169;
    --color-hairline: #e7e5e4;
    --color-hairline-strong: #d6d3d1;
    --color-canvas: #f5f5f5;
    --color-canvas-soft: #fafafa;
    --color-surface: #ffffff;
    --color-surface-strong: #f0efed;
    --color-error: #dc2626;
    --color-on-error: #ffffff;
    --color-gradient-mint: #a7e5d3;
    --color-gradient-peach: #f4c5a8;
    --color-gradient-sky: #a8c8e8;
    --color-gradient-rose: #e8b8c4;
    --theme-button-accent: #e8989a;
    --color-notice-bg: color-mix(in srgb, var(--color-ink) 94%, transparent);
    --color-notice-text: #ffffff;
    --control-bg: transparent;
    --control-bg-hover: var(--color-surface-strong);
    --control-bg-active: var(--color-primary);
    --control-text: var(--color-body);
    --control-text-active: var(--color-on-primary);
    --control-border: transparent;
    --control-border-hover: transparent;
    --tag-bg: var(--color-surface-strong);
    --tag-text: var(--color-muted);
    --panel-bg: var(--color-surface);
    --panel-border: var(--color-hairline);
    --panel-shadow: var(--shadow-soft);
    --field-border: var(--color-hairline-strong);
    --field-autofill-bg: var(--color-surface);
    --pagination-text: var(--color-muted);
    --pagination-button-bg: var(--color-surface-strong);
    --pagination-button-icon: var(--color-ink);
    --pagination-button-hover-bg: var(--color-ink);
    --pagination-button-hover-icon: var(--color-surface);
    --pagination-focus-ring: var(--color-primary);
    --pagination-progress-fill: var(--color-ink);
    --pagination-progress-track: var(--color-hairline);
    --pagination-current-bg: var(--color-surface);
    --pagination-current-text: var(--color-ink);
    --pagination-menu-bg: var(--color-surface);
    --pagination-menu-shadow: var(--shadow-soft);
    --pagination-menu-scrollbar: var(--color-hairline);
    --pagination-menu-page-text: var(--color-muted);
    --pagination-menu-page-hover-bg: var(--color-surface-strong);
    --pagination-menu-page-hover-text: var(--color-ink);
    --pagination-menu-page-active-bg: var(--color-ink);
    --pagination-menu-page-active-text: var(--color-surface);
    --reply-chip-tooltip-bg: #f0efed;
    --reply-chip-tooltip-text: #0c0a09;
    --theme-page-wide-width: 1400px;
    --theme-page-narrow-width: 960px;
    --theme-page-gutter: 40px;
    --theme-page-single-gutter: 32px;
    --theme-page-mobile-gutter: 8px;
    --radius-md: 8px;
    --radius-sm: 8px;
    --radius-button: var(--radius-md);
    --radius-pill: 999px;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.1);
    color-scheme: light;
}

:root[data-color-scheme="ink"] {
    --color-primary: #3a3a3a;
    --color-primary-active: #464646;
    --color-on-primary: #f5f5f5;
    --theme-button-accent: #a78bfa;
    --color-ink: #888888;
    --color-body: #888888;
    --color-muted: #888888;
    --color-hairline: #000000;
    --color-hairline-strong: #000000;
    --color-canvas: #1a1a1a;
    --color-canvas-soft: #242424;
    --color-surface: #212121;
    --color-surface-strong: #2d2d2d;
    --color-error: #ef5350;
    --color-on-error: #ffffff;
    --color-gradient-mint: #3c5f5b;
    --color-gradient-peach: #64473a;
    --color-gradient-sky: #3f5368;
    --color-gradient-rose: #5d424a;
    --color-notice-bg: #ffffff;
    --color-notice-text: #1f1f1f;
    --control-bg: transparent;
    --control-bg-hover: var(--color-surface-strong);
    --control-bg-active: var(--color-surface-strong);
    --control-text: var(--color-body);
    --control-text-active: #f5f5f5;
    --control-border: transparent;
    --control-border-hover: transparent;
    --tag-bg: color-mix(in srgb, var(--color-surface-strong) 72%, transparent);
    --tag-text: #888888;
    --panel-bg: var(--color-surface);
    --panel-border: #000000;
    --panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
    --field-border: var(--color-hairline-strong);
    --reply-chip-tooltip-bg: #2d2d2d;
    --reply-chip-tooltip-text: #f5f5f5;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.1);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

html[data-color-scheme="ink"] {
    background: radial-gradient(ellipse at center top, #2d2d2d 0%, #232323 50%, #1a1a1a 100%);
    background-attachment: fixed;
}

body {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    margin: 0;
    background: var(--color-canvas);
    color: var(--color-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.16px;
    line-height: 1.5;
}

html[data-color-scheme="ink"] body {
    background: transparent;
    color: var(--color-body);
}

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

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

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.site-header {
    position: sticky;
    z-index: 40;
    top: 12px;
    display: flex;
    min-height: 60px;
    align-items: center;
    gap: 24px;
    width: calc(100% - 32px);
    margin: 12px auto 0;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 0 20px;
    box-shadow: var(--shadow-soft);
}

html[data-color-scheme="ink"] .site-header {
    background: var(--color-surface);
}

.site-logo {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: max-content;
    align-items: center;
    gap: 10px;
    color: var(--color-ink);
    font-size: 20px;
    font-weight: 700;
}

.site-logo img {
    display: block;
    width: auto;
    max-width: 180px;
    height: 34px;
    object-fit: contain;
}

.site-category-nav {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
}

.site-category-list {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
    overflow: hidden;
}

.site-category-item {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.site-category-link,
.site-category-more-button,
.site-color-menu-button,
.site-nav {
    display: flex;
    align-items: center;
}

.site-category-link,
.site-category-more-button,
.site-color-menu-button {
    min-height: 36px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-button);
    background: var(--control-bg);
    color: var(--control-text);
    cursor: pointer;
    padding: 8px 8px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease;
}

.site-category-link:hover,
.site-category-more-button:hover,
.site-color-menu-button:hover,
.site-color-menu-button[aria-expanded="true"],
.site-category-link.is-active,
.site-category-item.is-active > .site-category-link {
    border-color: var(--control-border-hover);
    background: var(--control-bg-hover);
    color: var(--color-ink);
    font-weight: 500;
}

.site-color-menu-button {
    width: 36px;
    justify-content: center;
    gap: 7px;
    padding: 0;
}

.site-color-menu-button .theme-icon {
    width: 18px;
    height: 18px;
}

.site-color-menu-button:hover,
.site-color-menu-button[aria-expanded="true"] {
    border-color: var(--control-border-hover);
}

.site-category-submenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 42;
    display: none;
    min-width: 180px;
    max-height: min(420px, calc(100vh - 120px));
    overflow: auto;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    padding: 8px;
    box-shadow: var(--panel-shadow);
}

.site-category-item:hover > .site-category-submenu,
.site-category-item:focus-within > .site-category-submenu {
    display: grid;
}

.site-category-submenu .site-category-link,
.site-category-menu .site-category-link {
    justify-content: flex-start;
    width: 100%;
}

.site-category-child-link {
    min-height: 34px;
    padding: 8px 10px;
}

.site-category-more {
    position: relative;
    flex: 0 0 auto;
    margin-left: 6px;
}

.site-color-menu {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.site-category-menu,
.site-color-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: grid;
    min-width: 180px;
    max-height: min(420px, calc(100vh - 120px));
    overflow: auto;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    padding: 8px;
    box-shadow: var(--panel-shadow);
}

.site-color-menu-panel {
    right: 0;
    left: auto;
    gap: 2px;
    min-width: 136px;
}

.site-category-more[hidden],
.site-category-menu[hidden],
.site-color-menu-panel[hidden] {
    display: none;
}

.site-category-menu .site-category-item {
    display: grid;
}

.site-category-menu .site-category-submenu {
    position: static;
    display: grid;
    min-width: 0;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0 0 0 10px;
}

.site-nav {
    flex: 0 0 auto;
    gap: 14px;
    justify-content: flex-end;
}

.site-user-menu-panel form {
    display: contents;
}

.site-nav > a {
    border: 0;
    background: transparent;
    color: var(--color-body);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.site-color-menu-panel button {
    display: flex;
    min-height: 34px;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-body);
    padding: 0 10px;
    text-align: left;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.site-color-menu-panel button:hover,
.site-color-menu-panel button[aria-pressed="true"] {
    background: var(--color-surface-strong);
    color: var(--color-ink);
}

.site-nav > a:hover {
    color: var(--color-ink);
}

.site-notification-link {
    position: relative;
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: var(--radius-pill);
    color: var(--control-text);
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.site-notification-link:hover {
    background: var(--control-bg-hover);
    color: var(--color-ink);
}

.site-notification-link .theme-icon {
    width: 20px;
    height: 20px;
}

.site-notification-badge {
    position: absolute;
    top: 2px;
    right: 0;
    display: inline-flex;
    min-width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-error);
    color: var(--color-on-error);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--color-surface);
}

.site-notification-badge[hidden] {
    display: none;
}

.site-user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.site-user-menu-button {
    display: inline-grid;
    inline-size: 36px;
    block-size: 36px;
    min-inline-size: 36px;
    min-block-size: 36px;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-strong);
    padding: 0;
    color: var(--color-ink);
    cursor: pointer;
}

.site-user-menu-button img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.site-user-menu-button span {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.site-user-menu-panel {
    position: absolute;
    z-index: 50;
    top: calc(100% + 13px);
    right: -20px;
    display: grid;
    min-width: 156px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    padding: 8px;
    box-shadow: var(--panel-shadow);
}

.site-user-menu-panel[hidden] {
    display: none;
}

.site-user-menu-panel a,
.site-user-menu-panel button {
    display: flex;
    min-height: 36px;
    width: 100%;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-body);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 0 10px;
    text-align: left;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.site-user-menu-panel a:hover,
.site-user-menu-panel button:hover {
    background: var(--color-surface-strong);
    color: var(--color-ink);
}

.page-shell {
    width: min(var(--theme-page-wide-width), calc(100% - var(--theme-page-gutter)));
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 40px 0 72px;
}

.theme-page-shell-single {
    width: min(var(--theme-page-narrow-width), calc(100% - var(--theme-page-single-gutter)));
}

.theme-page-shell-wide {
    width: min(var(--theme-page-wide-width), calc(100% - var(--theme-page-gutter)));
}

.site-footer {
    flex: 0 0 auto;
    width: min(var(--theme-page-wide-width), calc(100% - var(--theme-page-gutter)));
    margin: 0 auto;
    padding: 0 0 24px;
}

.site-footer-inner {
    display: flex;
    min-height: 52px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--color-hairline);
    color: var(--color-muted);
    font-size: 13px;
    padding-top: 14px;
}

.site-footer-links {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.site-footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
}

.site-footer-prefix {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.site-footer-links a {
    color: var(--site-footer-link-color, var(--color-body));
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}

.site-footer-links a:hover {
    color: var(--color-ink);
}

.site-footer-links-right {
    justify-items: end;
    text-align: right;
}

.site-footer-links-right .site-footer-row {
    justify-content: flex-end;
}

.site-notice {
    position: fixed;
    z-index: 50;
    top: 14px;
    left: 50%;
    width: max-content;
    max-width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
    border: 1px solid color-mix(in srgb, var(--color-surface) 14%, transparent);
    border-radius: var(--radius-md);
    background: var(--color-notice-bg);
    color: var(--color-notice-text);
    padding: 11px 22px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 18px 48px rgba(12, 10, 9, 0.18);
    backdrop-filter: blur(16px);
    pointer-events: none;
    animation: dynamic-island-notice 4.2s ease both;
}

@keyframes dynamic-island-notice {
    0% {
        opacity: 0;
        transform: translate(-50%, -16px) scale(0.92);
    }

    10%,
    82% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -16px) scale(0.94);
    }
}

@keyframes dynamic-island-notice-reduced {
    0% {
        opacity: 0;
    }

    10%,
    82% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-notice {
        animation: dynamic-island-notice-reduced 4.2s ease both;
    }
}

.hero,
.page-title {
    margin-bottom: 32px;
}

.hero h1,
.page-title h1,
.topic-detail h1 {
    margin: 0;
    font-size: 40px;
    font-weight: 300;
    line-height: 1.2;
}

.hero p,
.page-description,
.topic-item p,
.empty-text {
    color: var(--color-body);
}

.page-description {
    max-width: 640px;
    margin: 12px 0 0;
    overflow-wrap: anywhere;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.avatar-preview {
    display: block;
    width: 88px;
    height: 88px;
    border: 1px solid var(--color-hairline);
    border-radius: 50%;
    margin: 0 0 16px;
    background: var(--color-canvas);
    object-fit: cover;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.button-primary,
.button-secondary,
.theme-attachment-upload-button {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-button);
    background: var(--color-canvas-soft);
    color: var(--color-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.button-primary {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.button-primary:hover,
.button-secondary:hover,
.theme-attachment-upload-button:hover,
.theme-attachment-upload-button:focus-within {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.button-primary:active,
.button-secondary:active {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.button-primary.danger,
.button-secondary.danger {
    color: var(--color-error);
}

.button-primary.danger:hover,
.button-secondary.danger:hover {
    background: color-mix(in srgb, var(--color-error) 10%, var(--color-canvas-soft));
    color: var(--color-error);
}

.auth-panel button[type="submit"]:not(.theme-edge-button),
.theme-edge-button {
    --theme-edge-button-color: var(--theme-button-accent);
    --theme-edge-button-corner-size: 10px;
    --theme-edge-button-corner-hover-size: 16px;
    --theme-edge-button-line-width: 1px;
    position: relative;
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--theme-edge-button-color);
    isolation: isolate;
    overflow: visible;
    padding: 10px 20px;
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease;
}

.auth-panel button[type="submit"]:not(.theme-edge-button)::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color)),
        linear-gradient(var(--theme-edge-button-color), var(--theme-edge-button-color));
    background-position:
        left top,
        left top,
        right top,
        right top,
        left bottom,
        left bottom,
        right bottom,
        right bottom;
    background-repeat: no-repeat;
    background-size:
        var(--theme-edge-button-corner-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-size),
        var(--theme-edge-button-corner-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-size),
        var(--theme-edge-button-corner-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-size),
        var(--theme-edge-button-corner-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-size);
    pointer-events: none;
    transition: background-size 200ms linear;
}

.auth-panel button[type="submit"]:not(.theme-edge-button):hover,
.theme-edge-button:hover {
    color: var(--theme-edge-button-color);
}

.auth-panel button[type="submit"]:not(.theme-edge-button):hover::before {
    background-size:
        var(--theme-edge-button-corner-hover-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-hover-size),
        var(--theme-edge-button-corner-hover-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-hover-size),
        var(--theme-edge-button-corner-hover-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-hover-size),
        var(--theme-edge-button-corner-hover-size) var(--theme-edge-button-line-width),
        var(--theme-edge-button-line-width) var(--theme-edge-button-corner-hover-size);
}

.auth-panel button[type="submit"]:not(.theme-edge-button):active {
    color: var(--theme-edge-button-color);
}

.theme-edge-button {
    min-height: 42px;
    padding: 0 30px;
    user-select: none;
}

.theme-edge-button--compact {
    --theme-edge-button-corner-size: 7px;
    --theme-edge-button-corner-hover-size: 11px;
    min-height: 30px;
    flex: 0 0 auto;
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 0 12px;
}

.theme-edge-button__corner {
    position: absolute;
    width: var(--theme-edge-button-corner-size);
    height: var(--theme-edge-button-corner-size);
    border-color: var(--theme-edge-button-color);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    transition:
        width 200ms linear,
        height 200ms linear;
}

.theme-edge-button__corner--tl {
    top: 0;
    left: 0;
    border-top-width: var(--theme-edge-button-line-width);
    border-left-width: var(--theme-edge-button-line-width);
}

.theme-edge-button__corner--tr {
    top: 0;
    right: 0;
    border-top-width: var(--theme-edge-button-line-width);
    border-right-width: var(--theme-edge-button-line-width);
}

.theme-edge-button__corner--bl {
    bottom: 0;
    left: 0;
    border-bottom-width: var(--theme-edge-button-line-width);
    border-left-width: var(--theme-edge-button-line-width);
}

.theme-edge-button__corner--br {
    right: 0;
    bottom: 0;
    border-right-width: var(--theme-edge-button-line-width);
    border-bottom-width: var(--theme-edge-button-line-width);
}

.theme-edge-button:hover .theme-edge-button__corner {
    width: var(--theme-edge-button-corner-hover-size);
    height: var(--theme-edge-button-corner-hover-size);
}

.theme-edge-button__label {
    position: relative;
    z-index: 1;
}

button {
    cursor: pointer;
}

.theme-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    color: currentColor;
    pointer-events: none;
    stroke: currentColor;
    vertical-align: -0.125em;
}

.theme-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.site-category-more-button,
.site-category-more-button:active,
.site-category-more-button[aria-expanded="true"] {
    min-height: 36px;
    border: 0;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    padding: 9px 12px;
}

.site-category-more-button:not([aria-expanded="true"]) {
    background: transparent;
    color: var(--color-body);
}

.button-link {
    min-height: auto;
    border: 0;
    background: transparent;
    color: var(--color-ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    padding: 0;
    transition: color 160ms ease;
}

.button-link:hover {
    color: var(--color-primary);
}

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

.site-nav > a:focus-visible,
.site-notification-link:focus-visible,
.site-user-menu-button:focus-visible,
.site-user-menu-panel a:focus-visible,
.site-user-menu-panel button:focus-visible,
.site-category-link:focus-visible,
.site-category-more-button:focus-visible,
.site-color-menu-button:focus-visible,
.site-color-menu-panel button:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible,
.button-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.topic-list,
.dashboard-grid,
.form-card,
.topic-detail,
.reply-panel {
    overflow: hidden;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
}

html[data-color-scheme="ink"] :is(.topic-list, .dashboard-grid, .form-card, .topic-detail, .reply-panel) {
    border-color: transparent;
}

.topic-detail > .topic-flags {
    margin-bottom: 10px;
}

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-hairline);
    transition: background 160ms ease;
}

.topic-item:last-child {
    border-bottom: 0;
}

.topic-item:hover {
    background: var(--color-canvas-soft);
}

.topic-item h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.topic-flags {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    vertical-align: middle;
}

.topic-flag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-pill);
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 6px;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.topic-flag .theme-icon {
    width: 12px;
    height: 12px;
}

.topic-item p {
    margin: 0;
    font-size: 14px;
}

.notification-page-title {
    margin-bottom: 20px;
}

.notification-fragment {
    display: grid;
    gap: 14px;
}

.notification-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-surface) 88%, var(--color-canvas-soft));
    padding: 7px;
    box-shadow: var(--shadow-soft);
}

.notification-filter a {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 32px;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    color: var(--control-text);
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.notification-filter a.has-unread {
    padding-right: 18px;
}

.notification-filter a:hover {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.notification-filter a.is-active {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.notification-filter a.is-empty:not(.is-active) {
    color: var(--color-muted);
}

.notification-filter-badge {
    position: relative;
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-ink) 8%, var(--color-surface));
    color: var(--color-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 0 7px;
}

.notification-filter a.is-active .notification-filter-badge {
    background: color-mix(in srgb, var(--color-surface) 82%, transparent);
    color: currentColor;
}

.notification-filter a.is-empty .notification-filter-badge {
    background: color-mix(in srgb, var(--color-muted) 8%, var(--color-surface));
    color: var(--color-muted);
}

.notification-filter-unread-badge {
    position: absolute;
    top: -4px;
    right: -3px;
    display: inline-flex;
    min-width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: var(--color-error);
    color: var(--color-on-error);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--color-surface);
}

.notification-list {
    display: grid;
    gap: 12px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.notification-copy {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 14px;
    pointer-events: none;
}

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

.notification-category {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--tag-bg);
    color: var(--color-ink);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

html[data-color-scheme="ink"] .notification-category {
    background: var(--tag-bg);
    color: var(--color-ink);
}

.notification-copy h2 {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.notification-body {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.notification-item {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    align-items: center;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
}

html[data-color-scheme="ink"] .notification-item {
    border-color: transparent;
}

.notification-item[hidden] {
    display: none;
}

.notification-item.is-unread {
    border-color: color-mix(in srgb, var(--color-error) 22%, var(--color-hairline));
    background: color-mix(in srgb, var(--color-surface-strong) 28%, var(--color-surface));
}

.notification-item.is-read {
    opacity: 0.78;
}

.notification-item::before {
    position: absolute;
    top: 20px;
    left: 14px;
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    background: transparent;
    box-shadow: 0 0 0 2px var(--color-surface);
    content: "";
}

.notification-item.is-unread::before {
    background: var(--color-error);
}

.notification-read-form {
    position: absolute;
    z-index: 1;
    inset: 0;
    margin: 0;
}

.notification-hitbox {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.notification-view-form {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    margin: 0;
}

.notification-view-button {
    min-height: 38px;
    padding: 9px 16px;
    white-space: nowrap;
}

.notification-hitbox:hover {
    background: transparent;
}

.notification-hitbox:active {
    background: transparent;
}

.notification-item:hover,
.notification-item:focus-within {
    background: color-mix(in srgb, var(--color-surface-strong) 36%, var(--color-surface));
}

.notification-hitbox:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -4px;
}

.notification-filter-empty {
    margin: 4px 0 0;
}

.topic-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topic-actions form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.topic-actions .button-primary,
.topic-actions .button-secondary {
    min-height: 40px;
    padding: 10px 18px;
    white-space: nowrap;
}

.topic-reward-form {
    max-width: 100%;
}

.topic-reward-form input {
    width: 78px;
    min-height: 38px;
    border-radius: var(--radius-pill);
    padding: 8px 12px;
    text-align: center;
}

.theme-fragment {
    position: relative;
}

.theme-fragment[data-loading] {
    opacity: 0.72;
    transition: opacity 160ms ease;
}

.theme-topic-list {
    display: grid;
    gap: 14px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.theme-topic-toolbar,
.content-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.theme-topic-tabs,
.theme-topic-view-tabs,
.content-tabs {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.theme-topic-tabs a,
.theme-topic-view-tabs a,
.content-tabs a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    border: 0;
    border-radius: var(--radius-button);
    background: var(--color-canvas-soft);
    color: var(--color-muted);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.theme-topic-tabs a:hover,
.theme-topic-tabs a.is-active,
.theme-topic-view-tabs a:hover,
.theme-topic-view-tabs a.is-active,
.content-tabs a:hover,
.content-tabs a.is-active {
    background: var(--control-bg-active);
    color: var(--control-text-active);
    font-weight: 500;
}

.theme-topic-tabs a.is-active,
.theme-topic-view-tabs a.is-active,
.content-tabs a.is-active {
    background: var(--control-bg-active);
    color: var(--control-text-active);
}

.theme-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.theme-topic-main {
    min-width: 0;
}

.theme-page-head {
    margin-bottom: 20px;
}

.theme-topic-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
}

.theme-sidebar-panel {
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

html[data-color-scheme="ink"] .theme-sidebar-panel {
    background: var(--color-surface);
}

.theme-sidebar-panel h2,
.theme-sidebar-panel p {
    margin: 0;
}

.theme-sidebar-panel h2 {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.25;
}

.theme-sidebar-panel p {
    margin-top: 10px;
    color: var(--color-body);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.theme-sidebar-intro {
    min-height: 0;
    background: var(--color-surface);
}

.theme-sidebar-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.theme-sidebar-stats span {
    display: grid;
    gap: 4px;
    border-radius: var(--radius-md);
    background: var(--color-canvas-soft);
    padding: 11px;
}

.theme-sidebar-stats strong {
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.theme-sidebar-stats small {
    color: var(--color-muted);
    font-size: 12px;
}

.theme-sidebar-links {
    display: grid;
    gap: 0;
    margin-top: 8px;
}

.theme-sidebar-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-hairline);
    border-radius: 0;
    background: transparent;
    color: var(--color-ink);
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
}

.theme-sidebar-links a:last-child {
    border-bottom: 0;
}

.theme-compose-actions .button-primary {
    width: 100%;
}

.theme-topic-item {
    position: relative;
    align-items: flex-start;
    height: 88px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 14px 20px 26px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.theme-topic-item:last-child {
    border-bottom: 0;
}

.theme-topic-copy {
    display: block;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

.theme-topic-item h2 {
    display: flex;
    min-width: 0;
    max-height: 28px;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0;
    overflow: visible;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
}

.theme-topic-item h2 a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-topic-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 8px 0 0;
    color: var(--color-body);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.theme-topic-preview-images {
    display: grid;
    grid-template-columns: repeat(3, 88px);
    gap: 6px;
    margin-top: 14px;
}

.theme-topic-preview-images a {
    display: block;
    overflow: hidden;
    width: 88px;
    height: auto;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-surface-strong);
}

.theme-topic-preview-images img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-topic-item-preview {
    height: auto;
    min-height: 0;
    padding: 16px 20px 14px;
}

.theme-topic-item-preview .theme-topic-copy {
    display: grid;
    min-height: 0;
    gap: 0;
}

.theme-topic-item-preview .theme-topic-excerpt {
    max-width: 760px;
    margin-top: 12px;
    color: var(--color-muted);
    font-size: 15px;
    -webkit-line-clamp: 2;
}

.theme-topic-preview-foot {
    position: static;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding-top: 0;
}

.theme-topic-preview-foot .theme-topic-meta {
    position: static;
    inset: auto;
    flex: 1 1 auto;
}

.theme-topic-preview-author {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: 14px;
    white-space: nowrap;
}

.theme-topic-preview-author span:first-child {
    overflow: hidden;
    max-width: 160px;
    color: var(--color-body);
    text-overflow: ellipsis;
}

.theme-topic-preview-author small {
    color: var(--color-muted);
    font-size: 13px;
}

.theme-topic-preview-author img,
.theme-topic-preview-avatar {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font-size: 13px;
    font-weight: 500;
    object-fit: cover;
}

.theme-topic-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.theme-topic-item-grid {
    display: grid;
    grid-template-rows: 150px minmax(0, 1fr);
    height: 258px;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    padding: 0;
    overflow: hidden;
}

.theme-topic-grid-cover {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 150px;
    aspect-ratio: auto;
    border: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--color-surface-strong);
    line-height: 1;
}

.theme-topic-grid-cover img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
}

.theme-topic-grid-cover-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: var(--color-surface-strong);
    color: color-mix(in srgb, var(--color-ink) 30%, transparent);
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
}

.theme-topic-grid-body {
    position: relative;
    display: grid;
    min-height: 0;
    min-width: 0;
    grid-template-rows: minmax(22px, 1fr) auto;
    gap: 10px;
    padding: 12px 14px 11px;
}

.theme-topic-item-grid .theme-topic-grid-title {
    display: block;
    min-width: 0;
    max-height: none;
    margin: 0;
    overflow: visible;
    font-size: 15px;
    line-height: 1.4;
}

.theme-topic-item-grid .theme-topic-grid-title a {
    display: block;
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-topic-item-grid .theme-topic-excerpt {
    display: none;
}

.theme-topic-grid-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    align-self: end;
}

.theme-topic-grid-user {
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.theme-topic-grid-user img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-topic-grid-user span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-topic-grid-meta .theme-topic-meta {
    position: static;
    inset: auto;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.theme-topic-grid-meta .theme-topic-meta-item {
    flex: 0 0 auto;
    gap: 3px;
    font-size: 12px;
}

.theme-topic-grid-meta .theme-topic-meta .theme-icon {
    width: 13px;
    height: 13px;
}

.theme-topic-item.has-pinned-flag h2 {
    padding-left: 10px;
}

.theme-topic-item.has-featured-flag::after {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 42px;
    height: 3px;
    border-radius: 0 var(--radius-md) 0 var(--radius-md);
    background: color-mix(in srgb, var(--color-primary) 52%, var(--color-hairline));
    content: "";
}

.theme-topic-item .topic-flags {
    position: static;
    overflow: visible;
    flex-wrap: nowrap;
}

.theme-topic-item .topic-flag {
    position: absolute;
    z-index: 2;
    top: 0;
    width: 14px;
    height: 16px;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.theme-topic-item .topic-flag-pinned {
    left: 9px;
}

.theme-topic-item .topic-flag-featured {
    display: none;
}

.theme-topic-item .topic-flag-pinned .theme-icon {
    width: 12px;
    height: 15px;
    transform: none;
}

.theme-topic-item.theme-topic-item-grid.has-pinned-flag h2 {
    padding-left: 0;
}

.theme-topic-item.theme-topic-item-grid > .topic-flags {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 10px;
    overflow: visible;
    flex-wrap: nowrap;
}

.theme-topic-item.theme-topic-item-grid .topic-flag {
    position: static;
    width: 14px;
    height: 16px;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.theme-topic-meta {
    position: absolute;
    right: 20px;
    bottom: 8px;
    left: 20px;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.theme-topic-author,
.theme-topic-meta-separator,
.theme-topic-meta-item {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
}

.theme-topic-author {
    flex: 0 1 auto;
    max-width: 148px;
    color: var(--color-body);
    line-height: 1.2;
}

.theme-topic-meta-separator {
    flex: 0 0 auto;
    color: var(--color-muted);
}

.theme-topic-meta-item {
    flex: 0 0 auto;
}

.theme-topic-author,
.theme-topic-meta-separator,
.theme-topic-meta-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-topic-actions {
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.theme-topic-actions > form,
.theme-topic-actions > .theme-action-reward {
    display: inline-flex;
    height: 36px;
    align-items: flex-start;
    margin: 0;
}

.theme-action-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 36px;
    min-height: 36px;
    border: 0;
    border-radius: var(--radius-full);
    padding: 0;
    background: transparent;
    color: var(--color-muted);
    line-height: 1;
    cursor: pointer;
}

.theme-action-icon-button:hover,
.theme-action-icon-button.is-active {
    color: var(--color-ink);
}

.theme-action-icon-button .theme-icon {
    position: absolute;
    top: 22px;
    left: 8px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
}

.theme-action-icon-button:not(button):not(summary) {
    cursor: default;
}

.theme-action-reward {
    position: relative;
}

.theme-action-reward-panel[hidden] {
    display: none;
}

.theme-action-reward-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    display: flex;
    width: max-content;
    max-width: calc(100vw - 24px);
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    box-shadow: var(--shadow-card);
}

.theme-action-reward-preset,
.theme-action-reward-form input {
    flex: 0 0 auto;
}

.theme-action-reward-preset .button-secondary {
    width: 36px;
    min-width: 36px;
    min-height: 34px;
    padding: 0;
}

.theme-action-reward-form {
    flex: 0 0 auto;
    min-width: 0;
}

.theme-action-reward-form input {
    width: 72px;
    min-height: 34px;
    border-radius: var(--radius-md);
    padding: 7px 8px;
    font-size: 13px;
}

.theme-action-reward-form .button-secondary {
    min-height: 34px;
    padding: 0 10px;
}

.theme-action-badge {
    position: absolute;
    top: 0;
    left: 24px;
    display: inline-flex;
    min-width: 0;
    height: auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    color: currentColor;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.theme-topic-meta .theme-icon {
    width: 14px;
    height: 14px;
}

.review-reason {
    margin-top: 8px;
    color: var(--color-error);
    overflow-wrap: anywhere;
}

.topic-stats {
    display: flex;
    gap: 12px;
    color: var(--color-muted);
    font-size: 13px;
    white-space: nowrap;
}

.theme-topic-detail-shell {
    width: min(var(--theme-page-wide-width), calc(100% - var(--theme-page-gutter)));
}

.theme-topic-detail-layout {
    align-items: start;
}

.theme-topic-detail-main {
    display: grid;
    gap: 16px;
}

.theme-topic-detail-card {
    display: grid;
    gap: 22px;
    overflow: visible;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
}

html[data-color-scheme="ink"] .theme-topic-detail-card {
    background: var(--color-surface);
}

.theme-topic-detail-card {
    padding: 24px;
}

.theme-topic-detail-head {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.theme-topic-detail-title-block {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.theme-topic-author-card-main:hover .theme-topic-author-card-name {
    color: var(--color-primary);
}

.theme-topic-author-card-name-row {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.theme-topic-detail-title-row {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 10px;
}

.topic-detail .theme-topic-detail-title-row h1 {
    min-width: 0;
    max-width: 100%;
    font-size: 25px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.theme-topic-detail-side-meta {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.theme-topic-detail-side-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.theme-topic-detail-side-meta .theme-icon {
    width: 14px;
    height: 14px;
}

.theme-topic-author-card-main {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: 12px;
    justify-items: center;
    gap: 10px;
    text-decoration: none;
}

.theme-topic-author-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface-strong);
    color: var(--color-ink);
    font-weight: 600;
    object-fit: cover;
}

.theme-topic-author-card-name {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--color-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-topic-detail-body {
    margin-top: 0;
    color: var(--color-ink);
    font-size: 17px;
    line-height: 1.85;
}

.theme-topic-detail-body :is(p, h2, h3):first-child {
    margin-top: 0;
}

.theme-topic-detail-body :is(p, h2, h3):last-child {
    margin-bottom: 0;
}

.theme-topic-detail-body img {
    max-width: 100%;
    height: auto;
}

.form-help {
    margin: -4px 0 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
}

.topic-paid-content {
    display: grid;
    gap: 14px;
    border-radius: var(--radius-md);
    background: var(--color-canvas-soft);
    padding: 16px;
}

.topic-paid-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.2;
}

.topic-paid-content-head strong {
    color: var(--color-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.topic-paid-content-body {
    color: var(--color-ink);
    font-size: 16px;
    line-height: 1.8;
}

.topic-paid-content-body :is(p, h2, h3):first-child {
    margin-top: 0;
}

.topic-paid-content-body :is(p, h2, h3):last-child {
    margin-bottom: 0;
}

.topic-paid-content-locked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topic-paid-content-locked p,
.topic-paid-content-locked span {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
}

.topic-paid-content-locked form {
    margin: 0;
}

.theme-topic-author-card {
    position: relative;
    display: flex;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 150px;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.theme-topic-author-avatar {
    width: 52px;
    height: 52px;
}

.theme-topic-author-card .theme-topic-author-card-bio {
    display: block;
    box-sizing: border-box;
    width: calc(100% + 16px);
    max-width: calc(100% + 16px);
    min-width: 0;
    margin: auto -8px -8px;
    padding-top: 10px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-card,
.topic-detail,
.reply-panel {
    padding: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-card {
    display: grid;
    gap: 8px;
    min-height: 140px;
    align-content: space-between;
    padding: 20px;
    border-right: 1px solid var(--color-hairline);
    transition: background 160ms ease;
}

.dashboard-card:last-child {
    border-right: 0;
}

.dashboard-card:hover {
    background: var(--color-canvas-soft);
}

.dashboard-card span,
.dashboard-card small {
    color: var(--color-muted);
    font-size: 13px;
}

.dashboard-card strong {
    color: var(--color-ink);
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
    overflow-wrap: anywhere;
}

.wallet-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 18px;
    margin-bottom: 18px;
}

.wallet-panel h2,
.wallet-transactions h2 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 500;
}

.wallet-exchange-panel {
    margin-bottom: 18px;
}

.wallet-exchange-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.wallet-exchange-head h2 {
    margin: 0;
}

.wallet-exchange-head span {
    color: var(--color-muted);
    font-size: 13px;
    white-space: nowrap;
}

.wallet-exchange-form {
    display: grid;
    gap: 14px;
}

.wallet-exchange-form label {
    margin-bottom: 0;
}

.wallet-exchange-controls {
    display: grid;
    grid-template-columns: minmax(120px, 0.75fr) minmax(140px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.wallet-exchange-rule-field select {
    min-height: 44px;
}

.wallet-balance-list,
.wallet-transaction-list {
    display: grid;
    gap: 10px;
}

.wallet-balance-row,
.wallet-transaction-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--color-hairline);
    padding-bottom: 10px;
}

.wallet-balance-row:last-child,
.wallet-transaction-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.wallet-balance-row span,
.wallet-transaction-row span {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 13px;
}

.wallet-balance-row strong,
.wallet-transaction-row strong {
    font-size: 18px;
    font-weight: 500;
}

.wallet-transfer-form button,
.wallet-exchange-form button {
    width: fit-content;
}

.search-form {
    display: flex;
    align-items: end;
    gap: 12px;
}

.search-form label {
    flex: 1;
    margin-bottom: 0;
}

.theme-search-form {
    align-items: flex-end;
}

.theme-search-form .button-primary {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 12px 18px;
}

.topic-action-form,
.reply-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.reply-panel {
    margin-top: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
}

.section-title span,
.reply-meta {
    color: var(--color-muted);
    font-size: 13px;
}

.reply-list {
    border-top: 1px solid var(--color-hairline);
}

.reply-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--color-hairline);
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.reply-meta strong {
    color: var(--color-ink);
    font-size: 14px;
}

.reply-body {
    color: var(--color-body);
    overflow-wrap: anywhere;
}

.content-image-uploader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 18px;
}

.content-image-button {
    position: relative;
    width: fit-content;
    overflow: hidden;
}

.content-image-button input {
    position: absolute;
    inset: 0;
    cursor: pointer;
    opacity: 0;
}

.content-image-hint {
    color: var(--color-muted);
    font-size: 13px;
}

.reply-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-hairline);
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--color-body);
    font-size: 14px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
    padding: 12px 16px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--field-autofill-bg) inset;
    caret-color: var(--color-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--field-autofill-bg) inset;
    -webkit-text-fill-color: var(--color-ink);
    transition: background-color 999999s ease-out, color 999999s ease-out;
}

input:autofill,
select:autofill,
textarea:autofill {
    box-shadow: 0 0 0 1000px var(--field-autofill-bg) inset;
    caret-color: var(--color-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--field-autofill-bg) inset;
    -webkit-text-fill-color: var(--color-ink);
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--field-border);
    outline: 0;
}

.topic-body {
    margin-top: 24px;
    color: var(--color-body);
    white-space: normal;
    overflow-wrap: anywhere;
}

.pagination {
    margin-top: 24px;
}

.msx-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.msx-pagination-simple {
    justify-content: flex-end;
}

.msx-pagination-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    color: var(--pagination-text);
}

.msx-pagination-button,
.msx-pagination-jump summary,
.msx-pagination-menu-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.msx-pagination-button {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--pagination-button-bg);
    cursor: pointer;
    padding: 0;
    appearance: none;
}

.msx-pagination-button::before {
    width: 6px;
    height: 6px;
    border-top: 2px solid var(--pagination-button-icon);
    border-left: 2px solid var(--pagination-button-icon);
    content: "";
}

.msx-pagination-prev::before {
    transform: translateX(2px) rotate(-45deg);
}

.msx-pagination-next::before {
    transform: translateX(-2px) rotate(135deg);
}

.msx-pagination-button:not(.is-disabled):not(:disabled):hover {
    background: var(--pagination-button-hover-bg);
}

.msx-pagination-button:not(.is-disabled):not(:disabled):hover::before {
    border-color: var(--pagination-button-hover-icon);
}

.msx-pagination-button.is-disabled,
.msx-pagination-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.msx-pagination-button:focus-visible,
.msx-pagination-menu-page:focus-visible {
    outline: 2px solid var(--pagination-focus-ring);
    outline-offset: 2px;
}

.msx-pagination-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.msx-pagination-jump {
    position: relative;
}

.msx-pagination-jump summary {
    width: 24px;
    height: 24px;
    cursor: pointer;
    list-style: none;
    padding: 0;
}

.msx-pagination-jump summary::-webkit-details-marker {
    display: none;
}

.msx-pagination-compass {
    position: relative;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: conic-gradient(
        var(--pagination-progress-fill) 0 var(--page-progress, 0%),
        var(--pagination-progress-track) var(--page-progress, 0%) 100%
    );
}

.msx-pagination-compass::before {
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: var(--pagination-current-bg);
    content: "";
}

.msx-pagination-current {
    position: relative;
    z-index: 1;
    color: var(--pagination-current-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.msx-pagination-menu {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 8px);
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 26px);
    gap: 4px;
    max-height: 146px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-md);
    background: var(--pagination-menu-bg);
    box-shadow: var(--pagination-menu-shadow);
    padding: 6px;
    scrollbar-color: var(--pagination-menu-scrollbar) transparent;
    scrollbar-width: thin;
    transform: translateX(50%);
}

.msx-pagination-menu::-webkit-scrollbar {
    width: 6px;
}

.msx-pagination-menu::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--pagination-menu-scrollbar);
}

.msx-pagination-menu-page {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--pagination-menu-page-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 0;
}

.msx-pagination-menu-page:hover {
    background: var(--pagination-menu-page-hover-bg);
    color: var(--pagination-menu-page-hover-text);
}

.msx-pagination-menu-page.is-active {
    background: var(--pagination-menu-page-active-bg);
    color: var(--pagination-menu-page-active-text);
    cursor: default;
}

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

@media (max-width: 720px) {
    .page-title,
    .topic-item,
    .search-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-form {
        align-items: stretch;
    }

    .site-header {
        top: 8px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "brand category actions";
        align-items: center;
        gap: 8px;
        width: min(960px, calc(100% - 16px));
        min-height: 0;
        padding: 10px 12px;
        border-radius: var(--radius-md);
    }

    .site-logo {
        grid-area: brand;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .site-logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-logo img {
        max-width: min(150px, 100%);
        height: 30px;
    }

    .site-category-nav {
        grid-area: category;
        align-self: stretch;
        width: auto;
        min-width: 0;
        justify-content: flex-end;
    }

    .site-category-nav.is-category-drawer-open::before {
        position: fixed;
        z-index: 44;
        inset: 0;
        background: color-mix(in srgb, #000000 46%, transparent);
        content: "";
    }

    .site-nav {
        grid-area: actions;
        width: auto;
        min-width: 0;
        max-width: 58vw;
        justify-content: flex-end;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
    }

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

    .site-nav > a {
        flex: 0 0 auto;
        font-size: 14px;
        white-space: nowrap;
    }

    .site-color-menu-panel,
    .site-user-menu-panel {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 72px);
        left: auto;
        z-index: 82;
        max-width: calc(100vw - 16px);
    }

    .site-color-menu-panel {
        right: clamp(72px, 22vw, 96px);
        min-width: 128px;
    }

    .site-user-menu-panel {
        right: 8px;
        min-width: 156px;
    }

    .site-category-list {
        display: none;
        flex: 0 0 auto;
        gap: 8px;
    }

    .site-category-link,
    .site-category-more-button,
    .site-color-menu-button {
        min-height: 34px;
        font-size: 14px;
    }

    .site-category-link,
    .site-category-more-button {
        padding: 8px 10px;
    }

    .site-category-more {
        position: relative;
        display: flex;
        margin-left: 0;
    }

    .site-category-menu {
        position: fixed;
        z-index: 46;
        top: auto;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        min-width: 0;
        max-height: min(70vh, 520px);
        gap: 4px;
        overscroll-behavior: contain;
        border-radius: var(--radius-md);
        padding: 10px;
    }

    .site-category-menu::before {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: var(--radius-pill);
        justify-self: center;
        margin: 2px 0 6px;
        background: var(--color-hairline-strong);
        content: "";
    }

    .site-category-menu .site-category-link {
        min-height: 40px;
        border-radius: var(--radius-md);
        padding: 0 12px;
    }

    .site-category-menu .site-category-submenu {
        gap: 2px;
        padding: 2px 0 6px 14px;
    }

    .site-category-menu .site-category-child-link {
        min-height: 36px;
    }

    .theme-topic-toolbar {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }

    .theme-topic-tabs,
    .theme-topic-view-tabs,
    .content-tabs {
        width: 100%;
    }

    .theme-topic-tabs,
    .theme-topic-view-tabs {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        scrollbar-width: none;
    }

    .theme-topic-tabs::-webkit-scrollbar,
    .theme-topic-view-tabs::-webkit-scrollbar {
        display: none;
    }

    .theme-topic-list-grid {
        grid-template-columns: 1fr;
    }

    .theme-topic-item-preview,
    .theme-topic-item-grid {
        width: 100%;
    }

    .theme-topic-preview-foot {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 14px;
    }

    .page-shell {
        padding-top: 32px;
    }

    .page-shell,
    .theme-page-shell-single,
    .theme-topic-detail-shell {
        width: min(var(--theme-page-narrow-width), calc(100% - var(--theme-page-mobile-gutter)));
    }

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

    .theme-topic-sidebar {
        position: static;
    }

    .msx-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .msx-pagination-list {
        justify-content: flex-start;
        width: 100%;
    }

    .hero h1,
    .page-title h1,
    .topic-detail h1 {
        font-size: 30px;
    }

    .topic-stats,
    .topic-actions {
        flex-wrap: wrap;
        white-space: normal;
    }

    .theme-topic-detail-head,
    .theme-topic-detail-title-row {
        flex-direction: column;
    }

    .theme-topic-detail-side-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
    }

    .theme-topic-detail-card {
        padding: 12px;
    }

    .theme-topic-detail-body {
        font-size: 16px;
    }

    .theme-action-reward-form {
        flex: 1 1 auto;
    }

    .topic-actions form {
        flex-wrap: nowrap;
    }

    .notification-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .notification-item {
        align-items: stretch;
        gap: 14px;
    }

    .notification-view-form {
        align-self: flex-start;
    }

    .topic-reward-form input {
        width: 72px;
    }

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

    .dashboard-card {
        min-height: 116px;
        border-right: 0;
        border-bottom: 1px solid var(--color-hairline);
    }

    .dashboard-card:last-child {
        border-bottom: 0;
    }

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

    .wallet-balance-row,
    .wallet-transaction-row {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .wallet-exchange-controls {
        grid-template-columns: 1fr;
    }

    .content-image-button,
    .search-form button {
        width: 100%;
    }

    .content-image-uploader {
        align-items: stretch;
        flex-direction: column;
    }
}
