/* Screen workspace only. The authored print sheets retain their own palette and geometry. */
@media screen {
 html {background:#0d1728;color-scheme:dark}
 html.light {background:#c6b18c;color-scheme:light}
 body[data-sheet-ui] {
  --bg:#0d1728;--bg2:#17283e;--bg3:#213b56;--bg4:#2b4964;
  --paper:#17283e;--border:#3c5570;--border2:#64809a;--rule:#304760;--rule2:#64809a;
  --text:#f5eddc;--text2:#c4d1de;--dim:#a3b5c8;--cyan:#93d5ee;--amber:#edc77e;
  --red:#ff9992;--green:#a6d49c;--blue:#abcafa;--purple:#d6b4f4;
  --input-bg:#102036;--input-border:#5b7793;--capbar:#102238;
  --radius:7px;--shadow:0 3px 9px #0003;--padNav:54px;
  max-width:1800px;padding:0 24px 64px;background:var(--bg);
 }
 body[data-sheet-ui].light {
  --bg:#c6b18c;--bg2:#f1e4c8;--bg3:#e3cc9e;--bg4:#d4b780;
  --paper:#f1e4c8;--border:#b89b67;--border2:#8c6c3d;--rule:#d0ba8b;--rule2:#9e804f;
  --text:#202b3b;--text2:#344052;--dim:#494236;--cyan:#174763;--amber:#603c13;
  --red:#83221e;--green:#204b20;--blue:#24446e;--purple:#60316f;
  --input-bg:#f8eed8;--input-border:#a4895c;--capbar:#183451;
 }
 body[data-sheet-ui] header {
  position:relative;top:auto;z-index:70;min-height:82px;gap:12px;
  padding:16px 0;margin:0;border-bottom:1px solid var(--border);
 }
 body[data-sheet-ui] header h1 {font-family:var(--serif);font-size:28px;letter-spacing:.015em}
 body[data-sheet-ui] header .brand {max-width:min(38vw,420px)}
 body[data-sheet-ui] #workspaceName {overflow:hidden;text-overflow:ellipsis;letter-spacing:0;margin-top:4px}
 body[data-sheet-ui] header h1 .era {font-size:15px;font-family:var(--sans);font-style:normal;letter-spacing:0;color:var(--amber)}
 body[data-sheet-ui] header .brand .sub {display:block;font-size:10px;letter-spacing:.13em;margin-top:0}
 body[data-sheet-ui] #saveIndicator {font-family:var(--sans);font-size:11px;letter-spacing:.03em;padding:5px 9px;min-width:0}
 body[data-sheet-ui] header .sheet-actions {flex-wrap:nowrap;gap:5px}
 body[data-sheet-ui] .sheet-actions>button,
 body[data-sheet-ui] .sheet-menu>summary {
  display:flex;align-items:center;justify-content:center;min-height:42px;min-width:54px;
  padding:8px 13px;border:1px solid var(--border);border-radius:6px;
  background:var(--bg2);color:var(--text2);font:600 13px var(--sans);cursor:pointer;list-style:none;
 }
 body[data-sheet-ui] .sheet-menu>summary::-webkit-details-marker {display:none}
 body[data-sheet-ui] .sheet-menu>summary::after {content:'⌄';padding-left:9px;color:var(--dim)}
 body[data-sheet-ui] .sheet-menu[open]>summary {border-color:var(--cyan);color:var(--cyan);background:var(--bg3)}
 body[data-sheet-ui] .sheet-menu {position:relative}
 body[data-sheet-ui] .sheet-menu-panel {
  position:absolute;right:0;top:calc(100% + 8px);width:226px;padding:7px;
  background:var(--paper);border:1px solid var(--border2);border-radius:9px;
  box-shadow:0 12px 32px #0004;display:grid;gap:3px;z-index:75;
 }
 body[data-sheet-ui] .sheet-menu:not([open])>.sheet-menu-panel {display:none}
 body[data-sheet-ui] header .sheet-menu-panel button {
  width:100%;min-height:44px;text-align:left;padding:9px 12px;border:0;background:transparent;
  color:var(--text);font:500 14px var(--sans);border-radius:4px;
 }
 body[data-sheet-ui] header .sheet-menu-panel button:hover {background:var(--bg3)}
 body[data-sheet-ui] :is(button,summary,a,input,select,textarea):focus-visible {outline:2px solid var(--cyan);outline-offset:3px}
 body[data-sheet-ui] #tabNav {
  position:sticky;top:0;z-index:55;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;
  scrollbar-width:thin;gap:3px;min-height:54px;padding:6px 0;margin:0 0 16px;
  border-bottom:1px solid #896d3f;background:#102238;
 }
 body[data-sheet-ui] .sheet-navigation {display:grid;grid-template-columns:38px minmax(0,1fr) 38px auto;gap:4px;align-items:center;position:sticky;top:0;z-index:55;background:#102238;border:1px solid #896d3f;border-radius:7px;margin-bottom:16px;padding:0 5px}
 body[data-sheet-ui] .sheet-navigation #tabNav {position:static;min-width:0;margin:0;border-bottom:0}
 body[data-sheet-ui] .sheet-nav-step {width:38px;min-width:0;min-height:44px;border:0;border-radius:5px;background:#213b56;color:#e9d6ae;font:24px var(--sans);cursor:pointer}
 body[data-sheet-ui] .sheet-nav-step:disabled {opacity:.3;cursor:default;background:transparent}
 body[data-sheet-ui] #rollDockToggle {position:static;writing-mode:horizontal-tb;min-height:44px;padding:8px 11px;border:1px solid var(--border);border-radius:5px;background:#213b56;color:#f3dfb6;box-shadow:none;font:600 12px var(--sans);letter-spacing:0;white-space:nowrap}
 body[data-sheet-ui] #rollDock {background:var(--paper);color:var(--text);height:100dvh;border-color:var(--border2)}
 body[data-sheet-ui] #rollDock .rd-head {min-height:64px;background:var(--bg3)}
 body[data-sheet-ui] #rollDock .rd-head button {min-height:44px}
 body[data-sheet-ui] #tabNav button {
  flex:none;bottom:0;min-height:40px;padding:9px 15px;border:0;border-radius:5px;
  font:600 13px var(--sans);letter-spacing:.01em;color:#c4d4e3;
 }
 body[data-sheet-ui] #tabNav button.active {background:#e0be77;color:#162439;box-shadow:inset 0 -3px #b48235}
 body[data-sheet-ui] #tabNav>.tab-rule {flex:none;white-space:nowrap;margin:0 0 0 8px;display:flex!important;align-items:center}
 body[data-sheet-ui].pad header {padding:12px 0;margin:0}
 body[data-sheet-ui].pad header .brand .sub {display:block}
 body[data-sheet-ui] #tabContent>.tab {padding-top:0;min-width:0}
 body[data-sheet-ui] :is(.char-main,.char-side,.char-col4,.char-grid)>.section,
 body[data-sheet-ui] #padStrip {border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);background:var(--paper)}
 body[data-sheet-ui] .section h3 {
  margin-bottom:9px;padding:11px 12px;border-radius:7px 7px 0 0;
  border-bottom:1px solid #896d3f;background:var(--capbar);color:#f0d6a3;
  font:700 13px var(--sans);letter-spacing:.05em;text-transform:uppercase;
 }
 body[data-sheet-ui] .section h3 .dim {color:#c4d1de!important;font-size:11px}
 body[data-sheet-ui] .sec-head {font:600 19px var(--serif);border-bottom:1px solid var(--border);padding:12px 0 8px}
 body[data-sheet-ui] table.g {font-variant-numeric:tabular-nums}
 body[data-sheet-ui] table.g th {font-family:var(--sans);font-size:var(--fs10);letter-spacing:.03em;background:var(--bg3);border-width:0 0 1px;border-color:var(--rule2)}
 body[data-sheet-ui] table.g td {border-width:0 0 1px;border-color:var(--rule)}
 body[data-sheet-ui] table.g .val,body[data-sheet-ui] table.g .calc {font-variant-numeric:tabular-nums}
 body[data-sheet-ui] .cell {border-radius:4px;border-color:var(--input-border)}
 body[data-sheet-ui] .eq-card {border-color:var(--border);border-radius:7px;box-shadow:none}
 body[data-sheet-ui] .tab-intro {border-radius:7px;border-color:var(--border);border-left-color:var(--cyan)}
 body[data-sheet-ui] .thr-chip {border-color:var(--border);border-radius:5px}
 body[data-sheet-ui] :is(#tab-magic,#tab-fgrim) .mg-tbl,body[data-sheet-ui] #tab-seen .ss-tbl {max-width:100%}
 body[data-sheet-ui] ::selection {background:#e0be77;color:#162439}
 body[data-sheet-ui] .sheet-navigation :focus-visible {outline-color:#f1d590}
 body[data-sheet-ui] .sheet-navigation #tabNav button:hover {background:#2a4560;color:#fff0d0}
 body[data-sheet-ui] .sheet-navigation #tabNav button.active:hover {background:#edcc89;color:#162439}
 body[data-sheet-ui] #tabContent .def-tile {
  --cyan:#afe2f3;--text2:#d0dbe3;--red:#ffaaa0;--green:#b3dda9;--amber:#f3cd85;--bg4:#2b4964;
  background:#183451;border-color:#826c49;border-top:3px solid #d3ad63;padding:9px 7px;
 }
 body[data-sheet-ui] #tabContent .def-tile .def-val {font:700 30px/1.15 var(--mono);color:#fff0cd;min-height:44px}
 body[data-sheet-ui] .def-lab {font-weight:600;letter-spacing:.06em}
 body[data-sheet-ui] .def-fold {border-top:1px solid var(--border);margin-top:10px;padding-top:5px}
 body[data-sheet-ui] .qref-scroll .included-bonus {background:var(--bg3)!important}
 body[data-sheet-ui] #tabContent .section .stepper .sv {font-weight:700}
 body[data-sheet-ui] :is(.tab-intro,.eq-card,.thr-chip) {background:var(--paper)}
 body[data-sheet-ui] .section:hover {box-shadow:var(--shadow)}
 /* Wide reference tables scroll locally, keeping navigation and other panels in view. */
 body[data-sheet-ui] :is(#tab-magic,#tab-fgrim) .mg-tbl {display:block;overflow-x:auto}
 body[data-sheet-ui] .faith-rites-table,body[data-sheet-ui] .enchantment-table {display:block;max-width:100%;overflow-x:auto}
 body[data-sheet-ui].pad #tabContent #tab-background,body[data-sheet-ui].pad #tabContent #tab-creatures {overflow-x:auto;max-width:100%}
 @media (max-width:900px) {
  body[data-sheet-ui] {padding:0 14px 48px}
  body[data-sheet-ui] header {padding:12px 0;min-height:72px;gap:8px}
  body[data-sheet-ui] header h1 {font-size:21px}
  body[data-sheet-ui] header .brand .sub {font-size:10px;letter-spacing:.08em}
  body[data-sheet-ui] .sheet-actions>button,body[data-sheet-ui] .sheet-menu>summary {min-height:44px;padding:8px 11px}
  body[data-sheet-ui] #tabNav button {min-height:44px;font-size:14px;padding:8px 13px}
 }
 @media (max-width:600px) {
  body[data-sheet-ui] #tab-faith .faith-reference-table,
  body[data-sheet-ui] #tab-faith .faith-reference-table tbody {display:block;width:100%}
  body[data-sheet-ui] #tab-faith .faith-reference-table tr {display:grid;grid-template-columns:minmax(0,1fr) auto auto;margin:12px 0;border:1px solid var(--border);border-radius:6px}
  body[data-sheet-ui] #tab-faith .faith-reference-table tr:has(th) {display:none}
  body[data-sheet-ui] #tab-faith .faith-reference-table td {display:block;min-width:0;width:auto!important;white-space:normal!important;padding:8px}
  body[data-sheet-ui] #tab-faith .faith-reference-table td:nth-child(1) {grid-column:1;grid-row:1}
  body[data-sheet-ui] #tab-faith .faith-reference-table td:nth-child(2) {grid-column:1/-1;grid-row:2}
  body[data-sheet-ui] #tab-faith .faith-reference-table td:nth-child(3) {grid-column:1/-1;grid-row:3}
  body[data-sheet-ui] #tab-faith .faith-reference-table td:nth-child(4) {grid-column:2;grid-row:1}
  body[data-sheet-ui] #tab-faith .faith-reference-table td:nth-child(5) {grid-column:3;grid-row:1}
  body[data-sheet-ui] header .sheet-actions {width:100%;margin-left:0;justify-content:flex-end}
  body[data-sheet-ui] header .brand {margin-right:auto}
  body[data-sheet-ui] header .brand .sub {display:none}
  body[data-sheet-ui].pad header .brand .sub {display:none}
  body[data-sheet-ui] .sheet-menu-panel {width:210px}
  body[data-sheet-ui] header .sheet-actions {position:relative}
  body[data-sheet-ui] .sheet-menu {position:static}
  body[data-sheet-ui].pad .sh-play {grid-template-columns:minmax(0,1fr)}
  body[data-sheet-ui].pad .sh-play>.char-col4 {grid-column:1/-1}
 }
 @media (prefers-reduced-motion:reduce) {
  body[data-sheet-ui] .tab.active {animation:none}
 }
}
@media print {.sheet-navigation{display:none!important}}
