/* Shared catalogue, reference and character-sheet composition.
   Screen-only: existing print layouts, hidden attributes and tab state remain owned
   by their original components. No mission/background/psychotest components here. */
@media screen {
  body.site-design {
    --foba-bg:var(--ds-bg); --foba-card-bg:var(--ds-panel); --foba-border:var(--ds-line);
    --foba-text:var(--ds-text); --foba-text-muted:var(--ds-muted); --foba-accent:var(--ds-accent);
    --ui-bg:var(--ds-bg); --ui-panel:var(--ds-panel); --ui-inset:var(--ds-inset);
    --ui-line:var(--ds-line); --ui-text:var(--ds-text); --ui-muted:var(--ds-muted); --ui-accent:var(--ds-accent);
    --dnd-bg:var(--ds-bg); --dnd-card-bg:var(--ds-panel); --dnd-border:var(--ds-line);
    --dnd-text:var(--ds-text); --dnd-text-muted:var(--ds-muted); --dnd-accent:var(--ds-accent);
    --pf2-bg:var(--ds-bg); --pf2-bg-card:var(--ds-panel); --pf2-border-light:var(--ds-line);
    --pf2-text:var(--ds-text); --pf2-text-muted:var(--ds-muted); --pf2-text-heading:var(--ds-text);
    --pf2-primary:var(--ds-accent); --pf2-font:var(--ds-font); --pf2-font-heading:var(--ds-font);
    --coc-bg:var(--ds-bg); --coc-bg-card:var(--ds-panel); --coc-border-light:var(--ds-line);
    --coc-text:var(--ds-text); --coc-text-muted:var(--ds-muted); --coc-text-heading:var(--ds-text);
    --coc-primary:var(--ds-accent); --coc-font:var(--ds-font); --coc-font-heading:var(--ds-font);
    --c-bg:var(--ds-bg); --c-card:var(--ds-panel); --c-border:var(--ds-line);
    --c-text:var(--ds-text); --c-muted:var(--ds-muted); --c-accent:var(--ds-accent);
    --pip-green:var(--ds-accent); --pip-green-dim:color-mix(in srgb,var(--ds-accent) 12%,transparent);
    --sidebar-top:var(--ds-header-height,116px); --sidebar-w:280px;
  }

  /* The shared content container owns page width and outside padding. */
  body.site-design :is(.helper-section,.foba-container,.rb-container,.gen-container,.foba-list,
    .dnd-section,.pf2-container,.coc-container,.cp-helper-section,.fallout-wrapper,.fallout-terminal,
    .view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,
    .pf2-edit-section,.dashboard-section,.univ-container) {
    box-sizing:border-box; width:100%; max-width:none!important; min-width:0;
    margin:0; padding:0; font-family:var(--ds-font)!important; color:var(--ds-text);
  }
  body.site-design :is(.helper-section,.foba-container,.rb-container,.gen-container,.foba-list,
    .dnd-section,.pf2-container,.coc-container,.cp-helper-section,.fallout-wrapper,.fallout-terminal,
    .view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,
    .pf2-edit-section,.dashboard-section,.lr-main,.lr-sidebar,.univ-container) * {box-sizing:border-box;}
  body.site-design :is(.helper-section,.foba-container,.rb-container,.gen-container,.foba-list,
    .dnd-section,.pf2-container,.coc-container,.cp-helper-section,.fallout-wrapper,.fallout-terminal,
    .view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,
    .pf2-edit-section,.dashboard-section,.lr-main,.lr-sidebar,.univ-container)
    :is(h1,h2,h3,h4,h5,h6,p,a,button,input,select,textarea,label,span,strong,small,summary) {
    font-family:var(--ds-font)!important;
  }
  body.site-design :is(.item-card,.keyword-card,.race-card,.rb-card,.dnd-card,.pf2-item-card,.coc-item-card,
    .item-description,.keyword-description,.feature-content,.rb-card-desc,.race-feature,.rule-text,
    .lr-content,.lr-article,.kw-v-content,.scenario-content,.coc-card-desc,.pf2-description,
    .dnd-detail-body,.card-title,.card-subtitle,.meta-row,.pf2-meta-row,.coc-meta-row,
    .sheet-status,.sheet-formula,.pf2-text-dim,.form-title,.panel-title) {font-family:var(--ds-font)!important;}
  body.site-design :is(.helper-header,.foba-module-header,.rb-header,.gen-header,.dnd-header,.foba-hub-heading,.robco-header,.lr-portal-header) {
    background:var(--ds-panel); border:1px solid var(--ds-line); border-top:3px solid var(--ds-accent);
    border-radius:14px; padding:24px; margin:0 0 24px; gap:16px;
    align-items:center; text-align:left; box-shadow:0 8px 24px #0002;
  }
  body.site-design :is(.helper-header,.foba-module-header,.rb-header,.gen-header,.dnd-header) {flex-wrap:wrap;}
  body.site-design :is(.page-title,.foba-title,.rb-title,.pf2-page-title,.coc-page-title,.cp-section-title,.lr-portal-title,.robco-header h1) {
    color:var(--ds-text); -webkit-text-fill-color:currentColor; background:none; text-shadow:none;
    font-size:clamp(1.65rem,3vw,2.35rem); line-height:1.22; font-weight:650;
    letter-spacing:0; text-transform:none; text-align:left; overflow-wrap:break-word; margin:0;
  }
  body.site-design :is(.pf2-container,.coc-container,.helper-section,.dashboard-section) > :is(.page-title,.pf2-page-title,.coc-page-title) {
    padding:24px; margin:0 0 24px; border:1px solid var(--ds-line); border-top:3px solid var(--ds-accent);
    border-radius:14px; background:var(--ds-panel);
  }
  body.site-design :is(.foba-hub-heading,.robco-header,.lr-portal-header) p {max-width:72ch; margin:12px 0 0; color:var(--ds-muted); line-height:1.65;}
  body.site-design :is(.back-link,.foba-btn-back,.rb-back-btn) {
    min-height:44px; padding:10px 14px; border:1px solid var(--ds-line); background:var(--ds-inset);
    color:var(--ds-accent); border-radius:8px; font-size:.875rem; line-height:1.5; text-decoration:none;
  }

  /* Catalogue and system hubs: grouped, aligned cards, never columns below 100%. */
  body.site-design :is(.helper-section,.fallout-terminal) :is(.grid-2,.keywords-grid),
  body.site-design :is(.rb-grid,.dnd-grid-2,.pf2-grid-2,.coc-grid-2,.cp-cards-grid) {
    grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start;
  }
  body.site-design :is(.dnd-grid-3,.dnd-grid-4,.pf2-grid-3,.pf2-grid-4,.coc-grid-3,.coc-grid-4,.pip-grid),
  body.site-design .helper-section > :is(.grid-3,.grid-4) {
    grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px;
  }
  body.site-design #foba-helper-home .grid-2 {grid-template-columns:repeat(4,minmax(0,1fr))!important; gap:16px!important;}
  body.site-design #foba-helper-home .tool-card h3 {font-family:var(--ds-font)!important;}
  body.site-design .foba-hub-group {margin:0 0 28px; padding:20px; border:1px solid var(--ds-line); border-radius:14px; background:var(--ds-inset);}
  body.site-design .foba-hub-group > h2 {font-size:1.05rem; font-weight:650; color:var(--ds-text); letter-spacing:0; margin:0 0 16px;}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) {
    min-width:0; padding:22px 18px!important; min-height:180px; height:auto;
    border:1px solid var(--ds-line); border-radius:12px; background:var(--ds-panel);
    color:var(--ds-text); box-shadow:none!important; text-shadow:none; transform:none;
    text-align:center; align-items:center; justify-content:flex-start; gap:10px; overflow-wrap:break-word;
  }
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card):hover {
    transform:none; border-color:var(--ds-accent); background:color-mix(in srgb,var(--ds-accent) 7%,var(--ds-panel)); box-shadow:none;
  }
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) :is(h3,p) {
    width:100%; margin:0!important; text-align:center; letter-spacing:0; text-transform:none; line-height:1.5;
  }
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) h3 {font-size:1rem!important; font-weight:600; color:var(--ds-text);}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) p {font-size:.875rem!important; color:var(--ds-muted); opacity:1;}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card) .card-count {position:static; margin-top:auto; align-self:center; padding:4px 8px; font-size:.8rem; color:var(--ds-accent);}
  body.site-design :is(.card-icon,.pip-icon) {filter:none; text-shadow:none; margin:0 0 6px;}
  body.site-design :is(.card-icon,.pip-icon) svg {width:36px; height:36px; color:var(--ds-accent);}
  body.site-design :is(.item-card,.keyword-card,.race-card,.rb-card,.dnd-card,.pf2-item-card,.coc-item-card,.cp-card,.scenario-card) {
    min-width:0; padding:22px; border:1px solid var(--ds-line); border-radius:12px;
    background:var(--ds-panel); color:var(--ds-text); box-shadow:0 4px 16px #0002;
    transform:none; overflow-wrap:break-word;
  }
  body.site-design :is(.item-card,.keyword-card,.race-card,.rb-card,.dnd-card,.pf2-item-card,.coc-item-card,.cp-card):hover {transform:none; border-color:var(--ds-accent);}
  body.site-design :is(.item-header,.keyword-header,.race-header,.rb-card-top) {gap:14px; align-items:flex-start; margin-bottom:16px; min-width:0;}
  body.site-design :is(.item-header h3,.keyword-header h2,.race-header h2,.rb-card-title,.dnd-card .card-title,.cp-card-title) {
    min-width:0; color:var(--ds-text); font-size:1.125rem; line-height:1.4; font-weight:650; margin:0; letter-spacing:0;
  }
  body.site-design :is(.item-description,.keyword-description,.feature-content,.rb-card-desc,.race-feature,.coc-card-desc,.pf2-description,.dnd-detail-body) {
    color:var(--ds-text); font-size:1rem; line-height:1.7;
  }
  body.site-design :is(.item-description,.keyword-description,.feature-content,.coc-card-desc,.pf2-description,.dnd-detail-body) p {margin:0 0 1em;}
  body.site-design :is(.item-meta .meta-row,.dnd-card .meta-row,.pf2-meta-row,.coc-meta-row) {
    display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:baseline;
    gap:8px 16px; padding:8px 0; border-bottom:1px solid var(--ds-line); font-size:.875rem; line-height:1.5;
  }
  body.site-design :is(.meta-row,.pf2-meta-row,.coc-meta-row) .label {min-width:0; color:var(--ds-muted);}
  body.site-design :is(.meta-row,.pf2-meta-row,.coc-meta-row) .value {min-width:0; color:var(--ds-text); text-align:right; overflow-wrap:break-word;}
  body.site-design :is(.cost-badge,.rank-badge,.req-tag,.rb-rank-badge,.item-level,.item-badge) {
    flex-shrink:0; max-width:45%; white-space:normal; padding:5px 8px; font-size:.8rem; line-height:1.4;
    border:1px solid var(--ds-line); border-radius:6px; background:var(--ds-inset); color:var(--ds-accent);
  }
  body.site-design .cost-badge {white-space:nowrap; font-variant-numeric:tabular-nums;}
  /* Cyberpunk RED predates the shared catalogue classes. */
  body.site-design .cp-helper-section > .cp-section-title {padding:24px; margin:0 0 24px; border:1px solid var(--ds-line); border-top:3px solid var(--ds-accent); border-radius:14px; background:var(--ds-panel);}
  body.site-design .cp-layout-container {gap:24px; min-width:0;}
  body.site-design .cp-sidebar-nav {top:calc(var(--ds-header-height,112px) + 12px); max-height:calc(100dvh - var(--ds-header-height,112px) - 24px); background:var(--ds-panel); border:1px solid var(--ds-line); box-shadow:none; padding:16px;}
  body.site-design .cp-nav-link {min-height:44px; padding:10px 12px; color:var(--ds-muted); line-height:1.5;}
  body.site-design .cp-nav-link.active {color:var(--ds-text); border-color:var(--ds-accent); background:color-mix(in srgb,var(--ds-accent) 12%,var(--ds-inset));}
  body.site-design .cp-category-title {color:var(--ds-accent); border-color:var(--ds-line); font-size:1.5rem; line-height:1.4;}
  body.site-design .cp-card::before {background:var(--ds-accent);}
  body.site-design .cp-property-row {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; align-items:baseline;}
  body.site-design .cp-property-label {min-width:0; color:var(--ds-muted); white-space:normal;}
  body.site-design .cp-property-value {min-width:0; color:var(--ds-text); overflow-wrap:break-word;}
  body.site-design .cp-property-value.highlight {color:var(--ds-accent);}
  body.site-design .cp-form-card {background:var(--ds-panel); padding:24px; margin-bottom:24px; border:1px solid var(--ds-line); border-radius:12px; box-shadow:none;}
  body.site-design .cp-form-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:16px;}
  body.site-design .cp-form-label {color:var(--ds-muted); font-size:.875rem; line-height:1.5;}
  body.site-design :is(.cp-form-input,.cp-form-select) {min-height:44px; padding:10px 12px; background-color:var(--ds-inset); color:var(--ds-text); border-color:var(--ds-line); font-size:1rem; line-height:1.5;}
  body.site-design .cp-form-select {padding-right:36px;}
  body.site-design :is(.cp-form-input,.cp-form-select):focus {border-color:var(--ds-accent); background-color:var(--ds-inset); box-shadow:none;}
  body.site-design .cp-checkbox-label {min-height:44px; color:var(--ds-text); background:var(--ds-inset); border-color:var(--ds-line); line-height:1.5;}
  body.site-design .cp-checkbox-label:has(:checked) {border-color:var(--ds-accent); background:color-mix(in srgb,var(--ds-accent) 12%,var(--ds-inset));}
  body.site-design .cp-checkbox-label input:checked + span {color:var(--ds-accent);}
  body.site-design .cp-btn-submit {background:var(--ds-accent); color:#101419; border:1px solid var(--ds-accent); border-radius:8px; min-height:48px; padding:12px 18px; font-size:1rem; line-height:1.5; letter-spacing:0; text-transform:none; white-space:normal; box-shadow:none;}
  body.site-design .cp-btn-submit:hover {transform:none; box-shadow:none; filter:brightness(1.08);}
  body.site-design :is(.expandable-trigger,.dnd-expandable-trigger,.pf2-expandable .expand-trigger,.coc-expandable .expand-trigger) {
    min-height:44px; padding:12px 0; color:var(--ds-accent); line-height:1.5; border-top:1px solid var(--ds-line); margin-top:14px;
  }
  body.site-design :is(.dnd-detail,.pf2-tab-panel,.dnd-detail-section,.coc-detail,.pf2-detail-header,.dnd-detail-header) {
    min-width:0; padding:24px; border:1px solid var(--ds-line); border-radius:12px; background:var(--ds-panel); margin-bottom:20px;
  }
  body.site-design .dnd-detail > :is(.dnd-detail-header,.dnd-detail-section) {padding:0; border:0; background:none; box-shadow:none;}
  body.site-design :is(.dnd-detail-title,.pf2-detail-title,.coc-detail-title) {color:var(--ds-text); line-height:1.25; letter-spacing:0;}

  /* Filters get one stable visual surface; controls retain their own toggles. */
  body.site-design :is(.filter-controls,.rb-controls,.dnd-filters-form,.pf2-filters,.coc-filters) {
    background:var(--ds-panel); padding:20px; border:1px solid var(--ds-line); border-radius:12px;
    margin:0 0 20px; gap:14px;
  }
  body.site-design :is(.filter-primary-row,.dnd-filters-bar,.dnd-filters-row,.pf2-filter-row,.coc-filter-row,.rb-controls) {gap:12px; flex-wrap:wrap; min-width:0;}
  body.site-design :is(.filter-panel,.filter-group,.dnd-filter-dropdown,.search-container) {min-width:0;}
  body.site-design .filter-panel {background:transparent; border:0; border-top:1px solid var(--ds-line); padding:18px 0 0; gap:16px;}
  body.site-design :is(.foba-input,.foba-select,.rb-search,.rb-select,.dnd-search-input,.pf2-search,.coc-search,.pf2-select,.coc-select) {
    min-height:44px; max-width:100%; padding:10px 12px; font-size:1rem; line-height:1.5;
    color:var(--ds-text); background:var(--ds-inset); border:1px solid var(--ds-line); border-radius:8px;
  }
  body.site-design :is(.filter-group label,.pf2-filter-label,.coc-filter-label) {font-size:.875rem; color:var(--ds-muted); margin-bottom:6px; letter-spacing:0; text-transform:none;}
  body.site-design :is(.foba-facet,.foba-ui-summary) {padding:14px 16px; background:var(--ds-inset); border:1px solid var(--ds-line); border-radius:10px; margin-bottom:14px;}
  body.site-design :is(.foba-facet-choice,.foba-ui-chip,.dnd-filter-btn,.pf2-tab-btn,.coc-tab-btn) {min-height:44px; font-size:.875rem; line-height:1.4; white-space:normal;}
  body.site-design :is(.foba-facet-title,.foba-ui-count,.dnd-results-count,.pf2-results-count,.coc-results-count) {font-size:.875rem; color:var(--ds-muted);}
  body.site-design :is(.dnd-filter-menu,.pf2-tooltip-popup,.coc-modal-content) {background:var(--ds-panel); border-color:var(--ds-line); color:var(--ds-text); max-width:calc(100vw - 28px);}
  body.site-design :is(.dnd-pagination,.pf2-pagination,.coc-pagination) {gap:8px; flex-wrap:wrap; padding-block:20px;}
  body.site-design :is(.dnd-pagination a,.pf2-page-btn,.coc-page-btn) {min-width:44px; min-height:44px;}

  /* Rules: retain the working navigation drawer, align body and sidebar. */
  body.site-design .rules-layout {display:grid; grid-template-columns:270px minmax(0,1fr); gap:22px; align-items:start;}
  body.site-design .rules-sidebar {position:sticky; top:calc(var(--ds-header-height,116px) + 16px); max-height:calc(100dvh - var(--ds-header-height,116px) - 32px); overflow-y:auto; padding:18px; border:1px solid var(--ds-line); border-radius:12px; background:var(--ds-panel);}
  body.site-design .rules-content {min-width:0; padding:28px; border:1px solid var(--ds-line); border-radius:14px; background:var(--ds-panel);}
  body.site-design .rule-text {font-size:1rem; line-height:1.8; color:var(--ds-text);}
  body.site-design .rule-text :is(h2,h3,h4) {line-height:1.35; margin:1.6em 0 .7em; scroll-margin-top:calc(var(--ds-header-height,116px) + 24px);}
  body.site-design .rules-content > h2 {font-size:1.55rem; line-height:1.35; color:var(--ds-text); margin:0 0 22px;}
  body.site-design .chapter-link {font-size:.875rem; line-height:1.5; padding:10px 12px; white-space:normal;}
  body.site-design .chapter-nav {gap:16px; flex-wrap:wrap; padding-top:20px;}
  body.site-design .rules-illustration {max-width:100%; height:auto; border-radius:10px;}
  body.site-design .footnotes {padding:16px; background:var(--ds-inset); border:1px solid var(--ds-line); border-radius:8px; line-height:1.7; color:var(--ds-muted);}

  /* Lore was viewport-fixed and shifted only its breadcrumb, not the content shell. */
  body.site-design .content-container:has(> .lr-main) {display:grid; grid-template-columns:280px minmax(0,1fr); gap:24px; align-items:start;}
  body.site-design:has(.lr-main) .breadcrumbs-wrapper {margin-inline:auto!important; padding-inline:24px;}
  body.site-design .lr-sidebar {position:sticky; top:calc(var(--ds-header-height,116px) + 16px); left:auto; bottom:auto; width:100%; height:calc(100dvh - var(--ds-header-height,116px) - 32px); border:1px solid var(--ds-line); border-radius:12px; background:var(--ds-panel); box-shadow:none; z-index:2;}
  body.site-design .lr-main {margin:0; padding:0; min-width:0; min-height:0; color:var(--ds-text); font-family:var(--ds-font);}
  body.site-design :is(.lr-portal,.lr-article) {width:100%; max-width:none; padding:0; margin:0;}
  body.site-design .lr-main > .md {max-width:78ch; padding:28px; border:1px solid var(--ds-line); border-radius:14px; background:var(--ds-panel);}
  body.site-design .lr-main .md {font-size:1rem; line-height:1.8; color:var(--ds-text);}
  body.site-design .lr-main .md h1 {background:none; -webkit-text-fill-color:currentColor; color:var(--ds-text);}
  body.site-design .lr-main .md pre {max-width:100%; overflow-x:auto;}
  body.site-design .lr-cards-grid {gap:18px; grid-template-columns:repeat(2,minmax(0,1fr));}
  body.site-design .lr-card {height:auto; min-height:360px; padding:24px; border:1px solid var(--ds-line); border-radius:12px;}
  body.site-design .lr-side-title {background:none; color:var(--ds-text); -webkit-text-fill-color:currentColor; line-height:1.4;}
  body.site-design :is(.lr-file,.lr-sec-title,.lr-sub-title) {white-space:normal; overflow-wrap:break-word; line-height:1.5; min-height:40px;}
  body.site-design :is(.lr-set-btn,.lr-hub-link) {min-height:44px;}
  body.site-design .lr-tree {min-height:0;}
  body.site-design .ch-nav {margin-top:24px; gap:14px;}

  /* Download cards and broad generators not owned by the generator redesign. */
  body.site-design .foba-sheets {margin:24px 0;}
  body.site-design .foba-sheets .sheet-card {padding:0; background:var(--ds-panel); border-color:var(--ds-line);}
  body.site-design .foba-sheets :is(.sheets-intro,.sheet-description,.sheet-version,.print-help p,.print-help ul) {color:var(--ds-muted);}
  body.site-design .foba-sheets :is(.print-help,.sheet-download) {background:var(--ds-inset); border-color:var(--ds-line);}
  body.site-design :is(.gen-panel,.rb-intro) {background:var(--ds-panel); border:1px solid var(--ds-line); border-radius:12px; padding:22px; margin-bottom:20px;}
  body.site-design .gen-panel .dice-row {gap:14px; padding:14px 0;}
  body.site-design .gen-panel .dice-meaning {min-width:0; line-height:1.65;}
  body.site-design .fallout-wrapper,body.site-design .fallout-terminal {min-height:0; background:transparent; box-shadow:none; border:0; overflow:visible;}
  body.site-design :is(.fallout-wrapper,.fallout-terminal)::before {content:none;}
  body.site-design .robco-header p {border:0; padding:0; opacity:1;}

  /* Sheet chrome: preserve data fields, formulae, and their existing state logic. */
  body.site-design :is(.view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,.pf2-edit-section) {--accent:var(--ds-accent); --card-bg:var(--ds-panel); --border-color:var(--ds-line);}
  body.site-design :is(.view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,.pf2-edit-section) :is(.panel,.char-form-card,.form-card,.pf2-form-card,.pf2-block,.char-header,.pf2-header) {
    min-width:0; background:var(--ds-panel); border:1px solid var(--ds-line); border-radius:12px; padding:24px; box-shadow:none; margin-bottom:20px;
  }
  body.site-design :is(.char-content,.char-info,.pf2-header-info,.pf2-form-group) {min-width:0;}
  body.site-design :is(.char-name,.pf2-char-name,.form-title,.pf2-form-title) {font-size:clamp(1.5rem,3vw,2.25rem); color:var(--ds-text); line-height:1.3; letter-spacing:0; text-transform:none; overflow-wrap:break-word;}
  body.site-design :is(.char-sheet,.pf2-header,.char-info-header,.header-actions,.char-actions,.pf2-header-actions,.sheet-panel-head) {gap:16px;}
  body.site-design .char-sheet {grid-template-columns:220px minmax(0,1fr); padding:24px; background:var(--ds-inset); border:1px solid var(--ds-line); box-shadow:none;}
  body.site-design .view-char-section .char-sheet .char-header {padding:20px;}
  body.site-design .char-sheet .char-sidebar {padding-right:18px; border-color:var(--ds-line); min-width:0;}
  body.site-design .foba-sheets {padding:24px;border:1px solid var(--ds-line);border-radius:14px;background:var(--ds-panel);}
  body.site-design :is(.panel-title,.pf2-block-title,.section-title) {color:var(--ds-text); font-size:1.125rem; line-height:1.45; letter-spacing:0; text-transform:none; margin:0 0 18px; padding-bottom:12px; border-bottom:1px solid var(--ds-line);}
  body.site-design :is(.char-tabs,.pf2-tabs,.view-char-section .tabs-nav) {position:static; padding:8px; margin:0 0 20px!important; gap:8px; background:var(--ds-inset); border:1px solid var(--ds-line); border-radius:10px; flex-wrap:wrap;}
  body.site-design :is(.char-tabs .tab-btn,.pf2-tabs .pf2-tab,.pf2-detail-tab,.view-char-section .tabs-nav .tab-btn) {min-height:44px; flex:1 1 140px; padding:10px 12px; font-size:.875rem; line-height:1.45; text-transform:none; white-space:normal;}
  body.site-design :is(.char-tabs .tab-btn.active,.pf2-tabs .pf2-tab.active,.pf2-detail-tab.active,.view-char-section .tabs-nav .tab-btn.active) {background:color-mix(in srgb,var(--ds-accent) 18%,var(--ds-inset)); color:var(--ds-text); border-color:var(--ds-accent);}
  body.site-design .view-char-section .grid-2-col {grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start;}
  body.site-design .view-char-section .skills-view-list {grid-template-columns:minmax(0,1fr);}
  body.site-design .view-char-section .skills-view-list li {display:grid!important; grid-template-columns:minmax(0,1fr) 3ch; gap:14px; padding:10px 0!important; line-height:1.5; font-size:.9375rem;}
  body.site-design .view-char-section .skills-view-list li span:first-child {min-width:0; overflow-wrap:break-word;}
  body.site-design .view-char-section .skills-view-list li span:last-child {text-align:right; font-variant-numeric:tabular-nums;}
  body.site-design :is(.kw-v-item,.sheet-item,.pf2-feat-accord-card,.pf2-strike-card,.pf2-combat-card,.pf2-ability-card) {background:var(--ds-inset); border-color:var(--ds-line); border-radius:8px;}
  body.site-design .kw-v-header {gap:12px; min-height:52px; line-height:1.5;}
  body.site-design .kw-v-name {min-width:0; overflow-wrap:break-word;}
  body.site-design .kw-v-content {padding:18px; color:var(--ds-text); line-height:1.75; font-size:.9375rem;}
  body.site-design :is(.sheet-counters,.sheet-quick,.pf2-abilities-grid,.pf2-combat-row) {gap:12px;}
  body.site-design .sheet-passives {gap:12px;}
  body.site-design .sheet-passives span {background:var(--ds-inset); padding:14px; border-color:var(--ds-line); line-height:1.5;}
  body.site-design :is(.sheet-status,.sheet-formula,.sheet-counters small,.char-meta,.pf2-text-dim) {color:var(--ds-muted); line-height:1.55;}
  body.site-design :is(.sheet-item-actions,.header-actions,.char-actions,.pf2-header-actions) {flex-wrap:wrap;}
  body.site-design :is(.create-char-section,.edit-char-section) .skill-item {grid-template-columns:minmax(0,1fr) 64px; gap:12px;}
  body.site-design :is(.create-char-section,.edit-char-section) .skill-item label {min-width:0; white-space:normal; line-height:1.5;}
  body.site-design :is(.view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,.pf2-edit-section)
    :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=color]),select,textarea) {
    max-width:100%; min-height:44px; font-size:1rem; line-height:1.5; border-color:var(--ds-line); color:var(--ds-text); background-color:var(--ds-inset);
  }
  body.site-design :is(.view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,.pf2-edit-section)
    :is(button,.btn-action,.btn-submit,.btn-cancel,.action-btn,.pf2-btn) {min-height:44px; white-space:normal; line-height:1.4;}
  body.site-design .stats-skills-container {grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px;}
  body.site-design .char-sheet .skills-list {grid-template-columns:minmax(0,1fr);}
  body.site-design .char-sheet .skill-row {gap:12px; min-width:0; align-items:center; padding:10px 0;}
  body.site-design .char-sheet .skill-name {flex:1; min-width:0; overflow-wrap:break-word;}
  body.site-design .char-sheet .skill-val {flex-shrink:0; font-variant-numeric:tabular-nums;}
  body.site-design .pf2-skills-view-grid {grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 20px;}
  body.site-design .pf2-skill-view-row {display:grid; grid-template-columns:36px minmax(0,1fr) 4ch; gap:10px; min-height:44px;}
  body.site-design .pf2-skill-view-name {white-space:normal; overflow-wrap:break-word;}
  body.site-design .dashboard-grid {grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-bottom:28px;}
  body.site-design .dashboard-section > h2 {margin:28px 0 16px; font-size:1.25rem; line-height:1.4;}
  body.site-design .dashboard-section .character-card {min-width:0; background-color:var(--ds-panel)!important; border:1px solid var(--ds-line)!important; box-shadow:none; border-radius:12px;}
  body.site-design .character-info-box {min-width:0; padding:18px;}
  body.site-design .character-name {white-space:normal; overflow-wrap:break-word; line-height:1.45;}
  body.site-design .rpg-archive {padding:20px; margin:24px 0; border:1px solid var(--ds-line); border-radius:12px; background:var(--ds-panel);}

  /* Universal sheet editor: only its chrome; custom field styles remain intact. */
  body.site-design .univ-container {height:auto; min-height:70dvh; overflow:visible;}
  body.site-design .univ-container .toolbar {height:auto; min-height:64px; flex-wrap:wrap; gap:12px; padding:16px; border:1px solid var(--ds-line); background:var(--ds-panel); border-radius:12px 12px 0 0;}
  body.site-design .univ-container .workspace {min-width:0; overflow:visible; align-items:flex-start;}
  body.site-design .univ-container .sidebar {position:sticky; top:calc(var(--ds-header-height,116px) + 12px); width:240px; max-height:calc(100dvh - var(--ds-header-height,116px) - 24px); background:var(--ds-panel); border-color:var(--ds-line);}
  body.site-design .univ-container .sheet-preview {min-width:0; overflow-x:auto; padding:20px;}
  body.site-design .univ-container .modal {z-index:1400; padding:14px;}
  body.site-design .univ-container .modal-content {width:min(400px,100%); max-width:calc(100vw - 28px); max-height:calc(100dvh - 28px); overflow:auto; background:var(--ds-panel); border-color:var(--ds-line); color:var(--ds-text);}

  /* Scenario reader has its own progress state, so only chrome is restyled. */
  body.site-design .foba-list .controls {padding:20px; margin-bottom:20px; background:var(--ds-panel); border:1px solid var(--ds-line); border-radius:12px;}
  body.site-design .scenario-grid {max-width:none; padding:0; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px;}
  body.site-design .scenario-card {padding:0; overflow:hidden;}
  body.site-design .scenario-content {padding:22px;}
  body.site-design .foba-scenario {width:100%; max-width:none; padding:0; margin:0; gap:18px; min-width:0;}
  body.site-design .foba-scenario :is(h1,h2,h3,h4,p,a,button,label,span,small) {font-family:var(--ds-font)!important;}
  body.site-design .foba-scenario :is(.scenario-header,.sidebar,.status-panel,.card,.node-card,.intro-module) {background:var(--ds-panel); border:1px solid var(--ds-line); border-radius:12px; padding:20px; box-shadow:none;}
  body.site-design .foba-scenario :is(.sidebar,.status-panel) {top:calc(var(--ds-header-height,112px) + 16px); max-height:calc(100dvh - var(--ds-header-height,112px) - 32px); overflow-y:auto;}
  body.site-design .foba-scenario .main-content {min-width:0; padding:0;}
  body.site-design .foba-scenario :is(h2,h3,h4) {letter-spacing:0; text-transform:none; line-height:1.4; color:var(--ds-text);}
  body.site-design .foba-scenario :is(p,.desc,.clue-text) {font-size:1rem; line-height:1.75; color:var(--ds-text);}
  body.site-design .foba-scenario .nav-btn {min-height:44px; padding:10px 12px; line-height:1.5; font-size:.875rem;}
}

@media screen and (max-width:1050px) {
  body.site-design #foba-helper-home .grid-2 {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.site-design :is(.view-char-section .grid-2-col,.stats-skills-container) {grid-template-columns:minmax(0,1fr);}
  body.site-design .char-sheet {grid-template-columns:180px minmax(0,1fr); padding:20px;}
  body.site-design .dashboard-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.site-design .rules-layout {grid-template-columns:230px minmax(0,1fr); gap:18px;}
  body.site-design .content-container:has(> .lr-main) {grid-template-columns:240px minmax(0,1fr); gap:18px;}
  body.site-design .lr-cards-grid {grid-template-columns:minmax(0,1fr);}
}

@media screen and (max-width:900px) {
  body.site-design .cp-sidebar-nav {top:var(--ds-header-height,112px); width:100%; max-height:180px; padding:10px; border-radius:10px;}
  body.site-design .cp-sidebar-nav ul {margin:0; gap:8px;}
  body.site-design .cp-nav-link {white-space:nowrap; padding:10px 12px;}
}

@media screen and (max-width:899px) {
  body.site-design .foba-scenario .sidebar {top:var(--ds-header-height,112px); height:calc(100dvh - var(--ds-header-height,112px)); max-height:calc(100dvh - var(--ds-header-height,112px)); border-radius:0 12px 12px 0;}
}

@media screen and (max-width:768px) {
  body.site-design :is(.helper-header,.foba-module-header,.rb-header,.gen-header,.dnd-header,.foba-hub-heading,.robco-header,.lr-portal-header) {padding:18px; margin-bottom:18px; gap:12px;}
  body.site-design :is(.helper-header,.dnd-header) {align-items:flex-start; flex-direction:column;}
  body.site-design :is(.pf2-container,.coc-container,.helper-section,.dashboard-section) > :is(.page-title,.pf2-page-title,.coc-page-title) {padding:18px; margin-bottom:18px;}
  body.site-design :is(.helper-section,.fallout-terminal) :is(.grid-2,.keywords-grid),
  body.site-design :is(.rb-grid,.dnd-grid-2,.pf2-grid-2,.coc-grid-2,.cp-cards-grid) {grid-template-columns:minmax(0,1fr); gap:16px;}
  body.site-design :is(.dnd-grid-3,.dnd-grid-4,.pf2-grid-3,.pf2-grid-4,.coc-grid-3,.coc-grid-4,.pip-grid),
  body.site-design .helper-section > :is(.grid-3,.grid-4) {grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px;}
  /* Entity grids share the hub's grid-3 class, but their reading cards need full width. */
  body.site-design :is(.dnd-grid,.pf2-grid,.coc-grid):has(> :is(.dnd-card,.pf2-item-card,.pf2-class-card,.coc-item-card)) {grid-template-columns:minmax(0,1fr);}
  body.site-design #foba-helper-home .grid-2 {grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:12px!important;}
  body.site-design .foba-hub-group {padding:14px; margin-bottom:20px;}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) {padding:18px 12px!important; min-height:170px;}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) h3 {font-size:.9375rem!important;}
  body.site-design :is(.item-card,.keyword-card,.race-card,.rb-card,.dnd-card,.pf2-item-card,.coc-item-card,.cp-card) {padding:18px;}
  body.site-design :is(.filter-controls,.rb-controls,.dnd-filters-form,.pf2-filters,.coc-filters) {padding:16px;}
  body.site-design .cp-helper-section > .cp-section-title {padding:18px; margin-bottom:18px;}
  body.site-design .cp-form-card {padding:18px;}
  body.site-design .filter-panel {grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px;}
  body.site-design .dnd-filter-dropdown {flex:0 1 auto;}
  body.site-design .dnd-filter-btn {width:100%;}
  body.site-design .dnd-filter-menu {min-width:0; width:min(280px,calc(100vw - 64px));}
  body.site-design :is(.dnd-detail,.pf2-tab-panel,.dnd-detail-section,.coc-detail,.pf2-detail-header,.dnd-detail-header) {padding:18px;}
  body.site-design .rules-layout {display:block;}
  body.site-design .rules-content {padding:20px 16px!important;}
  body.site-design .rules-sidebar {position:fixed!important; top:var(--ds-header-height,112px)!important; height:calc(100dvh - var(--ds-header-height,112px))!important; max-height:calc(100dvh - var(--ds-header-height,112px)); width:min(88vw,340px)!important; max-width:340px!important; border-radius:0 12px 12px 0; padding:16px; background:var(--ds-panel)!important;}
  body.site-design .sidebar-overlay {top:var(--ds-header-height,112px)!important; height:calc(100dvh - var(--ds-header-height,112px))!important;}
  body.site-design .content-container:has(> .lr-main) {display:block;}
  body.site-design:has(.lr-main) .breadcrumbs-wrapper {padding-inline:14px;}
  body.site-design .lr-sidebar {position:fixed; width:min(82vw,320px); left:calc(-1 * min(82vw,320px)); top:var(--ds-header-height,112px); height:calc(100dvh - var(--ds-header-height,112px)); border-radius:0 12px 12px 0; z-index:1100;}
  body.site-design .lr-sidebar.open {left:0;}
  body.site-design .lr-dtab {z-index:1101; min-width:30px; height:52px;}
  body.site-design .lr-dtab.open {left:min(82vw,320px);}
  body.site-design .lr-overlay {z-index:1099; top:var(--ds-header-height,112px);}
  body.site-design .lr-main > .md {padding:20px 16px;}
  body.site-design .lr-card {min-height:320px; max-height:none; height:auto; padding:22px;}
  body.site-design .ch-nav {flex-wrap:wrap;}
  body.site-design :is(.rules-content,.lr-main,.dnd-detail,.pf2-tab-panel,.coc-container) table {max-width:100%; display:block; overflow-x:auto;}
  body.site-design :is(.view-char-section,.create-char-section,.edit-char-section,.pf2-view-section,.pf2-create-section,.pf2-edit-section) :is(.panel,.char-form-card,.form-card,.pf2-form-card,.pf2-block,.char-header,.pf2-header) {padding:18px; margin-bottom:16px;}
  body.site-design .char-sheet {grid-template-columns:minmax(0,1fr); padding:16px;}
  body.site-design .char-sheet .char-sidebar {padding:0 0 18px; border-right:0; border-bottom:1px solid var(--ds-line);}
  body.site-design .foba-sheets {padding:16px;}
  body.site-design[data-site-system=cyberpunk] .char-sheet .char-sidebar {display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;}
  body.site-design[data-site-system=cyberpunk] .char-sidebar .char-avatar {flex:0 0 82px;width:82px;height:96px;margin:0;}
  body.site-design[data-site-system=cyberpunk] .char-sidebar .char-avatar img {width:100%;height:100%;object-fit:cover;}
  body.site-design[data-site-system=cyberpunk] .char-sidebar .equipped-block {flex:1 1 140px;min-width:0;}
  body.site-design[data-site-system=cyberpunk] .char-sidebar .char-main-stats {flex:1 1 100%;width:100%;}
  body.site-design .char-sheet .char-avatar {max-width:160px; margin-inline:auto;}
  body.site-design .char-sheet .char-main-stats {grid-template-columns:repeat(3,minmax(0,1fr));}
  body.site-design :is(.char-actions,.header-actions,.pf2-header-actions) {width:100%; gap:10px; justify-content:flex-start;}
  body.site-design :is(.char-actions,.header-actions,.pf2-header-actions) > a {margin:0!important;}
  body.site-design :is(.char-tabs .tab-btn,.pf2-tabs .pf2-tab,.pf2-detail-tab,.view-char-section .tabs-nav .tab-btn) {flex-basis:115px; font-size:.8125rem;}
  body.site-design :is(.pf2-row-2,.pf2-form-grid,.pf2-skills-view-grid,.view-char-section .grid-2-col,.create-char-section .grid-2-col,.edit-char-section .grid-2-col) {grid-template-columns:minmax(0,1fr);}
  body.site-design :is(.sheet-counters,.sheet-quick) {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.site-design .sheet-passives {grid-template-columns:minmax(0,1fr);}
  body.site-design :is(.pf2-abilities-grid,.pf2-combat-row) {grid-template-columns:repeat(3,minmax(0,1fr));}
  body.site-design .pf2-combat-row {display:grid;}
  body.site-design .dashboard-grid {grid-template-columns:minmax(0,1fr);}
  body.site-design .univ-container .workspace {flex-direction:column;}
  body.site-design .univ-container .sidebar {position:static; width:100%; max-height:320px; border:1px solid var(--ds-line);}
  body.site-design .univ-container .sheet-preview {width:100%; padding:16px 0;}
  body.site-design .univ-container .toolbar {align-items:flex-start;}
  body.site-design .univ-container :is(.toolbar-left,.toolbar-center,.toolbar-right) {min-width:0; flex-wrap:wrap; gap:8px;}
  body.site-design .scenario-grid {grid-template-columns:minmax(0,1fr);}
  body.site-design .foba-scenario :is(.card,.node-card,.intro-module,.scenario-header) {padding:16px;}
  body.site-design .foba-scenario .sidebar {top:var(--ds-header-height,112px); height:calc(100dvh - var(--ds-header-height,112px)); border-radius:0 12px 12px 0;}
}

@media screen and (max-width:390px) {
  body.site-design :is(.helper-header,.foba-module-header,.rb-header,.gen-header,.dnd-header,.foba-hub-heading) {padding:16px;}
  body.site-design :is(.tool-card,.dnd-tool-card,.pf2-tool-card,.coc-tool-card,.pip-card) {padding:16px 10px!important;}
  body.site-design #foba-helper-home .tool-card h3 {font-size:.8125rem!important;}
  body.site-design .filter-panel {grid-template-columns:minmax(0,1fr);}
  body.site-design :is(.item-header,.keyword-header,.race-header,.rb-card-top) {flex-wrap:wrap;}
  body.site-design :is(.cost-badge,.rank-badge,.req-tag,.rb-rank-badge,.item-level,.item-badge) {max-width:100%;}
  body.site-design :is(.sheet-counters,.sheet-quick,.pf2-abilities-grid,.pf2-combat-row) {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.site-design .foba-sheets .sheet-top {flex-direction:column; align-items:flex-start;}
}
