:root {
    /* Spacing scale (4px grid) */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s7: 32px;
    --s8: 40px;

    /* Layout */
    --container: 1600px;
    --gutter: var(--s6);
    --control-h: 52px;
    --control-h-sm: 44px;
    --box-h: 112px;
    --box-h-sm: 88px;
    --icon-sm: 18px;
    --icon-md: 24px;
    --icon-lg: 36px;
    --icon-xl: 42px;
    --mobile-bottom-nav-height: 64px;

    --font: "IBM Plex Sans", system-ui, sans-serif;
}

html,
html[data-theme="dark"] {
    color-scheme: dark;

    /* Surfaces */
    --bg: #404456;
    --bg-deep: #2c2e40;
    --bg-panel: #494c62;
    --bg-panel-hover: #525674;
    --bg-input: #2c2e40;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-strong: rgba(255, 255, 255, 0.1);

    /* Text hierarchy */
    --text: #ffffff;
    --text-muted: #e4e7f0;
    --text-dim: #b8bfd4;
    --icon: #ffffff;
    --on-primary: #ffffff;

    /* Chrome (header / menü / başlık / footer) */
    --chrome-bg: #2c2e40;
    --chrome-mid: #494c62;
    --chrome-text: #ffffff;
    --chrome-muted: #e4e7f0;
    --chrome-dim: #b8bfd4;
    --chrome-icon: #ffffff;
    --chrome-input: #2c2e40;
    --chrome-border: rgba(255, 255, 255, 0.08);

    /* Links — metin tonları, asla mavi değil */
    --link: var(--text-muted);
    --link-hover: var(--text);

    /* Vurgu metinleri (eyebrow, badge vb.) */
    --accent-text: #d4d9e8;
    --accent-soft: rgba(255, 255, 255, 0.08);
    --accent-border: rgba(255, 255, 255, 0.12);

    /* Soft fills (hover / active overlays) */
    --soft-fill: rgba(255, 255, 255, 0.04);
    --soft-fill-strong: rgba(255, 255, 255, 0.06);
    --soft-fill-active: rgba(255, 255, 255, 0.12);
    --soft-fill-active-hover: rgba(255, 255, 255, 0.18);

    /* Aksiyon rengi — sadece butonlar ve dolu aktif durumlar */
    --primary: #38a9ff;
    --primary-hover: #2b8ad4;
    --primary-dark: #2480c4;
    --primary-soft: rgba(56, 169, 255, 0.12);
    --primary-border: #38a9ff;

    /* Section / tablo başlıkları */
    --heading-bg: #2c2e40;
    --heading-bg-alt: #252736;
    --heading-text: #ffffff;

    /* Durum renkleri */
    --success: #8ecf9f;
    --danger: #e08888;
    --control-accent: #cdd1de;

    --shadow: none;
    --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.45);
    --overlay: rgba(12, 14, 24, 0.78);
}

html[data-theme="light"] {
    color-scheme: light;

    /* İçerik yüzeyleri — koyu paletten türetilmiş gri, saf beyaz değil */
    --bg: #d8dae6;
    --bg-deep: #f3f4f9;
    --bg-panel: #eaecf3;
    --bg-panel-hover: #e2e5ef;
    --bg-input: #ffffff;

    --border: rgba(44, 46, 64, 0.14);
    --border-light: rgba(44, 46, 64, 0.09);
    --border-strong: rgba(44, 46, 64, 0.2);

    --text: #1e2130;
    --text-muted: #3a3f54;
    --text-dim: #5c6378;
    --icon: #2c2e40;
    --on-primary: #ffffff;

    /* Aynı koyu chrome — header, menü, başlık, footer */
    --chrome-bg: #2c2e40;
    --chrome-mid: #494c62;
    --chrome-text: #ffffff;
    --chrome-muted: #e4e7f0;
    --chrome-dim: #b8bfd4;
    --chrome-icon: #ffffff;
    --chrome-input: #3a3d50;
    --chrome-border: rgba(255, 255, 255, 0.1);

    --link: var(--text-muted);
    --link-hover: var(--text);

    --accent-text: #4a5168;
    --accent-soft: rgba(44, 46, 64, 0.06);
    --accent-border: rgba(44, 46, 64, 0.12);

    --soft-fill: rgba(44, 46, 64, 0.05);
    --soft-fill-strong: rgba(44, 46, 64, 0.08);
    --soft-fill-active: rgba(255, 255, 255, 0.14);
    --soft-fill-active-hover: rgba(255, 255, 255, 0.2);

    --primary: #2b8ad4;
    --primary-hover: #2480c4;
    --primary-dark: #1d6ba5;
    --primary-soft: rgba(43, 138, 212, 0.12);
    --primary-border: #2b8ad4;

    --heading-bg: #2c2e40;
    --heading-bg-alt: #252736;
    --heading-text: #ffffff;

    --success: #2f8f55;
    --danger: #c24b4b;
    --control-accent: #5a6178;

    --shadow: none;
    --shadow-dropdown: 0 12px 28px rgba(44, 46, 64, 0.18);
    --shadow-modal: 0 20px 48px rgba(44, 46, 64, 0.22);
    --overlay: rgba(20, 22, 34, 0.52);
}

html[data-theme="light"] .admin-tools-toolbar .muted,
html[data-theme="light"] .admin-tools-count {
    color: var(--chrome-muted);
}

html[data-theme="light"] .admin-tools-filter {
    color: var(--chrome-muted);
}

html[data-theme="light"] .site-header a:not(.btn):not(.search-dropdown-item),
html[data-theme="light"] .site-footer a:not(.btn),
html[data-theme="light"] .panel-head a:not(.btn),
html[data-theme="light"] .forum-post-top a:not(.btn) {
    color: var(--chrome-muted);
}

html[data-theme="light"] .site-header a:not(.btn):not(.search-dropdown-item):hover,
html[data-theme="light"] .site-footer a:not(.btn):hover,
html[data-theme="light"] .panel-head a:not(.btn):hover,
html[data-theme="light"] .forum-post-top a:not(.btn):hover {
    color: var(--chrome-text);
}

html[data-theme="light"] .site-header .search-dropdown,
html[data-theme="light"] .site-header .search-dropdown a,
html[data-theme="light"] .site-header .search-dropdown-item,
html[data-theme="light"] .site-header .search-dropdown-item strong {
    color: var(--text);
}

html[data-theme="light"] .site-header .search-dropdown-item:hover {
    color: var(--text);
}

html[data-theme="light"] .site-header .search-dropdown-item small,
html[data-theme="light"] .site-header .search-dropdown-status {
    color: var(--text-muted);
}

html[data-theme="light"] .site-header .search-dropdown-label {
    color: var(--text-dim);
}

html[data-theme="light"] .site-header .btn,
html[data-theme="light"] .panel-head .btn,
html[data-theme="light"] .site-footer .btn {
    color: var(--on-primary);
}

html[data-theme="light"] .site-header .btn .ph-duotone,
html[data-theme="light"] .panel-head .btn .ph-duotone,
html[data-theme="light"] .site-footer .btn .ph-duotone {
    color: var(--on-primary);
}

html {
    scrollbar-gutter: stable;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    font-size: 15px;
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

a {
    color: var(--link);
    text-decoration: none;
    font: inherit;
    transition: color 0.15s ease;
}

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

.brand,
.brand:hover,
.category-card,
.category-card:hover,
.tool-card,
.tool-card:hover,
.recent-discussion-title,
.recent-discussion-title:hover,
.profile-row-title,
.profile-row-title:hover,
.profile-interest-tag,
.profile-interest-tag:hover,
.discussion-table-row,
.discussion-table-row:hover,
.tool-row,
.tool-row:hover,
.discussion-row,
.discussion-row:hover,
.hub-topic,
.hub-topic:hover,
.thread-item,
.thread-item:hover,
.thread-title-link,
.thread-title-link:hover,
.topic-title,
.topic-title:hover,
.topic-preview,
.topic-preview:hover,
.sidebar-links a,
.sidebar-links a:hover,
.footer-list-link a,
.footer-list-link a:hover {
    color: var(--text);
}

.breadcrumbs a {
    color: var(--text-dim);
}

.breadcrumbs a:hover {
    color: var(--text);
}

.profile-link {
    color: var(--link);
}

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

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

/* Icons */
.ph-duotone {
    font-size: var(--icon-md);
    line-height: 1;
    flex-shrink: 0;
    color: var(--icon);
}

.icon-sm .ph-duotone,
.ph-duotone.icon-sm {
    font-size: var(--icon-sm);
}

.icon-lg .ph-duotone,
.ph-duotone.icon-lg {
    font-size: var(--icon-lg);
}

.container {
    width: min(var(--container), calc(100% - (var(--gutter) * 2)));
    max-width: 100%;
    margin-inline: auto;
    min-width: 0;
}

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

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-body {
    padding: var(--s5);
    min-width: 0;
    max-width: 100%;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s4);
    min-height: var(--control-h);
    min-width: 0;
    padding: var(--s4) var(--s5);
    background: var(--heading-bg);
    border-bottom: 1px solid var(--chrome-border);
    color: var(--heading-text);
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading-text);
}

.panel-head .ph-duotone {
    color: var(--chrome-icon);
}

.panel h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Header */
.site-header {
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-border);
    color: var(--chrome-text);
    position: sticky;
    top: 0;
    z-index: 140;
}

.site-header .ph-duotone {
    color: var(--chrome-icon);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--s4);
    min-height: 76px;
    padding-block: var(--s4);
}

.header-inner > .brand {
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    width: min(420px, 100%);
    max-width: 420px;
    margin-left: var(--s5);
    background: var(--chrome-input);
    border: 1px solid var(--chrome-border);
    min-height: var(--control-h);
    position: relative;
}

.header-search-field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand .ph-duotone {
    font-size: var(--icon-lg);
    flex-shrink: 0;
}

.brand-text {
    display: inline;
    white-space: nowrap;
}

.brand-word {
    font-weight: 700;
}

.brand-domain {
    font-weight: 300;
    color: var(--text-muted);
}

.brand-white,
.brand-white .brand-text {
    color: var(--chrome-text);
}

.brand-white .brand-domain {
    color: var(--chrome-muted);
}

.header-search input {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 0;
    color: var(--chrome-text);
    font: inherit;
    outline: none;
    min-height: var(--control-h);
    padding: 0 calc(var(--control-h) - 4px) 0 var(--s4);
}

.header-search input::-webkit-search-cancel-button,
.header-search input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.header-search input::-ms-clear {
    display: none;
}

.search-clear {
    position: absolute;
    right: var(--s2);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--chrome-icon);
    cursor: pointer;
}

.search-clear[hidden] {
    display: none;
}

.search-clear .ph-duotone {
    color: var(--chrome-icon);
    font-size: var(--icon-sm);
}

.search-clear:hover {
    opacity: 0.85;
}

.header-search input::placeholder {
    color: var(--chrome-dim);
}

.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h);
    min-height: var(--control-h);
    padding: 0;
    border: 0;
    border-left: 1px solid var(--border);
    background: var(--primary);
    color: var(--on-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.search-submit:hover {
    background: var(--primary-hover);
}

.search-submit .ph-duotone {
    color: var(--on-primary);
    font-size: var(--icon-sm);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 120;
    max-height: 360px;
    overflow: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-dropdown);
}

.header-search .search-dropdown--header {
    width: 100%;
}

.search-dropdown--page,
.search-dropdown--discussion {
    position: static;
    margin-top: var(--s3);
    max-height: 280px;
}

.search-dropdown-group {
    display: grid;
    border-bottom: 1px solid var(--border-light);
}

.search-dropdown-group:last-child {
    border-bottom: 0;
}

.search-dropdown-label {
    padding: var(--s2) var(--s4);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg);
}

.search-dropdown-item {
    display: grid;
    gap: 2px;
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    text-decoration: none;
}

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

.search-dropdown-item:hover {
    background: var(--bg-panel-hover);
}

.search-dropdown-item strong {
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text);
}

.search-dropdown-item small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.search-dropdown-status {
    padding: var(--s4);
    font-size: 0.86rem;
    color: var(--text-muted);
}

.discussion-search {
    margin-bottom: var(--s5);
    padding: var(--s4);
}

.discussion-search-label {
    display: block;
    margin-bottom: var(--s3);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.discussion-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s3);
}

.discussion-search-row input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: var(--control-h);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    padding: var(--s3) var(--s4);
}

.search-results-group {
    margin-bottom: var(--s6);
}

.search-results-group h2 {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    margin: 0 0 var(--s4);
    font-size: 1rem;
    color: var(--text);
}

.page-head > .container > h1 {
    margin: 0;
    color: var(--text);
}

.search-inline-empty {
    padding: var(--s6);
    text-align: center;
    color: var(--text-muted);
}

.discussion-table-row--search {
    grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) 72px 88px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h);
    min-height: var(--control-h);
    padding: 0;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input);
    color: var(--chrome-icon);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    background: var(--chrome-mid);
    border-color: var(--chrome-border);
}

.theme-toggle .ph-duotone {
    font-size: var(--icon-md);
    color: var(--chrome-icon);
}

.theme-toggle .theme-icon-moon,
html[data-theme="light"] .theme-toggle .theme-icon-sun {
    display: none;
}

html[data-theme="light"] .theme-toggle .theme-icon-moon {
    display: inline-block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--s3);
    flex-shrink: 0;
    margin-left: 0;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--control-h);
    min-height: var(--control-h);
    padding: 0;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input);
    color: var(--chrome-icon);
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-toggle .ph-duotone {
    font-size: var(--icon-md);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle[aria-expanded="true"] {
    background: var(--primary);
    border-color: var(--primary-border);
    color: var(--on-primary);
}

.mobile-menu-toggle:hover .ph-duotone,
.mobile-menu-toggle[aria-expanded="true"] .ph-duotone {
    color: var(--on-primary);
}

.header-actions .btn {
    padding-inline: var(--s5);
    min-width: 110px;
}

.mobile-nav-backdrop {
    display: none;
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s1);
    min-width: 0;
    min-height: var(--mobile-bottom-nav-height);
    padding: var(--s2) var(--s1);
    border: 0;
    background: transparent;
    color: var(--chrome-muted);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.mobile-bottom-nav-item .ph-duotone {
    font-size: var(--icon-md);
    color: inherit;
}

.mobile-bottom-nav-item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.mobile-bottom-nav-item.is-active {
    background: var(--soft-fill);
}

.mobile-bottom-nav-item.is-menu-open {
    color: var(--chrome-text);
    background: var(--soft-fill-strong);
}

.mega-nav-head {
    display: none;
}

/* Buttons — all blue */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    min-height: var(--control-h);
    max-width: 100%;
    padding: 0 var(--s6);
    border: 1px solid var(--primary-border);
    background: var(--primary);
    color: var(--on-primary);
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.calc-form .btn,
.comment-form .btn,
.reply-box .btn,
.discussion-new-form .btn {
    width: fit-content;
    max-width: 100%;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--on-primary);
}

.btn .ph-duotone {
    color: var(--on-primary);
}

/* Duotone X ikonundaki dolgu plakasını gizle — yalnız çizgi kalsın */
.btn .ph-x::before,
.auth-modal-close .ph-x::before,
.discussion-modal-close .ph-x::before,
.search-clear .ph-x::before,
.mega-nav-close .ph-x::before {
    display: none !important;
    margin: 0 !important;
    content: none !important;
}

.btn .ph-x::after,
.auth-modal-close .ph-x::after,
.discussion-modal-close .ph-x::after,
.search-clear .ph-x::after,
.mega-nav-close .ph-x::after {
    opacity: 1;
    margin-left: 0 !important;
}

.profile-edit-actions .btn {
    padding-inline: calc(var(--s6) + 2px) var(--s6);
    gap: var(--s4);
}

.profile-edit-actions .btn .ph-duotone {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    display: inline-block;
    margin-inline: 0;
    overflow: visible;
}

.btn-accent,
.btn-ghost {
    background: var(--primary);
    border-color: var(--primary-border);
    color: var(--on-primary);
}

.btn-accent:hover,
.btn-ghost:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--on-primary);
}

.btn-sm {
    padding-inline: var(--s5);
    font-size: 0.92rem;
}

/* Category nav — r10 style */
.mega-nav {
    border-top: 1px solid var(--chrome-border);
    background: var(--chrome-mid);
    color: var(--chrome-text);
}

.cat-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    overflow: hidden;
}

.cat-nav-item {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.cat-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 14px 4px;
    overflow: hidden;
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--chrome-muted);
    border-right: 1px solid var(--chrome-border);
    text-decoration: none;
}

.cat-nav-link-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.cat-nav-link-inner > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-nav-link-inner .ph-duotone {
    font-size: var(--icon-sm);
    flex-shrink: 0;
    line-height: 1;
    color: var(--chrome-icon);
}

.cat-nav-item:last-child .cat-nav-link {
    border-right: 0;
}

.cat-nav-item:hover .cat-nav-link,
.cat-nav-link:focus-visible {
    background: var(--primary);
    color: var(--on-primary);
}

.cat-nav-item:hover .cat-nav-link .ph-duotone,
.cat-nav-link:focus-visible .ph-duotone {
    color: var(--on-primary);
}

.cat-nav-link.is-active {
    background: transparent;
    color: var(--chrome-text);
    box-shadow: inset 0 -3px 0 var(--primary);
}

.cat-nav-link.is-active .ph-duotone {
    color: var(--chrome-text);
}

.cat-nav-item:hover .cat-nav-link.is-active,
.cat-nav-link.is-active:focus-visible {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: none;
}

.cat-nav-item:hover .cat-nav-link.is-active .ph-duotone,
.cat-nav-link.is-active:focus-visible .ph-duotone {
    color: var(--on-primary);
}

.cat-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 280px;
    max-width: 340px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    background: var(--chrome-bg);
    border: 1px solid var(--chrome-border);
    box-shadow: var(--shadow-dropdown);
    color: var(--chrome-text);
}

.cat-dropdown::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.cat-nav-item:hover .cat-dropdown,
.cat-nav-item:focus-within .cat-dropdown {
    display: block;
}

.cat-dropdown li {
    margin: 0;
    border-bottom: 1px solid var(--chrome-border);
}

.cat-dropdown li:last-child {
    border-bottom: 0;
}

.cat-dropdown a {
    display: block;
    padding: 16px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--chrome-muted);
}

.cat-dropdown a:hover,
.cat-dropdown a:focus-visible {
    background: var(--chrome-mid);
    color: var(--chrome-text);
}

.cat-dropdown-head {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-weight: 700;
    color: var(--chrome-text);
}

.cat-dropdown-topic {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    font-weight: 600;
    color: var(--chrome-text);
}

.cat-dropdown-topic .ph-duotone {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--chrome-icon);
}

.cat-dropdown-topic span {
    line-height: 1.35;
}

.cat-dropdown-discuss {
    font-weight: 600;
}

.cat-dropdown-tool--disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    padding: 16px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--chrome-dim);
    cursor: not-allowed;
    opacity: 0.55;
}

.cat-dropdown a.is-new,
.cat-dropdown a:has(.badge) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    color: var(--chrome-text);
    font-weight: 600;
}

.cat-dropdown .badge {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    color: var(--chrome-text);
    border-color: var(--chrome-border);
}

.discuss-intro {
    margin: 0 0 var(--s5);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.topic-title {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-weight: 600;
}

.topic-preview {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

/* Recent discussions — home, below header */
.recent-discussions {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--s5) 0 var(--s4);
}

.recent-discussions-list {
    display: grid;
    padding: 0;
    overflow: hidden;
    overflow-x: auto;
    background: var(--bg-panel);
}

.recent-discussions-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s4);
    padding: var(--s4) var(--s5);
    background: var(--heading-bg);
    border-bottom: 1px solid var(--chrome-border);
    color: var(--heading-text);
}

.recent-discussions-head h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-text);
}

.recent-discussions-head .ph-duotone {
    color: var(--chrome-icon);
}

.recent-discussions-table-head,
.recent-discussion-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 80px 128px 88px;
    gap: var(--s3);
    align-items: center;
    min-height: 40px;
    padding: var(--s2) var(--s4);
    border-bottom: 1px solid var(--border-light);
}

.recent-discussions-table-head {
    margin: 0;
    min-height: 40px;
    padding-block: var(--s3);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--heading-text);
    background: var(--heading-bg);
}

.recent-discussions-table-head > span {
    display: inline-flex;
    align-items: center;
    gap: var(--s4);
    white-space: nowrap;
}

.recent-discussions-table-head > span .ph-duotone {
    flex-shrink: 0;
    color: var(--chrome-icon);
}

.recent-discussions-table-head > span:nth-child(1) {
    justify-content: flex-start;
}

.recent-discussions-table-head > span:nth-child(2) {
    justify-content: center;
}

.recent-discussions-table-head > span:nth-child(3),
.recent-discussions-table-head > span:nth-child(4) {
    justify-content: center;
}

.recent-discussions-table-head > span:nth-child(5) {
    justify-content: flex-end;
}

.recent-discussion-row:hover {
    background: var(--bg-panel-hover);
}

.recent-discussion-row.is-hidden {
    display: none;
}

.recent-discussion-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}

.recent-discussion-user {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}

.recent-discussion-stat {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.recent-discussion-cat {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.recent-discussions-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    width: 100%;
    min-height: 44px;
    padding: var(--s3) var(--s5);
    margin: 0;
    border: 0;
    border-top: 1px solid var(--chrome-border);
    background: var(--heading-bg);
    color: var(--chrome-text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.recent-discussions-more:hover {
    color: var(--chrome-text);
    background: var(--heading-bg-alt);
}

.recent-discussions-more .ph-duotone {
    color: var(--chrome-icon);
}

.recent-discussions-more.is-done {
    display: none;
}

/* Main */
.site-main {
    min-height: calc(100vh - 240px);
    min-width: 0;
    max-width: 100%;
}

/* Hero */
.hero {
    padding: var(--s7) 0 var(--s6);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--s6);
    align-items: stretch;
    min-width: 0;
}

.hero-grid > * {
    min-width: 0;
}

.eyebrow {
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin: 0 0 var(--s3);
}

.hero h1 {
    margin: 0 0 var(--s3);
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    line-height: 1.15;
}

.lead {
    color: var(--text-muted);
    max-width: 56ch;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: var(--s3);
    flex-wrap: wrap;
    margin-top: var(--s5);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s3);
    align-items: stretch;
    align-content: center;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    padding: var(--s4);
    overflow: hidden;
    box-sizing: border-box;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    text-align: center;
    min-width: 0;
    max-width: 100%;
    padding: var(--s4) var(--s2);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    min-height: var(--box-h);
    height: auto;
    overflow: hidden;
    box-sizing: border-box;
}

.hero-stat-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: var(--heading-bg);
    border: 1px solid var(--border-light);
    box-sizing: border-box;
}

.hero-stat-icon .ph-duotone {
    font-size: var(--icon-lg);
    color: var(--chrome-icon);
}

.hero-stat-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
    min-width: 0;
    max-width: 100%;
}

.hero-stat strong {
    font-size: 1.5rem;
    line-height: 1.1;
    color: var(--text);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.hero-stat-body > span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Sections */
.section {
    padding: var(--s7) 0;
}

.section-alt {
    background: var(--bg-deep);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.section-head {
    margin-bottom: var(--s5);
    padding: var(--s4) var(--s5);
    background: var(--heading-bg);
    border: 1px solid var(--chrome-border);
    color: var(--heading-text);
}

.section-head:has(+ .panel) {
    margin-bottom: 0;
    border-bottom: none;
}

.section-head + .panel {
    border-top: none;
}

.section-alt .section-head {
    background: var(--heading-bg-alt);
}

.section-head h2 {
    margin: 0 0 var(--s2);
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--heading-text);
    letter-spacing: 0.01em;
}

.section-head .ph-duotone {
    color: var(--chrome-icon);
}

.section-head .muted {
    margin: 0;
    font-size: 0.9rem;
    color: var(--chrome-muted);
}

/* Grids */
.category-grid,
.tool-grid,
.split-grid {
    display: grid;
    gap: var(--s4);
    align-items: stretch;
}

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

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

.split-grid > div {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.split-grid .section-head {
    flex-shrink: 0;
}

.split-grid .panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Cards */
.category-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 24px;
    gap: var(--s4);
    align-items: center;
    min-width: 0;
    height: auto;
    min-height: var(--box-h);
    padding: var(--s5);
    border: 1px solid var(--border);
    background: var(--bg-panel);
    overflow: hidden;
}

.category-card-copy {
    min-width: 0;
}

.tool-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 24px;
    gap: var(--s4);
    align-items: center;
    min-width: 0;
    height: auto;
    min-height: var(--box-h);
    padding: var(--s5);
    border: 1px solid var(--border);
    background: var(--bg-panel);
    overflow: hidden;
}

.tool-card > div:nth-child(2) {
    min-width: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s2);
}

.category-card:hover,
.tool-card:hover,
.tool-row:hover,
.discussion-row:hover,
.hub-topic:hover,
.discussion-table-row:hover {
    background: var(--bg-panel-hover);
}

.category-icon,
.title-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-bg);
}

.category-icon .ph-duotone,
.title-icon .ph-duotone {
    font-size: var(--icon-lg);
    color: var(--chrome-icon);
}

.category-card h3,
.tool-card h3 {
    margin: 0 0 var(--s1);
    font-size: 1rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.category-card p,
.tool-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-arrow {
    opacity: 0.7;
}

.card-arrow .ph-duotone {
    font-size: var(--icon-sm);
}

/* Lists */
.tool-list,
.discussion-list {
    display: grid;
}

.tool-row {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: var(--s4);
    align-items: center;
    min-height: 56px;
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border-light);
}

.tool-row span {
    font-weight: 500;
}

.tool-row small {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: right;
}

.discussion-row {
    display: grid;
    gap: var(--s2);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border-light);
    min-height: 72px;
}

.discussion-row strong {
    font-size: 0.95rem;
}

.discussion-row p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.discussion-row small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 8px;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid var(--chrome-border);
    background: var(--heading-bg);
    color: var(--heading-text);
}

.badge .ph-duotone,
.badge .icon-sm {
    font-size: 0.75rem;
    color: inherit;
    line-height: 1;
}

.badge-muted,
.badge-success,
.badge-pending {
    background: var(--heading-bg);
    color: var(--heading-text);
    border-color: var(--chrome-border);
}

.panel-head .badge,
.panel-head .badge-muted,
.panel-head .badge-success,
.panel-head .badge-pending,
.section-head .badge,
.section-head .badge-muted,
.section-head .badge-success,
.section-head .badge-pending {
    background: rgba(255, 255, 255, 0.12);
    color: var(--chrome-text);
    border-color: var(--chrome-border);
}

/* Page head */
.page-head {
    padding-top: var(--s6);
    border-bottom: 1px solid var(--border);
    background: var(--bg-deep);
}

.page-head .container {
    padding-bottom: var(--s5);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    align-items: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: var(--s4);
}

.page-title {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: var(--s4);
    align-items: center;
    min-width: 0;
}

.page-title-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s3);
}

.page-title h1 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.25;
    color: var(--text);
    font-weight: 700;
}

.page-title .muted {
    margin: var(--s1) 0 0;
}

.tool-card-foot {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s3);
    margin-top: var(--s3);
    padding-top: var(--s3);
    border-top: 1px solid var(--border);
}

.tool-card {
    position: relative;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: var(--s3);
    min-height: var(--box-h-sm);
    height: auto;
    padding: var(--s4);
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-bg);
    flex-shrink: 0;
}

.tool-card-icon .ph-duotone {
    font-size: var(--icon-md);
    color: var(--chrome-icon);
}

.tool-card h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 600;
}

.tool-card--disabled,
.tool-card--disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg-panel);
}

.slug,
.slug-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* Tool page */
.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: var(--s4);
    align-items: start;
}

.tool-main,
.tool-sidebar {
    min-width: 0;
    max-width: 100%;
}

.tool-main > .panel,
.tool-sidebar > .panel {
    margin-bottom: var(--s4);
    min-width: 0;
    max-width: 100%;
}

.tool-sidebar > .panel:last-child {
    margin-bottom: 0;
}

.tool-sidebar .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s2);
    min-height: auto;
    min-width: 0;
    padding: var(--s3) var(--s4);
}

.tool-sidebar .panel-head h2 {
    min-width: 0;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.tool-sidebar .panel-body {
    padding: var(--s3) var(--s4);
}

.tool-sidebar .panel-head .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
    height: auto;
    min-height: var(--control-h-sm);
    padding: var(--s2) var(--s3);
    font-size: 0.84rem;
    line-height: 1.25;
    text-align: center;
}

.tool-sidebar .hub-topic strong {
    font-size: 0.86rem;
    line-height: 1.3;
}

.tool-sidebar .hub-topics {
    display: grid;
    gap: 0;
}

.tool-sidebar .hub-topic {
    padding: var(--s2) 0;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.tool-sidebar .hub-topic:last-child {
    border-bottom: 0;
}

.tool-sidebar .hub-topic:hover {
    background: transparent;
}

.tool-sidebar .hub-topic:hover strong {
    color: var(--text);
}

.tool-sidebar .hub-topic small {
    margin-top: var(--s1);
    font-size: 0.78rem;
}

.calc-form,
.form-row,
.comment-form,
.reply-box form,
.discussion-new-form {
    display: grid;
    gap: var(--s4);
    min-width: 0;
    max-width: 100%;
}

.form-row {
    width: 100%;
}

.form-row label {
    display: block;
    margin-bottom: var(--s2);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.form-row input,
.form-row select,
.form-row textarea,
.comment-form textarea,
.reply-box input,
.reply-box textarea,
.inline-search input,
.discussion-search-row input,
.auth-panel .form-row input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: var(--control-h);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    padding: var(--s3) var(--s4);
}

.comment-form textarea,
.reply-box textarea,
.discussion-new-form textarea {
    min-height: 96px;
    resize: vertical;
}

.result-box {
    margin: 0;
    padding: var(--s4) var(--s5) var(--s5);
    border-top: 1px dashed var(--border-light);
    background: var(--bg-deep);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.result-box p {
    margin: var(--s2) 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.calc-widget .calc-intro {
    margin: 0 0 var(--s1);
    font-size: 0.9rem;
}

.calc-result-highlight {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: var(--s4);
    overflow-wrap: anywhere;
}

.calc-result-lines {
    display: grid;
    gap: var(--s2);
    min-width: 0;
}

.calc-result-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s4);
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    min-width: 0;
}

.calc-result-line:last-child {
    border-bottom: 0;
}

.calc-result-line span {
    color: var(--text-dim);
    min-width: 0;
}

.calc-result-line strong {
    color: var(--text-muted);
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

.calc-result-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.92rem;
}

.tool-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--s4);
    padding: var(--s7) var(--s5);
}

.tool-coming-soon-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    background: var(--heading-bg);
    border: 1px solid var(--border);
}

.tool-coming-soon-icon .ph-duotone {
    font-size: var(--icon-xl);
    color: var(--chrome-icon);
}

.tool-coming-soon h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.tool-coming-soon .muted {
    margin: 0;
    max-width: 42ch;
    line-height: 1.55;
}

.tool-coming-soon-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s3);
    width: 100%;
    padding-top: var(--s2);
}

.calc-widget--pending .panel-body {
    padding: 0;
}

.hub-topics,
.sidebar-links {
    display: grid;
    gap: var(--s3);
}

.hub-topic,
.sidebar-links a {
    display: block;
    padding: var(--s4);
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.hub-topic small {
    display: block;
    margin-top: var(--s2);
    color: var(--text-dim);
    font-size: 0.82rem;
}

.comment-list {
    display: grid;
    gap: var(--s3);
}

.comment-item {
    padding: var(--s4);
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.comment-item > p {
    margin: 0;
    color: var(--text);
    line-height: 1.55;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
    font-size: 0.85rem;
}

.comment-meta .profile-link,
.comment-meta .profile-link strong {
    color: var(--text);
    font-weight: 700;
}

.comment-meta .profile-link:hover,
.comment-meta .profile-link:hover strong {
    color: var(--link-hover);
}

.comment-meta span {
    color: var(--text-dim);
    flex-shrink: 0;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin-top: var(--s3);
}

.comment-actions button {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-height: 32px;
    padding: 0 var(--s3);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.comment-actions button .ph-duotone {
    color: inherit;
    font-size: var(--icon-sm);
}

.comment-actions button:hover {
    background: var(--bg-panel-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.comment-actions button.is-liked,
.comment-like.is-liked {
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-panel));
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    color: var(--accent);
}

.comment-actions button.is-liked:hover,
.comment-like.is-liked:hover {
    background: color-mix(in srgb, var(--accent) 26%, var(--bg-panel));
    color: var(--accent);
    border-color: var(--accent);
}

.comment-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    align-items: center;
    justify-content: flex-end;
}

.comment-reply-quote {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    padding: var(--s3);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.86rem;
}

.comment-reply-quote strong {
    color: var(--text);
    font-weight: 600;
}

.comment-item.is-reply {
    margin-left: var(--s5);
    border-left: 2px solid var(--border);
    padding-left: var(--s4);
}

.comment-empty {
    margin: 0;
}

.tool-sidebar > .panel:has(.panel-head) {
    padding: 0;
}

.tool-sidebar > .panel:not(:has(.panel-head)) {
    padding: var(--s3) var(--s4);
}

.tool-sidebar h3 {
    margin: 0 0 var(--s3);
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: 0.95rem;
}

.tool-sidebar .sidebar-links {
    gap: 0;
}

.tool-sidebar .sidebar-links a {
    padding: var(--s2) 0;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

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

.sidebar-links a {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sidebar-link-disabled {
    display: block;
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
    color: var(--text-dim);
    opacity: 0.55;
    cursor: not-allowed;
}

.slug-box {
    display: block;
    padding: var(--s4);
    background: var(--bg-deep);
    border: 1px solid var(--border);
}

/* Discussion table */
.discussion-table {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.discussion-table-head,
.discussion-table-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(0, 2fr) 80px 100px 88px;
    gap: var(--s4);
    align-items: center;
    padding-inline: var(--s5);
    border-bottom: 1px solid var(--border);
}

.discussion-table-head {
    min-height: 40px;
    padding-block: var(--s3);
}

.discussion-table-row {
    min-height: 52px;
    padding-block: var(--s4);
    align-items: center;
}

.discussion-table-row > * {
    align-self: center;
}

.discussion-latest-cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.discussion-category-cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.discussion-latest-user {
    display: inline-block;
    margin-top: var(--s2);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.discussion-threads-table-head,
.discussion-thread-row {
    grid-template-columns: minmax(0, 1fr) 120px 80px 100px 88px;
}

.discussion-table-row:hover {
    background: var(--bg-panel-hover);
}

.discussion-table-row .topic-title,
.discussion-table-row .topic-preview {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-width: 0;
}

.discussion-category-cell .topic-title {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-weight: 600;
    color: var(--text);
}

.discussion-category-desc {
    margin: var(--s2) 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.discussion-table-row .topic-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.4;
}

.discussion-thread-title {
    font-weight: 500;
    color: var(--text);
}

.discussion-thread-author {
    text-align: center;
    justify-self: center;
    align-self: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.discussion-stat,
.discussion-last {
    text-align: center;
    justify-self: center;
    align-self: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.discussion-last {
    font-size: 0.82rem;
}

.discussion-table-head {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--heading-text);
    background: var(--heading-bg);
    align-items: center;
}

.discussion-table-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    align-self: center;
    gap: 6px;
    min-width: 0;
    min-height: 1.2em;
    line-height: 1;
    white-space: nowrap;
}

.discussion-table-head > span .ph-duotone {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    font-size: 0.95em;
    line-height: 1;
    color: var(--chrome-icon);
    vertical-align: middle;
}

.discussion-table-head > span:nth-child(1),
.discussion-table-head > span:nth-child(2) {
    justify-self: start;
    justify-content: flex-start;
}

.discussion-table-head > span:nth-child(3),
.discussion-table-head > span:nth-child(4),
.discussion-table-head > span:nth-child(5) {
    justify-self: center;
    justify-content: center;
    text-align: center;
}

.discussion-threads-table-head > span:nth-child(2),
.discussion-thread-row .discussion-thread-author,
.discussion-threads-table-head > span:nth-child(5),
.discussion-thread-row .discussion-last {
    justify-self: center;
    text-align: center;
}

.discussion-threads-table-head > span:nth-child(2) {
    justify-content: center;
}

/* Threads */
.thread-list {
    margin-bottom: var(--s4);
}

.thread-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 100px;
    gap: var(--s3);
    align-items: center;
    min-height: 48px;
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.thread-item:hover {
    background: var(--bg-panel-hover);
}

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

.thread-item h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.thread-title-link {
    color: inherit;
}

.thread-title-link:hover {
    color: var(--text);
}

.thread-item p {
    margin: 0;
    font-size: 0.85rem;
}

.thread-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--bg-deep);
}

.thread-last {
    color: var(--text-dim);
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
}

.thread-last:hover {
    color: var(--text-muted);
}

/* Profile */
.profile-head {
    padding-bottom: 0;
}

.profile-card {
    overflow: hidden;
}

.profile-card-body {
    display: grid;
    gap: var(--s4);
    padding: var(--s5) var(--s6) var(--s6);
}

.profile-card-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s5);
    align-items: center;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    background: var(--heading-bg);
    border: 1px solid var(--border);
}

.profile-avatar .ph-duotone {
    font-size: var(--icon-lg);
    color: var(--chrome-icon);
}

.profile-avatar-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--heading-bg);
}

.profile-avatar-edit {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--s4);
    width: 100%;
    text-align: center;
}

.profile-avatar-media {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s4);
}

.profile-avatar-preview {
    display: grid;
    place-items: center;
}

.profile-avatar-preview .profile-avatar,
.profile-avatar-preview .profile-avatar-image {
    width: 96px;
    height: 96px;
}

.profile-avatar-preview.is-removing .profile-avatar-image {
    opacity: 0.35;
}

.profile-avatar-controls {
    display: grid;
    gap: var(--s3);
    justify-items: center;
    width: 100%;
    max-width: 240px;
}

.profile-avatar-upload-btn {
    width: 100%;
    justify-content: center;
    cursor: pointer;
}

.profile-avatar-remove-btn {
    white-space: nowrap;
}

.profile-avatar-remove-btn[aria-pressed="true"] {
    opacity: 0.85;
}

.profile-avatar-note {
    margin: 0;
}

.profile-card-headline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s4);
    align-items: start;
    min-width: 0;
}

.profile-card-names {
    display: grid;
    gap: var(--s2);
    min-width: 0;
}

.profile-name {
    margin: 0;
    font-size: clamp(1.45rem, 2.8vw, 2rem);
    line-height: 1.15;
    font-weight: 700;
    color: var(--text);
}

.profile-handle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-dim);
    letter-spacing: 0.01em;
}

.profile-role {
    justify-self: start;
}

.profile-edit-btn {
    flex-shrink: 0;
    margin-top: var(--s1);
}

.profile-save-notice {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s4);
    padding: var(--s4) var(--s5);
    color: var(--success);
    background: rgba(142, 207, 159, 0.08);
    border: 1px solid rgba(142, 207, 159, 0.22);
}

.profile-bio {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.profile-card-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s5);
    align-items: start;
    padding-top: var(--s4);
    border-top: 1px solid var(--border-light);
}

.profile-about-compact {
    display: grid;
    gap: var(--s3);
    min-width: 0;
}

.profile-interests-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2) var(--s3);
}

.profile-interests-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
}

.profile-interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

.profile-interest-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    min-height: 28px;
    padding: 0 var(--s2);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-deep);
    border: 1px solid var(--border-light);
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-interest-tag:hover {
    color: var(--text);
    background: var(--bg-panel-hover);
}

.profile-side-info {
    display: grid;
    gap: var(--s2);
    min-width: 180px;
    padding-left: var(--s5);
    border-left: 1px solid var(--border-light);
}

.profile-info-line {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: 0.82rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.profile-info-line .ph-duotone {
    flex-shrink: 0;
    color: var(--text-dim);
}

.profile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
}

.profile-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-height: 36px;
    padding: 0 var(--s4);
    font-size: 0.84rem;
    color: var(--text-muted);
    background: var(--bg-deep);
    border: 1px solid var(--border-light);
}

.profile-meta-chip .ph-duotone {
    color: var(--text-dim);
}

.profile-section {
    padding-top: var(--s6);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s6);
    align-items: stretch;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    min-width: 0;
    min-height: var(--box-h);
    padding: var(--s5);
    text-align: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    overflow: hidden;
}

.profile-stat-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    background: var(--heading-bg);
    border: 1px solid var(--border-light);
}

.profile-stat-icon .ph-duotone {
    font-size: var(--icon-lg);
    color: var(--chrome-icon);
}

.profile-stat-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
    min-width: 0;
}

.profile-stat-body strong {
    font-size: 1.5rem;
    line-height: 1.1;
    color: var(--text);
}

.profile-stat-body > span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.profile-discuss {
    overflow: hidden;
}

.profile-discuss-head {
    padding: var(--s4) var(--s5);
    background: var(--heading-bg);
    border-bottom: 1px solid var(--chrome-border);
    color: var(--heading-text);
}

.profile-discuss-head h2 {
    margin: 0 0 var(--s1);
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading-text);
}

.profile-discuss-head .ph-duotone {
    color: var(--chrome-icon);
}

.profile-discuss-head .muted {
    margin: 0;
    font-size: 0.88rem;
    color: var(--chrome-muted);
}

.profile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--chrome-border);
    background: var(--chrome-bg);
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 52px;
    padding: var(--s3) var(--s4);
    border: 0;
    border-right: 1px solid var(--chrome-border);
    background: transparent;
    color: var(--chrome-muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-tab:last-child {
    border-right: 0;
}

.profile-tab.is-active {
    background: var(--primary);
    color: var(--on-primary);
}

.profile-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 var(--s2);
    background: var(--soft-fill-active);
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-tab.is-active .profile-tab-count {
    background: var(--soft-fill-active-hover);
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.is-active {
    display: block;
}

.profile-table-head,
.profile-table-row {
    display: grid;
    gap: var(--s4);
    align-items: center;
    min-height: 48px;
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--border-light);
}

.profile-table-head-topics,
.profile-table-row-topics {
    grid-template-columns: minmax(0, 2fr) 100px 80px 128px 88px;
}

.profile-table-head-messages,
.profile-table-row-messages {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) 120px 100px;
}

.profile-table-head {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--heading-text);
    background: var(--heading-bg);
}

.profile-table-head > span {
    display: inline-flex;
    align-items: center;
    gap: var(--s4);
    white-space: nowrap;
}

.profile-table-head > span .ph-duotone {
    flex-shrink: 0;
    color: var(--chrome-icon);
}

.profile-table-head-topics > span:nth-child(3),
.profile-table-head-topics > span:nth-child(4),
.profile-table-head-topics > span:nth-child(5),
.profile-table-row-topics .profile-row-replies,
.profile-table-row-topics .profile-row-views,
.profile-table-row-topics .profile-row-time {
    justify-self: center;
    text-align: center;
}

.profile-table-row-topics .profile-row-replies,
.profile-table-row-topics .profile-row-views {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.profile-table-head-topics > span:nth-child(2),
.profile-table-row-topics .profile-row-cat,
.profile-table-head-messages > span:nth-child(3),
.profile-table-row-messages .profile-row-cat {
    justify-self: center;
    text-align: center;
}

.profile-table-head-messages > span:nth-child(4),
.profile-table-row-messages .profile-row-time {
    justify-self: end;
    text-align: right;
}

.profile-table-row:hover {
    background: var(--bg-panel-hover);
}

.profile-table-row.is-hidden {
    display: none;
}

.profile-row-title {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--text);
}

.profile-row-title:hover {
    color: var(--text);
}

.profile-row-excerpt {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.profile-row-excerpt:hover {
    color: var(--text);
}

.profile-row-cat,
.profile-row-replies,
.profile-row-time {
    font-size: 0.84rem;
    color: var(--text-dim);
}

.profile-row-replies {
    font-weight: 600;
    color: var(--text-muted);
}

.profile-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    width: 100%;
    min-height: 48px;
    padding: var(--s3) var(--s5);
    border: 0;
    border-top: 1px solid var(--border-light);
    background: var(--bg-deep);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-load-more:hover {
    background: var(--bg-panel-hover);
    color: var(--text);
}

.profile-load-more.is-done {
    display: none;
}

.profile-empty {
    padding: var(--s6) var(--s5);
    margin: 0;
    text-align: center;
}

.profile-edit-section {
    padding-top: var(--s6);
}

.profile-edit-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    margin-bottom: var(--s4);
    padding: var(--s4) var(--s5);
    color: var(--danger);
    background: rgba(224, 136, 136, 0.08);
    border: 1px solid rgba(224, 136, 136, 0.22);
}

.profile-edit-alert ul {
    margin: 0;
    padding-left: var(--s5);
}

.profile-edit-alert li + li {
    margin-top: var(--s1);
}

.profile-edit-form {
    display: grid;
    gap: var(--s4);
    min-width: 0;
    max-width: 100%;
}

.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s3);
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.profile-edit-span {
    grid-column: 1 / -1;
}

.profile-edit-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    height: 100%;
}

.profile-edit-panel .panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.profile-edit-panel-media .panel-body {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-email-badge {
    flex-shrink: 0;
}

.profile-email-fields .profile-email-note {
    margin-bottom: 0;
}

.profile-email-verify-btn {
    justify-self: start;
}

.profile-edit-panel .panel-head {
    padding: var(--s3) var(--s4);
}

.profile-edit-panel .panel-body {
    padding: var(--s4);
}

.profile-edit-panel .panel-head h2 {
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    margin: 0;
    font-size: 1rem;
}

.profile-edit-fields {
    display: grid;
    gap: var(--s3);
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.profile-edit-fields .form-row {
    gap: var(--s1);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.profile-edit-fields .form-row label {
    margin-bottom: 0;
}

.profile-edit-fields .form-row .profile-edit-note {
    margin: 0;
}

.profile-edit-fields input,
.profile-edit-fields select,
.profile-edit-fields textarea,
.profile-edit-fields .form-row input,
.profile-edit-fields .form-row select,
.profile-edit-fields .form-row textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.profile-edit-fields textarea {
    min-height: 96px;
    resize: vertical;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    padding: var(--s3) var(--s4);
    line-height: 1.55;
}

.profile-edit-note {
    margin: 0 0 var(--s3);
    font-size: 0.88rem;
}

.profile-interest-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s4);
}

.profile-interest-option {
    position: relative;
    cursor: pointer;
}

.profile-interest-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-interest-option-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: var(--control-h-sm);
    padding: 0 var(--s4);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--chrome-muted);
    background: var(--chrome-bg);
    border: 1px solid var(--chrome-border);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-interest-option-body .ph-duotone {
    color: var(--chrome-icon);
    transition: color 0.15s ease;
}

.profile-interest-option:hover .profile-interest-option-body {
    background: var(--chrome-mid);
    border-color: var(--chrome-border);
    color: var(--chrome-text);
}

.profile-interest-option:hover .profile-interest-option-body .ph-duotone {
    color: var(--chrome-icon);
}

.profile-interest-option.is-checked .profile-interest-option-body,
.profile-interest-option input:checked + .profile-interest-option-body {
    color: var(--on-primary);
    background: var(--primary);
    border-color: var(--primary-border);
}

.profile-interest-option.is-checked .profile-interest-option-body .ph-duotone,
.profile-interest-option input:checked + .profile-interest-option-body .ph-duotone {
    color: var(--on-primary);
}

.profile-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-edit-section > .container {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.reply-box {
    padding: var(--s5);
}

.reply-box h2 {
    margin: 0 0 var(--s4);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
}

.thread-detail {
    display: grid;
    gap: var(--s4);
    margin-bottom: var(--s4);
}

/* Forum thread — r10 style separated posts */
.forum-thread {
    display: grid;
    gap: var(--s4);
    margin-bottom: var(--s4);
}

.forum-post {
    overflow: hidden;
}

.forum-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    min-height: 176px;
    min-width: 0;
}

.forum-post-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--s3);
    padding: var(--s5) var(--s4);
    text-align: center;
    background: var(--bg-deep);
    border-right: 1px solid var(--border-light);
}

.forum-post-avatar {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--heading-bg);
    overflow: hidden;
    flex-shrink: 0;
}

.forum-post-avatar .ph-duotone {
    font-size: var(--icon-md);
    color: var(--chrome-icon);
}

.forum-post-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.forum-post-name {
    font-size: 0.88rem;
    color: var(--text);
    word-break: break-all;
}

.forum-post-stat {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.3;
}

.forum-post-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.forum-post-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--s3);
    min-height: 44px;
    padding: var(--s2) var(--s5);
    background: var(--heading-bg);
    border-bottom: 1px solid var(--chrome-border);
    font-size: 0.78rem;
    color: var(--chrome-muted);
}

.forum-post-top .ph-duotone,
.forum-post-top a {
    color: var(--chrome-muted);
}

.forum-post-top a:hover {
    color: var(--chrome-text);
}

.forum-post-content {
    flex: 1 1 auto;
    padding: var(--s5);
}

.forum-post-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.forum-post-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s2);
    padding: var(--s3) var(--s5);
    border-top: 1px solid var(--border-light);
    background: var(--bg-deep);
}

.forum-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 36px;
    min-width: 112px;
    padding: 0 var(--s3);
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.forum-post-actions [data-admin-edit-post],
.forum-post-actions [data-admin-delete-post] {
    min-width: 0;
    padding-inline: var(--s3);
}

.forum-action:hover {
    background: var(--bg-panel-hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.forum-action.is-liked,
.forum-like.is-liked {
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-panel));
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    color: var(--accent);
}

.forum-action.is-liked:hover,
.forum-like.is-liked:hover {
    background: color-mix(in srgb, var(--accent) 26%, var(--bg-panel));
    color: var(--accent);
    border-color: var(--accent);
}

.forum-action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
    padding: 0 var(--s1);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.72rem;
    font-weight: 700;
}

.inline-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s3);
    padding: var(--s4);
    margin-top: var(--s4);
    position: relative;
    min-width: 0;
}

.inline-search .search-dropdown--page {
    grid-column: 1 / -1;
}

.empty {
    text-align: center;
    padding: var(--s8) var(--s6);
}

.empty .ph-duotone {
    font-size: 48px;
    color: var(--text);
    margin: 0 auto var(--s4);
    display: block;
}

.empty h1 {
    margin: 0 0 var(--s3);
}

.empty .btn {
    margin-top: var(--s5);
}

/* Footer */
.site-footer {
    margin-top: var(--s6);
    border-top: 1px solid var(--chrome-border);
    background: var(--chrome-bg);
    color: var(--chrome-text);
    padding-top: var(--s6);
    overflow: hidden;
}

.site-footer .container {
    min-width: 0;
}

.site-footer .ph-duotone {
    color: var(--chrome-icon);
}

.footer-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--s4);
    align-items: stretch;
    padding-bottom: var(--s6);
    min-width: 0;
}

.footer-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    text-align: center;
    min-width: 0;
    min-height: var(--box-h);
    height: auto;
    padding: var(--s4);
    background: var(--chrome-mid);
    border: 1px solid var(--chrome-border);
    overflow: hidden;
}

.footer-stat .ph-duotone {
    font-size: var(--icon-lg);
    color: var(--chrome-icon);
}

.footer-stat strong {
    display: block;
    max-width: 100%;
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--chrome-text);
    overflow-wrap: anywhere;
}

.footer-stat span {
    display: block;
    max-width: 100%;
    color: var(--chrome-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.footer-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s4);
    align-items: stretch;
    padding-bottom: var(--s6);
    min-width: 0;
}

.footer-list-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: var(--s1) var(--s3);
    align-content: center;
    align-items: start;
    min-width: 0;
    min-height: var(--box-h-sm);
    height: auto;
    padding: var(--s3) var(--s4);
    background: var(--chrome-mid);
    border: 1px solid var(--chrome-border);
    overflow: hidden;
}

.footer-list-icon {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    align-self: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--heading-bg);
    border: 1px solid var(--chrome-border);
}

.footer-list-icon .ph-duotone {
    font-size: var(--icon-md);
    color: var(--chrome-icon);
}

.footer-list-label {
    min-width: 0;
    color: var(--chrome-dim);
    font-size: 0.82rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.footer-list-link {
    min-width: 0;
}

.footer-list-link a,
.footer-list-link > span,
.footer-list-link .footer-auth-link {
    display: block;
    max-width: 100%;
    color: var(--chrome-text);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-decoration: none;
}

.footer-list-link a:hover,
.footer-list-link .footer-auth-link:hover {
    color: var(--chrome-muted);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s4);
    min-height: 52px;
    padding-block: var(--s4);
    border-top: 1px solid var(--chrome-border);
    font-size: 0.85rem;
    color: var(--chrome-muted);
}

.footer-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px 14px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.footer-legal a {
    color: var(--chrome-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    text-decoration: none;
}

.footer-legal a:hover {
    color: var(--chrome-text);
}

/* Auth modal */
body.auth-open,
body.discussion-open,
body.swal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

body.swal2-shown {
    padding-right: 0 !important;
}

html.swal2-shown {
    padding-right: 0 !important;
}

.auth-modal,
.discussion-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: var(--s4);
    overscroll-behavior: none;
    touch-action: none;
}

.auth-modal-dialog,
.auth-modal-body,
.discussion-modal-dialog,
.discussion-modal-body {
    touch-action: auto;
}

.auth-modal[hidden],
.discussion-modal[hidden] {
    display: none;
}

.auth-modal-backdrop,
.discussion-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
}

.auth-modal-dialog,
.discussion-modal-dialog {
    position: relative;
    width: min(100%, 460px);
    max-height: calc(100dvh - (var(--s4) * 2));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 0;
    box-shadow: var(--shadow-modal);
}

.discussion-modal-dialog {
    width: min(100%, 560px);
}

.auth-modal-head,
.discussion-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    min-height: var(--control-h);
    padding: var(--s4) var(--s5);
    background: var(--heading-bg);
    border-bottom: 0;
    color: var(--heading-text);
}

.auth-modal-head h2,
.discussion-modal-head h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading-text);
}

.auth-modal-head .ph-duotone,
.discussion-modal-head .ph-duotone {
    color: var(--chrome-icon);
}

.auth-modal-close,
.discussion-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: var(--chrome-input);
    color: var(--chrome-icon);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-modal-close .ph-duotone,
.discussion-modal-close .ph-duotone {
    font-size: var(--icon-sm);
    color: var(--chrome-icon);
}

.auth-modal-close:hover,
.discussion-modal-close:hover {
    background: var(--primary);
    border-color: transparent;
    color: var(--on-primary);
}

.auth-modal-close:hover .ph-duotone,
.discussion-modal-close:hover .ph-duotone {
    color: var(--on-primary);
}

.discussion-modal-body {
    padding: var(--s4);
    overflow: auto;
}

.discussion-modal-intro {
    margin: 0 0 var(--s3);
    font-size: 0.9rem;
    line-height: 1.4;
}

.admin-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--s3);
    margin-top: var(--s4);
}

.admin-edit-form .form-row {
    margin-bottom: var(--s4);
}

.admin-edit-form .form-errors {
    margin: 0 0 var(--s4);
}

.discussion-new-form {
    gap: var(--s3);
}

.discussion-new-form .form-row label {
    margin-bottom: 4px;
    font-size: 0.84rem;
}

.discussion-new-form .form-row input,
.discussion-new-form .form-row textarea {
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.discussion-new-form textarea {
    min-height: 110px;
}

.discussion-new-form .form-row input:focus,
.discussion-new-form .form-row textarea:focus,
.discussion-new-form .form-row input:focus-visible,
.discussion-new-form .form-row textarea:focus-visible {
    outline: none;
    box-shadow: none;
    border-color: var(--border);
}

.auth-modal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-bottom: 0;
    background: var(--bg-deep);
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 48px;
    padding: var(--s3) var(--s4);
    border: 0;
    border-right: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab:last-child {
    border-right: 0;
}

.auth-tab.is-active {
    background: var(--primary);
    color: var(--on-primary);
}

.auth-modal-body {
    padding: var(--s4);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.auth-panel {
    display: none;
    gap: var(--s2);
    min-width: 0;
    max-width: 100%;
}

.auth-panel.is-active {
    display: grid;
}

.auth-intro {
    margin: 0 0 var(--s1);
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.auth-panel .form-row {
    gap: var(--s1);
}

.auth-panel .form-row label {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    margin-bottom: 0;
    font-size: 0.84rem;
}

.auth-panel .form-row input {
    min-height: 46px;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
}

.auth-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--control-accent);
    flex-shrink: 0;
}

.auth-check a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.auth-check a:hover {
    color: var(--text);
}

.auth-submit {
    width: 100%;
}

.auth-switch {
    margin: 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.auth-switch-link,
.footer-auth-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: inherit;
    font-weight: 600;
    line-height: inherit;
    cursor: pointer;
    text-decoration: none;
}

.auth-switch-link:hover {
    color: var(--text);
}

.footer-auth-link {
    font-size: 0.9rem;
    text-align: left;
    color: var(--chrome-text);
    width: 100%;
}

.footer-auth-link:hover {
    color: var(--chrome-muted);
}

.auth-notice {
    margin-top: var(--s4);
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.auth-notice.is-success {
    border-color: rgba(111, 191, 138, 0.35);
    color: var(--success);
}

.auth-notice.is-error {
    border-color: rgba(217, 107, 107, 0.35);
    color: var(--danger);
}

.auth-gate-placeholder .ph-duotone {
    font-size: 48px;
    margin: 0 auto var(--s4);
    display: block;
}

@media (max-width: 768px) {
    .auth-modal,
    .discussion-modal {
        padding: 0;
        align-items: stretch;
    }

    .auth-modal-dialog,
    .discussion-modal-dialog {
        width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        border: 0;
    }

    .auth-modal-body,
    .discussion-modal-body {
        flex: 1;
        overflow-y: auto;
    }
}

/* Responsive */
@media (max-width: 1280px) {
    .footer-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--s4);
    }

    .footer-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--s4);
    }

    .tool-layout {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    }
}

@media (max-width: 1024px) {
    .header-inner {
        flex-wrap: wrap;
        gap: var(--s3);
    }

    .header-search {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .header-actions {
        margin-left: 0;
    }

    .cat-nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cat-nav::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    .cat-nav-item {
        flex: 0 0 auto;
    }

    .cat-nav-link {
        width: auto;
        padding: 14px 16px;
    }

    .hero-grid,
    .split-grid,
    .tool-layout {
        grid-template-columns: 1fr;
    }

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

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

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--s3);
        min-height: 0;
    }

    .footer-copy,
    .footer-legal {
        flex: none;
        width: 100%;
    }

    .footer-legal {
        justify-content: center;
        gap: 6px 12px;
    }

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

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

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

    .profile-card-body {
        padding-inline: var(--s5);
    }

    .profile-card-details {
        grid-template-columns: 1fr;
        gap: var(--s4);
    }

    .profile-side-info {
        min-width: 0;
        padding-left: 0;
        padding-top: var(--s3);
        border-left: 0;
        border-top: 1px solid var(--border-light);
    }

    .profile-card-top {
        grid-template-columns: 1fr;
        gap: var(--s4);
    }

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

    .profile-edit-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .profile-avatar,
    .profile-avatar-image {
        width: 64px;
        height: 64px;
    }

    .profile-avatar-preview .profile-avatar,
    .profile-avatar-preview .profile-avatar-image {
        width: 88px;
        height: 88px;
    }

    .profile-avatar-controls {
        max-width: none;
    }

    .profile-edit-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .profile-edit-span {
        grid-column: auto;
    }

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

    .profile-edit-actions {
        flex-direction: column-reverse;
    }

    .profile-edit-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-table-head-topics,
    .profile-table-row-topics {
        grid-template-columns: minmax(0, 1fr) 56px 64px;
    }

    .profile-table-head-topics > span:nth-child(2),
    .profile-table-row-topics .profile-row-cat,
    .profile-table-head-topics > span:nth-child(5),
    .profile-table-row-topics .profile-row-time,
    .profile-table-head-messages > span:nth-child(2),
    .profile-table-row-messages .profile-row-excerpt {
        display: none;
    }

    .profile-table-head-messages,
    .profile-table-row-messages {
        grid-template-columns: minmax(0, 1fr) 88px 64px;
    }

    .page-title {
        grid-template-columns: 52px 1fr;
    }

    .page-title-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        width: 100%;
    }

    .page-title-actions .btn {
        flex: 1 1 calc(50% - var(--s2));
        justify-content: center;
    }

    .discussion-table-head,
    .discussion-table-row {
        grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) 72px 88px 80px;
        gap: var(--s3);
        padding-inline: var(--s4);
    }

    .discussion-threads-table-head,
    .discussion-thread-row {
        grid-template-columns: minmax(0, 1fr) 100px 64px 88px 80px;
    }

    .recent-discussions-table-head,
    .recent-discussion-row {
        grid-template-columns: minmax(0, 1fr) 120px 64px 104px 80px;
        gap: var(--s3);
        padding-inline: var(--s4);
    }
}

@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }

    body {
        padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 160;
        display: flex;
        align-items: stretch;
        min-height: var(--mobile-bottom-nav-height);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--chrome-bg);
        border-top: 0;
        color: var(--chrome-muted);
    }

    .mobile-bottom-nav .mobile-bottom-nav-item,
    .mobile-bottom-nav a.mobile-bottom-nav-item {
        color: var(--chrome-muted);
        border: 0;
        background: transparent;
    }

    .mobile-bottom-nav .mobile-bottom-nav-item .ph-duotone {
        color: inherit;
    }

    .mobile-bottom-nav .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav .mobile-bottom-nav-item.is-active,
    .mobile-bottom-nav .mobile-bottom-nav-item.is-menu-open {
        color: var(--chrome-text);
        background: var(--soft-fill-strong);
    }

    .site-footer {
        margin-bottom: 0;
    }

    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand theme"
            "search search";
        gap: var(--s3);
        min-height: auto;
        padding-block: var(--s3);
    }

    .header-inner > .brand {
        grid-area: brand;
        font-size: 1.05rem;
    }

    .header-inner > .brand .ph-duotone {
        font-size: var(--icon-md);
    }

    .theme-toggle {
        grid-area: theme;
        margin-left: 0;
        width: var(--control-h-sm);
        min-height: var(--control-h-sm);
    }

    .theme-toggle .ph-duotone {
        font-size: var(--icon-sm);
    }

    .header-search {
        grid-area: search;
        order: initial;
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .mobile-menu-toggle,
    .header-actions {
        display: none;
    }

    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        top: var(--header-height, 132px);
        right: 0;
        bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
        left: 0;
        background: var(--overlay);
        z-index: 120;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .mobile-nav-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        z-index: 165;
    }

    .mega-nav {
        display: block;
        position: fixed;
        top: var(--header-height, 132px);
        left: 0;
        right: 0;
        bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
        z-index: 170;
        max-height: none;
        overflow: hidden;
        background: var(--chrome-bg);
        color: var(--chrome-text);
        border-top: 0;
        transform: translateY(8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .mega-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mega-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--s3);
        min-height: 52px;
        padding: var(--s3) var(--s4);
        background: var(--chrome-mid);
        border-bottom: 0;
        color: var(--chrome-text);
    }

    .mega-nav-head strong {
        display: inline-flex;
        align-items: center;
        gap: var(--s2);
        font-size: 0.95rem;
        color: var(--chrome-text);
    }

    .mega-nav-head .ph-duotone {
        color: var(--chrome-icon);
    }

    .mega-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--chrome-icon);
        cursor: pointer;
    }

    .mega-nav-close .ph-duotone {
        font-size: var(--icon-sm);
        color: var(--chrome-icon);
    }

    .mega-nav-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--chrome-text);
    }

    .mega-nav-body {
        width: 100%;
        height: calc(100% - 52px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-inline: 0;
        background: var(--chrome-bg);
        color: var(--chrome-text);
    }

    .cat-nav {
        display: flex;
        flex-direction: column;
        overflow: visible;
        background: var(--chrome-bg);
    }

    .cat-nav-item {
        flex: initial;
        width: 100%;
    }

    .mega-nav .cat-nav-link {
        justify-content: flex-start;
        width: 100%;
        padding: var(--s4);
        border: 0;
        border-right: 0;
        border-bottom: 0;
        font-size: 0.92rem;
        cursor: pointer;
        color: var(--chrome-muted);
        background: transparent;
        box-shadow: none;
    }

    .mega-nav .cat-nav-link-inner .ph-duotone {
        color: var(--chrome-icon);
    }

    .mega-nav .cat-nav-link.is-active {
        background: var(--soft-fill-strong);
        color: var(--chrome-text);
        box-shadow: none;
    }

    .mega-nav .cat-nav-link.is-active .ph-duotone {
        color: var(--chrome-icon);
    }

    .mega-nav .cat-nav-item:hover .cat-nav-link,
    .mega-nav .cat-nav-link:focus-visible,
    .mega-nav .cat-nav-item:hover .cat-nav-link.is-active,
    .mega-nav .cat-nav-link.is-active:focus-visible {
        background: var(--primary);
        color: var(--on-primary);
        box-shadow: none;
    }

    .mega-nav .cat-nav-item:hover .cat-nav-link .ph-duotone,
    .mega-nav .cat-nav-link:focus-visible .ph-duotone,
    .mega-nav .cat-nav-item:hover .cat-nav-link.is-active .ph-duotone,
    .mega-nav .cat-nav-link.is-active:focus-visible .ph-duotone {
        color: var(--on-primary);
    }

    .cat-nav-link-inner {
        justify-content: flex-start;
        gap: var(--s3);
        white-space: normal;
    }

    .cat-nav-link::after {
        display: none;
    }

    .cat-nav-item:hover .cat-dropdown,
    .cat-nav-item:focus-within .cat-dropdown,
    .cat-nav-item.is-expanded .cat-dropdown {
        display: none;
    }

    .cat-dropdown {
        display: none;
    }

    .recent-discussions {
        padding: var(--s4) 0;
    }

    .recent-discussions-head {
        flex-direction: column;
        align-items: stretch;
        gap: var(--s3);
        padding: var(--s4);
    }

    .recent-discussions-head .btn {
        width: 100%;
    }

    .recent-discussions-table-head {
        display: none;
    }

    .recent-discussion-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s1);
        padding: var(--s3) var(--s4);
        min-height: auto;
    }

    .recent-discussion-title {
        font-size: 0.9rem;
        line-height: 1.4;
        -webkit-line-clamp: 3;
    }

    .recent-discussion-user,
    .recent-discussion-stat,
    .recent-discussion-cat {
        text-align: left;
        font-size: 0.78rem;
        font-weight: 400;
    }

    .recent-discussion-user::before {
        content: "Son cevap: ";
        color: var(--text-dim);
    }

    .recent-discussion-stat:nth-of-type(1)::before,
    .recent-discussion-replies::before {
        content: "Yanıt: ";
        color: var(--text-dim);
    }

    .recent-discussion-stat:nth-of-type(2)::before,
    .recent-discussion-views::before {
        content: "Görüntülenme: ";
        color: var(--text-dim);
    }

    .recent-discussion-cat::before {
        content: "Kategori: ";
        color: var(--text-dim);
    }

    .hero {
        padding: var(--s6) 0 var(--s5);
    }

    .hero h1 {
        font-size: clamp(1.55rem, 6vw, 2rem);
    }

    .hero-actions {
        flex-direction: column;
    }

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

    .hero-stats {
        grid-template-columns: 1fr;
        height: auto;
        padding: var(--s3);
    }

    .hero-stat {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: var(--s4);
        min-height: var(--box-h-sm);
        height: auto;
        padding: var(--s4);
    }

    .hero-stat-icon {
        flex-shrink: 0;
    }

    .hero-stat-body {
        align-items: flex-start;
    }

    .hero-stat strong {
        font-size: 1.35rem;
    }

    .section {
        padding: var(--s6) 0;
    }

    .section-head {
        padding: var(--s4);
    }

    .section-head h2 {
        font-size: 1.05rem;
    }

    .panel-head {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: var(--s4);
        min-height: auto;
    }

    .panel-head .btn {
        width: 100%;
    }

    .panel-body {
        padding: var(--s4);
    }

    .page-head {
        padding-top: var(--s5);
    }

    .page-head .container {
        padding-bottom: var(--s4);
    }

    .page-title h1 {
        font-size: 1.35rem;
    }

    .page-title-actions {
        flex-direction: column;
    }

    .page-title-actions .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .discussion-table-head {
        display: none;
    }

    .discussion-table-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s3);
        padding: var(--s5);
        min-height: auto;
    }

    .discussion-table-row span:nth-child(3)::before,
    .discussion-stat-replies::before {
        content: "Yanıt: ";
        color: var(--text-dim);
    }

    .discussion-table-row span:nth-child(4)::before,
    .discussion-stat-views::before {
        content: "Görüntülenme: ";
        color: var(--text-dim);
    }

    .discussion-table-row span:nth-child(5)::before,
    .discussion-last::before {
        content: "Son: ";
        color: var(--text-dim);
    }

    .discussion-thread-row .discussion-thread-author::before {
        content: "Açan: ";
        color: var(--text-dim);
    }

    .discussion-latest-user::before {
        content: "Açan: ";
        color: var(--text-dim);
    }

    .discussion-table-row span:nth-child(n + 3) {
        font-size: 0.8rem;
    }

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

    .forum-post-user {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        gap: var(--s2) var(--s3);
        padding: var(--s4);
        border-right: 0;
        border-bottom: 1px solid var(--border-light);
    }

    .forum-post-avatar {
        width: 44px;
        height: 44px;
    }

    .forum-post-stat {
        width: 100%;
    }

    .forum-post-top,
    .forum-post-content,
    .forum-post-actions {
        padding-inline: var(--s4);
    }

    .forum-post-actions {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: var(--s2);
        padding: var(--s3) var(--s4);
    }

    .forum-action {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--s2);
        width: auto;
        min-width: 0;
        min-height: 36px;
        padding: 0 var(--s3);
        font-size: 0.78rem;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
    }

    .forum-action .ph-duotone {
        flex-shrink: 0;
        font-size: var(--icon-sm);
    }

    .forum-action-count {
        min-width: 18px;
        min-height: 18px;
        padding: 0 4px;
        font-size: 0.65rem;
    }

    .thread-item {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: var(--s3);
        padding: var(--s4);
        align-items: start;
    }

    .thread-last {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }

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

    .tool-row {
        grid-template-columns: 1fr;
        gap: var(--s1);
        padding: var(--s4);
    }

    .tool-row small {
        text-align: left;
    }

    .category-card {
        grid-template-columns: 44px minmax(0, 1fr) 20px;
        gap: var(--s3);
        padding: var(--s4);
        min-height: var(--box-h-sm);
    }

    .tool-card {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: var(--s3);
        padding: var(--s4);
        min-height: var(--box-h-sm);
    }

    .category-icon,
    .title-icon,
    .tool-card-icon {
        width: 44px;
        height: 44px;
    }

    .tool-card-icon {
        width: 40px;
        height: 40px;
    }

    .category-icon .ph-duotone,
    .title-icon .ph-duotone,
    .tool-card-icon .ph-duotone {
        font-size: var(--icon-md);
    }

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

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

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--s3);
        min-height: 0;
        padding-block: var(--s4);
    }

    .footer-copy {
        flex: none;
        width: 100%;
    }

    .footer-legal {
        flex: none;
        width: 100%;
        max-width: 22rem;
        justify-content: center;
        gap: 6px 10px;
    }

    .footer-legal a {
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .inline-search {
        grid-template-columns: 1fr;
    }

    .inline-search .btn {
        width: 100%;
    }

    .result-box {
        margin: 0;
        padding: var(--s4);
    }

    .reply-box {
        padding: var(--s4);
    }

    .reply-box .btn {
        width: 100%;
    }

    .comment-form .btn,
    .calc-form .btn {
        width: 100%;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s1);
    }

    .empty {
        padding: var(--s7) var(--s4);
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: var(--s4);
        --control-h: 48px;
    }

    .header-actions .btn {
        padding-inline: var(--s3);
        font-size: 0.8rem;
        gap: var(--s2);
    }

    .header-actions .btn .ph-duotone {
        font-size: var(--icon-sm);
    }

    .category-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }

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

    .profile-card-body {
        padding: var(--s4) var(--s4) var(--s5);
        gap: var(--s3);
    }

    .profile-bio {
        font-size: 0.88rem;
    }

    .profile-info-line {
        white-space: normal;
    }

    .profile-meta-chip {
        width: 100%;
    }

    .profile-stat {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        min-height: var(--box-h-sm);
        gap: var(--s4);
    }

    .profile-stat-body {
        align-items: flex-start;
    }

    .profile-table-head,
    .profile-table-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s2);
        padding: var(--s4);
        min-height: auto;
    }

    .profile-table-head {
        display: none;
    }

    .profile-row-cat::before {
        content: "Kategori: ";
        color: var(--text-dim);
    }

    .profile-row-replies::before {
        content: "Yanıt: ";
        color: var(--text-dim);
    }

    .profile-row-views::before {
        content: "Görüntülenme: ";
        color: var(--text-dim);
    }

    .profile-row-time::before {
        content: "Zaman: ";
        color: var(--text-dim);
    }

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

    .recent-discussions-more {
        padding: var(--s4);
        font-size: 0.85rem;
    }

    .breadcrumbs {
        font-size: 0.8rem;
    }

    .discuss-intro {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-actions .btn span.btn-label {
        display: none;
    }

    .header-actions .btn {
        min-height: var(--control-h);
        padding: 0;
    }
}

/* Admin panel & moderation */
.admin-layout {
    display: grid;
    gap: var(--s6);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s4);
}

.admin-stat {
    display: grid;
    gap: var(--s2);
    padding: var(--s5);
    text-align: center;
}

.admin-stat strong {
    font-size: 1.6rem;
    line-height: 1.1;
}

.admin-stat span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--s4);
}

.admin-nav-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: var(--s4);
    align-items: center;
    padding: var(--s5);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-nav-card:hover {
    background: var(--bg-panel-hover);
    border-color: var(--border-strong);
}

.admin-nav-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-deep);
    color: var(--text);
    flex-shrink: 0;
}

.admin-nav-card strong {
    display: block;
    margin-bottom: var(--s1);
    color: var(--text);
}

.admin-nav-card p {
    margin: 0;
    font-size: 0.88rem;
}

.admin-nav-card-arrow {
    color: var(--text-dim);
}

.admin-tools-panel {
    overflow: hidden;
}

.admin-tools-toolbar {
    flex-wrap: wrap;
    gap: var(--s3);
}

.admin-tools-toolbar h2 {
    margin: 0;
}

.admin-tools-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
}

.admin-tools-filter {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    margin: 0;
    color: var(--chrome-muted);
    font-size: 0.82rem;
}

.admin-tools-filter select {
    min-height: 36px;
    min-width: 160px;
    padding: 0 var(--s3);
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input);
    color: var(--chrome-text);
    font: inherit;
    font-size: 0.88rem;
}

.admin-tools-count {
    font-size: 0.82rem;
    color: var(--chrome-dim);
    white-space: nowrap;
}

.admin-tools-empty {
    margin: 0;
    padding: var(--s5);
    text-align: center;
}

.admin-tool-table {
    display: grid;
}

.admin-tool-head,
.admin-tool-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 88px 108px;
    gap: var(--s4);
    align-items: center;
    padding: var(--s3) var(--s5);
    border-top: 1px solid var(--border-light);
}

.admin-tool-head {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-deep);
    border-top: 0;
}

.admin-tool-name {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.admin-tool-title-row {
    display: flex;
    align-items: center;
    gap: var(--s2);
    min-width: 0;
}

.admin-tool-title-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.admin-tool-flag {
    flex-shrink: 0;
}

.admin-tool-name small {
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.admin-tool-category {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.admin-tool-status {
    justify-self: start;
}

.admin-tool-row .btn {
    justify-self: end;
    min-width: 96px;
    white-space: nowrap;
}

.admin-help-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: var(--s3);
    color: var(--text-muted);
}

.admin-users-panel {
    overflow: hidden;
}

.admin-tools-filter input[type="search"] {
    min-height: 36px;
    min-width: 180px;
    padding: 0 var(--s3);
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input);
    color: var(--chrome-text);
    font: inherit;
    font-size: 0.88rem;
}

.admin-user-table {
    display: grid;
}

.admin-user-head,
.admin-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) 90px 110px 96px minmax(118px, auto);
    gap: var(--s3);
    align-items: center;
    padding: var(--s3) var(--s5);
    border-top: 1px solid var(--border-light);
}

.admin-user-head {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-deep);
    border-top: 0;
}

.admin-user-name {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.admin-user-name strong,
.admin-user-name small,
.admin-user-email,
.admin-user-seen {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-name small,
.admin-user-email,
.admin-user-seen {
    color: var(--text-dim);
    font-size: 0.82rem;
}

.admin-user-row .btn {
    justify-self: end;
    white-space: nowrap;
    width: auto;
    min-width: max-content;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--border-light);
}

.pagination-pages {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
}

.pagination-btn,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    min-width: 36px;
    padding: 0 var(--s3);
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.pagination-btn:hover,
.pagination-page:hover {
    background: var(--bg-panel-hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.pagination-page.is-current {
    background: var(--heading-bg);
    color: var(--heading-text);
    border-color: var(--chrome-border);
}

.pagination-btn.is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.pagination-ellipsis {
    color: var(--text-dim);
    padding: 0 var(--s1);
}

.comment-pagination {
    padding-top: 0;
}

.comment-pagination .pagination {
    border-top: 1px solid var(--border-light);
    padding-inline: 0;
}

.discussion-threads-table-head.is-admin,
.discussion-thread-row.is-admin {
    grid-template-columns: minmax(0, 1fr) minmax(0, 110px) 64px 88px 80px 110px;
    column-gap: var(--s3);
}

.discussion-threads-table-head.is-admin > .discussion-admin-head,
.discussion-thread-row.is-admin > .discussion-admin-actions {
    justify-self: end;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.discussion-thread-row.is-admin > * {
    min-width: 0;
}

.discussion-thread-row.is-admin .discussion-thread-title,
.discussion-thread-row.is-admin .discussion-thread-author,
.discussion-thread-row.is-admin .discussion-last {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discussion-thread-row.is-admin .discussion-thread-title {
    display: block;
    -webkit-line-clamp: unset;
}

.discussion-admin-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.discussion-admin-actions .btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.discussion-admin-actions .btn .ph-duotone {
    margin: 0;
    font-size: var(--icon-sm);
}

.discussion-thread-row.is-pinned .discussion-thread-title {
    font-weight: 700;
}

.thread-pin-badge {
    display: inline-flex;
    vertical-align: -0.15em;
    margin-right: 4px;
    color: var(--accent);
    flex-shrink: 0;
}

.thread-lock-badge {
    display: inline-flex;
    vertical-align: -0.15em;
    margin-right: 4px;
    color: var(--muted);
    flex-shrink: 0;
}

.admin-thread-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    max-width: 100%;
}

.admin-thread-actions .btn {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .discussion-threads-table-head.is-admin,
    .discussion-thread-row.is-admin {
        grid-template-columns: minmax(0, 1fr) minmax(0, 96px) 56px 72px 64px 110px;
        column-gap: var(--s2);
    }
}

@media (max-width: 960px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-tool-head,
    .admin-tool-row {
        grid-template-columns: minmax(0, 1fr) 96px 76px 100px;
        gap: var(--s3);
        padding-inline: var(--s4);
    }

    .discussion-threads-table-head.is-admin,
    .discussion-thread-row.is-admin {
        grid-template-columns: minmax(0, 1fr) minmax(0, 88px) 52px 64px 60px 110px;
    }
}

@media (max-width: 768px) {
    .admin-tool-head {
        display: none;
    }

    .admin-tool-row {
        grid-template-columns: 1fr;
        gap: var(--s2);
        padding: var(--s4);
    }

    .admin-tool-row .btn {
        justify-self: start;
        width: 100%;
    }

    .admin-tool-title-row {
        flex-wrap: wrap;
    }

    .admin-user-head {
        display: none;
    }

    .admin-user-row {
        grid-template-columns: 1fr;
        gap: var(--s2);
        padding: var(--s4);
    }

    .admin-user-row .btn {
        justify-self: start;
        width: 100%;
    }

    .discussion-thread-row.is-admin .discussion-thread-title,
    .discussion-thread-row.is-admin .discussion-thread-author,
    .discussion-thread-row.is-admin .discussion-last {
        white-space: normal;
        text-overflow: unset;
    }

    .discussion-admin-actions {
        width: auto;
        min-width: 0;
        max-width: none;
        margin-top: var(--s2);
        padding-top: var(--s3);
        border-top: 1px solid var(--border-light);
        justify-content: flex-start;
    }
}
