* { margin: 0; padding: 0; }

html, body {
    font-family: arial, helvetica, sans-serif;
    font-size: 10pt;
    background: var(--bg);
    color: var(--fg);
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* Light (default) */
:root, .light, .system {
    --bg: #EEF2FF;
    --fg: #000;
    --link: #34345C;
    --link-hover: #ff0000;
    --bar-bg: #D6DAF0;
    --bar-border: #B7C5D9;
    --card-bg: #D6DAF0;
    --card-border: #B7C5D9;
    --card-hover: #E0E4F5;
    --thumb-bg: #C0C5D5;
    --title: #0F0C5D;
    --muted: #707070;
    --sub: #A0A0A0;
}

/* Dark */
.dark {
    --bg: #0a0a0f;
    --fg: #c0c0c0;
    --link: #89a;
    --link-hover: #fff;
    --bar-bg: #12121e;
    --bar-border: #1a1a2e;
    --card-bg: #0f0f18;
    --card-border: #1a1a2e;
    --card-hover: #151525;
    --thumb-bg: #0a0a0f;
    --title: #c0c0c0;
    --muted: #505070;
    --sub: #303050;
}

/* System dark mode override */
@media (prefers-color-scheme: dark) {
    :root:not(.light), .system {
        --bg: #0a0a0f;
        --fg: #c0c0c0;
        --link: #89a;
        --link-hover: #fff;
        --bar-bg: #12121e;
        --bar-border: #1a1a2e;
        --card-bg: #0f0f18;
        --card-border: #1a1a2e;
        --card-hover: #151525;
        --thumb-bg: #0a0a0f;
        --title: #c0c0c0;
        --muted: #505070;
        --sub: #303050;
    }
}

.boardlist {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bar-bg);
    border-bottom: 1px solid var(--bar-border);
    padding: 3px 8px;
    font-size: 9pt;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 24px;
    width: auto;
    display: block;
}

.bar-left,
.bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bar-right {
    margin-left: auto;
}

@media (max-width: 640px) {
    .boardlist {
        gap: 6px;
        padding: 4px 6px;
    }
    .bar-left,
    .bar-right {
        gap: 6px;
    }
    .bar-right {
        margin-left: 0;
        flex-basis: 100%;
    }
    .sep {
        display: none;
    }
    .logo {
        height: 20px;
    }
    .search-form input {
        width: 100px;
    }
}

.boardlist a {
    text-decoration: none;
}

.boardlist a:hover {
    text-decoration: underline;
}

.theme-select {
    font-size: 8pt;
    background: transparent;
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 1px 4px;
    font-family: inherit;
    cursor: pointer;
}

.theme-form {
    display: inline;
}

.theme-submit {
    font-size: 8pt;
    font-family: inherit;
    background: transparent;
    border: 1px solid;
    padding: 1px 4px;
    cursor: pointer;
    color: var(--fg);
}

.account-menu {
    display: inline-block;
    position: relative;
    font-size: 9pt;
    margin-right: 8px;
    vertical-align: middle;
}

.account-menu summary {
    cursor: pointer;
    color: var(--link);
    list-style: none;
}

.account-menu div {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    z-index: 50;
    min-width: 100px;
    white-space: nowrap;
}

.account-menu a {
    display: block;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--link);
}

.account-menu .inline-form {
    display: block;
}

.account-menu .link-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--link);
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.account-menu a:hover,
.account-menu .link-btn:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

.mod-actions {
    display: inline-block;
    position: relative;
    margin-left: 8px;
    vertical-align: middle;
}

.mod-actions summary {
    cursor: pointer;
    color: var(--link);
    list-style: none;
    font-size: 9pt;
    padding: 2px 6px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    background: var(--card-bg);
}

.mod-actions summary:hover {
    color: var(--link-hover);
}

.mod-actions div {
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    z-index: 50;
    min-width: 180px;
    padding: 4px;
}

.mod-actions a,
.mod-actions .link-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--link);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 9pt;
    cursor: pointer;
}

.mod-actions a:hover,
.mod-actions .link-btn:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

.mod-actions .rename-form {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.mod-actions .rename-form input {
    width: 100%;
    padding: 2px 4px;
    font-size: 8pt;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--fg);
}

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

.search-form input {
    font-size: 8pt;
    background: transparent;
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 1px 4px;
    font-family: inherit;
    width: 140px;
}

.inline-form {
    display: inline;
}

.link-btn {
    background: none;
    border: none;
    color: var(--link);
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
}

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

.notif-badge {
    background: #d32f2f;
    color: #fff;
    font-size: 7pt;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 8px;
    text-decoration: none;
}

.notif-badge:hover {
    background: #b71c1c;
    color: #fff;
}

.notif-unread {
    padding: 8px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.notif-read {
    padding: 8px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.notif-meta {
    font-size: 8pt;
    color: var(--muted);
    margin-bottom: 4px;
}

.notif-body {
    font-size: 10pt;
}

.kaomoji-page {
    max-width: 100%;
}

.kaomoji-page h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.kaomoji-page h3 {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 8px;
}

.inbox-page {
    max-width: 600px;
}

.inbox-page h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.inbox-page form {
    margin-bottom: 16px;
}

.inbox-page button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.inbox-page .form-row {
    margin-bottom: 8px;
}

.inbox-page .form-row label {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 2px;
}

.inbox-page .form-row textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
    resize: vertical;
}

.inbox-page .form-actions {
    margin-top: 12px;
}

.kaomoji-page form {
    margin-bottom: 16px;
}

.kaomoji-page button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.kaomoji-page .form-row {
    margin-bottom: 8px;
}

.kaomoji-page .form-row label {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 2px;
}

.kaomoji-page .form-row input {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
}

.kaomoji-page .form-actions {
    margin-top: 12px;
}

.kaomoji-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0;
}

.kaomoji-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10pt;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    color: var(--fg);
}

.kaomoji-chip:hover {
    background: var(--card-hover);
}

.kaomoji-chip.blacklisted {
    opacity: 0.4;
    text-decoration: line-through;
}

.kaomoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kaomoji-category {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 12px;
}

.kaomoji-category h4 {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: capitalize;
}

main {
    margin: 24px 8px 0;
    padding: 8px;
}

.post-count {
    text-align: right;
    color: var(--muted);
    font-size: 9pt;
    margin: 8px 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 300px));
    gap: 12px;
}

.post-card {
    background: var(--card-bg);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.post-card:hover {
    background: var(--card-hover);
}

.post-card .thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--thumb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.multi-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 3px;
    padding: 3px;
    line-height: 0;
    display: flex;
}

.post-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card .meta {
    padding: 4px 6px;
}

.post-card .meta .title {
    color: var(--title);
    font-weight: bold;
    font-size: 10pt;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card .meta .body-snippet {
    color: var(--fg);
    font-size: 8pt;
    margin-top: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.post-card .meta .info {
    color: var(--muted);
    font-size: 8pt;
    margin-top: 4px;
}

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

.empty-state p { margin-bottom: 4px; }
.empty-state .sub { font-size: 8pt; color: var(--sub); }

.post {
    margin: 0.2em 4px;
    padding: 0.5em 0.3em 0.5em 0.6em;
    display: inline-block;
    max-width: 94%;
}

.post.op {
    margin-right: 20px;
    margin-bottom: 5px;
}

.post-image {
    float: left;
    margin: 5px 10px 10px 0;
}

.post-image img {
    max-width: 50vw;
    height: auto;
    cursor: pointer;
}

.post-image img.expanded {
    max-width: 100%;
}

.post-video video {
    max-width: 50vw;
    height: auto;
    cursor: pointer;
}

.post-audio audio {
    width: min(50vw, 480px);
    margin: 5px 10px 10px 0;
}

p.fileinfo {
    margin: 0 0 0 20px;
    font-size: 10px;
}

.replies-header {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    margin: 16px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.post.reply {
    display: block;
    margin: 8px 0;
    padding: 8px;
    border-left: 2px solid var(--card-border);
}

.edit-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 8pt;
    color: var(--muted);
    text-decoration: none;
}

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

.btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 9pt;
    font-family: inherit;
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--card-hover);
}

.btn-small {
    font-size: 8pt;
    padding: 2px 8px;
}

p.intro {
    margin: 0.5em 0;
    padding: 0;
    padding-bottom: 0.2em;
}

.subject {
    color: var(--title);
    font-weight: bold;
}

.name {
    color: #117743;
    font-weight: bold;
}

.badge {
    font-size: 7pt;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

.badge-admin {
    background: #d32f2f;
    color: #fff;
}

.badge-mod {
    background: #1976d2;
    color: #fff;
}

.edit-tag {
    color: #e6a800;
    font-style: italic;
}

.spoiler {
    background: var(--fg);
    color: transparent;
    border-radius: 2px;
    cursor: pointer;
}

.spoiler:hover {
    background: var(--card-bg);
    color: var(--fg);
}

.post-ref {
    color: var(--link);
    text-decoration: none;
    font-weight: bold;
}

.post-ref:hover {
    color: var(--link-hover);
}

.edit-history {
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.edit-history summary {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 8px;
}

.edit-entry {
    margin-bottom: 12px;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.edit-meta {
    font-size: 8pt;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}

.edit-old {
    font-size: 9pt;
    margin-bottom: 4px;
}

.edit-new {
    font-size: 9pt;
}

.edit-body {
    font-size: 9pt;
    margin-bottom: 4px;
}

.edited-link {
    font-size: 8pt;
    color: var(--muted);
    text-decoration: none;
    margin-left: 8px;
}

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

.reply-to {
    font-size: 9pt;
    color: var(--muted);
    margin: 8px 0;
}

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

.greentext {
    color: #789922;
}

.post .body {
    margin-top: 0.8em;
    padding-right: 3em;
    padding-bottom: 0.3em;
    word-wrap: break-word;
    white-space: pre-wrap;
}

pre {
    overflow-x: auto;
    max-width: 100%;
    margin: 8px 0;
}

pre code {
    display: block;
    padding: 12px;
    font-size: 9pt;
    line-height: 1.4;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
}

/* highlight.js theme toggling is handled in theme.js via <link disabled>. */

.tag {
    font-size: 8pt;
    color: var(--link);
    text-decoration: none;
}

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

.profile-header {
    margin-bottom: 8px;
}

.profile-header .name {
    font-size: 14pt;
    font-weight: bold;
    color: var(--title);
}

.profile-header .role {
    font-size: 8pt;
    color: var(--muted);
    margin-left: 6px;
    border: 1px solid var(--bar-border);
    padding: 1px 4px;
}

.profile-message {
    font-size: 9pt;
    color: var(--link);
    text-decoration: none;
    margin-left: 8px;
}

.profile-message:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.profile-bio {
    margin: 8px 0;
    font-size: 10pt;
    white-space: pre-wrap;
}

.profile-stats {
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 20px;
}

.profile h2 {
    font-size: 11pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 10px;
}

.card-tags {
    margin-top: 4px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 7pt;
    color: var(--link);
    text-decoration: none;
}

.card-tag:hover {
    color: var(--link-hover);
}

.settings h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 16px;
}

.settings h3 {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 8px;
    margin-top: 16px;
}

.tz-form select {
    font-size: 9pt;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 4px 8px;
    font-family: inherit;
}

.tz-form button {
    font-size: 8pt;
    font-family: inherit;
    background: transparent;
    border: 1px solid var(--bar-border);
    padding: 2px 6px;
    cursor: pointer;
    color: var(--fg);
}

.login-form {
    max-width: 400px;
}

.login-form h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.login-err {
    color: #d00;
    font-size: 9pt;
    margin-bottom: 8px;
}

.login-form .form-row {
    margin-bottom: 8px;
}

.login-form .form-row input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
}

.login-form .form-actions button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.post-form {
    max-width: 500px;
}

.post-form h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.form-row {
    margin-bottom: 8px;
}

.form-row label {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 2px;
}

.form-row input:not([type="checkbox"]),
.form-row textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
    resize: vertical;
}

.form-row .sub {
    font-size: 8pt;
    color: var(--sub);
    margin-top: 4px;
}

.form-actions {
    margin-top: 12px;
}

.form-actions button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 9pt;
    color: var(--muted);
    cursor: pointer;
    margin: 4px 0;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: auto;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--link);
}

.post-err {
    color: #d00;
    font-size: 9pt;
    margin-bottom: 8px;
}

.account-form {
    max-width: 500px;
}

.account-form h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.account-field {
    margin-bottom: 8px;
}

.account-field label {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 2px;
}

.account-value {
    font-size: 10pt;
    padding: 4px 0;
}

.account-ok {
    color: #0a0;
    font-size: 9pt;
    margin-bottom: 8px;
}

.tree-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tree-header h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
}

.tree-header a {
    font-size: 9pt;
}

.tree-node {
    margin-bottom: 2px;
}

.tree-user {
    font-size: 10pt;
}

.tree-user a {
    color: var(--link);
    text-decoration: none;
    font-weight: bold;
}

.tree-user a:hover {
    color: var(--link-hover);
}

.tree-invited-by {
    font-size: 9pt;
    color: var(--muted);
}

.tree-invited-by a {
    font-weight: normal;
}

.tree-actions {
    margin-left: 8px;
    font-size: 8pt;
}

.tree-actions .link-btn {
    margin-right: 6px;
    font-weight: normal;
}

.tree-user .banned-label {
    color: #d32f2f;
    font-weight: bold;
}

.tree-date {
    font-size: 8pt;
    color: var(--sub);
    padding-left: 2px;
}

.search-page h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.search-row input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
}

.search-row button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.search-hint {
    font-size: 8pt;
    color: var(--sub);
    margin-bottom: 16px;
}

.invite-page {
    max-width: 500px;
}

.invite-page h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 12px;
}

.invite-page h3 {
    font-size: 10pt;
    color: var(--title);
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 8px;
}

.invite-list {
    list-style: none;
    padding: 0;
}

.invite-link-item {
    padding: 4px 0;
}

.invite-link-item code {
    font-size: 9pt;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2px 6px;
    user-select: all;
}

.invite-link-item.used {
    opacity: 0.5;
}

.invite-used {
    font-size: 9pt;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2px 6px;
    user-select: all;
}

.invite-invitee {
    font-size: 9pt;
    color: var(--muted);
    margin-left: 8px;
}

.account-form .form-row {
    margin-bottom: 8px;
}

.account-form .form-row label {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 2px;
}

.account-form .form-row input,
.account-form .form-row textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--fg);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 10pt;
    resize: vertical;
}

.account-form .form-actions button {
    background: var(--bar-bg);
    border: 1px solid var(--bar-border);
    color: var(--fg);
    padding: 6px 16px;
    font-family: inherit;
    font-size: 10pt;
    cursor: pointer;
}

.tags-header {
    margin-bottom: 16px;
}

.tags-header h2 {
    font-size: 12pt;
    color: var(--title);
    font-weight: bold;
    margin-bottom: 4px;
}

.tags-header .tag-desc {
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 4px;
}

.tags-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
}

.tags-table th {
    text-align: left;
    color: var(--muted);
    font-size: 9pt;
    font-weight: normal;
    padding: 4px 8px;
    border-bottom: 1px solid var(--card-border);
}

.tags-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--card-border);
}

.tags-table tr:hover {
    background: var(--card-hover);
}

.tags-table .tag-count {
    color: var(--muted);
    text-align: right;
}

.ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 40;
}

.ac-item {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 9pt;
}

.ac-item:hover,
.ac-item.ac-active {
    background: var(--card-hover);
}

.related-tags {
    margin-top: 4px;
    font-size: 9pt;
}

.related-label {
    color: var(--muted);
}

.related-tag {
    color: var(--link);
    cursor: pointer;
}

.related-tag:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.related-sep {
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.page-indicator {
    font-size: 9pt;
    color: var(--muted);
}

.count-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 4px;
    margin-bottom: 4px;
}

.count-digits {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.count-digits img {
    height: 240px;
    width: auto;
    display: inline-block;
}

.count-banner-label {
    font-size: 9pt;
    color: var(--muted);
    margin-top: 2px;
}
.tag-graph {
    width: 100%;
    height: calc(100vh - 130px);
    border: 1px solid var(--card-border);
    background: var(--bg);
    box-sizing: border-box;
}

.cms-page {
    margin-bottom: 16px;
    line-height: 1.5;
}
