/* Shared compact layout. Loaded after page styles; keep content and controls readable. */
:root { --rr-header-height: 60px; --rr-ui-gap: 12px; }
html { scroll-padding-top: calc(var(--rr-header-height) + 60px); }
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
body :is(main,section,article,aside,form,fieldset) { min-width: 0; }
body :is(h1,h2,h3,p,.post-body,.feed-body,.doc-body,.message-body,.list-row,.topic-title) { overflow-wrap: anywhere; }
body :is(img,video,iframe) { max-width: 100%; }
body :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 2px solid #6fefff !important; outline-offset: 3px;
}
body :is(button,a.button,a.btn) { touch-action: manipulation; }
body :is(button,.button,.btn,.form-actions) { white-space: normal; }
body :is(input,select,textarea) { min-width: 0; }
body :is(.form-control,.control,.ctl,.input) { max-width: 100%; }
body :is(.form-help,.form-hint,.note,.field-help) { font-size: 12px; line-height: 1.5; }
body :is(.form-label,.form-field>label,.field>label,.field-head label) { font-size: 12px; line-height: 1.4; }
body :is(.form-control,.control,.ctl,.input) { font-size: 14px; line-height: 1.45; }
body :is(.form-actions,.actions,.hero-actions,.toolbar,.forum-editor-toolbar,.forum-media-tools) { flex-wrap: wrap; gap: 8px; }
body :is(.form-grid,.form-row) { gap: 12px; }
body :is(.form-card,.panel-body) { padding: 16px; }
body :is(.table-wrap,.table-scroll) { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
body :is(.table-wrap,.table-scroll) table { width: 100%; }
body :is(.table-wrap,.table-scroll) :where(th,td) { padding: 10px 12px; font-size: 12px; }
body :is(.tabs,.rr-section-nav,.newsroom-section-nav) { scroll-margin-top: var(--rr-header-height); }
body .rr-header-inner { min-height: 60px; gap: 14px; }
body .rr-brand img { width: 38px; height: 38px; }
body .rr-brand strong { font-size: 16px; letter-spacing: .08em; }
body .rr-brand small { font-size: 9px; letter-spacing: .08em; }
body .rr-nav a { padding-inline: 10px; font-size: 11px; letter-spacing: .025em; }
body .rr-header-tools { gap: 8px; }
body :is(.rr-login-link,.rr-register-link,.rr-config-link) { min-height: 38px; font-size: 10px; }
body .rr-account-chip { min-height: 38px; }
body .rr-account-chip strong { font-size: 11px; }
body .rr-account-chip small { font-size: 9px; }
body .rr-nav-account { display: none; }
body .rr-utility .rr-shell { min-height: 24px; font-size: 9px; letter-spacing: .04em; }
body .rr-footer-grid { min-height: 90px; padding-block: 18px; gap: 16px; }
body .rr-footer-brand span { font-size: 11px; }
body .rr-footer-links { gap: 6px 12px; }
body .rr-footer-links a { display: inline-flex; align-items: center; min-height: 32px; font-size: 11px; }
body .rr-footer-bottom { min-height: 36px; font-size: 10px; gap: 8px; }
body .rr-shortcuts-card { max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 12px; clip-path: none; }
body .rr-shortcuts-grid span { font-size: 13px; }
body .rr-shortcuts-card>p { font-size: 12px; }
body.rr-dialog-open { overflow: hidden; }
body .rr-language-slot:empty { display: none; }
body .reprise-language-switch { z-index: 90; right: auto; left: max(12px,env(safe-area-inset-left)); bottom: max(12px,env(safe-area-inset-bottom)); }
body .reprise-language-switch a { min-width: 34px; height: 34px; }
body .rr-language-slot .reprise-language-switch { position: static; margin: 0; padding: 2px; box-shadow: none; backdrop-filter: none; }
body .rr-language-slot .reprise-language-switch__icon { display: none; }

/* Forum hierarchy: fewer stacked bars, readable category rows and editor labels. */
body .social-main { padding-top: 16px; padding-bottom: 24px; }
body .social-page-hero { padding: 0; }
body .social-page-hero .social-container { padding-block: 20px; }
body .social-page-hero h1 { margin-block: 5px 7px; font-size: clamp(24px,3vw,34px); line-height: 1.15; }
body .social-page-hero p { font-size: 13px; line-height: 1.5; }
body .forum-context-inner { min-height: 48px; gap: 10px; }
body .forum-context-bar .social-nav a { min-height: 48px; font-size: 11px; }
body .forum-context-title { padding-right: 10px; }
body .forum-search-toggle { display: none; }
body .forum-shortcuts-inner { display: flex; padding-block: 6px; gap: 8px; }
body .shortcut-pill { min-height: 38px; padding: 7px 10px; }
body .shortcut-pill strong { font-size: 11px; }
body .shortcut-pill span { display: none; }
body .forum-welcome { padding: 18px; margin-bottom: 14px; gap: 14px; }
body .forum-welcome h1 { font-size: clamp(26px,3.2vw,36px); }
body .forum-welcome p { font-size: 13px; }
body :is(.forum-home-layout,.forum-layout,.social-layout,.topic-layout) { gap: 16px; }
body :is(.category-row,.topic-row) { min-height: 64px; }
body .category-main { padding: 12px; }
body :is(.category-main h3,.category-name) { font-size: 15px; }
body :is(.category-main p,.category-last,.topic-meta,.post-meta,.feed-meta) { font-size: 12px; line-height: 1.45; }
body .section-header p { font-size: 11px; }
body :is(.category-stats,.topic-stats) { font-size: 12px; }
body :is(.button,.btn) { min-height: 38px; font-size: 13px; line-height: 1.35; }
body :is(.editor-tool,.media-tool) { font-size: 12px; }
body .forum-editor-toolbar { display: flex; padding: 8px; gap: 4px; }
body .forum-media-toolbar small { font-size: 12px; line-height: 1.5; }
body .breadcrumbs { padding: 9px 12px; margin-bottom: 12px; font-size: 12px; }
body :is(.post-body,.feed-body,.doc-body,.message-body) { font-size: 14px; line-height: 1.65; }
body .post-body pre { max-width: 100%; overflow-x: auto; }
body .form-card { max-width: 920px; margin-inline: auto; }
body .form-control.textarea { min-height: 160px; }
body .rr-text-counter { font-size: 11px; line-height: 1.4; color: var(--muted,#9ba6c3); text-align: right; text-transform: none; letter-spacing: 0; }
body .rr-text-counter.is-over-limit { color: var(--red,#ff5f7a); font-weight: 700; }
body .forum-fab { right: max(16px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom)); }
body[data-reprise-page="forum-editor"] .forum-fab { display: none; }
body .newsroom-section-nav { top: var(--rr-header-height); }
body .ooc-newsroom-v2 { min-height: 260px; padding: 24px; gap: 20px; }
body .ooc-newsroom-v2 .ooc-newsroom-copy h1 { font-size: clamp(32px,4.5vw,56px); }
body .ooc-feature-v2 { min-height: 300px; }
body .ooc-feature-v2 .ooc-feature-copy { padding: 24px; }
body :is(.avatar-vault-hero,.avatar-progress-hero) { padding: 22px; gap: 20px; }
body .avatar-vault-copy h1 { font-size: clamp(30px,4vw,48px); }

/* Public portal and account pages use their existing components. */
body[data-reprise-page="portal"] .hero { min-height: 560px; padding: 56px 0; }
body[data-reprise-page="portal"] .hero-grid { gap: 32px; }
body[data-reprise-page="portal"] .hero h1 { font-size: clamp(48px,6.8vw,88px); line-height: .95; margin-top: 14px; }
body[data-reprise-page="portal"] .hero-copy { font-size: 16px; line-height: 1.65; margin-top: 18px; }
body[data-reprise-page="portal"] .hero-actions { margin-top: 22px; }
body[data-reprise-page="portal"] .hero-meta { margin-top: 20px; }
body[data-reprise-page="portal"] .section { padding-block: 48px; }
body[data-reprise-page="account"] .hero-inner { padding-block: 22px; gap: 20px; }
body[data-reprise-page="account"] .hero h1 { font-size: 34px; }
body[data-reprise-page="account"] .metric { min-height: 80px; padding: 12px; }
body[data-reprise-page="account"] .metric small { font-size: 11px; }
body[data-reprise-page="account"] .tabs { top: var(--rr-header-height); padding-block: 4px; }
body[data-reprise-page="account"] .tabs a { min-height: 38px; display: inline-flex; align-items: center; font-size: 12px; }
body[data-reprise-page="account"] .layout { gap: 16px; }
body[data-reprise-page="admin"] .side { top: calc(var(--rr-header-height) + 12px); }
body :is(.emx-section,.ems-section,.tools-section) { padding-block: 40px; }
body :is(.emx-hero,.ems-hero,.tools-hero) { padding-block: 32px; }
body :is(.emx-hero-grid,.ems-hero-grid) { gap: 20px; }
body :is(.emx-cards,.ems-grid-3,.ems-split,.emx-advantages) { gap: 12px; margin-top: 22px; }
body[data-reprise-page="tools"] .hero { padding-block: 36px; }
body[data-reprise-page="tools"] .section { padding-block: 36px; }
body[data-reprise-page="tools"] .tool-card { padding: 22px; }
body[data-reprise-page="login"] .card,body[data-reprise-page="register"] .card { padding: 24px; }

@media(max-width:1180px) {
  body .rr-nav a { padding-inline: 8px; }
  body .forum-context-inner { grid-template-columns: auto minmax(0,1fr) auto !important; }
  body .forum-context-bar .social-nav { grid-column: 1/-1; order: 5; display: flex; }
  body .forum-context-bar .social-search { grid-column: 2; min-width: 0; max-width: none; display: flex; }
}
@media(max-width:900px) {
  body .rr-header-inner { min-height: 58px; gap: 8px; }
  body .rr-menu-toggle { width: 44px; height: 44px; }
  body .rr-nav { max-height: calc(100dvh - var(--rr-header-height) - 20px); border-radius: 10px; clip-path: none; }
  body .rr-nav a { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  body .rr-nav-account { display: grid; border-top: 1px solid var(--rr-line); margin-top: 6px; padding-top: 6px; }
  body :is(.rr-shortcut-button,.rr-shortcuts-head button) { min-width: 44px; min-height: 44px; }
  body .rr-nav kbd { display: none; }
  body :is(.rr-section-nav a,.newsroom-section-nav a) { min-height: 44px; font-size: 12px; }
  body[data-reprise-page="portal"] .hero { min-height: 0; padding-block: 32px; }
  body[data-reprise-page="portal"] .hero-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
  body[data-reprise-page="portal"] .section { padding-block: 32px; }
}
@media(max-width:900px),(pointer:coarse) {
  body :is(.button,.btn,.editor-tool,.media-tool,.avatar-filter,.form-control,.control,.ctl,.input) { min-height: 44px; }
  body .editor-tool { min-width: 44px; }
  body main :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]) { font-size: 16px; }
}
@media(max-width:720px) {
  html { min-width: 0; }
  body { min-width: 0; }
  body .rr-shell { width: calc(100% - 24px); }
  body .social-container { width: calc(100% - 24px); }
  body .rr-utility { display: none; }
  body .forum-context-inner { grid-template-columns: auto minmax(0,1fr) auto !important; gap: 8px !important; padding-block: 6px; }
  body .forum-context-title { display: none; }
  body .forum-context-bar .nav-toggle { display: flex; min-height: 44px; padding-inline: 10px; font-size: 13px; }
  body .forum-context-bar .nav-toggle span { display: inline; }
  body .forum-search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-soft); justify-self: start; }
  body .forum-context-bar .social-nav { display: none; grid-column: 1/-1; }
  body.nav-open .forum-context-bar .social-nav { display: flex; }
  body .forum-context-bar .social-nav a { min-height: 44px; }
  body .forum-context-bar .social-search { display: none !important; grid-column: 1/-1; grid-row: 2; order: 6; width: 100%; margin: 0; }
  body.forum-search-open .forum-context-bar .social-search { display: flex !important; }
  body .social-search input { width: 100%; min-height: 44px; font-size: 16px; }
  body .social-search button { min-width: 44px; min-height: 44px; }
  body .forum-context-tools { gap: 4px; }
  body .forum-context-tools .notification-link { width: 44px; min-width: 44px; height: 44px; }
  body .forum-context-tools .notification-link:first-child { display: inline-flex; }
  body .forum-identity-chip { min-height: 44px; padding: 4px; }
  body .forum-shortcuts { display: block; }
  body .forum-shortcuts-inner { overflow-x: auto; flex-wrap: nowrap !important; }
  body .shortcut-pill { flex: 0 0 auto; min-height: 40px; }
  body .social-page-hero .social-container { padding-block: 16px; }
  body .social-page-hero h1 { font-size: 26px; }
  body :is(.forum-home-layout,.forum-layout,.social-layout,.topic-layout) { grid-template-columns: minmax(0,1fr) !important; }
  body .forum-welcome { align-items: flex-start; flex-direction: column; padding: 16px; }
  body .category-row { grid-template-columns: minmax(0,1fr); }
  body :is(.category-stats,.category-last) { padding: 6px 12px; border-left: 0; }
  body :is(.post-card,.editorial-topic .post-card) { grid-template-columns: minmax(0,1fr); }
  body .post-author { width: auto; padding: 12px; }
  body :is(.post-main,.post-content) { min-width: 0; padding: 12px; }
  body :is(.button,.btn,.editor-tool,.media-tool,.avatar-filter) { min-height: 44px; }
  body .editor-tool { min-width: 44px; }
  body :is(.form-control,.control,.ctl,.input) { min-height: 44px; font-size: 16px; }
  body main :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]) { font-size: 16px; }
  body :is(.form-control.textarea,textarea.control,textarea.ctl) { min-height: 160px; }
  body .form-row { grid-template-columns: minmax(0,1fr); }
  body .form-actions { display: flex; flex-direction: row; justify-content: stretch; }
  body .form-actions>* { flex: 1 1 120px; }
  body .form-actions>:last-child { flex-basis: 100%; }
  body :is(.table-wrap,.table-scroll) { scrollbar-width: thin; }
  body :is(.table-wrap,.table-scroll) table { min-width: 600px; }
  body[data-reprise-page="account"] :is(.layout,.hero-inner) { grid-template-columns: minmax(0,1fr); }
  body[data-reprise-page="account"] .form-grid { grid-template-columns: minmax(0,1fr); }
  body[data-reprise-page="account"] .character-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-reprise-page="admin"] .layout { grid-template-columns: minmax(0,1fr); }
  body[data-reprise-page="admin"] .side { position: static; display: flex; overflow-x: auto; }
  body[data-reprise-page="admin"] .side a { flex: 0 0 auto; min-height: 44px; font-size: 12px; }
  body[data-reprise-page="admin"] .side-title { display: none; }
  body[data-reprise-page="admin"] :is(.g2,.g3,.g4) { grid-template-columns: minmax(0,1fr); }
  body :is(.ooc-newsroom-v2,.ooc-feature-v2,.avatar-vault-hero,.avatar-progress-hero) { padding: 16px; min-height: 0; }
  body .ooc-feature-v2 .ooc-feature-copy { padding: 16px; }
  body .rr-footer-links a { min-height: 44px; }
  body[data-reprise-page="history"] .hero-main,body[data-reprise-page="timeline"] .hero-main { padding: 20px 16px; }
  body[data-reprise-page="history"] .hero h1,body[data-reprise-page="timeline"] .hero h1 { font-size: 32px; }
  body :is(.login-card,.register-card) { padding: 20px; }
  body[data-reprise-page="login"] .card,body[data-reprise-page="register"] .card { padding: 20px 16px; }
}
@media(max-width:520px) {
  body .rr-brand { gap: 7px; min-width: 0; }
  body .rr-brand img { width: 32px; height: 32px; }
  body .rr-brand strong { font-size: 12px; letter-spacing: .035em; }
  body .rr-brand small { display: none; }
  body .rr-header-tools { gap: 0; }
  body .rr-language-slot .reprise-language-switch a { min-width: 32px; height: 40px; padding-inline: 3px; }
  body .forum-context-inner { grid-template-columns: auto minmax(0,1fr) auto !important; }
  body .forum-context-tools { grid-column: 3; grid-row: 1; }
  body .forum-context-bar .social-search { grid-column: 1/-1; grid-row: 2; }
  body .forum-welcome h1 { font-size: 28px; }
  body .rr-shortcuts-grid { grid-template-columns: minmax(0,1fr); }
  body[data-reprise-page="account"] .tabs { top: var(--rr-header-height); }
}
@media(max-width:360px) { body .rr-brand span { display: none; } }
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  body :is(a,button,.avatar-card-v2,.editorial-card) { transition: none; }
}
@media print { .rr-language-slot,.forum-fab,.rr-header,.forum-context-bar,.forum-shortcuts { display: none !important; } }
