/* Community extensions inherit every color from the selected KBoard palette. */
.main-nav {
    flex-wrap: nowrap;
}
.main-nav a {
    white-space: nowrap;
}
.x-notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    background: var(--accent);
    color: var(--navy-deep);
    font-size: 10px;
    font-weight: 800;
    margin-left: 4px;
}
.x-notification-count[hidden] {
    display: none;
}
.x-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.x-tabs > a {
    padding: 17px 22px;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.x-tabs > a.active {
    border-bottom-color: var(--blue);
    color: var(--blue);
    background: var(--blue-soft);
}
.x-topic {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 19px 23px;
    border-bottom: 1px solid var(--border);
}
.x-topic:last-child {
    border-bottom: 0;
}
.x-topic > div {
    flex: 1;
    min-width: 0;
}
.x-topic-icon {
    font-size: 24px;
    color: var(--blue);
    width: 29px;
    flex-shrink: 0;
}
.x-topic-count {
    min-width: 46px;
    text-align: center;
    color: var(--text);
    font-weight: 700;
}
.x-topic-count small {
    display: block;
    color: var(--muted);
    font-weight: 400;
    font-size: 10px;
}
.x-panel {
    margin-bottom: 22px;
}
.x-panel .panel-header h2 {
    margin: 0;
    font-size: 15px;
}
.x-empty {
    padding: 15px 0;
    line-height: 1.7;
}
.x-activity {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.x-activity:last-child {
    border: 0;
}
.x-activity-dot {
    display: block;
    width: 9px;
    height: 9px;
    background: var(--blue);
    border: 3px solid var(--blue-soft);
    outline: 1px solid var(--border);
    box-sizing: content-box;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.x-activity > div {
    min-width: 0;
}
.x-activity a {
    font-weight: 600;
}
.x-link-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    padding-top: 10px;
}
.x-inline {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap;
}
.x-inline > .button:last-child {
    margin-left: auto;
}
.x-check {
    display: flex !important;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 400 !important;
    line-height: 1.5;
}
.x-check input {
    width: 17px !important;
    height: 17px;
    min-width: 17px;
    padding: 0;
    margin: 0;
}
.x-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    margin-top: 22px;
}
.x-profile-buttons {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-left: auto;
}
.x-profile-buttons .button {
    padding: 8px 13px;
    font-size: 12px;
}
.x-rank {
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 13px;
    color: var(--blue);
    padding: 10px 20px;
    border-left: 1px solid var(--border);
}
.x-rank > span {
    font-size: 26px;
}
.x-rank small {
    color: var(--muted);
}
.x-wall-list {
    margin-top: 24px;
}
.x-wall-post {
    padding: 18px 0;
    border-top: 1px solid var(--border);
}
.x-wall-post > .x-inline {
    margin-bottom: 12px;
}
.x-wall-post .button {
    font-size: 10px;
    padding: 3px 8px;
}
.x-profile-fields {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 18px;
}
.x-profile-fields dt {
    font-weight: 600;
}
.x-profile-fields dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.x-trophy {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.x-trophy > span {
    font-size: 26px;
}
.x-trophy p {
    margin: 4px 0;
}
.x-tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.x-tag {
    background: var(--blue-soft);
    color: var(--blue);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 11px;
}
.x-thread-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 30px;
    padding: 17px 21px;
    margin: 0 0 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.x-thread-fields > div {
    display: flex;
    gap: 8px;
}
.x-thread-fields dt {
    font-weight: 600;
    color: var(--muted);
}
.x-thread-fields dd {
    margin: 0;
}
.x-solution {
    border-color: var(--success);
    border-left-width: 4px;
}
.x-solution .panel-header {
    color: var(--success);
    background: var(--surface-alt);
}
.x-solution .post-body {
    max-height: 280px;
    overflow: auto;
}
.x-post-solution {
    border-left: 4px solid var(--success);
}
.x-post-extras {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
    padding: 10px 0 15px;
    flex-wrap: wrap;
}
.x-reactions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.x-reaction {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-alt);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 9px;
    font-size: 10px;
    line-height: 1.8;
}
.x-reaction > span {
    font-size: 13px;
    color: var(--blue);
}
.x-reaction b {
    font-size: 10px;
    color: var(--text);
}
.x-reaction.selected {
    background: var(--blue-soft);
    color: var(--blue);
    border-color: var(--blue);
}
.x-reaction:disabled {
    cursor: default;
    opacity: 0.8;
}
.x-accepted {
    color: var(--success);
    border-color: var(--success);
}
.x-poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.x-poll-option {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 13px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.x-poll-option > input {
    width: 17px;
    flex-shrink: 0;
}
.x-poll-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 7px;
    flex-direction: column;
}
.x-poll-option strong {
    font-size: 12px;
    min-width: 70px;
    text-align: right;
}
.x-poll-option strong small {
    font-weight: 400;
    color: var(--muted);
}
.x-poll-option.selected {
    border-color: var(--blue);
}
.x-poll-bar {
    height: 5px;
    background: var(--border);
    border-radius: 5px;
    display: block;
    overflow: hidden;
}
.x-poll-bar > span {
    display: block;
    width: var(--poll-width);
    height: 100%;
    background: var(--blue);
    border-radius: 5px;
}
.x-thread-tools {
    text-align: right;
    margin: -5px 0 15px;
}
.x-live-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: sticky;
    top: 10px;
}
.x-details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.x-details summary {
    padding: 14px 18px;
    background: var(--surface-alt);
    color: var(--blue);
    cursor: pointer;
    font-weight: 600;
}
.x-details-body {
    padding: 18px;
    display: grid;
    gap: 14px;
}
.x-details-body .form-group {
    margin: 0;
}
.x-custom-fields:not(:empty) {
    display: grid;
    gap: 16px;
    margin-bottom: 19px;
}
.x-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}
.x-fields-grid .form-group {
    margin: 0;
}
.x-editor-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 17px;
    margin: 12px 0 22px;
    min-width: 0;
    background: var(--surface-alt);
}
.x-editor-row legend {
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
}
.x-editor-row > .x-inline {
    margin-top: 16px;
}
.x-editor-row > .form-group {
    margin-top: 15px;
}
.x-editor-row .button-danger {
    margin-left: auto;
}
.x-board-options {
    display: grid;
    gap: 16px;
}
.x-board-options .form-group {
    margin: 0;
}
.x-admin-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.x-admin-list {
    margin-top: 18px;
}
.x-admin-list .x-topic {
    padding-left: 0;
    padding-right: 0;
    gap: 12px;
}
.x-wide-modal {
    width: min(800px, calc(100% - 30px)) !important;
    max-width: 800px !important;
}
.x-wide-modal textarea[name="body"] {
    min-height: 260px;
    font-family: ui-monospace, monospace;
    line-height: 1.65;
}
.x-document {
    max-width: 850px;
    line-height: 1.85;
    margin: 0 auto;
    padding: 15px 8px 30px;
}
.x-document h1,
.x-document h2,
.x-document h3 {
    line-height: 1.3;
    margin-top: 1.6em;
}
.x-document img {
    max-width: 100%;
    height: auto;
}
.x-document table {
    max-width: 100%;
    border-collapse: collapse;
}
.x-document td,
.x-document th {
    padding: 10px;
    border: 1px solid var(--border);
}
.x-article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 22px;
}
.x-article-grid .panel {
    margin: 0;
}
.x-article-grid h2 {
    margin: 10px 0;
}
.x-article-grid p {
    line-height: 1.8;
}
.x-participants {
    margin: -5px 0 20px;
    padding: 13px 18px;
    background: var(--blue-soft);
    border-radius: var(--radius);
    font-size: 12px;
}
.x-messages {
    margin-bottom: 22px;
}
.x-message {
    padding: 22px;
    border-bottom: 1px solid var(--border);
}
.x-message:last-child {
    border-bottom: 0;
}
.x-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}
.x-message-meta a {
    font-weight: 700;
}
.x-message-meta time {
    font-size: 11px;
    color: var(--muted);
}
.x-recipient-results {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    max-height: 220px;
    overflow: auto;
}
.x-recipient-selected {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.x-recipient {
    padding: 8px 12px;
    background: var(--blue-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}
.x-recipient input {
    width: 16px !important;
}
.x-recipient-selected .x-recipient {
    border-radius: 22px;
    font-size: 12px;
}
.x-notification {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    padding: 18px 14px;
    border-bottom: 1px solid var(--border);
}
.x-notification:last-child {
    border-bottom: 0;
}
.x-notification > div {
    flex: 1;
    min-width: 0;
}
.x-notification.unread {
    background: var(--blue-soft);
    border-radius: 6px;
}
.x-notification a {
    font-weight: 600;
}
.x-notification p {
    margin: 6px 0 0;
}
.x-feed-links {
    font-size: 10px;
    color: var(--muted);
}
.x-widget-zone {
    clear: both;
}
.x-widget-zone[data-x-widgets="header"] {
    margin-bottom: 20px;
}
.x-widget-zone[data-x-widgets="header"],
.x-widget-zone[data-x-widgets="footer"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}
.x-widget-zone .x-topic {
    padding: 12px 0;
    gap: 10px;
}
.x-widget-zone .x-topic-count {
    display: none;
}
.x-widget-zone .x-topic-icon {
    width: 20px;
    font-size: 19px;
}
.x-widget-zone .thread-title {
    font-size: 12px;
}
.x-widget-zone .topic-meta {
    font-size: 9px;
}
.x-widget-news {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.x-widget-news:last-child {
    border: 0;
}
#x-typing:empty {
    display: none;
}
@media (max-width: 900px) {
    .main-nav {
        row-gap: 0;
    }
    .x-profile-grid {
        grid-template-columns: minmax(0, 1fr) 230px;
    }
    .x-profile-buttons {
        margin-left: 0;
    }
    .profile-header {
        flex-wrap: wrap;
    }
    .x-rank {
        margin-left: auto;
    }
    .x-fields-grid {
        grid-template-columns: 1fr;
    }
    .x-post-extras {
        gap: 10px;
    }
    .x-reactions {
        gap: 4px;
    }
}
@media (max-width: 620px) {
    .x-profile-grid {
        grid-template-columns: 1fr;
    }
    .x-topic {
        padding: 15px 14px;
        gap: 11px;
    }
    .x-topic-icon {
        display: none;
    }
    .x-topic-count {
        min-width: 35px;
    }
    .x-tabs > a {
        padding: 13px 14px;
        font-size: 11px;
    }
    .x-thread-fields {
        gap: 8px 18px;
        padding: 13px;
    }
    .x-thread-fields > div {
        width: 100%;
        font-size: 12px;
    }
    .x-message {
        padding: 16px;
    }
    .x-message-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
    .x-notification {
        gap: 12px;
        padding: 14px 9px;
        flex-wrap: wrap;
    }
    .x-notification > .button {
        margin-left: 27px;
    }
    .x-notification > div {
        flex-basis: calc(100% - 30px);
    }
    .x-poll-option {
        padding: 11px;
        gap: 10px;
    }
    .x-poll-option strong {
        min-width: 48px;
        font-size: 11px;
    }
    .x-editor-row {
        padding: 12px;
    }
    .x-profile-buttons {
        width: 100%;
    }
    .x-profile-buttons .button {
        flex: 1;
    }
    .x-rank {
        border: 0;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        margin: 0;
        padding: 4px 0;
    }
    .x-rank > span {
        font-size: 18px;
    }
    .x-document {
        padding: 0;
    }
    .x-document h1 {
        font-size: 25px;
    }
    .x-feed-links {
        width: 100%;
    }
    .x-live-alert {
        align-items: flex-start;
    }
    .x-live-alert .button {
        white-space: nowrap;
    }
    .x-admin-list .x-topic {
        flex-wrap: wrap;
    }
    .x-admin-list .x-topic > div {
        flex-basis: 100%;
    }
    .x-reaction {
        padding: 4px 7px;
    }
    .main-nav {
        max-width: 100%;
    }
    .main-nav .nav-spacer {
        display: none;
    }
    .main-nav .theme-toggle {
        margin-left: auto;
    }
    .x-widget-zone[data-x-widgets="header"],
    .x-widget-zone[data-x-widgets="footer"] {
        grid-template-columns: 1fr;
    }
}
.x-locale-control {
    display: flex;
    align-items: center;
    margin: 0 5px;
}
.x-locale-control select {
    background: transparent;
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 3px;
    font-size: 10px;
    max-width: 47px;
}
.x-locale-control option {
    background: var(--surface);
    color: var(--text);
}
.x-new-post {
    animation: x-arrive 0.35s ease-out;
}
.x-live-attachments {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    padding: 10px 0;
}
.x-live-attachments > a {
    padding: 5px 9px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-alt);
}
@keyframes x-arrive {
    from {
        opacity: 0.2;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .x-new-post {
        animation: none;
    }
}
.x-nested-category {
    margin-left: calc(var(--category-depth, 0) * 17px);
    position: relative;
}
.x-nested-category::before {
    content: "↳";
    position: absolute;
    left: -18px;
    top: 16px;
    color: var(--muted);
    font-size: 15px;
}
.x-category-parent {
    font-size: 10px;
    font-weight: 400;
    color: var(--muted);
}
@media (max-width: 620px) {
    .x-nested-category {
        margin-left: calc(var(--category-depth, 0) * 8px);
    }
    .x-nested-category::before {
        left: -9px;
        font-size: 10px;
    }
    .x-category-parent {
        display: none;
    }
}
.x-locale-control {
    color: var(--header-text, #b6cada);
}
.x-category-parent {
    color: inherit;
    opacity: 0.75;
}
/* The classic forum navigation stays on the first row; community tools have their own scrollable row. */
.x-secondary-nav {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    min-width: 0;
}
.x-secondary-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 52px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    padding-top: 7px;
    padding-bottom: 7px;
}
.x-shell-nav,
.x-dynamic-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: none;
    min-width: 0;
}
.x-dynamic-nav {
    margin-left: auto;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}
.x-dynamic-nav[hidden] {
    display: none;
}
.x-secondary-nav .x-shell-nav > a,
.x-secondary-nav .x-dynamic-nav > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: relative;
    min-height: 35px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    flex: none;
}
.x-secondary-nav .x-shell-nav > a:hover,
.x-secondary-nav .x-dynamic-nav > a:hover {
    color: var(--blue);
    background: var(--surface-alt);
    border-color: var(--border);
}
.x-secondary-nav .x-shell-nav > a.active,
.x-secondary-nav .x-dynamic-nav > a.active {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: var(--border);
}
.x-secondary-nav a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -1px;
}
.main-nav > a,
.main-nav > .x-locale-control {
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .x-secondary-inner {
        min-height: 47px;
        gap: 14px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
    .x-secondary-nav .x-shell-nav > a,
    .x-secondary-nav .x-dynamic-nav > a {
        font-size: 10px;
        padding: 8px 11px;
        min-height: 34px;
    }
    .x-dynamic-nav {
        padding-left: 14px;
    }
}
@media (max-width: 620px) {
    .x-secondary-inner {
        width: 100%;
        max-width: 100%;
        padding-right: 12px;
        padding-left: 12px;
        gap: 13px;
    }
    .x-shell-nav,
    .x-dynamic-nav {
        gap: 3px;
    }
    .x-dynamic-nav {
        margin-left: 0;
        padding-left: 13px;
    }
    .x-secondary-nav .x-shell-nav > a,
    .x-secondary-nav .x-dynamic-nav > a {
        padding: 8px 10px;
    }
    .x-secondary-nav .x-notification-count {
        font-size: 9px;
        min-width: 16px;
        height: 16px;
    }
}
.x-locale-control {
    position: relative;
}
.x-notification-count {
    background: var(--blue);
    color: var(--on-primary, #fff);
}
