/* Character window and attribute allocation.
 *
 * One of the stylesheets split out of the old style.css. index.html links them
 * in the order they had in that file, so the cascade is unchanged - keep
 * that order when adding a rule, or a later sheet may win where it used to lose. */

/* Character window: equipment, carried items, and one shared inspector.
 * The shell follows the content; only the local lists and copy scroll. */
#character-modal {
  width:min(1500px,calc(var(--safe-vw) - 48px)); height:min(780px,calc(var(--safe-dvh) - 48px)); max-height:none;
  padding:24px 28px 18px; overflow:hidden; border:1px solid #62513b;
  background:url('../assets/ui/character-surface.svg') repeat,
    radial-gradient(ellipse at 12% 38%,#67502d22,transparent 52%),
    linear-gradient(135deg,#262821,#121a1b 70%);
  box-shadow:0 26px 80px #000b; color:#e8dcc5; font:400 14px/1.4 "Segoe UI",system-ui,sans-serif;
  letter-spacing:0; display:flex; flex-direction:column; gap:16px;
}
#character-modal::before {
  content:""; position:absolute; inset:0; pointer-events:none; background:none;
  border:30px solid transparent; border-image:url('../assets/ui/skill-window-frame.svg') 40 / 30px stretch;
  opacity:1; z-index:3;
}
#character-modal[data-view="attributes"] { height:auto; max-height:calc(var(--safe-dvh) - 48px); }
#character-modal button {
  min-width:44px!important; min-height:44px!important; padding:8px 12px!important;
  border:1px solid #4a5049; border-radius:3px; outline:none; box-shadow:none;
  background:#252d2d; color:#e8dcc5; font:600 13px/1.25 "Segoe UI",system-ui,sans-serif;
  text-transform:none; letter-spacing:0; transform:none; pointer-events:auto;
}
#character-modal button:hover:not(:disabled) { background:#303a38; border-color:#b89964; transform:none; }
#character-modal button:focus-visible { outline:2px solid #e9ca8f; outline-offset:2px; }
#character-modal button:disabled { opacity:.5; }
.character-modal-header { display:flex; align-items:center; gap:14px; flex:none; min-height:48px; padding-bottom:12px; border-bottom:1px solid #484336; }
.character-header-title-block { flex:1; min-width:0; position:relative; padding-left:58px; }
.character-header-title-block::before { content:""; position:absolute; left:0; top:50%; width:42px; height:60px; transform:translateY(-50%); background:url('../assets/ui/character-insignia.svg') center/contain no-repeat; opacity:.85; pointer-events:none; }
.character-eyebrow { margin:0; color:#b6a382; font-size:11px; }
#character-modal h2 { margin:0; padding:0; border:0; font:32px/1.1 Georgia,serif; color:#f3e4c5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheet-summary { color:#aeb2a4; font-size:12px; }
#character-modal .character-close-btn { background:transparent; border-color:#4a4b43; flex:none; }
#character-modal .sheet-party { display:flex; gap:4px; flex:none; margin:0; }
#character-modal .sheet-party-member { width:46px; padding:3px!important; display:flex; flex-direction:column; gap:1px; }
#character-modal .sheet-party-member[aria-pressed="true"] { border-color:#c5a36a; background:#383426; }
.sheet-party-face { display:block; width:24px; height:24px; background:center 30% / 135% no-repeat; }
.sheet-party-member[data-job="Warrior"] .sheet-party-face { background-image:url('../assets/characters/warrior.png'); }
.sheet-party-member[data-job="Mage"] .sheet-party-face { background-image:url('../assets/characters/mage.png'); }
.sheet-party-member[data-job="Rogue"] .sheet-party-face { background-image:url('../assets/characters/rogue.png'); }
.sheet-party-name { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.sheet-party-member.fallen .sheet-party-face { filter:grayscale(1) brightness(.6); }
.character-navigation { display:flex; gap:4px; flex:none; }
#character-modal .character-navigation button { background:transparent; border-color:transparent; color:#abb0a4; }
#character-modal .character-navigation button[aria-pressed="true"] { color:#f4deb3; border-bottom-color:#baa06b; border-radius:0; background:#b79a6120; }
.character-points { display:inline-grid; place-items:center; min-width:18px; height:18px; background:#c6a66d; color:#171914; border-radius:10px; font-size:11px; }
.character-compact-label,.character-bag-tab { display:none!important; }
.character-modal-body { display:grid; grid-template-columns:minmax(250px,.95fr) minmax(0,1.45fr) minmax(240px,.8fr); gap:22px; flex:1; min-height:0; }
.character-section { min-width:0; min-height:0; }
.character-section-title { display:flex; align-items:center; gap:12px; margin:0; color:#d5bd8e; font:16px/1.2 Georgia,serif; }
.character-section-title::after { content:""; flex:1; height:1px; background:linear-gradient(90deg,#8c744455,transparent); }
#character-modal[data-view="attributes"] .equipment-pane,
#character-modal[data-view="attributes"] .bag-panel,
#character-modal[data-view="attributes"] .character-inspector { display:none; }
#character-modal:not([data-view="attributes"]) .character-attributes-row { display:none; }
#character-modal[data-view="attributes"] .character-modal-body { flex:0 1 auto; height:auto; }
.equipment-pane { display:flex; flex-direction:column; gap:12px; }
.equipment-layout { display:grid; grid-template-columns:78px minmax(0,1fr) 78px; grid-template-rows:repeat(5,minmax(44px,1fr)); gap:8px 12px; min-height:0; flex:1; }
.paperdoll-portrait { grid-column:2; grid-row:2/5; min-height:0; align-self:stretch; position:relative; background:radial-gradient(ellipse,#a17b3120,transparent 70%); }
.paperdoll-portrait::before { content:""; position:absolute; inset:-15% -18%; background:url('../assets/ui/character-insignia.svg') center/contain no-repeat; opacity:.38; pointer-events:none; }
.sheet-portrait { position:relative; width:100%; height:100%; background:center / contain no-repeat; image-rendering:auto; }
.sheet-portrait[data-job="Warrior"] { background-image:url('../assets/characters/warrior.png'); }
.sheet-portrait[data-job="Mage"] { background-image:url('../assets/characters/mage.png'); }
.sheet-portrait[data-job="Rogue"] { background-image:url('../assets/characters/rogue.png'); }
.equipment-grid-3x3 { display:contents; }
.slot-helmet { grid-column:2; grid-row:1; justify-self:center; width:78px; }
.slot-chest { grid-column:1; grid-row:2; }
.slot-gloves { grid-column:1; grid-row:3; }
.slot-main-hand { grid-column:1; grid-row:4; }
.slot-ring-left { grid-column:1; grid-row:5; }
.slot-amulet { grid-column:3; grid-row:2; }
.slot-boots { grid-column:3; grid-row:3; }
.slot-off-hand { grid-column:3; grid-row:4; }
.slot-ring-right { grid-column:3; grid-row:5; }
#character-modal .equipment-slot { align-self:center; height:min(78px,100%); min-width:0!important; padding:5px!important; display:flex; flex-direction:column; gap:2px; background:#232a27; border-color:#4d5546; overflow:hidden; }
.equipment-slot small { color:#c4c0ab; font-size:11px; }
.equipment-slot-icon { display:grid; place-items:center; width:48px; height:44px; flex:1; min-height:0; }
.equipment-slot-icon img { width:100%; height:100%; object-fit:contain; image-rendering:auto; }
.equipment-slot-name { display:none; }
#character-modal .equipment-slot[data-empty="true"] { background:#161d1b60; border:1px solid #41493d; }
.equipment-slot[data-empty="true"] .equipment-slot-icon { opacity:.5; }
#character-modal .equipment-slot[aria-pressed="true"] { border-color:#d1b373; background:#443d29; }
#character-modal .equipment-slot[data-rarity="rare"] { border-color:#547792; }
#character-modal .equipment-slot[data-rarity="epic"] { border-color:#927aa6; }
#character-modal .equipment-slot[data-rarity="legendary"] { border-color:#be954e; }
#character-modal .equipment-slot[data-rarity="mythic"] { border-color:#b67376; }
.character-inspector { border-left:1px solid #74624355; padding-left:22px; display:flex; flex-direction:column; gap:14px; }
#equipment-inspector { display:flex; flex-direction:column; width:100%; min-height:0; flex:1; gap:8px; }
#bag-inspector { display:flex; flex-direction:column; width:100%; min-height:0; flex:1; }
#character-modal[data-inspector="bag"] #equipment-inspector,
#character-modal[data-inspector="equipment"] #bag-inspector { display:none; }
.equipment-stat-summary { grid-column:2; grid-row:5; align-self:center; text-align:center; max-height:100%; overflow-y:auto; font-size:12px; line-height:1.5; color:#d0bc8f; white-space:pre-line; padding:4px; border:0; }
.equipment-details { padding:0; display:flex; flex-direction:column; flex:1; gap:10px; overflow:hidden; min-height:0; }
.equipment-details .hint { color:#a3aaa1; font:400 13px/1.5 "Segoe UI",system-ui; margin:0; }
.equipment-inspect-content { flex:1; min-height:0; overflow-y:auto; }
.equipment-inspect-header { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:8px; align-items:start; }
.equipment-details-icon { display:flex; align-items:center; justify-content:center; width:100%; height:180px; grid-column:1/-1; overflow:hidden; background:radial-gradient(ellipse,#96743a18,transparent 70%),url('../assets/ui/character-insignia.svg') center/auto 92% no-repeat; }
.equipment-details-icon img { width:100%; height:100%; object-fit:contain; image-rendering:auto; }
.equipment-details-copy { display:flex; flex-direction:column; gap:6px; min-width:0; }
.equipment-details-copy strong { color:#f2e3c7; font:24px/1.2 Georgia,serif; }
.equipment-details-copy small { color:#b4b9ae; font-size:12px; }
.equipment-rarity-tag { font-size:11px; color:#b8af97; margin-right:5px; }
.equipment-rarity-tag[data-rarity="rare"] { color:#91b7d0; }
.equipment-rarity-tag[data-rarity="epic"] { color:#c5afd8; }
.equipment-rarity-tag[data-rarity="legendary"] { color:#e5c17c; }
#character-modal .btn-inspect-close { padding:4px!important; background:transparent; border-color:transparent; font-size:20px; }
#character-modal .btn-inspect-dismiss { display:none; }
.equipment-inspect-lore { margin:10px 0 0; font-size:12px; color:#b4a88e; font-style:italic; }
.equipment-inspect-actions,.unequip-confirmation-prompt .prompt-actions { display:flex; gap:6px; flex-wrap:wrap; }
.equipment-inspect-actions { flex:none; max-height:65%; overflow-y:auto; padding-top:10px; border-top:1px solid #454b40; }
.equipment-inspect-actions button { flex:1; }
.unequip-confirmation-prompt { flex:none; max-height:75%; overflow-y:auto; color:#dcb1a5; font-size:12px; }
.unequip-prompt-text { margin:0 0 8px; }
#character-modal .btn-unequip-action { color:#e8c6aa; border-color:#7e6650; }
#character-modal .bag-panel { padding:0 0 0 18px; border-left:1px solid #74624355; margin:0; display:flex; flex-direction:column; }
#character-modal .bag-panel-heading { margin:0 0 8px; flex:none; }
#character-modal .bag-panel-heading h3 { font:16px/1.2 Georgia,serif; color:#d5bd8e; }
#char-inventory { display:flex; flex-direction:column; flex:1; min-height:0; gap:8px; }
#character-modal .bag-header { padding:0; min-height:44px; flex:none; gap:8px; align-items:center; }
#character-modal .bag-capacity { flex-direction:column; align-items:flex-start; gap:0; }
#character-modal .bag-capacity strong { font-size:18px; color:#e2c795; }
#character-modal .bag-capacity span { font-size:11px; }
#character-modal .bag-grid-frame { min-height:0; flex:1; overflow-y:auto; padding:10px; background:linear-gradient(135deg,#392e1d22,#0b111044); box-shadow:inset 0 2px 14px #0004; scrollbar-color:#726045 #17201d; scrollbar-width:thin; }
#character-modal .bag-grid { grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); gap:8px; align-content:start; }
#character-modal .bag-slot { padding:6px!important; height:84px; aspect-ratio:auto; background:linear-gradient(145deg,#39362a,#202a26); border-color:#696047; outline:none; }
#character-modal .bag-slot.empty { background:transparent; border:1px solid #343e32; }
#character-modal .bag-slot.selected { border-color:#c5a36a; background:#3c3b2c; }
#character-modal[data-inspector="equipment"] .bag-slot.selected { border-color:#454e42; background:#252c29; }
#character-modal[data-inspector="bag"] .equipment-slot[aria-pressed="true"] { background:#232a27; }
#character-modal .bag-slot-name { font-size:11px; color:#c9c9ba; }
#character-modal .bag-slot img,#character-modal .bag-gear-icon img { image-rendering:auto; }
#character-modal .bag-quantity { font:600 11px/1 "Segoe UI",system-ui; border:0; background:#39372b; box-shadow:none; border-radius:2px; }
#character-modal .bag-details { flex:1; min-height:0; margin:0; padding:0; display:flex; flex-direction:column; align-items:stretch; gap:10px; overflow:hidden; background:transparent; border:0; }
.bag-detail-icon { display:flex; align-items:center; justify-content:center; width:100%; height:180px; margin:0 0 10px; overflow:hidden; background:radial-gradient(ellipse,#96743a18,transparent 70%),url('../assets/ui/character-insignia.svg') center/auto 92% no-repeat; }
.bag-detail-icon img { width:100%; height:100%; object-fit:contain; image-rendering:auto; }
#character-modal .bag-detail-copy { display:block; flex:1; min-height:0; overflow-y:auto; }
#character-modal .bag-detail-copy strong { display:block; font:24px/1.2 Georgia,serif; color:#f2e3c7; margin-bottom:8px; }
#character-modal .bag-detail-copy small { display:block; font-size:12px; line-height:1.5; color:#b4b9ae; }
#character-modal .bag-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; flex:none; max-height:65%; overflow-y:auto; padding-top:10px; border-top:1px solid #454b40; background:transparent; }
#character-modal .bag-actions button { flex:1 1 auto; min-width:0!important; font-size:12px!important; padding:7px 10px!important; }
#character-modal .bag-action-equip,#character-modal .bag-action-drink { color:#f5e1b8; border-color:#a18b5e; background:#403c2c; }
#character-modal .bag-action-discard { color:#d5a69c; }
#character-modal .bag-give-qty { height:44px; font:inherit; }
#character-modal .bag-give-field { font-size:12px; }
#character-modal .bag-empty-note { font-size:13px; }
#character-modal .bag-party-supplies { flex:none; max-height:70px; overflow-y:auto; margin:0; }
#character-modal .bag-party-supplies-title { font-size:11px; }
#character-modal .bag-party-supply { font-size:12px!important; }
#character-modal .discard-confirmation-prompt { width:100%; flex:1 0 100%; padding:8px; background:#342725; border-color:#6e5148; }
#character-modal .discard-confirmation-prompt p { font-size:12px; color:#e0bfb3; }
#character-modal #char-inventory[data-capacity="8"] .bag-grid { grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); }
.bag-space { display:flex; align-items:center; gap:10px; flex:none; padding:4px 2px; color:#b3b8a3; font-size:11px; }
.bag-space progress { appearance:none; flex:1; width:0; height:4px; border:0; background:#343d31; }
.bag-space progress::-webkit-progress-bar { background:#343d31; }
.bag-space progress::-webkit-progress-value { background:#ae9059; }
.bag-space progress::-moz-progress-bar { background:#ae9059; }
#character-modal .gear-stat-diffs { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:8px; font-size:12px; }
#character-modal .diff-label { color:#a9b3a8; }
#character-modal .stat-diff.positive { color:#a9c88e; font-weight:500; }
#character-modal .stat-diff.negative { color:#dea79c; font-weight:500; }
.character-attributes-row { grid-column:1/-1; display:grid; grid-template-columns:1fr; max-height:calc(var(--safe-dvh) - 210px); overflow-y:auto; align-content:start; }
#character-modal #stat-block { border:0; padding:0; margin:0; }
.ability-bar-block[hidden] { display:none; }
.ability-bar-block { margin-top:12px; padding-top:10px; border-top:1px solid #41473d; }
.ability-bar-block .eyebrow { margin:0 0 8px; }
.ability-bar-list { display:grid; grid-template-columns:1fr; gap:6px; }
.ability-bar-card { display:flex; align-items:center; flex-wrap:wrap; gap:8px 10px; width:100%; min-height:44px; padding:7px 10px; text-align:left; background:rgba(21,24,22,0.78); border:1px solid #3f473c; border-radius:8px; color:#d8ded6; }
.ability-bar-card.is-equipped { border-color:#8aa77d; background:rgba(37,49,38,0.68); }
.ability-bar-art { flex:none; width:30px; height:30px; display:grid; place-items:center; border-radius:6px; background:rgba(12,14,13,0.75); border:1px solid rgba(255,255,255,0.08); }
.ability-bar-art img { width:24px; height:24px; object-fit:contain; image-rendering:auto; }
.ability-bar-copy { min-width:0; flex:1 1 180px; display:flex; flex-direction:column; gap:2px; }
.ability-bar-head { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; }
.ability-bar-name { font-size:13px; color:#edf3ea; }
.ability-bar-cost { font-size:11px; color:#d9c27e; font-weight:600; }
.ability-bar-slot { margin-left:auto; font-size:11px; color:#9eb29d; }
.ability-bar-card.is-equipped .ability-bar-slot { color:#c9e2be; font-weight:600; }
.ability-bar-desc { font-size:11px; color:#aab4a9; line-height:1.3; }
.ability-bar-choices { flex:1 1 280px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
#character-modal .ability-bar-choice { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:3px; text-align:left; min-width:0!important; }
.ability-choice-slot { color:#c7b48d; font-size:11px; white-space:nowrap; }
.ability-choice-effect { overflow-wrap:normal; }
#character-modal .ability-bar-choice[aria-pressed="true"] { border-color:#6b8061; color:#bed0b3; background:rgba(37,49,38,0.68); cursor:default; }
#character-modal .eyebrow { font-size:14px; color:#d4c29e; }
#character-modal #stat-spare { color:var(--gold); }
#character-modal #stat-list { list-style:none; margin:10px 0 0; padding:0; display:grid; flex-direction:column; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 24px; }
#character-modal #stat-list li { display:grid; align-items:center; grid-template-columns:minmax(80px,1fr) minmax(120px,1.3fr) 28px 44px; font-size:13px; gap:8px; }
#character-modal #stat-list .stat-name { min-width:0; color:#f4e8c9; }
#character-modal #stat-list .stat-blurb { min-width:0; color:var(--muted); font-size:11px; line-height:1.4; }
#character-modal #stat-list .stat-value { width:26px; text-align:right; color:var(--gold); font-size:18px; }
/* With nothing to spend the + keeps its place but is not offered. */
#character-modal #stat-list button.is-idle { visibility:hidden; }
.stat-compact-benefit { display:none; }
.character-readouts { border-top:1px solid #41473d; padding-top:10px; flex:none; }
#character-modal .sheet-vitals { display:flex; gap:4px 16px; flex-wrap:wrap; margin:0; padding:0; border:0; }
#character-modal .sheet-vitals > span { font-size:11px; color:#aab3a6; padding:0; }
#character-modal .sheet-vitals strong { color:#e4d5b6; font-weight:600; }
@media(max-width:900px),(max-height:520px) {
  #character-modal { width:calc(var(--safe-vw) - 16px); height:calc(var(--safe-dvh) - 16px); max-height:none; padding:8px 12px; gap:8px; }
  #character-modal[data-view="attributes"] { height:auto; max-height:calc(var(--safe-dvh) - 16px); }
  .character-header-title-block { padding-left:0; }
  .character-header-title-block::before { display:none; }
  #character-modal::before { border-width:14px; border-image-width:14px; }
  .equipment-pane { gap:0; }
  #character-modal .equipment-slot { padding:3px!important; height:100%; }
  .character-modal-header { min-height:44px; padding-bottom:0; border:0; gap:10px; }
  #character-modal h2 { font-size:23px; }
  .character-eyebrow { display:none; }
  .character-navigation { position:absolute; top:62px; left:12px; width:88px; flex-direction:column; gap:6px; }
  #character-modal .character-navigation button { padding:8px 6px!important; text-align:left; border-left:2px solid transparent; }
  #character-modal .character-navigation button[aria-pressed="true"] { border-bottom-color:transparent; border-left-color:#baa06b; }
  .character-wide-label { display:none; }
  .character-compact-label { display:inline!important; }
  .character-bag-tab { display:inline-flex!important; }
  .character-modal-body { margin-left:98px; grid-template-columns:minmax(0,1fr) minmax(200px,.95fr); height:auto!important; flex:1; gap:14px; }
  .character-section-title { display:none; }
  #character-modal[data-view="equipment"] .bag-panel,
  #character-modal[data-view="bag"] .equipment-pane { display:none; }
  #character-modal[data-view="bag"] .bag-panel { display:flex; }
  .paperdoll-portrait::before { opacity:.2; }
  .equipment-layout { grid-template-columns:52px minmax(0,1fr) 52px; gap:4px 5px; }
  .slot-helmet { width:52px; }
  #character-modal .equipment-slot small { font-size:9px; }
  .equipment-slot-icon { height:28px; width:28px; }
  .character-inspector { padding-left:14px; gap:0; }
  .equipment-stat-summary { font-size:10px; line-height:1.2; padding:0 2px; }
  .equipment-details-icon { width:44px; height:44px; background:none; grid-column:1; grid-row:1; }
  .equipment-inspect-header { grid-template-columns:44px minmax(0,1fr) 44px; gap:6px; }
  .equipment-details-copy { grid-column:2; grid-row:1; gap:4px; }
  .equipment-details-copy strong { font:600 15px/1.25 "Segoe UI",system-ui; }
  .equipment-details-copy small { font-size:11px; }
  .btn-inspect-close { grid-column:3; grid-row:1; }
  .equipment-inspect-lore { font-size:11px; }
  #character-modal .bag-panel { padding:0; border:0; }
  #character-modal .bag-panel-heading { display:none; }
  #character-modal .bag-grid,
  #character-modal #char-inventory[data-capacity="8"] .bag-grid { grid-template-columns:repeat(auto-fill,minmax(60px,1fr)); gap:5px; }
  #character-modal .bag-grid-frame { padding:2px; }
  #character-modal .bag-slot { height:76px; }
  #character-modal .bag-slot img,#character-modal .bag-gear-icon { max-height:40px; }
  .bag-detail-icon { background:none; float:left; width:44px; height:44px; margin:0 8px 4px 0; }
  #character-modal .bag-detail-copy strong { font:600 15px/1.25 "Segoe UI",system-ui; margin-bottom:5px; }
  #character-modal .bag-detail-copy small { font-size:11px; }
  #character-modal .bag-actions button { flex:1 1 calc(50% - 3px); }
  .character-attributes-row { grid-template-columns:1fr; max-height:calc(var(--safe-dvh) - 150px); }
  #character-modal #stat-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; margin-top:8px; }
  #character-modal #stat-list li { grid-template-columns:minmax(0,1fr) 44px; grid-template-rows:auto auto auto; gap:0 4px; padding:4px 0; border-bottom:1px solid #3a433b; }
  #character-modal #stat-list .stat-name { grid-column:1; grid-row:1; font-size:12px; }
  #character-modal #stat-list .stat-value { grid-column:1; grid-row:2; text-align:left; }
  #character-modal #stat-list button { grid-column:2; grid-row:1/3; }
  #character-modal #stat-list .stat-blurb { display:none; }
  .stat-compact-benefit { display:block; grid-column:1/-1; grid-row:3; font-size:11px; color:#9fab94; }
  .character-readouts { padding-top:6px; }
  #character-modal .sheet-vitals { gap:3px 12px; }
}
@media(min-width:561px) and (max-width:900px),(min-width:561px) and (max-height:520px) {
  #character-modal[data-view="attributes"] { min-height:min(320px,calc(var(--safe-dvh) - 16px)); }
  #character-modal[data-view="attributes"] .character-readouts { margin-top:auto; }
}
@media(max-width:560px) {
  #character-modal { width:calc(var(--safe-vw) - 16px); height:calc(var(--safe-dvh) - 16px); padding:10px; }
  .character-modal-header { flex-wrap:wrap; }
  .sheet-summary { font-size:11px; }
  .character-header-title-block { flex-basis:40%; }
  #character-modal .sheet-party-member { width:44px; }
  .character-navigation { position:static; width:100%; order:4; flex-direction:row; border-bottom:1px solid #484336; padding-bottom:6px; }
  #character-modal .character-navigation button { text-align:center; padding:6px 9px!important; }
  .character-modal-body { margin-left:0; grid-template-columns:1fr; overflow-y:auto; align-content:start; }
  #character-modal .equipment-pane { min-height:285px; }
  .equipment-layout { min-height:260px; grid-template-columns:62px 1fr 62px; }
  .slot-helmet { width:62px; }
  .character-inspector { padding:12px 0 0; border:0; border-top:1px solid #454b40; min-height:180px; }
  .equipment-inspect-content { overflow:visible; }
  #character-modal .bag-panel { min-height:260px; }
  #character-modal .bag-details { min-height:180px; }
  .character-attributes-row { grid-template-columns:1fr; max-height:calc(var(--safe-dvh) - 230px); }
  #character-modal #stat-list { display:flex; }
  #character-modal #stat-list li { grid-template-columns:minmax(80px,1fr) 32px 44px; }
  #character-modal #stat-list .stat-name { grid-row:1; }
  #character-modal #stat-list .stat-value { grid-column:2; grid-row:1; }
  #character-modal #stat-list button { grid-column:3; grid-row:1; }
  #character-modal #stat-list .stat-blurb { display:block; grid-column:1/-1; grid-row:2; }
  .stat-compact-benefit { display:none; }
}
@media(hover:none) and (pointer:coarse) { #character-modal .kbd { display:none; } }
