:root {
    color-scheme: light;
    --dh-bg: light-dark(#f3f4f6, #151918);
    --dh-surface: light-dark(#fff, #202725);
    --dh-raised: light-dark(#edf2f0, #2a3431);
    --dh-border: light-dark(#e2e5ea, #3d4b46);
    --dh-text: light-dark(#1f2933, #f1f3ec);
    --dh-text-muted: light-dark(#626d76, #b4c1bb);
    --dh-primary: var(--dh-custom-primary, light-dark(#246257, #a6dbce));
    --dh-primary-contrast: var(--dh-custom-contrast, light-dark(#fff, #142f29));
    --dh-accent: light-dark(#2f5d62, #9dd5cc);
    --dh-success: light-dark(#216340, #a0e4b8);
    --dh-warning: light-dark(#805218, #f6d195);
    --dh-danger: light-dark(#9c3836, #ffb5ad);
    --dh-radius: 10px;
    --dh-shadow: 0 1px 3px rgb(0 0 0 / .08);
    --dh-font: "Noto Sans Thai", system-ui, sans-serif;
}
@font-face {
    font-family: "Noto Sans Thai";
    src: url("../fonts/NotoSansThai-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Noto Sans Thai";
    src: url("../fonts/NotoSansThai-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
body {
    margin: 0;
    background: var(--dh-bg);
    color: var(--dh-text);
    font: 1rem/1.7 var(--dh-font);
}
body a { color: var(--dh-accent); }
body a:hover { color: var(--dh-text); }
:focus-visible { outline: 2px solid var(--dh-accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.dh-sr, .dh-skip:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.dh-skip:focus {
    position: fixed;
    z-index: 30;
    inset: 8px auto auto 8px;
    padding: .5rem 1rem;
    background: var(--dh-surface);
}
.dh-prose { max-width: 72ch; line-height: 1.9; overflow-wrap: anywhere; }
body input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=reset]),
body select, body textarea {
    box-sizing: border-box;
    max-width: 100%;
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    background: var(--dh-surface);
    color: var(--dh-text);
    font: inherit;
    padding: .25rem .5rem;
}
body input:is([type=checkbox], [type=radio]) { accent-color: var(--dh-accent); }
.dh-card {
    background: var(--dh-surface);
    color: var(--dh-text);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    box-shadow: var(--dh-shadow);
    padding: 1rem;
}
.dh-card-header { border-block-end: 1px solid var(--dh-border); padding-block-end: .55rem; margin-block-end: .75rem; font-weight: 700; }
.dh-btn, .dh-icon-button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 40px;
    padding: .3rem .75rem;
    border: 1px solid var(--dh-border);
    border-radius: 7px;
    background: var(--dh-surface);
    color: var(--dh-text);
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
}
.dh-btn:hover, .dh-icon-button:hover { background: var(--dh-raised); text-decoration: none; }
.dh-btn--primary, .dh-btn--primary:hover { background: var(--dh-primary); color: var(--dh-primary-contrast); border-color: transparent; }
.dh-btn--secondary { color: var(--dh-accent); }
.dh-btn--danger { color: var(--dh-danger); }
.dh-btn--ghost { background: transparent; border-color: transparent; }
.dh-btn--sm { min-height: 34px; padding-inline: .55rem; font-size: .875rem; }
.dh-btn--lg { min-height: 48px; padding-inline: 1rem; }
.dh-icon-button { width: 40px; padding: 0; }
.dh-icon { display: inline-block; vertical-align: middle; flex: none; }
.dh-badge, .dh-account .amt {
    display: inline-grid;
    place-items: center;
    min-width: 1.35em;
    padding: .05em .35em;
    border-radius: 99px;
    background: var(--dh-primary);
    color: var(--dh-primary-contrast);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.5;
}
.dh-avatar {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--dh-raised);
    vertical-align: middle;
}
.dh-avatar--sm { width: 30px; height: 30px; }
.dh-avatar--lg { width: 64px; height: 64px; }
.dh-avatar img:not(.dh-icon) { width: 100%; height: 100%; object-fit: cover; }
.dh-tabs { display: flex; flex-wrap: wrap; gap: .5rem; border-bottom: 1px solid var(--dh-border); margin-block-end: 1rem; }
.dh-tabs [aria-selected=true] { border-bottom: 3px solid var(--dh-accent); color: var(--dh-accent); }
.dh-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
body .current_page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 2rem;
    min-block-size: 2rem;
    padding: .15rem .45rem;
    border-radius: .45rem;
    background: var(--dh-primary);
    color: var(--dh-primary-contrast);
    white-space: nowrap;
    vertical-align: middle;
}
body .current_page::before, body .current_page::after { content: none; }
body .pagesection .nav_page, .dh-pagination a { padding: .15rem .45rem; color: var(--dh-accent); }
.dh-alert { display: block; padding: .65rem 1rem; border: 1px solid currentColor; border-radius: 6px; background: var(--dh-surface); color: var(--dh-accent); }
.dh-alert--success { color: var(--dh-success); }
.dh-alert--warning { color: var(--dh-warning); }
.dh-alert--error { color: var(--dh-danger); }
.dh-table { width: 100%; border-collapse: collapse; }
.dh-table :is(th, td) { padding: .5rem .7rem; border-bottom: 1px solid var(--dh-border); text-align: start; }
.dh-table th { background: var(--dh-raised); }
.dh-dropdown > summary { cursor: pointer; }
.dh-modal { width: min(100% - 2rem, 36rem); color: var(--dh-text); }
.dh-modal::backdrop { background: rgb(0 0 0 / .55); }
.dh-shell, #footer .dh-shell { box-sizing: border-box; width: min(100% - 32px, 1200px); margin-inline: auto; }
.dh-header { background: var(--dh-surface); border-bottom: 1px solid var(--dh-border); }
.dh-top { min-height: 80px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px) minmax(0, 1fr); align-items: center; gap: 1rem; }
.dh-brand { display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--dh-text); font-size: 1.2rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.dh-brand > img, .dh-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; object-fit: contain; }
.dh-brand-mark { background: #2f5d62; }
.dh-search { display: flex; gap: .3rem; min-width: 0; }
.dh-search input[type=search] { width: 100%; min-width: 0; }
.dh-mobile-search { display: none; }
.dh-account { display: flex; justify-content: end; align-items: center; gap: .35rem; }
.dh-account-link { position: relative; }
.dh-account-link .dh-badge { position: absolute; inset: -6px -5px auto auto; }
.dh-nav-band { background: var(--dh-raised); border-top: 1px solid var(--dh-border); }
.dh-navigation { position: relative; }
.dh-menu, .dh-menu ul, .dh-crumb ol { list-style: none; margin: 0; padding: 0; }
.dh-menu { display: flex; flex-wrap: wrap; gap: .2rem .5rem; padding-block: .25rem; }
.dh-menu li { position: relative; display: flex; align-items: center; }
.dh-menu li a { display: block; padding: .45rem .6rem; text-decoration: none; color: var(--dh-text); }
.dh-menu a:hover, .dh-menu .dh-menu-current { background: var(--dh-surface); border-radius: 6px; color: var(--dh-accent); }
.dh-menu .dh-menu-current { font-weight: 700; }
.dh-menu summary { list-style: none; min-width: 32px; text-align: center; }
.dh-menu summary::-webkit-details-marker, .dh-mobile-search summary::-webkit-details-marker { display: none; }
.dh-menu details > ul { position: absolute; z-index: 10; inset: 100% auto auto 0; min-width: 12rem; padding: .3rem; background: var(--dh-surface); border: 1px solid var(--dh-border); border-radius: 8px; box-shadow: var(--dh-shadow); }
.dh-menu details details > ul { position: static; min-width: 0; box-shadow: none; }
.dh-menu details li { flex-wrap: wrap; }
.dh-menu details li > a { flex: 1; }
.dh-nav-toggle { display: none; }
.dh-crumb { margin-block: .75rem; padding: .4rem .75rem; background: var(--dh-surface); border: 1px solid var(--dh-border); border-radius: 7px; color: var(--dh-text-muted); font-size: .875rem; }
.dh-crumb ol { display: flex; flex-wrap: wrap; gap: .1rem .45rem; }
.dh-crumb li { overflow-wrap: anywhere; }
.dh-crumb li + li::before { content: "/"; margin-inline-end: .45rem; }
.dh-content { min-height: 56vh; padding-block: .25rem 1.5rem; }
.dh-content main { min-width: 0; overflow-wrap: anywhere; }
#footer.dh-footer { position: static; margin: 0; padding: 1.25rem 0; border-top: 1px solid var(--dh-border); background: var(--dh-surface); color: var(--dh-text-muted); }
.dh-footer-grid { display: grid; grid-template-columns: 1fr 1fr auto; align-items: start; gap: .75rem 1.5rem; }
.dh-footer-grid nav, .dh-language > div { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
#footer.dh-footer a { color: var(--dh-accent); }
.dh-copyright { grid-column: 1 / -1; border-top: 1px solid var(--dh-border); padding-top: .75rem; font-size: .875rem; }

.dh-site-columns { display: grid; grid-template-columns: minmax(0,1fr); gap: .9rem; align-items: start; }
.dh-site-columns > main { min-width: 0; }
.dh-site-columns.dh-site-has-left { grid-template-columns: minmax(10rem,1fr) minmax(0,3fr); }
.dh-site-columns.dh-site-has-right { grid-template-columns: minmax(0,3fr) minmax(10rem,1fr); }
.dh-site-columns.dh-site-has-left.dh-site-has-right { grid-template-columns: minmax(10rem,1fr) minmax(0,3fr) minmax(10rem,1fr); }
.dh-sitewide { display: grid; gap: .75rem; min-width: 0; }
.dh-sitewide-top, .dh-sitewide-bottom { margin-block: .75rem; }
.dh-sitewide .dhp-block { min-width: 0; overflow-wrap: anywhere; }
.dh-sitewide .dhp-block img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
@media (max-width: 900px) {
    .dh-site-columns,
    .dh-site-columns.dh-site-has-left,
    .dh-site-columns.dh-site-has-right,
    .dh-site-columns.dh-site-has-left.dh-site-has-right { grid-template-columns: minmax(0,1fr); }
    .dh-site-columns > main { order: -1; }
}

.dh-site { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.dh-site > .dh-content { flex: 1 0 auto; min-height: 0; }
.dh-site > #footer.dh-footer { flex: 0 0 auto; inset: auto; width: auto; }
.dh-header-tools { display: flex; min-width: 0; align-items: center; gap: .45rem; }
.dh-header-tools .dh-desktop-search { flex: 1; }
.dh-header-tools [data-dh-theme] { flex: none; }
.dh-credit { margin-top: .35rem; }
body .dh-btn--calm {
    border-color: light-dark(#bfd5cb, #52776a);
    background: light-dark(#deebe5, #2c4d43);
    color: light-dark(#214c40, #e1f5e9);
    text-shadow: none;
}
body .dh-btn--calm:hover, body .dh-btn--calm:focus-visible {
    background: light-dark(#cadfd5, #365d51);
    color: light-dark(#16382d, #fff);
}
@media (max-width: 767px) {
    .dh-header-tools { gap: .18rem; }
}
:root[data-theme=dark] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { color-scheme: dark; }
}
.dh-sun { display: none; }
:root[data-theme=dark] .dh-sun { display: inline; }
:root[data-theme=dark] .dh-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .dh-sun { display: inline; }
    :root:not([data-theme]) .dh-moon { display: none; }
}
/* SMF fallback templates keep their own structure and use the theme palette. */
main :is(.windowbg, .windowbg2, .roundframe, .information, .generic_list_wrapper, .post_wrapper, .popup_window, .title_bar, .cat_bar, .sub_bar, .quoteheader, .codeheader, .bbc_quote, .bbc_code, .up_contain, .board_stats, .childboards, .settings, .description, .appro\76 bg, .admin_content, .post) {
    background: var(--dh-surface);
    color: var(--dh-text);
    border-color: var(--dh-border);
}
main :is(.cat_bar, .title_bar, .sub_bar, tr.table_head, .table_grid thead) {
    background: var(--dh-raised);
    color: var(--dh-text);
    border-color: var(--dh-border);
    box-shadow: none;
}
main :is(.catbg, .titlebg, .subbg, .catbg a, .titlebg a, .table_grid th a, .board_name a, .info a, .lastpost a) { color: var(--dh-text); text-shadow: none; }
main :is(.button, .quickbuttons > li, .quickbuttons .subsections, .dropmenu ul, .popup_heading) { background: var(--dh-raised); color: var(--dh-text); border-color: var(--dh-border); text-shadow: none; }
main :is(.button:hover, .quickbuttons > li:hover) { background: var(--dh-surface); color: var(--dh-accent); }
main :is(.errorbox, .noticebox, .infobox) { background: var(--dh-surface); }
main .errorbox { color: var(--dh-danger); }
main .noticebox { color: var(--dh-warning); }
main .infobox { color: var(--dh-accent); }
main :is(.info, .lastpost, #info_center, .post_wrapper, .cat_bar, .sub_bar, .title_bar) :is(a, strong, b, time, em) {
    color: var(--dh-text);
}
main :is(.info, .lastpost, #info_center, .post_wrapper) a:not(.button) { color: var(--dh-accent); }
main :is(.board_stats, .lastpost, .childboards, .board_icon) { border-color: var(--dh-border); }
#footer.dh-footer .dh-footer-grid > div:first-child strong { color: var(--dh-text); }

/* Use the themed foreground for native title rules that otherwise retain a fixed dark color. */
body .dh-header .dh-brand, body .dh-header .dh-brand > span:last-child,
body #display_head .display_title, body #display_head #top_subject,
body .dhp-heading h1, body .dhp-block .dh-card-header,
body .dhp-block :is(.dhp-card-topic, h3) a,
body #topic_header a, body .dh-topic-heading :is(h2, h3) {
    color: var(--dh-text);
    text-shadow: none;
}

body .dh-crumb a:any-link,
body main .dh-board-row .dh-index-summary a:any-link,
body main .dh-board-row .dh-index-last a:any-link,
body main .dh-topic-row .dh-topic-title .preview a:any-link {
    color: var(--dh-accent);
    text-shadow: none;
}
body main #display_head.dh-board-heading .display_title,
body main #display_head.dh-board-heading .display_title a:any-link,
body main #display_head.dh-topic-heading p strong,
body main #display_head.dh-topic-heading p b,
body main #display_head.dh-board-heading :is(h1,h2) {
    color: var(--dh-text);
    text-shadow: none;
}
@media (max-width: 767px) {
    .dh-top { min-height: 64px; grid-template-columns: minmax(0, 1fr) auto auto; gap: .35rem; }
    .dh-brand { font-size: .95rem; gap: .35rem; }
    .dh-brand > img, .dh-brand-mark { width: 34px; height: 34px; }
    .dh-desktop-search { display: none; }
    .dh-mobile-search { display: block; }
    .dh-mobile-search > summary { display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; list-style: none; }
    .dh-mobile-search .dh-search { position: absolute; z-index: 12; inset: 64px 16px auto; background: var(--dh-surface); padding: .6rem; border: 1px solid var(--dh-border); border-radius: 7px; }
    .dh-account .dh-btn { padding-inline: .35rem; font-size: .77rem; }
    .dh-nav-toggle:not([hidden]) { display: inline-flex; margin-block: .35rem; }
    .dh-navigation.dh-nav-closed .dh-menu { display: none; }
    .dh-menu, .dh-menu details > ul { display: block; }
    .dh-menu li { flex-wrap: wrap; }
    .dh-menu li > a { flex: 1; }
    .dh-menu details[open] { width: 100%; }
    .dh-menu details > ul { position: static; box-shadow: none; min-width: 0; }
    .dh-footer-grid { grid-template-columns: 1fr; }
    .dh-table, .dh-table tbody, .dh-table tr, .dh-table td { display: block; box-sizing: border-box; }
    .dh-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .dh-table tbody tr { border: 1px solid var(--dh-border); border-radius: var(--dh-radius); margin-block: .5rem; }
    .dh-table td[data-label]::before { content: attr(data-label); display: block; color: var(--dh-text-muted); font-weight: 700; }
    main .table_grid { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 420px) {
    .dh-top { grid-template-columns: minmax(0, 1fr) auto; padding-block: .55rem; }
    .dh-account { grid-column: 1 / -1; }
    .dh-mobile-search .dh-search { inset-block-start: 52px; }
}
/* The board and topic indexes share the same row grid. */
main .dh-list-card { padding: 0; margin-block: .85rem; }
main .dh-list-heading {
    display: flow-root;
    padding: .65rem 1rem;
    margin: 0;
    background: light-dark(#e6efec, #293b36);
    border: 0;
    border-bottom: 1px solid var(--dh-border);
    border-radius: var(--dh-radius) var(--dh-radius) 0 0;
}
main .dh-list-heading h3 { margin: 0; padding: 0; font-size: 1rem; line-height: 1.65; }
main .dh-list-heading h3 a { color: var(--dh-accent); }
.dh-list-heading .desc { font-size: .875rem; color: var(--dh-text-muted); }
.dh-list-heading button[aria-controls] {
    padding: 0;
    width: 32px;
    min-height: 28px;
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    background: var(--dh-surface);
    color: var(--dh-accent);
    margin-inline-start: .5rem;
}
.dh-list-heading button[aria-controls]::before {
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    background: none;
    box-shadow: none;
    content: "−";
}
.dh-list-heading button.toggle_down[aria-controls]::before { content: "+"; }
.dh-index-row, #topic_container .dh-topic-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(95px, 13%) minmax(145px, 25%);
    gap: .85rem;
    align-items: start;
    padding: .8rem 1rem;
}
.dh-index-row, #topic_container .dh-topic-row {
    background: var(--dh-surface);
    color: var(--dh-text);
    margin: 0;
    border: 0;
    box-shadow: none;
}
.dh-index-row + .dh-index-row, #topic_container .dh-topic-row + .dh-topic-row { border-top: 1px solid var(--dh-border); }
.dh-index-row:last-child, #topic_container .dh-topic-row:last-child { border-radius: 0 0 var(--dh-radius) var(--dh-radius); }
#topic_container .dh-topic-row.sticky { background: light-dark(#fbf5e8, #322c20); }
.dh-index-summary, .dh-index-last, .dh-last-copy { min-width: 0; }
.dh-board-symbol {
    box-sizing: border-box;
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--dh-raised);
    border: 1px solid var(--dh-border);
    border-radius: 9px;
}
.dh-board-symbol.dh-board-unread { border: 2px solid var(--dh-accent); }
.dh-board-symbol .profile_sm { position: absolute; inset: auto -4px -4px auto; }
.dh-index-subject { color: var(--dh-accent); font-weight: 700; font-size: 1.02rem; }
.dh-index-summary :is(.board_description, .moderators, .dh-index-children) { color: var(--dh-text-muted); font-size: .86rem; line-height: 1.55; }
.dh-index-children p { margin: .3rem 0 0; }
.dh-index-children p > span { display: inline-block; margin-inline-start: .35rem; }
.dh-index-children .board_new_posts { font-weight: 700; }
.dh-index-counts, .dh-last-copy { display: grid; gap: .1rem; color: var(--dh-text-muted); font-size: .82rem; line-height: 1.5; }
.dh-last-copy strong { color: inherit; }
.dh-index-counts strong { color: var(--dh-text); }
.dh-index-last { display: flex; gap: .45rem; align-items: start; }
.dh-index-last:empty { display: none; }
.dh-index-last .dh-avatar { flex: none; }
.dh-last-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dh-accent); font-weight: 700; }
.dh-index-actions, .dh-index-actions .buttonlist { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.dh-index-actions .buttonlist { margin: 0; padding: 0; }
main .dh-index-actions .dh-btn { margin: 0; min-height: 38px; border-radius: 7px; }
main .dh-index-actions .dh-btn--primary { background: var(--dh-primary); color: var(--dh-primary-contrast); }
main .dh-index-actions .dh-btn--secondary { background: var(--dh-surface); color: var(--dh-accent); }
.dh-index-actions .top_menu {
    min-width: min(15rem, 65vw);
    max-width: min(18rem, 75vw);
    border-color: var(--dh-border);
    background: var(--dh-surface);
    color: var(--dh-text);
}
.dh-index-actions .top_menu a:hover, .dh-index-actions .top_menu a:focus { background: var(--dh-raised); }
#info_center.dh-info-center { margin-block: 1rem 0; }
.dh-info-center > .dh-list-heading { border: 1px solid var(--dh-border); border-radius: var(--dh-radius); }
.dh-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .75rem; margin-top: .75rem; }
.dh-info-grid .dh-info-card { min-width: 0; }
.dh-info-card :is(.sub_bar, .subbg) { margin: 0; }
main .dh-info-card .sub_bar { background: none; padding: 0 0 .35rem; margin-bottom: .45rem; border: 0; border-bottom: 1px solid var(--dh-border); }
#upshrink_stats .dh-info-card p.inline { padding: 0; margin: .25rem 0; }
#upshrink_stats .dh-info-card p.inline span:not(.main_icons) { color: inherit; }
.dh-info-recent { grid-column: 1 / -1; }
#display_head.dh-board-heading { margin-block: .85rem; }
#display_head.dh-board-heading h2 { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--dh-text); }
#display_head.dh-board-heading p { color: var(--dh-text-muted); }
#display_head.dh-board-heading span { margin: 0; }
main .dh-index-toolbar, main .dh-topic-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
main .dh-index-toolbar { margin-block: .55rem 0; }
main .dh-topic-controls { padding: .65rem 1rem; background: var(--dh-raised); border-radius: var(--dh-radius) var(--dh-radius) 0 0; }
.dh-index-pages { min-width: 0; }
.dh-sort { position: relative; }
.dh-sort ul { position: absolute; z-index: 6; inset-inline-start: 0; min-width: 10rem; margin: .25rem 0 0; padding: .4rem; list-style: none; background: var(--dh-surface); border: 1px solid var(--dh-border); border-radius: 8px; box-shadow: var(--dh-shadow); }
.dh-sort li a { display: block; padding: .3rem .5rem; }
.dh-topic-title, .dh-topic-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; }
.dh-topic-title { font-size: 1rem; }
.dh-topic-unread .dh-topic-title a, .dh-topic-row.sticky .dh-topic-title a { font-weight: 700; }
.dh-topic-status { display: inline-flex; align-items: center; background: var(--dh-raised); border-radius: 5px; padding: 2px; }
.dh-topic-status .dh-icon { width: 17px; height: 17px; }
.dh-topic-meta { color: var(--dh-text-muted); font-size: .82rem; margin-top: .35rem; }
.dh-topic-meta .dh-avatar { width: 24px; height: 24px; }
#topic_container .dh-topic-row:has(.dh-topic-moderation) { grid-template-columns: 44px minmax(0, 1fr) minmax(90px, 12%) minmax(135px, 23%) auto; }
.dh-topic-moderation { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; max-width: 5rem; }
.dh-topic-moderation br { display: none; }
.dh-topic-moderation input { margin: .35rem; }
#quick_actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: .5rem; padding: .65rem 1rem; border-top: 1px solid var(--dh-border); }
@media (hover: hover) {
    .dh-topic-row:not(:hover, :focus-within) .dh-topic-moderation:not(:has(:checked)) { opacity: .55; }
}
@media (max-width: 767px) {
    .dh-index-row, #topic_container .dh-topic-row, #topic_container .dh-topic-row:has(.dh-topic-moderation) {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: .35rem .55rem;
        padding: .7rem;
    }
    .dh-index-icon-cell { grid-row: 1 / span 3; }
    .dh-index-row .dh-board-symbol { width: 34px; height: 34px; }
    .dh-index-row :is(.dh-index-summary, .dh-index-counts, .dh-index-last, .dh-topic-moderation) { grid-column: 2; }
    .dh-index-counts { display: flex; flex-wrap: wrap; gap: .25rem .65rem; }
    .dh-index-last:not(:empty) { padding-top: .35rem; border-top: 1px solid var(--dh-border); }
    .dh-topic-moderation { max-width: none; }
    #ic_recentposts { display: block; max-width: 100%; overflow-x: auto; }
}

.dh-topic-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--dh-text-muted); }
.dh-topic-legend > span { display: inline-flex; align-items: center; gap: .35rem; }

.dh-site > .dh-content:has(#info_center.dh-info-center) {
    padding-block-end: .65rem;
}
#main_content_section:has(#info_center.dh-info-center) { padding-block-end: 0; }
#display_head.dh-topic-heading { margin: .85rem 0; }
#display_head.dh-topic-heading h2 { margin: 0; color: var(--dh-text); font-weight: 700; line-height: 1.4; }
#display_head.dh-topic-heading :is(p, span) { margin: 0; }
#display_head.dh-topic-heading p { color: var(--dh-text-muted); }
.dh-topic-heading .dh-topic-toolbar { margin-bottom: 0; }
#moderationbuttons.dh-topic-moderation-tools { margin-block: .75rem; }
#moderationbuttons.dh-topic-moderation-tools .buttonlist { display: flex; }
#display_jump_to { margin-block: .75rem; }

#forumposts .dh-topic-post { padding: 0; margin: 0 0 1rem; background: var(--dh-surface); color: var(--dh-text); }
.dh-topic-post .post_wrapper {
    display: grid;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    border-radius: inherit;
}
.dh-topic-post .post_wrapper::after { content: none; }
.dh-topic-post .dh-post-user {
    float: none;
    width: auto;
    min-width: 0;
    padding: .9rem;
    background: var(--dh-raised);
    border-inline-end: 1px solid var(--dh-border);
    border-start-start-radius: var(--dh-radius);
    border-end-start-radius: var(--dh-radius);
    color: var(--dh-text);
    overflow-wrap: anywhere;
}
.dh-poster-top { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.dh-post-user .dh-post-avatar { flex: none; width: 64px; height: 64px; }
.dh-poster-identity { min-width: 0; }
.dh-post-user .dh-poster-identity h4, .dh-post-user .dh-poster-identity h4 a { color: var(--dh-accent); }
.dh-post-user .dh-post-ranks { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.dh-rank { border: 1px solid var(--dh-border); background: var(--dh-surface); color: var(--dh-text); border-radius: 6px; padding-inline: .35rem; font-size: .75rem; }
.dh-post-user .dh-user-info { display: block; list-style: none; margin: .35rem 0 0; padding: 0; color: var(--dh-text-muted); font-size: .82rem; }
.dh-post-user .dh-user-info > li { display: block; }
.dh-post-user .dh-user-info > li.icons:empty { display: none; }
.dh-post-user details { margin-top: .55rem; font-size: .83rem; }
.dh-post-user details summary { cursor: pointer; color: var(--dh-accent); }
.dh-post-user details dl { margin: .35rem 0; }
.dh-post-user details dt { font-weight: 700; }
.dh-post-user details dd { margin: 0 0 .35rem; }
.dh-post-mobile-date { display: none; }
.dh-userinfo-extra:not(:empty) { margin-top: .65rem; }

.dh-topic-post .dh-post-main { margin: 0; min-width: 0; padding: .85rem 1rem; }
.dh-topic-post .dh-post-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .35rem;
    padding: 0 0 .55rem;
    margin: 0;
    border-bottom: 1px solid var(--dh-border);
}
.dh-post-header .subject_title { grid-column: 1; min-width: 0; }
.dh-post-header .subject_title a { color: var(--dh-text); overflow-wrap: anywhere; }
.dh-post-header .dh-post-number { grid-column: 2; grid-row: 1 / span 2; color: var(--dh-accent); }
.dh-post-header .dh-post-date { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--dh-text-muted); }
.dh-post-header .dh-post-date a.smalltext { color: var(--dh-text-muted); opacity: 1; }
.dh-post-header .dh-post-date strong, .dh-post-mobile-date strong { color: inherit; }
.dh-post-header [id$="_quick_mod"] { grid-column: 1 / -1; min-width: 0; }
.dh-post-header [id$="_quick_mod"]:empty { display: none; }
.dh-topic-post .post { min-width: 0; background: var(--dh-surface); }
main .dh-topic-post .dh-post-body {
    max-width: none;
    padding: .8rem 0;
    border: 0;
    color: var(--dh-text);
    overflow-wrap: anywhere;
    word-break: normal;
}
.dh-post-body :is(img, video, iframe), .dh-post-signature img { max-width: 100%; }
.dh-post-body pre { max-width: 100%; overflow: auto; }
.dh-post-body table { display: block; max-width: 100%; overflow-x: auto; }
.dh-topic-post .modified { float: none; color: var(--dh-text-muted); }
.dh-topic-post .modified.mvisible { display: block; margin: .2rem 0 .55rem; }
.dh-topic-post .dh-post-signature .signature { border-color: var(--dh-border); box-shadow: none; color: var(--dh-text-muted); }
.dh-post-main .dh-post-attachments, .dh-post-main .dh-post-attachments fieldset {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    gap: .55rem;
    border-color: var(--dh-border);
    box-shadow: none;
}
.dh-post-main .dh-post-attachments fieldset { grid-column: 1 / -1; min-width: 0; }
.dh-post-attachments .attached {
    float: none;
    min-width: 0;
    margin: 0;
    padding: .55rem;
    border: 1px solid var(--dh-border);
    border-radius: 7px;
    background: var(--dh-raised);
}
.dh-post-attachments .atc_img { max-width: 100%; height: auto; }
.dh-post-attachments .attachments_bot { color: var(--dh-text-muted); overflow-wrap: anywhere; }

.dh-post-main .dh-post-actions, .dh-post-actions .quickbuttons_post, .dh-post-actions :is(.dh-post-likes, ul.floatleft) { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.dh-post-main .dh-post-actions { box-sizing: border-box; padding: .65rem 0 0; border-top: 1px solid var(--dh-border); }
.dh-post-actions .quickbuttons_post, .dh-post-actions :is(.dh-post-likes, ul.floatleft) { float: none; list-style: none; margin: 0; padding: 0; }
.dh-post-actions .quickbuttons_post > li, .dh-post-actions :is(.dh-post-likes, ul.floatleft) > li { float: none; margin: 0; box-shadow: none; border: 0; background: none; }
.dh-post-actions .quickbuttons_post > li > a,
.dh-post-actions .quickbuttons_post summary, .dh-post-actions .msg_like {
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    gap: .22rem;
    padding: .25rem .45rem;
    min-height: 32px;
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    background: var(--dh-raised);
    color: var(--dh-text);
    font-size: .8rem;
    cursor: pointer;
}
.dh-post-actions .dh-post-overflow { position: relative; }
.dh-post-overflow summary { list-style: none; }
.dh-post-actions .dh-post-overflow details[open] > ul {
    display: block;
    position: absolute;
    z-index: 8;
    inset: 100% auto auto 0;
    min-width: 9rem;
    max-width: 45vw;
    padding: .35rem;
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: 7px;
}
.dh-post-overflow ul li { float: none; }
.dh-post-overflow ul li a { color: var(--dh-text); white-space: normal; }
.dh-post-actions-extra:not(:empty) { flex-basis: 100%; }

main .dh-poll { padding: 0; margin-block: .75rem; }
.dh-poll > .cat_bar { margin: 0; padding: .45rem .75rem; border-radius: var(--dh-radius) var(--dh-radius) 0 0; }
.dh-poll #poll_options { padding: .55rem 0; }
.dh-poll #poll_options .dh-poll-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .45rem; align-items: center; }
.dh-poll-result { display: flex; align-items: center; gap: .5rem; margin: 0; }
.dh-poll-result progress { min-width: 0; width: min(100%, 250px); accent-color: var(--dh-accent); }
.dh-poll-result .percentage { position: static; white-space: nowrap; color: var(--dh-text-muted); }
.dh-poll-results dt.voted { font-weight: 700; }
.dh-quick-reply, .dh-topic-review { margin-block: .9rem; }
#quickreply.dh-quick-reply > summary, .dh-topic-review > summary { cursor: pointer; font-weight: 700; color: var(--dh-accent); }
#quickreply.dh-quick-reply .roundframe { padding: .6rem 0 0; margin: 0; border: 0; box-shadow: none; }

.dh-post-form { margin-block: .75rem; }
.dh-post-form #post_area .dh-compose-fields { min-width: 0; border-start-start-radius: 0; border-start-end-radius: 0; }
.dh-compose-panel { margin-block: .65rem; padding: .65rem; border: 1px solid var(--dh-border); border-radius: 8px; background: var(--dh-surface); }
.dh-compose-panel fieldset { min-width: 0; border-color: var(--dh-border); }
.dh-post-form #post_settings .post_options { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin: 0; padding: 0; }
.dh-post-form #postMoreExpandLink { min-height: 36px; }
.dh-post-form #attachment_upload .attach_drop_zone_label { background: var(--dh-raised); color: var(--dh-text); }
.dh-post-form #attachment_upload { border: 2px dashed var(--dh-accent); border-radius: 8px; }
main :is(.dh-post-form, .dh-quick-reply) .sceditor-container { max-width: 100%; box-sizing: border-box; }
main :is(.dh-post-form, .dh-quick-reply) #post_confirm_buttons .dh-btn--primary { background: var(--dh-primary); color: var(--dh-primary-contrast); }
main :is(.dh-post-form, .dh-quick-reply) #post_confirm_buttons .dh-btn--secondary { background: var(--dh-raised); color: var(--dh-text); }
.dh-topic-review .list_posts { overflow-wrap: anywhere; }
.dh-topic-review > .windowbg { margin-top: .7rem; padding: .7rem; border: 1px solid var(--dh-border); border-radius: 7px; }
@media (max-width: 767px) {
    .dh-topic-post .post_wrapper { grid-template-columns: minmax(0, 1fr); }
    .dh-topic-post .dh-post-user { border-inline-end: 0; border-bottom: 1px solid var(--dh-border); border-radius: var(--dh-radius) var(--dh-radius) 0 0; padding: .65rem; }
    .dh-poster-top { flex-direction: row; align-items: center; }
    .dh-post-user .dh-post-avatar { width: 40px; height: 40px; }
    .dh-post-mobile-date { display: block; font-size: .78rem; color: var(--dh-text-muted); }
    .dh-post-header .dh-post-date > a.smalltext { display: none; }
    .dh-topic-post .dh-post-main { padding: .65rem; }
    .dh-post-actions :is(.dh-post-icon-action, .msg_like) { min-width: 36px; justify-content: center; }
    .dh-post-actions .msg_like { font-size: 0; }
    .dh-post-action-text { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
    .dh-post-actions .dh-post-overflow details[open] > ul { inset-inline-start: auto; inset-inline-end: 0; }
    .dh-post-form dl.settings > :is(dt, dd), .dh-post-form #post_header > :is(dt, dd) { float: none; width: auto; margin-inline: 0; }
}

.dh-post-form #attachment_upload.dz-drag-hover { background: var(--dh-raised); }
.dh-topic-post .dh-post-signature { margin: 0; }
.dh-post-body :is(.bbc_standard_quote, .bbc_alternate_quote, .bbc_code),
.dh-topic-review :is(.bbc_standard_quote, .bbc_alternate_quote, .bbc_code) {
    background: var(--dh-raised);
    border-color: var(--dh-border);
    color: var(--dh-text);
}

.dh-topic-neighbors {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .55rem;
    margin-block: .8rem;
}
.dh-topic-navigation, .dh-topic-pages {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}
.dh-topic-navigation { gap: .6rem; }
.dh-topic-toolbar .dh-topic-jump { display: inline-flex; gap: .35rem; align-items: center; }
.dh-topic-pages .pages { margin-inline-end: .15rem; color: var(--dh-text-muted); }
body .dh-topic-toolbar .dh-topic-pages :is(.nav_page, .current_page, .expand_pages) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 2.25rem;
    min-block-size: 2.25rem;
    margin: 0;
    padding: .15rem .4rem;
    border: 1px solid var(--dh-border);
    border-radius: .55rem;
    font-weight: 600;
}
body .dh-topic-toolbar .dh-topic-pages .current_page { border-color: transparent; }
.dh-topic-pages .nav_page:hover { background: var(--dh-surface-muted, var(--dh-surface)); }


[data-dh-zoom-ready] { cursor: zoom-in; }
[data-dh-zoom-ready]:focus-visible { outline: 2px solid var(--dh-accent); outline-offset: 3px; }
.dh-image-viewer {
    box-sizing: border-box;
    max-inline-size: calc(100vw - 1.5rem);
    max-block-size: calc(100dvh - 1.5rem);
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    cursor: zoom-out;
}
.dh-image-viewer::backdrop { background: rgb(0 0 0 / .82); }
.dh-image-viewer img {
    display: block;
    width: auto;
    height: auto;
    max-inline-size: calc(100vw - 1.5rem);
    max-block-size: calc(100dvh - 1.5rem);
    object-fit: contain;
    outline: none;
}
/* Sign-in, registration, recovery and guest notices retain their SMF forms. */
main > .login,
main > form > .login,
main > #registration,
main > .dh-search-page,
main > #fatal_error {
    box-sizing: border-box;
    width: min(100%, 42rem);
    margin: 1rem auto;
    background: var(--dh-surface);
    color: var(--dh-text);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    box-shadow: var(--dh-shadow);
}
main > .login, main > form > .login, main > #registration, main > #fatal_error { padding: 1rem; }
main > #registration { width: min(100%, 46rem); }
main > #registration fieldset { min-width: 0; }
main > #registration :is(.register_form, dl.settings), main .login dl { margin: .65rem 0; }
main :is(#registration, .login) .roundframe { margin: .25rem 0; padding: .6rem 0 0; border: 0; box-shadow: none; }
main :is(.login, #registration, #fatal_error, #searchform) :is(.cat_bar, .title_bar) {
    padding: .35rem .65rem;
    background: var(--dh-raised);
    border: 0;
    border-radius: 6px;
}
main :is(.login, #registration, #searchform) :is(.errorbox, .noticebox), body:is(.action_signup, .action_signup2) main > .errorbox {
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: .65rem .9rem;
}
body:is(.action_signup, .action_signup2) main > .errorbox { max-width: 44rem; margin: 1rem auto; }
main :is(.login, #registration) :is(.verification_control, .post_verification) { background: var(--dh-raised); border-radius: 6px; padding: .6rem; }
main :is(.login, #registration) :is(.smalltext, label), main #fatal_error .padding { color: var(--dh-text); }
main :is(.login, #registration) input[type=submit], main #searchform .dh-btn--primary {
    color: var(--dh-primary-contrast);
    background: var(--dh-primary);
    border-color: transparent;
    border-radius: 6px;
    padding: .35rem .7rem;
    min-height: 38px;
}
main > #fatal_error .windowbg { margin: 0; background: var(--dh-surface); }
#maintenance_mode { max-width: 42rem; }

.dh-profile-heading { margin-block: .85rem; padding: 0 0 .85rem; }
.dh-profile-cover {
    height: clamp(80px, 12vw, 140px);
    border-radius: var(--dh-radius) var(--dh-radius) 0 0;
    background: #2f5d62;
    overflow: hidden;
}
.dh-profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.dh-profile-identity { display: flex; align-items: flex-start; gap: .8rem; padding: .75rem 1rem .35rem; min-width: 0; }
.dh-profile-identity > .dh-avatar { flex: none; margin-top: -1.7rem; border: 3px solid var(--dh-surface); }
.dh-profile-identity h1 { color: var(--dh-text); font-size: clamp(1.2rem, 2vw, 1.65rem); line-height: 1.3; margin: 0 0 .2rem; overflow-wrap: anywhere; }
.dh-profile-meta, .dh-profile-actions, .dh-profile-actions-extra { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.dh-profile-meta { color: var(--dh-text-muted); font-size: .85rem; }
.dh-profile-meta strong { color: inherit; }
.dh-profile-presence::before { content: ""; display: inline-block; margin-inline-end: .35rem; width: .55em; height: .55em; border-radius: 50%; background: var(--dh-text-muted); }
.dh-profile-presence.dh-is-online::before { background: var(--dh-success); }
.dh-profile-actions, .dh-profile-reputation { margin-inline: 1rem; }
.dh-profile-actions:not(:has(a, button, .dh-profile-actions-extra:not(:empty))),
.dh-profile-heading .dh-profile-reputation:empty, .dh-profile-actions-extra:empty { display: none; }
.dh-profile-reputation:not(:empty) { margin-top: .6rem; }
.dh-profile-tabs { gap: .3rem; align-items: flex-start; margin-top: .8rem; }
.dh-profile-tabs > :is(details, .dh-profile-tab) { position: relative; }
.dh-profile-tab { display: flex; align-items: center; }
.dh-profile-tabs :is(a, summary), .dh-pm-menu :is(a, summary) { display: block; padding: .3rem .55rem; border-radius: 6px; color: var(--dh-text); }
.dh-profile-tabs summary, .dh-pm-menu summary { display: list-item; cursor: pointer; }
.dh-profile-tabs a[aria-current=page], .dh-pm-menu a[aria-current=page] { color: var(--dh-accent); background: var(--dh-raised); font-weight: 700; }
.dh-profile-tabs a:hover, .dh-pm-menu a:hover { background: var(--dh-raised); }
.dh-profile-tabs ul, .dh-pm-menu ul { list-style: none; margin: 0; padding: .25rem; }
.dh-profile-tabs details > ul {
    position: absolute;
    z-index: 15;
    inset-block-start: 100%;
    inset-inline-start: 0;
    min-width: 10rem;
    max-width: min(16rem, 70vw);
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: 7px;
    box-shadow: var(--dh-shadow);
}
.dh-profile-tabs ul details > ul { position: static; min-width: 0; box-shadow: none; }
.dh-profile-tabs .dh-page-submenu > summary { font-size: .78rem; color: var(--dh-text-muted); }
#profileview.dh-profile-summary { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 1rem; }
#profileview.dh-profile-summary :is(#basicinfo, #detailedinfo) { float: none; width: auto; min-width: 0; margin: 0; }
#profileview.dh-profile-summary #detailedinfo dt { color: var(--dh-text-muted); }
.dh-profile-panels :is(.title_bar, .cat_bar) { border-radius: 7px; }
.dh-profile-panels :is(dl.settings, fieldset) { border-color: var(--dh-border); }
#profileview.dh-profile-summary .signature { color: var(--dh-text-muted); border-color: var(--dh-border); box-shadow: none; }

.dh-pm-layout { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); align-items: start; gap: 1rem; margin-top: .75rem; }
.dh-pm-menu { padding: .45rem; }
.dh-pm-menu summary { font-weight: 700; color: var(--dh-accent); }
.dh-pm-menu details + details { border-top: 1px solid var(--dh-border); padding-top: .25rem; }
#admin_content.dh-pm-pane { min-width: 0; margin: 0; padding: 0; }
.dh-pm-pane #personal_messages > :is(.windowbg, .roundframe, .information) { border-radius: var(--dh-radius); }
.dh-pm-pane #personal_messages :is(a, .pm_from_to) { overflow-wrap: anywhere; }
.dh-pm-pane #personal_messages .pm_inline_time { color: var(--dh-text-muted); }

#searchform.dh-search-page > fieldset { min-width: 0; padding: 0; border: 0; }
.dh-search-fields { padding: .7rem 0 .3rem; }
.dh-search-fields dl.settings { margin: .45rem 0; }
.dh-search-advanced { margin-block: .6rem; background: var(--dh-surface); border: 1px solid var(--dh-border); border-radius: 8px; padding: .55rem; }
.dh-search-advanced > summary { cursor: pointer; color: var(--dh-accent); font-weight: 700; }
.dh-search-page #advanced_panel_div ul { min-width: 0; }
main .dh-search-heading { display: flow-root; margin-block: .7rem; }
main .dh-feed-card { margin-block: .65rem; min-width: 0; }
main .dh-feed-card .topic_details { color: var(--dh-text-muted); }
main .dh-feed-card .topic_details h5 { overflow-wrap: anywhere; }
main .dh-feed-card .list_posts { overflow-wrap: anywhere; color: var(--dh-text); }
/* SMF sets its highlight foreground with !important. */
main .dh-search-result :is(mark, .highlight) { color: light-dark(#673c00, #ffe0a6) !important; background: light-dark(#f8e4b8, #513a1d); border-radius: .2em; }
.dh-search-result .list_posts { padding-inline: 0; }
#topic_container .dh-unread-row .dh-index-last { display: block; color: var(--dh-text-muted); font-size: .86rem; }
#topic_container .dh-unread-row .dh-index-summary p.floatleft { float: none; margin: .25rem 0 0; color: var(--dh-text-muted); font-size: .86rem; }
#topic_container .dh-unread-row .dh-index-counts p { margin: 0; }
#topic_container .dh-unread-row:has(.moderation) { grid-template-columns: 44px minmax(0, 1fr) minmax(90px, 12%) minmax(135px, 23%) auto; }

#calendar #main_grid, #calendar #month_grid {
    margin-block: .75rem;
    background: var(--dh-surface);
    color: var(--dh-text);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    padding: .65rem;
}
#calendar .calendar_table { width: 100%; border-collapse: separate; border-spacing: 0; border-color: var(--dh-border); }
#calendar .calendar_table :is(th, td) { border-color: var(--dh-border); background: var(--dh-surface); color: var(--dh-text); }
#calendar .calendar_table :is(th, .weeks) { background: var(--dh-raised); }
#calendar .calendar_table td.disabled { background: var(--dh-bg); color: var(--dh-text-muted); }
#calendar .calendar_table .calendar_today { background: var(--dh-raised); color: var(--dh-accent); box-shadow: inset 0 0 0 2px var(--dh-accent); }
#calendar :is(.calendar_table td.dh-holyday, li.dh-holyday) {
    border-inline-start: .25rem solid var(--dh-primary);
    background: light-dark(#fcf4e4, #342b20);
}
#calendar :is(.event_title, .calendar_table .days a) { overflow-wrap: anywhere; }
#calendar #main_grid ul { min-width: 0; }
#calendar .calendar_table strong { color: inherit; }
#calendar .calendar_table .days .event_title a { color: var(--dh-accent); }

/* Keep the default admin screens and apply the palette to their existing panels. */
body.action_admin :is(.generic_menu .dropmenu > li > a, .generic_menu .dropmenu li li a, .generic_menu .dropmenu li li a.chosen) { color: var(--dh-text); }
body.action_admin .generic_menu .dropmenu :is(ul, li li:hover, a.active) { background: var(--dh-raised); border-color: var(--dh-border); text-shadow: none; }
body.action_admin #admin_content :is(.content, .windowbg, .roundframe, .generic_list_wrapper, .descbox, .progress_bar) { background: var(--dh-surface); color: var(--dh-text); border-color: var(--dh-border); }
body.action_admin #admin_content :is(.settings dt, .settings dd, .smalltext, .table_grid th, .table_grid td) { color: var(--dh-text); }
body.action_admin #admin_content .table_grid :is(th, td) { border-color: var(--dh-border); }
body.action_admin #admin_content .table_grid thead th { background: var(--dh-raised); }
body.action_admin #admin_content .table_grid a { color: var(--dh-accent); }
body.action_admin #admin_content :is(.buttonlist .button, .buttonrow .button) { background: var(--dh-raised); color: var(--dh-text); }

@media (max-width: 767px) {
    main :is(#registration, .login, #searchform) dl > :is(dt, dd) { float: none; width: auto; margin-inline: 0; text-align: start; }
    #profileview.dh-profile-summary, .dh-pm-layout { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
    #profileview.dh-profile-summary #basicinfo { border: 0; padding: 0; }
    .dh-profile-meta { display: grid; justify-items: start; }
    .dh-profile-tabs details > ul { position: static; min-width: 0; box-shadow: none; }
    .dh-profile-tabs > .dh-profile-tab:has(details[open]) { align-items: flex-start; flex-direction: column; }
    .dh-pm-menu > details { padding-inline: .2rem; }
    .dh-pm-menu > details > ul { display: flex; flex-wrap: wrap; gap: .2rem; }
    #topic_container .dh-unread-row:has(.moderation) { grid-template-columns: 36px minmax(0, 1fr); }
    #topic_container .dh-unread-row > .moderation { grid-column: 2; }
    #calendar #main_grid { overflow-x: auto; }
    #calendar #main_grid .calendar_table { min-width: 29rem; }
}

.dh-profile-navigation .dh-profile-primary,
.dh-profile-navigation .dh-profile-submenu {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%, 10.5rem),1fr));
    gap: .5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.dh-profile-navigation :is(.dh-profile-primary,.dh-profile-submenu) > li { min-width: 0; list-style: none; }
.dh-profile-navigation :is(.dh-profile-primary,.dh-profile-submenu) > li > a {
    display: flex;
    align-items: center;
    min-height: 2.65rem;
    height: 100%;
    padding: .45rem .7rem;
    border-radius: .5rem;
    border: 1px solid var(--dh-border);
    color: var(--dh-text);
    background: var(--dh-raised);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.dh-profile-navigation :is(.dh-profile-primary,.dh-profile-submenu) > li > a:hover { border-color: var(--dh-accent); color: var(--dh-accent); }
.dh-profile-navigation :is(.dh-profile-primary,.dh-profile-submenu) > li > a[aria-current="page"] {
    background: var(--dh-accent);
    color: light-dark(#fff,#172421);
    border-color: var(--dh-accent);
    font-weight: 700;
}
.dh-profile-navigation .dh-profile-sections { display: block; }
.dh-profile-navigation .dh-profile-section { margin-top: .9rem; }
.dh-profile-navigation .dh-profile-section h3 { margin: 0 0 .35rem; color: var(--dh-text); font-size: .95rem; }
.dh-profile-navigation .dh-profile-submenu { margin-top: .65rem; }
.dh-profile-navigation .dh-page-submenu { margin-top: .2rem; }
@media (max-width: 480px) {
    .dh-profile-navigation :is(.dh-profile-primary,.dh-profile-submenu) {
        grid-template-columns: repeat(auto-fit,minmax(min(100%,8.25rem),1fr));
    }
}
