html, body { min-width: 0; min-height: 100%; overflow-x: hidden; background: #11110f; }
.room-character-sheet { margin: 0; overscroll-behavior-y: auto; }
.room-character-sheet .tools-panel { position: static !important; display: block !important; box-sizing: border-box; width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important; padding-bottom: 28px; overflow: visible !important; border: 0; transform: none !important; }
.room-character-sheet .panel-heading { position: sticky; z-index: 12; top: 0; background: rgba(17,17,15,.96); backdrop-filter: blur(10px); }
.room-character-sheet .sheet-heading-actions { flex-wrap: wrap; }
.room-character-sheet .custom-occupation-attribute { display: inline-block; width: 48px; min-width: 48px; height: 24px; min-height: 24px; margin: 0 2px; padding: 0 2px; vertical-align: middle; color: var(--gold); background: #171714; font: .6rem/1 var(--sans); text-align: center; }
.room-character-sheet .attribute-field { grid-template-columns: minmax(58px,1fr) 42px 44px; }
.room-character-sheet .attribute-field input[data-attribute] { left: 0; justify-self: center; width: 38px; min-height: 42px; padding-inline: 2px; }
.room-character-sheet .room-submit-button:disabled { opacity: .55; cursor: default; }
.room-character-sheet.tabletop-readonly .skill-roles input:disabled { opacity: 1; color: #d7d0c4; -webkit-text-fill-color: #d7d0c4; }
.room-character-sheet.tabletop-readonly .skill-roles .allocation-input:disabled { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.045); }
.room-character-sheet.tabletop-initial-lock .tools-panel { pointer-events: none; }
.room-character-sheet.tabletop-torn .tools-panel { filter: grayscale(1); opacity: .58; }
@media (hover: hover) and (pointer: fine) {
  .room-character-sheet .skill-tooltip, .room-character-sheet .attribute-tooltip { max-height: none; overflow: visible; pointer-events: none; }
}
.room-character-sheet.entity-mode .skill-head,
.room-character-sheet.entity-mode .skill-row { grid-template-columns: 32px minmax(110px,1fr) 58px 38px 38px; }
.room-character-sheet.entity-mode .skill-value-input { width: 100%; min-width: 0; text-align: center; }
.room-character-sheet.entity-mode .skill-pin { width: 17px; height: 17px; margin: auto; accent-color: var(--gold); }
.room-character-sheet.entity-mode .derived-field.readout input { width: 100%; min-width: 0; color: white; text-align: center; }
.room-character-sheet.entity-mode .game-weapons-section { order: 0; }
.room-character-sheet.entity-mode .game-weapon-table input[readonly] { border-color: transparent; color: #c9c4ba; background: rgba(255,255,255,.025); }
.room-character-sheet.entity-mode .entity-combat-notes { margin: 12px 0 0; }
.room-character-sheet.entity-mode .background-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.room-character-sheet.entity-mode textarea { min-height: 78px; resize: vertical; }
.room-character-sheet.entity-mode.monster-mode .monster-skill-row,
.room-character-sheet.entity-mode.monster-mode .skill-head { display: grid; grid-template-columns: minmax(110px,1fr) 64px 44px 44px 52px; gap: 5px; align-items: center; }
.room-character-sheet.entity-mode.monster-mode .skill-head span:first-child { text-align: left; }
.room-character-sheet.entity-mode.monster-mode .skill-head span:nth-child(2) { text-align: center; }
.room-character-sheet.entity-mode .monster-skill-row { min-height: 42px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.room-character-sheet.entity-mode .monster-skill-row input { width: 100%; min-width: 0; }
.room-character-sheet.entity-mode .monster-skill-row output { color: var(--muted); text-align: center; font-size: .68rem; }
.room-character-sheet.entity-mode .monster-skill-remove { min-height: 30px; padding: 0 5px; border: 1px solid #713c37; color: #df8c80; background: transparent; cursor: pointer; font-size: .62rem; }
.room-character-sheet.entity-mode .monster-skill-empty { margin: 0; padding: 14px 4px; color: var(--muted); font-size: .68rem; }
@media (max-width:430px) {
  .room-character-sheet .attribute-field { grid-template-columns: minmax(54px,1fr) 40px 38px; }
  .room-character-sheet .attribute-field input[data-attribute] { width: 36px; }
  .room-character-sheet .side-panel > * { margin-inline: 10px; }
  .room-character-sheet .panel-heading { gap: 6px; align-items: center; margin-inline: 0; padding-inline: 12px; }
  .room-character-sheet .panel-heading > span:first-child { flex: 0 0 auto; font-size: 1rem; white-space: nowrap; }
  .room-character-sheet .sheet-heading-actions { flex-wrap: nowrap; gap: 4px; }
  .room-character-sheet .sheet-heading-actions button { min-height: 30px; padding-inline: 6px; font-size: .6rem; white-space: nowrap; }
  .room-character-sheet.entity-mode .skill-head,
  .room-character-sheet.entity-mode .skill-row { grid-template-columns: 24px minmax(84px,1fr) 44px 30px 30px; gap: 3px; }
  .room-character-sheet.entity-mode.monster-mode .monster-skill-row,
  .room-character-sheet.entity-mode.monster-mode .skill-head { grid-template-columns: minmax(84px,1fr) 44px 30px 30px 46px; gap: 3px; }
  .room-character-sheet.entity-mode .background-grid { grid-template-columns: 1fr; }
}
