:root { --r5-grad-start: #414fa0; --r5-grad-end: #347ea7; }
/* r5: reference-style header and label grids. Poster grids are unchanged. */
body > .tx-wide#top { max-width: 1440px; }
#top > .site-header.compact-header { border-bottom: 0; padding: 16px 0; }
.compact-header .compact-top { flex-wrap: wrap; gap: 12px; }
.compact-header .compact-brand { font-size: clamp(20px, 2.3vw, 30px); line-height: 1.3; background: linear-gradient(100deg, var(--accent), #ffbd62); -webkit-background-clip: text; background-clip: text; color: transparent; }
.compact-header .compact-home { border-radius: 18px; height: 36px; }
.compact-header .compact-search { border-radius: 24px; height: 40px; flex: 0 0 300px; width: 300px; }
.compact-header .compact-search button { background: #f6bb5d; color: #211b13; font-weight: 700; border-left: 0; }
.compact-header .compact-nav, .link-grid, .tag-wrap, .icon-grid, .category-panel { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.compact-header .compact-nav { overflow: visible; margin-top: 18px; }
.compact-header .compact-nav a, .link-card, .tag, .category-row dt a, .category-row dd a { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 34px; padding: 6px 3px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.compact-header .compact-nav a { background: transparent; }
.link-card { text-overflow: clip; }
.category-panel { padding: 0; background: transparent; }
.category-panel .category-row { display: contents; }
.category-panel .category-row dt, .category-panel .category-row dd { margin: 0; padding: 0; min-width: 0; width: auto; line-height: normal; }
.category-panel .category-row dt a, .category-panel .category-row dd a { height: 100%; }
.tags-section .tag-wrap { gap: 5px; }
.tags-section .tag { padding: 6px 3px; font-size: 14px; }
.icon-card img { max-width: 100%; }
.section-title-row { background: linear-gradient(100deg, var(--r5-grad-start), var(--r5-grad-end)); border-bottom: 0; border-radius: 8px; min-height: 42px; padding: 10px 13px; gap: 10px; }
.section-title-row h2 { font-size: 16px; color: #fff; }
.section-title-row .more { color: #fff; font-size: 13px; white-space: nowrap; }
@media (max-width: 760px) {
 .compact-header .compact-nav, .link-grid, .tag-wrap, .icon-grid, .category-panel { grid-template-columns: repeat(5, minmax(0, 1fr)); }
 .compact-header .compact-brand { flex: 1 1 100%; font-size: 21px; }
 .compact-header .compact-search { flex: 1 1 0; width: auto; min-width: 0; height: 36px; }
 .compact-header .compact-home { flex: 0 0 auto; }
 .compact-header .compact-nav { margin-top: 14px; gap: 5px; }
 .compact-header .compact-nav a, .link-card, .tags-section .tag, .category-panel .category-row dt a, .category-panel .category-row dd a { font-size: 12px; padding: 6px 2px; min-height: 34px; }
 .section-title-row { padding: 9px 10px; }
}

/* Keep clearfix pseudo-elements and empty records from occupying icon cells. */
.icon-grid::before, .icon-grid::after { content: none !important; display: none !important; }
.icon-grid > .icon-card[hidden] { display: none !important; }

/* r8: align the icon strip with the full-width content, never drop a configured link. */
.icon-panel { width: 100%; max-width: none; margin: 14px 0; }
.icon-panel .icon-grid { width: 100%; justify-items: start; }
.icon-panel .icon-card { width: 100%; max-width: 80px; justify-self: start; }
.icon-panel .icon-card img[hidden] { display: none !important; }
.icon-panel .icon-card.icon-image-unavailable::before { content: attr(data-icon-label); display: grid; place-items: center; width: 56px; max-width: 100%; height: 56px; flex: 0 0 56px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); color: var(--accent); font-size: 26px; }

/* Match the failed-image placeholder to this theme. */
.icon-panel .icon-card.icon-image-unavailable::before { background: #294779; }

/* Imported rich text is displayed as inert text in security revision r13. */
.article-content { white-space: pre-wrap; overflow-wrap: anywhere; }
