/* Conan-Wissen: shared Obsidian & Bronze presentation. No application behavior. */
:root{
  --cw-bg:#0d1011;--cw-panel:#141819;--cw-panel-soft:#191d1e;--cw-input:#0c1112;
  --cw-border:#5A482E;--cw-border-hover:#927142;--cw-accent:#D6AB66;
  --cw-text:#e7e1d5;--cw-muted:#bcb5a8;--cw-radius:5px;
  --cw-max-width:1400px;--cw-gutter:clamp(16px,2vw,28px);
  --cw-inner-max:calc(var(--cw-max-width) - 2 * var(--cw-gutter));
  --cw-space:clamp(16px,2vw,24px);--heading-ink:var(--cw-accent);
  --gold:var(--cw-accent);--paper:var(--cw-text);--line:var(--cw-border);
}
body,body.account-page-active,body.profile-page,body.cw-server-page{background:var(--cw-bg);color:var(--cw-text);background-image:none;--account-gold:var(--cw-accent);--account-bronze:var(--cw-border);--profile-gold:var(--cw-accent);--profile-bronze:var(--cw-border);--profile-border:var(--cw-border)}
/* Shared content edges; full-width image banners are deliberately excluded. */
body :is(.header-inner,.legal-header,.footer-inner,.footer-legal,.public-profile-footer){max-width:var(--cw-max-width);margin-inline:auto;padding-inline:var(--cw-gutter);width:100%}
body :is(#homeView.content-wrap,#homeView>.content-wrap),body .beginner-page,body .dungeon-page,body .public-image-page,body .search-admin,body.cw-server-page .cw-directory,body.profile-page .public-profile,body .cw-legal-page{
  width:calc(100% - 2 * var(--cw-gutter));max-width:var(--cw-inner-max);margin-inline:auto;padding-inline:var(--cw-space);min-width:0;
  border:1px solid var(--cw-border);border-radius:var(--cw-radius);background:var(--cw-panel);
  margin-block:var(--cw-space) 40px;
}
body :is(#homeView.content-wrap,#homeView>.content-wrap){padding-block:var(--cw-space) 32px}
body .beginner-page,body .dungeon-page,body .public-image-page,body .search-admin,body.cw-server-page .cw-directory{padding-top:var(--cw-space);padding-bottom:40px}
body .search-admin{margin-block:var(--cw-space)}
body .cw-legal-page{margin-block:var(--cw-space) 40px}
body.community-gallery-active #communityView,body.account-page-active #accountView,body.account-page-active.user-signed-in main>.user-nav{
  width:calc(100% - 2 * var(--cw-gutter));max-width:var(--cw-inner-max);margin-inline:auto;
}
body.community-gallery-active #communityView{padding:var(--cw-space);margin-block:var(--cw-space) 40px;border:1px solid var(--cw-border);border-radius:var(--cw-radius);background:var(--cw-panel)}
body.account-page-active #accountView{padding:0;margin-bottom:40px}
body.account-page-active #accountView :is(.account-heading,.account-body,.account-profile-header){padding:var(--cw-space)}
/* Elegant headings, also in previously independent profile/server/account themes. */
body :is(h1,h2,h3,h4,h5,h6){font-family:Georgia,'Times New Roman',serif!important;color:var(--cw-accent)!important;line-height:1.3;overflow-wrap:anywhere}
body.account-page-active #accountView :is(h2,h3,h4),body.account-page-active #accountView .account-heading .account-welcome-title,
body #communityView :is(h1,h2,h3),body.cw-server-page #main :is(h1,h2,h3),
body.profile-page .public-profile .profile-identity h1,body.profile-page .public-profile .profile-about h2,body.profile-page .public-profile .profile-gallery-heading h2{
  color:var(--cw-accent)!important;font-family:Georgia,'Times New Roman',serif!important;
}
body :is(.category-info strong,.feature-info strong,.catalog-card strong,.result-list strong){color:var(--cw-accent)!important;font-family:Georgia,'Times New Roman',serif!important}
body #homeView .category-info strong{color:var(--cw-accent)!important}
body :is(.hero h1,.hero h2,.portal-banner h2){
  color:var(--cw-accent)!important;text-shadow:0 2px 3px #000,0 0 2px #000;-webkit-text-stroke:.4px #352618;
}
body :is(.hero-inner,.portal-banner-inner){color:var(--cw-text)}
body :is(.hero-eyebrow,.hero-copy,.hero-search-hint,.portal-banner-eyebrow,.portal-banner-copy){color:var(--cw-text);text-shadow:0 1px 3px #000}
body .portal-banner:before{background:linear-gradient(90deg,#0b0e10a6,#0b0e104d 52%,#0b0e1066)}
body .hero:before{background:linear-gradient(90deg,#0b0e1066,#0b0e104d 52%,#0b0e1059)}
body .hero:after{background:none}
body .portal-banner{border-bottom:1px solid var(--cw-border);box-shadow:none}
body.profile-page .portal-banner{border-bottom-width:1px}
/* Dialogs are shared by search details, recipes, maps and account access. */
body dialog{color:var(--cw-text);background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:var(--cw-radius);box-shadow:0 12px 36px #0006;max-width:calc(100% - 32px)}
body dialog::backdrop{background:#000a}
body .account-dialog .account-heading{background:var(--cw-panel-soft);border-color:var(--cw-border)}
body .account-dialog .account-body{background:var(--cw-panel)}
body :is(.dialog-links a,.catalog-types button,.search-form,.search-result,.account-detail-section,.cw-server-form fieldset){border-color:var(--cw-border);border-radius:var(--cw-radius)}
body :is(.account-detail-section,.cw-server-form fieldset){background:var(--cw-panel);min-width:0}
/* Every account subview and independent information group has a complete frame. */
body :is(.account-detail-section,.cw-social-settings,.catalog-panel){border:1px solid var(--cw-border);border-radius:var(--cw-radius);padding:var(--cw-space);min-width:0}
body .beginner-steps{border:0;background:transparent;box-shadow:none;display:grid;gap:var(--cw-space)}
body .beginner-number{border:1px solid var(--cw-border);outline:0}
body :is(.catalog-types,.catalog-pagination,.dialog-links,.image-share-actions){flex-wrap:wrap;min-width:0}
body :is(.catalog-types button,.catalog-pagination button,.dialog-links a){max-width:100%;white-space:normal;overflow-wrap:anywhere}
body :is(.catalog-detail-header>div,.catalog-stats>div,.cw-server-pair>*,.account-pair>*){min-width:0}
body .section-heading h2{white-space:normal}
body :is(.hero-inner,.portal-banner-inner){transform:none}
/* One quiet frame per meaningful group. Legacy specificity is normalized here. */
body :is(.category-card,.feature-card,.search-results,.search-result,.catalog-card,.catalog-component,
 .account-page,.account-quick-actions button,.account-profile,.account-about,.account-public-link,.account-private-details,
 .account-gallery article,.account-image-viewer,.category-row,.category-add,.platform-picker,.gallery-crop,.cw-editor-shell,
 .community-panel,.community-build,.community-empty,.community-card,.community-free,
 .public-profile-card,.public-profile-count,.profile-image-card,
 .cw-server-card,.cw-server-panel,.cw-management-overview,.cw-server-empty,.cw-server-start-guide,
 .cw-server-renewal,.cw-server-notice,.dungeon-world,.dungeon-next,.beginner-step,.beginner-tip,
 .stats-topic,.stats-notice,.draft-notice,.legal-contact,.image-voting){
  border:1px solid var(--cw-border)!important;border-radius:var(--cw-radius)!important;
  background:var(--cw-panel)!important;box-shadow:none!important;min-width:0;
}
body :is(.community-panel,.community-card,.account-about,.account-public-link,.account-private-details,.cw-server-panel,
 .cw-server-empty,.cw-server-start-guide,.dungeon-next,.beginner-tip,.stats-topic,.stats-notice,.draft-notice,.legal-contact){padding:var(--cw-space)}
body .community-panel:before,body .community-panel:after,body .public-profile-count:before,body .profile-gallery:before,body .profile-avatar-frame:after{content:none}
body .profile-avatar-frame{border:1px solid var(--cw-border);background:var(--cw-panel);box-shadow:none;padding:4px}
body :is(.account-avatar,.profile-avatar){border-width:1px;border-color:var(--cw-border)}
body.account-page-active #accountView .account-profile>div{background:var(--cw-panel);border-color:var(--cw-border)}
body.account-page-active #accountView .account-heading{background:var(--cw-panel-soft);border:0;border-bottom:1px solid var(--cw-border);border-radius:var(--cw-radius) var(--cw-radius) 0 0}
body.account-page-active #accountView .account-body{background:transparent;border:0;border-radius:0 0 var(--cw-radius) var(--cw-radius)}
body :is(.cw-editor-toolbar,.cw-editor-footer,.account-profile-header,.image-discover,.community-gallery-heading,.featured-section){border-color:var(--cw-border)}
body :is(.cw-editor-toolbar,.account-viewer-caption,.profile-image-caption,.community-build-content){background:var(--cw-panel-soft)}
body .public-image-page figure{background:var(--cw-panel);border:1px solid var(--cw-border);border-radius:var(--cw-radius);box-shadow:none}
body :is(.cw-server-hero,[data-avatar-canvas],.gallery-crop canvas){border:1px solid var(--cw-border);border-radius:var(--cw-radius)}
body :is(.category-art,.feature-art,.account-gallery img,.profile-image-cover,.community-build-image){box-shadow:none}
body :is(.category-card,.feature-card,.search-result,.catalog-card,.profile-image-card,.community-build,.cw-server-card):hover{border-color:var(--cw-border-hover)!important;box-shadow:none!important}
/* Keep semantic success/error/danger colors rather than making all notices bronze. */
body :is(.account-danger,.account-notice[data-error=true]){border-width:1px;border-radius:var(--cw-radius);box-shadow:none}
/* Controls retain their existing handlers, selected states and native semantics. */
body :is(.account-field input,.account-field textarea,.account-field select,.country-select,.profile-link-field,.image-link-fallback,
 .catalog-filter select,.community-toolbar input,.community-toolbar select,.cw-server-form input:not([type=checkbox]),
 .cw-server-form textarea,.cw-server-form select,.cw-server-filterbar input,.cw-server-filterbar select,.cw-share-url,.search-admin select){
  background:var(--cw-input)!important;border:1px solid var(--cw-border)!important;border-radius:var(--cw-radius)!important;
  color:var(--cw-text);max-width:100%;min-width:0;
}
body :is(.account-edit-menu,.cw-server-nav,.community-tabs,.account-page-menu){gap:8px;flex-wrap:wrap;border-color:var(--cw-border)}
body :is(.account-primary,.cw-button,.community-upload,.profile-gallery-all,.catalog-button,.country-select,.search-admin button){border-width:1px;border-radius:var(--cw-radius);box-shadow:none}
body :is(button,a,input,select,textarea,[contenteditable=true]):focus-visible{outline:2px solid var(--cw-accent);outline-offset:3px}
body :is(.account-checkbox,.cw-checkbox){min-width:0}
body :is(.account-checkbox,.cw-checkbox) input{flex-shrink:0}
body :is(.stats-table,.cw-server-mods){max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
body .stats-table{border:1px solid var(--cw-border);border-radius:var(--cw-radius)}
body .stats-table :is(th,td){border-color:var(--cw-border);background:var(--cw-panel);vertical-align:top}
body .stats-table th{background:var(--cw-panel-soft);color:var(--cw-accent)}
body .stats-table table{margin:0}
body :is(.catalog-stats,.catalog-detail-header,.cw-server-stats,.cw-server-pair,.account-pair,.community-layout,.profile-header-actions){min-width:0}
body :is(.account-body,.catalog-card-copy,.cw-server-card-copy,.community-build-content,.profile-image-caption,.account-public-link,.cw-server-panel){overflow-wrap:anywhere}
body :is(.account-help,.account-profile-note,.catalog-note,.catalog-muted,.legal-date,.image-fullsize-hint){color:var(--cw-muted)}
body .cw-legal-page>article{padding:0;background:transparent}
body .cw-legal-page h1{margin-top:0}
body .cw-legal-page h2{margin-top:28px}
/* Existing page-specific mobile navigation and stacked layouts remain in charge. */
@media(max-width:1100px){
  body .community-layout{grid-template-columns:190px minmax(0,1fr)}
  body .community-sidebar{grid-column:1/-1}
}
@media(max-width:760px){
  body .community-layout{grid-template-columns:minmax(0,1fr)}
  body .community-sidebar{grid-column:auto}
}
@media(max-width:650px){
  body #homeView .category-grid{grid-auto-rows:auto}
  body.account-page-active #accountView .account-profile-header{display:grid;grid-template-columns:auto minmax(0,1fr)}
  body.account-page-active #accountView .account-profile-intro{min-width:0}
  body.account-page-active #accountView .account-header-logout{grid-column:2;justify-self:start;margin:0}
  body.account-page-active #accountView .account-welcome-title{margin-right:0}
  body :is(.account-field input,.account-field textarea,.account-field select,.country-select,.cw-server-form input:not([type=checkbox]),.cw-server-form textarea,.cw-server-form select){font-size:16px}
  body :is(.account-public-actions,.profile-share-buttons,.cw-server-actions){min-width:0;flex-wrap:wrap}
  body .search-admin form{gap:12px}
  body .search-admin label{max-width:100%;min-width:0}
  body :is(.account-edit-menu button,.cw-server-nav a,.community-tabs button){min-height:42px}
  body .profile-header-actions{flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){body :is(.category-card,.feature-card,.catalog-card,.profile-image-cover img,.community-build-image img){transition:none;transform:none!important}}
