.tm-search-form { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; padding:8px 0; }
.tm-search-filter { display:flex; flex-direction:column; gap:5px; min-width:0; }
.tm-search-filter label { font-size:12px; line-height:1.4; color:#656565; }
.tm-search-form input[type=search] { flex:1 1 260px; width:auto; min-width:0; padding:9px; font-size:14px; }
.tm-search-form select { max-width:100%; padding:7px; font-size:13px; }
.tm-search-form .tm-first-only { display:inline-flex; align-items:center; gap:5px; margin:0; padding:8px 0; font-size:13px; line-height:1.5; }
.tm-first-only input { margin:0; }
.tm-results { list-style:none; margin:0; padding:0; }
.tm-result { padding:18px 20px; margin-bottom:10px; }
.tm-result h3 { border:0; margin:0 0 8px; padding:0; text-transform:none; font-size:17px; }
.tm-result-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; font-size:12px; color:#656565; margin:0 0 10px; }
.tm-result-meta > a, .tm-author-name { color:inherit; text-decoration:underline; text-underline-offset:3px; }
.tm-author { position:relative; display:inline-flex; align-items:center; gap:2px; }
.tm-author-toggle { display:none; border:0; padding:4px; background:transparent; color:inherit; cursor:pointer; font-size:14px; line-height:1; }
.tm-author-ready .tm-author-toggle { display:inline-flex; }
.tm-author-toggle:focus-visible { outline:2px solid #6d5833; outline-offset:2px; }
.tm-author-card { position:absolute; top:100%; left:0; z-index:20; width:276px; max-width:calc(100vw - 32px); padding:16px; box-sizing:border-box; background:#fffdf8; border:1px solid #b6aa96; border-radius:6px; box-shadow:0 6px 22px #0003; color:#49443b; line-height:1.6; }
.tm-author-card[hidden] { display:none; }
.tm-author-summary { display:flex; align-items:center; gap:12px; }
.tm-author-avatar { display:flex; justify-content:center; align-items:center; flex:0 0 56px; min-height:56px; font-size:32px; }
.tm-author-avatar img { max-width:56px; max-height:64px; width:auto; height:auto; }
.tm-author-avatar .icon { font-size:32px; }
.tm-author-card-name { display:block; overflow-wrap:anywhere; font-weight:bold; font-size:14px; }
.tm-author-stat { display:block; font-size:11px; }
.tm-author-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-top:14px; }
.tm-author-actions .button { padding:6px 12px; }
.tm-result-excerpt { margin:0; line-height:1.8; overflow-wrap:anywhere; }
.tm-result-images { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.tm-result-images a { display:flex; align-items:center; justify-content:center; width:108px; height:82px; padding:4px; box-sizing:border-box; border:1px solid #c9c2b4; border-radius:4px; background:#fff; }
.tm-result-images a:hover, .tm-result-images a:focus { border-color:#6d5833; outline:2px solid #6d5833; outline-offset:1px; }
.tm-result-images img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; }
.tm-result-links { display:flex; flex-wrap:wrap; gap:18px; margin-top:12px; font-size:12px; }
.tm-result-count { display:flex; justify-content:space-between; padding:5px; }
.tm-pages { margin:12px 0 16px; }
.tm-pages ul { display:flex; flex-wrap:wrap; gap:6px; align-items:center; list-style:none; margin:0; padding:0; }
.tm-pages .button { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; min-width:34px; min-height:34px; padding:5px 9px; }
.tm-pages .tm-page-current { background:#f8f6ee; border:2px solid #6d5833; color:#5d492c; font-weight:bold; cursor:default; box-shadow:none; text-shadow:none; }
.tm-page-ellipsis { padding:0 3px; }
.tm-link-broken { display:inline-block; font-size:11px; color:#8b2e24; background:#fff0ed; border:1px solid #e7c9c3; padding:1px 5px; border-radius:3px; vertical-align:baseline; }
.tm-author-materials { margin-top:8px; }
.postprofile .tm-author-materials { display:block; margin-top:12px; }
.postprofile .tm-materials-button { display:inline-flex; align-items:center; gap:5px; padding:7px 11px; font-size:13px; line-height:1.5; white-space:nowrap; }
.tm-topic-section { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; clear:both; margin:18px 0 10px; }
.tm-topic-section h2 { margin:0; padding:0; font-size:18px; }
.tm-topic-section h2 span { margin-left:12px; font-size:13px; font-weight:normal; color:#656565; }
.tm-topic-section-actions { display:flex; flex-wrap:wrap; align-items:center; gap:16px; }
.tm-replies-section { padding-top:18px; margin-top:24px; border-top:1px solid #b6aa96; scroll-margin-top:16px; }
.tm-original-jump { font-size:13px; }
.tm-header-scope { max-width:160px; height:28px; vertical-align:middle; }
.tm-attachment-image { max-width:100%; height:auto; }
.postbody img.tm-topic-image-default { max-width:min(100%, 320px); max-height:220px; width:auto; height:auto; object-fit:contain; }
.postbody img.tm-topic-image-default.tm-image-expanded { max-width:100%; max-height:none; }
.nojs .postbody img.tm-topic-image-default { max-width:100%; max-height:none; }
.tm-image-frame { position:relative; display:inline-block; max-width:100%; vertical-align:top; margin:4px 8px 8px 0; line-height:0; }
.tm-image-frame > a { display:inline-block; max-width:100%; }
.tm-image-frame:focus-visible { outline:2px solid #6d5833; outline-offset:3px; }
.tm-image-frame img { transition:filter .15s; }
.tm-image-actions { position:absolute; inset:0; display:flex; flex-wrap:wrap; justify-content:center; align-content:center; align-items:center; gap:8px; padding:8px; box-sizing:border-box; opacity:0; pointer-events:none; font-size:12px; line-height:1.5; }
.tm-image-actions .button { background:#fffdf8; color:#493a23; border:1px solid #8b7959; text-shadow:none; box-shadow:0 2px 8px #0003; text-decoration:none; }
.tm-image-frame:hover img, .tm-image-frame:focus-visible img, .tm-image-frame:has(:focus-visible) img { filter:brightness(.76); }
.tm-image-frame:hover .tm-image-actions, .tm-image-frame:focus-visible .tm-image-actions, .tm-image-frame:has(:focus-visible) .tm-image-actions { opacity:1; }
.tm-image-frame:hover .tm-image-actions > *, .tm-image-frame:focus-visible .tm-image-actions > *, .tm-image-frame:has(:focus-visible) .tm-image-actions > * { pointer-events:auto; }
.postbody .content .tm-inline-image { display:inline-block; max-width:100%; vertical-align:top; margin:4px 12px 8px 0; }
.postbody dl.tm-image-file { display:inline-block; max-width:100%; vertical-align:top; }
.tm-result-images[hidden], .tm-result-images a[hidden] { display:none; }

/* Browse materials without turning each candidate into a full article. */
.tm-scope-tabs, .tm-home-kinds, .tm-material-jumps { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.tm-scope-tabs a, .tm-home-kinds a, .tm-material-jumps a, .tm-view-switch a { display:inline-flex; align-items:center; gap:5px; padding:8px 12px; border:1px solid #c5baa6; border-radius:5px; background:#fffdf7; color:#594526; text-decoration:none; font-size:13px; }
.tm-scope-tabs a[aria-current], .tm-view-switch a[aria-current] { background:#6d5833; color:#fff; border-color:#6d5833; }
.tm-scope-tabs a:hover, .tm-home-kinds a:hover, .tm-material-jumps a:hover { border-color:#6d5833; }
.tm-category-filter { flex:1 1 180px; max-width:300px; }
.tm-category-filter select { width:100%; }
.tm-result-count { align-items:center; gap:12px; flex-wrap:wrap; }
.tm-view-switch { display:flex; gap:4px; margin-left:auto; }
.tm-result-count > span { margin-right:auto; color:#656565; }
.tm-results { display:grid; gap:12px; }
.tm-result { position:relative; box-sizing:border-box; min-width:0; margin:0; padding:16px; border:1px solid #d4cbbb; border-radius:6px; }
#page-body .tm-result h3 { background:none; color:#594526; margin:0 0 8px; padding:0; line-height:1.5; font-size:16px; overflow-wrap:anywhere; }
#page-body .tm-result h3 a { color:#594526; }
.tm-result-meta { gap:4px 12px; line-height:1.5; margin-bottom:8px; }
.tm-result-excerpt { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:13px; line-height:1.65; margin:0; }
.tm-result-links { margin-top:8px; }
.tm-result-images { margin:0; }
.tm-result-images > a:not(:first-child) { display:none; }
.tm-preview-count, .tm-preview-cycle { position:absolute; top:14px; left:25px; padding:4px 7px; border:1px solid #d4cbbb; border-radius:3px; background:#fffdf7ee; font-size:11px; color:#594526; z-index:1; }
.tm-preview-cycle { cursor:pointer; min-height:28px; }
.tm-preview-cycle:focus-visible { outline:2px solid #6d5833; outline-offset:2px; }
.tm-result-placeholder { display:none; }
.tm-results-list .tm-result-has-image { padding-left:202px; min-height:154px; }
.tm-results-list .tm-result-images { position:absolute; top:14px; left:14px; }
.tm-results-list .tm-result-images a { width:170px; height:124px; }
.tm-results-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tm-results-grid .tm-result { display:flex; flex-direction:column; padding:14px; }
.tm-results-grid .tm-result-images, .tm-results-grid .tm-result-placeholder { order:-1; margin:0 0 12px; }
.tm-results-grid .tm-result-images a, .tm-results-grid .tm-result-placeholder { display:flex; width:100%; height:152px; align-items:center; justify-content:center; border:1px solid #d4cbbb; border-radius:4px; background:repeating-conic-gradient(#f5f2e9 0% 25%,#fffdf7 0% 50%) 50% / 16px 16px; }
.tm-results-grid .tm-result-images > a:not(:first-child) { display:none; }
.tm-results-grid .tm-result-images img { max-width:100%; max-height:140px; }
.tm-results-grid .tm-result-placeholder { color:#c5baa6; font-size:40px; }
.tm-results-grid .tm-result-excerpt { margin-top:auto; }
.tm-results-grid .tm-preview-count, .tm-results-grid .tm-preview-cycle { top:24px; left:24px; }
#page-header .logo { padding:6px 0; }
/* The theme's retina loader sets an inline width. Let both axes scale together. */
#page-header .logo img { width:auto !important; height:auto; max-width:100%; max-height:65px; }
.tm-home-search.panel { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:6px 14px; padding:10px 14px; margin:8px 0 12px; border:1px solid #c5baa6; border-radius:6px; }
.tm-home-search h2 { flex:none; font-size:15px; line-height:1.4; margin:0; padding:0; color:#594526; }
.tm-home-search .tm-search-form { margin:0; padding:0; gap:6px 10px; align-items:center; }
.tm-home-search .tm-search-form input[type=search] { box-sizing:border-box; flex:1 1 200px; max-width:320px; height:32px; padding:5px 8px; font-size:13px; }
.tm-home-search .tm-search-filter { flex:none; flex-direction:row; align-items:center; gap:5px; }
.tm-home-search .tm-search-filter label { white-space:nowrap; font-size:11px; }
.tm-home-search .tm-search-form select { height:32px; padding:4px; font-size:12px; }
.tm-home-search .tm-search-form button { flex:none; min-height:32px; padding:4px 10px; font-size:12px; }
.tm-home-search .tm-search-form > a { font-size:12px; white-space:nowrap; }
.tm-home-kinds { grid-column:2; margin:0; gap:6px; }
.tm-home-kinds a { flex:0 0 auto; justify-content:center; padding:6px 10px; font-size:12px; font-weight:bold; }
.tm-home-directory .forabg { margin-bottom:14px; }
.tm-home-directory .forums .row-item { min-height:42px; padding-top:2px; padding-bottom:2px; }
.tm-home-directory .forumtitle { font-size:14px; }
.tm-home-directory .forum-description { display:none; }
.tm-home-directory .forum-statistics { font-size:10px; }
.tm-home-directory .category-57 .forums { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:12px; }
.tm-home-directory .category-57 .header dd { display:none; }
.tm-home-directory .category-57 .forums > li { min-width:0; }
.tm-home-directory .category-57 .forum-lastpost { display:none !important; }
.tm-home-directory .category-57 .forums .row-item dt { width:100%; }
.tm-home-directory .category-57 .forums .list-inner { margin-right:8px !important; }
.tm-home-directory .category-57 .forums .row-item dt { margin-right:0; }
.tm-home-directory .category-57 .forums dd.lastpost { display:none; }
.tm-home-directory .category-57 .forums .row-item > dd { display:none; }
.tm-forum-preview { float:left; display:flex; align-items:center; justify-content:center; width:108px; height:76px; margin:0 14px 4px 0; border:1px solid #c5baa6; border-radius:4px; background:#fffdf7; }
.tm-forum-preview img { max-width:100%; max-height:100%; width:auto; height:auto; }
.tm-forum-gallery-link { margin:0 0 12px; }
.tm-forum-preview[hidden] { display:none; }
#page-body .tm-result h3 { box-shadow:none; border-radius:0; }
.tm-result-images img { image-rendering:auto; }
.tm-material-jumps { margin:0 0 14px; }
.tm-license-group { display:flex; flex-wrap:wrap; align-items:flex-start; gap:6px; margin:8px 0 14px; max-width:100%; scroll-margin-top:65px; }
.tm-license-group .tm-license-badge { display:block; max-width:100%; height:auto; margin:0; }
.tm-license-group > a { display:block; max-width:100%; }
.tm-license-badge { scroll-margin-top:65px; }
.attachbox { scroll-margin-top:65px; }
.tm-signature { clear:both; margin-top:12px; border-top:1px solid #d4cbbb; padding-top:6px; font-size:11px; color:#706651; }
.tm-signature summary, .tm-profile-details summary { cursor:pointer; }
.tm-signature summary, .tm-profile-details summary { display:list-item; list-style:disclosure-closed inside; }
.tm-signature[open] > summary, .tm-profile-details details[open] > summary { list-style-type:disclosure-open; }
.tm-profile-details { margin-top:8px; }
.postprofile .tm-profile-details dl { border:0; margin:8px 0; padding:0; }
.postprofile .tm-profile-details dd { margin:4px 0; }
.tm-compact-post .postprofile { min-height:0; }
.tm-compact-post .postprofile .avatar img { max-width:52px; max-height:60px; width:auto; height:auto; }
.tm-compact-post .postprofile .tm-materials-button { margin-top:0; padding:5px 8px; font-size:12px; }
@media(min-width:1100px) { .tm-results-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:900px) { .tm-results-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
    .tm-home-search.panel { display:block; padding:8px 10px; }
    .tm-home-search h2 { font-size:13px; }
    .tm-home-search .tm-search-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:6px; margin-top:6px; }
    .tm-home-search .tm-search-form input[type=search] { grid-column:1 / 3; grid-row:1; width:100%; max-width:none; }
    .tm-home-search .tm-search-form button { grid-column:3; grid-row:1; }
    .tm-home-search .tm-search-filter { width:auto; align-items:stretch; flex-direction:column; gap:2px; }
    .tm-home-search .tm-search-filter select { width:100%; height:28px; }
    .tm-home-search .tm-search-form > a { align-self:end; padding-bottom:6px; font-size:11px; }
    .tm-home-kinds { margin-top:8px; gap:4px; }
    .tm-home-kinds a { padding:4px 5px; font-size:11px; }
    .tm-home-directory .category-57 .forums { grid-template-columns:minmax(0,1fr); }
    .tm-category-filter { max-width:none; }
    .tm-scope-tabs { gap:5px; }
    .tm-scope-tabs a { padding:8px; font-size:12px; }
    .tm-results-grid { gap:8px; }
    .tm-results-grid .tm-result { padding:10px; }
    #page-body .tm-results-grid h3 { font-size:14px; }
    .tm-results-grid .tm-result-images a, .tm-results-grid .tm-result-placeholder { height:112px; }
    .tm-results-grid .tm-result-images img { max-height:100px; }
    .tm-results-grid .tm-result-meta { font-size:10px; }
    .tm-results-grid .tm-preview-count, .tm-results-grid .tm-preview-cycle { top:17px; left:17px; font-size:10px; }
    .tm-results-list .tm-result-has-image { padding-left:116px; min-height:122px; }
    .tm-results-list .tm-result-images { left:10px; top:12px; }
    .tm-results-list .tm-result-images a { width:94px; height:94px; }
    .tm-results-list .tm-preview-count, .tm-results-list .tm-preview-cycle { top:16px; left:15px; font-size:10px; }
    .tm-forum-preview { width:76px; height:60px; margin-right:10px; }
    .tm-license-group { gap:5px; }
    .tm-license-group img.tm-license-badge { max-width:min(100%,240px); }
}
@media print {
    .tm-material-jumps, .tm-signature > summary, .tm-profile-details > details > summary { display:none; }
    .tm-signature:not([open]) > *, .tm-profile-details details:not([open]) > * { display:block; }
}
@media (hover:none) {
    .tm-image-frame .tm-image-actions { opacity:1; inset:auto 0 0; padding:5px; background:#0005; }
    .tm-image-frame .tm-image-actions > * { pointer-events:auto; }
}
.tm-image-actions .button { padding:4px 10px; font-size:12px; }
@media print {
    .tm-image-actions { display:none; }
    .postbody img.tm-topic-image-default { max-width:100%; max-height:none; }
}
@media(max-width:600px) {
    .tm-search-form input[type=search] { flex:1 1 calc(100% - 90px); width:0; max-width:none; order:0; }
    .tm-search-form button[type=submit] { order:1; min-height:38px; }
    .tm-search-form .tm-search-filter { order:2; }
    .tm-search-form > select { order:3; }
    .tm-search-form .tm-first-only { order:4; }
    .tm-search-form > a { order:5; }
    .tm-search-form > select, .tm-search-filter { flex:1 1 110px; width:100%; }
    .tm-search-filter select { flex:none; width:100%; }
    .tm-search-form .tm-scope-filter { flex-basis:100%; }
    .tm-search-form .tm-first-only { flex-basis:auto; }
    .tm-compact-post .postprofile .tm-profile-details { display:block; }
    .tm-result { padding:14px; }
    .tm-result h3 { font-size:15px; }
}

.postbody .tm-image-attachments { display:flex; flex-wrap:wrap; gap:8px 16px; float:none; }
.postbody .tm-image-attachments > dt { flex-basis:100%; }
.postbody .tm-image-attachments > dd { clear:none; max-width:100%; }
.postbody .tm-image-file dd { max-width:320px; overflow-wrap:anywhere; font-size:11px; }
@media print {
    .tm-image-frame img { filter:none; }
    .postbody .tm-inline-image, .postbody dl.tm-image-file { display:block; }
}
