/*Configure the tab button*/
.charsheet .sheet-tabstoggle:not([value="character"]) ~ div.sheet-character,
.charsheet .sheet-tabstoggle:not([value="equipped"]) ~ div.sheet-equipped,
.charsheet .sheet-tabstoggle:not([value="editskills"]) ~ div.sheet-editskills,
.charsheet .sheet-tabstoggle:not([value="inventory"]) ~ div.sheet-inventory,
.charsheet .sheet-tabstoggle:not([value="editcharacter"]) ~ div.sheet-editcharacter,
.charsheet .sheet-tabstoggle:not([value="editpsionics"]) ~ div.sheet-editpsionics,
.charsheet .sheet-tabstoggle:not([value="editship"]) ~ div.sheet-editship,
.charsheet .sheet-tabstoggle:not([value="npc"]) ~ div.sheet-npc {
    display: none;
}

.charsheet div.sheet-main-buttons {
  display: grid;     
  width: 827px;
  grid-template-columns: 100px 100px 100px 100px 100px 100px 100px 100px;
  grid-template-rows: 28px;      
  grid-gap: auto;   
}

/*Configure the tab buttons*/
.sheet-tabstoggle1:not([value="body-discipline"]) ~ div.sheet-body-discipline,
.sheet-tabstoggle1:not([value="causation"]) ~ div.sheet-causation,
.sheet-tabstoggle1:not([value="clairvoyance"]) ~ div.sheet-clairvoyance,
.sheet-tabstoggle1:not([value="deflection"]) ~ div.sheet-deflection,
.sheet-tabstoggle1:not([value="domination"]) ~ div.sheet-domination,
.sheet-tabstoggle1:not([value="energy-communion"]) ~ div.sheet-energy-communion,
.sheet-tabstoggle1:not([value="molecular-alteration"]) ~ div.sheet-molecular-alteration,
.sheet-tabstoggle1:not([value="pyrokinesis"]) ~ div.sheet-pyrokinesis,
.sheet-tabstoggle1:not([value="subatomic-alteration"]) ~ div.sheet-subatomic-alteration,
.sheet-tabstoggle1:not([value="telekinesis"]) ~ div.sheet-telekinesis,
.sheet-tabstoggle1:not([value="anti-psionics"]) ~ div.sheet-anti-psionics {
    display: none;
}

/*Configure the weapon-inventory buttons*/
.charsheet .sheet-tabstoggle2:not([value="melee"]) ~ div.sheet-inventory-melee,
.charsheet .sheet-tabstoggle2:not([value="ranged"]) ~ div.sheet-inventory-ranged,
.charsheet .sheet-tabstoggle2:not([value="explosives"]) ~ div.sheet-inventory-explosives {
    display: none;
}




/* COLOR THEME */
/* 
    blue: #278BCE 
    grey: #7d7d7d
    yellow: rgba(255, 215, 0, 1);
    red: #FF2400
*/
/*----------- LABELS -------------*/
/*
h2 {
  grid-column: 1 / -1;
  background: rgb(51, 60, 87);
  color: rgba(255, 215, 0, 1);
  line-height: 1;  
  font-size: 16px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 5px;
}
*/
h2 {
  grid-column: 1 / -1;
  background: rgb(51, 60, 87);
  color: rgba(255, 215, 0, 1);
  line-height: 1;
  font-size: 14px;
  text-transform: uppercase;
  text-align: center; /* Centers text horizontally */
  margin: 0; /* Remove any default margin */
  padding: 0 5px; /* 5px padding to the left and right */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  margin-bottom: 5px;
  display: grid; /* Define this as a grid container */
  align-content: center; /* Centers content vertically inside the grid */
  width: 100%;
}


h3 {
  font-size: 12px;
  color: #278BCE;
  line-height: 1;
  text-align: center;
}
h4 {
  font-size: 10px;
  line-height: 1;
  color: #278BCE;
  text-align: center;
}

.label {
}

.charsheet {
    background: #282828;
}

.charsheet .sheet-width75 {
  width: 75px;
}

.sheet-center {
    margin: auto;       
  }

.sheet-center-2 {
  padding-left: 3px;
  padding-top: 6px;
}

.sheet-subheading {
  color: #278bce;
  font-size: 16px;
  font-family: "Orbitron", sans-serif;
  font-variant: small-caps;
}

.sheet-subsubheading {
  color: #278bce;
  font-size: 12px;
  font-family: "Orbitron", sans-serif;
  font-variant: small-caps;
  width: 200px;
}

.sheet-goldenHeading {
  color: #ffd700;
  font-size: 20px;
  font-family: "Orbitron", sans-serif;
  font-variant: small-caps;
}

.text {
  color: grey;  
  font-size: 12px;
  font-weight: bold;
}

.sheet-green-color {
    color: #2cff01;
  }

.sheet-yellow-color {
    color: #fffb00;
  }

.sheet-red-color {
  color: #ff2400;
}

.sheet-blue-color {
  color: #278bce;
}

.sheet-pink-color {
  color: pink;
}

.sheet-purple-color {
  color: rgb(245, 52, 245);
}

.sheet-grey-color {
  /*color: #505050;*/
  color: 278BCE;
  
}

.sheet-white-color {
    /*color: #505050;*/
    color: #ffffff;
  }

  .sheet-silver-color {
    /*color: #505050;*/
    color:silver;
  }

.sheet-gold-color {
  color: #ffd700;
}

label {
  color: rgba(255, 215, 0, 1);
  font-size: 21px;
  font-family: "Orbitron", sans-serif;
  font-variant: small-caps;
  font-weight: 400;
}

.sheet-borderedContainer {
  background: #111111;
  border-style: solid;
  border-radius: 5px;
  border-width: 1px;
  border-color: #555555;
  padding: 5px;
}

.sheet-dropdown {
    transition: all 0.4s ease-in-out;
    width: 100px;
    outline: none;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);    
    color:#278bce;
  }

  .sheet-dropdown-red {
    transition: all 0.4s ease-in-out;
    width: 100px;
    outline: none;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);    
    color:red;
  } 

  .sheet-dropdown120 {
    transition: all 0.4s ease-in-out;
    width: 120px;
    height: 24px
    outline: none;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);    
    color: #278bce;
  }

.sheet-inputfield {
    outline: none;
    box-sizing: border-box;    
    width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    borborder-boxdropdownder-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;
    text-align: center;    
  }

  .sheet-inputfield:disabled {
    outline: none;
    box-sizing: border-box;
    width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }

  .sheet-inputfield:read-only {
    outline: none;
    box-sizing: border-box;
    width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }
  
  .sheet-inputfield:hover {
      border-color: #f8f8f27e;
      color: #ffffff;
    }
    
    .sheet-inputfield:focus {
      border-color: #f8f8f2;
      color: #ffffff;
    }

.sheet-inputfield52 {
  outline: none;
  box-sizing: border-box;    
  width: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
  text-align: center;    
}
  
  .inputfield52:disabled {
    outline: none;
    box-sizing: border-box;
    width: 52px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }

  .sheet-inputfield52:read-only {
    outline: none;
    box-sizing: border-box;
    width: 52px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }
  
  .inputfield52:hover {
      border-color: #f8f8f27e;
      color: #ffffff;
    }
    
    .inputfield52:focus {
      border-color: #f8f8f2;
      color: #ffffff;
    }

.sheet-inputfield60 {
  outline: none;
  box-sizing: border-box;
  width: 60px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
  text-align: center;      
  }

  .sheet-inputfield60:disabled {
  outline: none;
  box-sizing: border-box;
  width: 60px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;    
  text-align: center;
  color:#278bce;
  }

  .sheet-inputfield60:read-only {
    outline: none;
    box-sizing: border-box;
    width: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }
  
  .sheet-inputfield60:hover {
      border-color: #f8f8f27e;
      color: #ffffff;
  }
  
  .sheet-inputfield60:focus {
      border-color: #f8f8f2;
      color: #ffffff;
  }

.sheet-inputfield75 {
  outline: none;
  box-sizing: border-box;
  width: 75px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
  text-align: center;      
  }

  .sheet-inputfield75:disabled {
  outline: none;
  box-sizing: border-box;
  width: 75px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;    
  text-align: center;
  color:#278bce;
  }

  .sheet-inputfield75:read-only {
    outline: none;
    box-sizing: border-box;
    width: 75px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
  }
  
  .sheet-inputfield75:hover {
      border-color: #f8f8f27e;
      color: #ffffff;
  }
  
  .sheet-inputfield75:focus {
      border-color: #f8f8f2;
      color: #ffffff;
  }

  .sheet-inputfield120 {
    outline: none;
    box-sizing: border-box;    
    width: 120px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;
    text-align: center;    
  }

.inputfield120:disabled {
  outline: none;
  box-sizing: border-box;
  width: 120px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;    
  text-align: center;
}

.sheet-inputfield120:read-only {
  outline: none;
  box-sizing: border-box;  
  width: 120px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;    
  text-align: center;
}

.inputfield120:hover {
    border-color: #f8f8f27e;
    color: #ffffff;
  }
  
.inputfield200:focus {
  border-color: #f8f8f2;
  color: #ffffff;
}

.sheet-inputfield200 {
  outline: none;
  box-sizing: border-box;
  width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
  text-align: center;    
  color:#278bce;
  }

.sheet-inputfield200:disabled {
outline: none;
box-sizing: border-box;
width: 200px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 5px;
background: rgba(0, 0, 0, 0.5);
transition: all 0.4s ease-in-out;    
text-align: center;
color:#278bce;
}

.sheet-inputfield200:read-only {
  outline: none;
  box-sizing: border-box;
  width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;    
  text-align: center;
}

.sheet-inputfield200:hover {
    border-color: #f8f8f27e;
    color: #ffffff;
}

.sheet-inputfield200:focus {
    border-color: #f8f8f2;
    color: #ffffff;
}

    .sheet-inputfield-health {
      outline: none;
      box-sizing: border-box;    
      width: 52px;      
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 5px;
      background: rgba(0, 0, 0, 0.5);
      transition: all 0.4s ease-in-out;
      text-align: center;    
      color: #278bce;
    }
  
    .sheet-inputfield-health:disabled {
      outline: none;
      box-sizing: border-box;
      width: 52px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 5px;
      background: rgba(0, 0, 0, 0.5);
      transition: all 0.4s ease-in-out;    
      text-align: center;
      color: #278bce;

    }
    
    .sheet-inputfield-health:hover {
        border-color: #278bce;;
        color: #278bce;
      }
      
      .sheet-inputfield-health:focus {
        border-color: #f8f8f2;
        color: #278bce;
      }

.sheet-inputfieldlc {
    outline: none;
    box-sizing: border-box;
    width: 120px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;
    text-align: center;    
    }

    .sheet-inputfieldlc:disabled {
    outline: none;
    width: 120px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease-in-out;    
    text-align: center;
    }

    .sheet-inputfieldlc:read-only {
      outline: none;
      width: 120px;
      box-sizing: border-box;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 5px;
      background: rgba(0, 0, 0, 0.5);
      transition: all 0.4s ease-in-out;    
      text-align: center;
      }
    
    .sheet-inputfieldlc:hover {
        border-color: #f8f8f27e;
        color: #ffffff;
    }
    
    .sheet-inputfieldlc:focus {
        border-color: #f8f8f2;
        color: #ffffff;
    }    

      .sheet-inputfield-blank {
        outline: none;
        box-sizing: border-box;
        width: 52px;
        border: 1px solid #282828;
        border-radius: 5px;
        background:#282828;
        transition: all 0.4s ease-in-out;
        text-align: center;    
        color:#278bce;
        }
    
        .sheet-inputfield-blank:disabled {
        outline: none;
        box-sizing: border-box;
        border: 1px solid #282828;
        border-radius: 5px;
        background: #282828;
        transition: all 0.4s ease-in-out;    
        text-align: center;
        color:#278bce;
        }
        
        .sheet-inputfield-blank:hover {
            border-color:#282828;
            color: #282828;
        }
        
        .sheet-inputfield-blank:focus {
            border-color:#282828;
            color: #282828;
        }

    .sheet-inputfield-combat-style {
        outline: none;
        box-sizing: border-box;
        width: 60px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 5px;
        background: rgba(0, 0, 0, 0.5);
        transition: all 0.4s ease-in-out;
        text-align: center;    
      }
    
      .sheet-inputfield-combat-style:disabled {
        outline: none;
        box-sizing: border-box;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 5px;
        background: rgba(0, 0, 0, 0.5);
        transition: all 0.4s ease-in-out;    
        text-align: center;
      }
      
      .sheet-inputfield-combat-style:hover {
          border-color: #f8f8f27e;
          color: #ffffff;
        }
        
        .sheet-inputfield-combat-style:focus {
          border-color: #f8f8f2;
          color: #ffffff;
        }

.charsheet div.sheet-block{    
    padding: 5px;
    border: 1.5px solid #278bce;    
}

.charsheet div.sheet-block-2px{    
  padding: 5px;
  border: 1.5px solid #278bce;    
}

/* START OF CHARACTER ACTION PAGE */
.charsheet .sheet-grid-section {
  display: grid;
  grid-gap: 5px;
  width: 100%;  
  grid-template-columns: 140px 687px;
  grid-template-rows: auto; 
  grid-template-areas: 
  "core-stats   health"
  "headers      headers"
  "skills       skills"
}

.sheet-core-stats {   
    display: grid; 
    grid-area: core-stats;    
    grid-template-columns: 120px;
    grid-auto-rows: 28px;
    grid-gap: 5px;
    text-align: right;
    align-content: center;
  }

.sheet-core-health {  
  display: grid;
  grid-area: health;
  grid-template-columns: 75px 75px 85px 52px 52px 52px 60px 60px 60px 52px;
  grid-auto-rows: 28px;
  grid-gap: 1px;    
  column-gap: 5px;
  text-align: center;  
}

.sheet-core-armor-header {
  grid-area: header; 
  width: 827px;
  grid-template-columns: 500px ; /* name, dmg, dmg+, mult, rf, P+, range, ammo, +tohit, Tech Level */
  grid-auto-rows: 28px;
  grid-gap: 5px;    
  text-align: center;
  font-variant-caps: all-petite-caps;
  font-size: large;
  color:#ff2400;
}

.sheet-core-armor {
  grid-area: armor;  
  display: grid;
  grid-template-columns: 120px 60px 60px 52px 52px 52px 52px 52px 52px 52px 52px 52px; /* name, hitpoints, P+, regen, shrug,, defense bonus, cds, str, dex, con, movement*/
  grid-auto-rows: 28px;
  grid-gap: 2px;    
  column-gap: 5px;
  color:#278bce;
}

.sheet-combat {
  display: grid;
  grid-area: combat;
  grid-template-columns: 60px 125px 60px 60px 52px 52px 52px 52px 52px 60px 60px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
  text-align: center;
}

.sheet-main-ranged-weapons {
    grid-area: ranged;
    display: grid;     
    width: 827px;
    grid-template-columns: 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px; 
    grid-template-rows: 28px;      
}

.sheet-core-stats h3 {
    grid-column: 1 / -1;    
    text-align: center;
    grid-row: 1;    
}

.sheet-core-stats h4 {
  grid-column: 1 / -1;    
  text-align: center;
  grid-row: 5;    
  color: gold;
}

.sheet-core-health h3 {
  grid-column: 1 / -1;    
  text-align: center;
  grid-row: 1;    
}

.sheet-combat h3{
    grid-column: 1 / -1;
    text-align: center;
    grid-row: 1;     
    color: gold;
    font-size: large;   
    height: 25px;
}

/*.sheet-core-skills {
  grid-area: skills;
  display: grid;
  width: 820px;
  grid-template-columns: 80px 60px 60px 80px 60px 60px 80px 60px 60px 80px 60px 60px;
  grid-template-rows: 28px;
  font-size: x-small;
} */
.sheet-skill-headers {
  display: grid;
  grid-area: headers;    
  grid-template-columns: 70px 120px 90px 52px 52px 90px 52px 52px 52px 52px 52px 75px;
  grid-template-rows: 28px;    
  grid-auto-rows: 28px;    
  grid-gap: 2px;   
  text-align: center;     
}
.sheet-core-skills {
display: flex;
grid-area: skills;      
font-size: smaller;
grid-template-columns: 70px 120px 90px 52px 52px 90px 52px 52px 52px 52px 52px 75px;
grid-template-rows: 28px;    
grid-auto-rows: 28px;    
grid-gap: 2px;   
text-align: center;    

}

.sheet-skills h3{  
  grid-column: 1 / -1;
  text-align: center;
  grid-row: 1;        
}

.charsheet .sheet-core-skill-data{
  display: flex;
  justify-content: space-between;
  width: 400px;
}
.charsheet .sheet-core-skill-data> * {
  flex: 1;
}

.charsheet input.sheet-toggle-show:not(:checked) ~ div.sheet-body,
.charsheet input.sheet-toggle-hide:checked ~ div.sheet-body {
    display: none;
}
/* END OF CHARACTER ACTION PAGE */

/* START OF EQUIPPED SECTION */

.sheet-equipped-grid {
    display: grid;
    width: 100%;  
    grid-gap: 5px;
    grid-template-columns: 33.3% 33.3% 33.3%;
    grid-template-rows: auto auto auto auto; 
    grid-template-areas:   
    "header  header  header"
    "armor   armor   armor"
    "melee   melee   melee"
    "ranged  ranged  ranged"
  }

.sheet-equipped-header {
    grid-area: header; 
    width: 827px;
    grid-template-columns: 500px ; /* name, dmg, dmg+, mult, rf, P+, range, ammo, +tohit, Tech Level */
    grid-auto-rows: 28px;
    grid-gap: 5px;    
    text-align: center;
    font-variant-caps: all-petite-caps;
    font-size: large;
    color:#ff2400;
  }

.sheet-equipped-armor {
    grid-area: armor;  
    display: grid;
    grid-template-columns: 120px 75px 75px 52px 60px 60px 52px 52px 52px 52px 52px 52px; /* name, hitpoints, P+, regen, shrug,, defense bonus, cds, str, dex, con, movement*/
    grid-auto-rows: 28px;
    grid-gap: 2px;    
    column-gap: 5px;
    color:#278bce;
  }

.sheet-equipped-armor h3 {
    grid-column: 6 / -6;    
    text-align: center;
    grid-row: 1;    
    color:#278bce;
  }

.sheet-equipped-combat-melee {
    display: grid;
    grid-area: melee;
    grid-template-columns: 100px 90px 75px 75px 60px 60px 60px 60px 60px 75px 75px;
    grid-template-rows: auto;    
    grid-auto-rows: 28px;    
    grid-gap: 3px;    
  }

.sheet-equipped-repeating-ranged {
  grid-area: ranged;
  width: 822px;
}

.sheet-equipped-ranged-weapons {
  display: grid;  
  width: 100%;
  grid-template-columns: 120px 75px 60px 60px 60px 60px 60px 60px 60px 60px 60px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
}


.sheet-equipped-weapons h3 {  
    grid-column: 13 / -13;    
    text-align: center;
    grid-row: 0;    
    color:#278bce;
  }

/* END OF EQUIPPED SECTION */

/* START OF EDIT SKILLS PAGE */

.sheet-edit-skills-grid-section{
  display: grid;
  grid-gap: 5px;  
  grid-template-columns: 100%;
  grid-template-rows: auto auto auto; 
  grid-template-areas: 
  "edit-ability"    
  "edit-skill-headers"    
  "edit-repeating-skills"
}

.sheet-edit-ranged {
  display: grid;
  grid-area: edit-ability;
  grid-template-columns: 90px 90px 52px 52px 52px 75px 52px 52px 52px 52px 52px 75px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 3px;    
  color: #278bce;
  text-align: center;
}

.sheet-edit-melee {
  display: grid;
  grid-area: edit-ability;
  grid-template-columns: 90px 90px 75px 52px 52px 52px 52px 52px 60px 60px 52px 75px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 3px;    
  color: #278bce;
  text-align: center;
}

.sheet-edit-ability h3 {
  grid-column: 1 / -1;    
  text-align: center;
  grid-row: 1;    
  width: 820px;
  text-align: center;
  font-size: x-large;
  color: gold;
  background-color: rgb(60, 56, 87);
  row-gap: 5px;  
}

.sheet-edit-combat h3 {
  grid-column: 1 / -1;    
  text-align: center;
  grid-row: 1;    
  width: 820px;
  text-align: center;
  font-size: x-large;
  color: gold;
  background-color: rgb(60, 56, 87);
  row-gap: 5px;  
}


.sheet-edit-skill-headers {
  display: grid;
  grid-area: edit-skill-headers;    
  grid-template-columns: 70px 120px 90px 52px 52px 90px 52px 52px 52px 52px 52px 75px;
  grid-template-rows: 28px;    
  grid-auto-rows: 28px;    
  grid-gap: 2px;   
  text-align: center;     
}

.sheet-edit-repeating-skills {
  display: grid;
  grid-area: edit-repeating-skills;      
  font-size: smaller;
  grid-template-columns: 70px 120px 90px 52px 52px 90px 52px 52px 52px 52px 52px 75px;
  grid-template-rows: 28px;    
  grid-auto-rows: 28px;    
  grid-gap: 2px;   
  text-align: center;     
}

.sheet-edit-skills h3 {
  grid-column: 5 / -5;    
  text-align: center;
  grid-row: 1;    
}

.sheet-skills-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  grid-gap: 5px;
}


.sheet-edit-skills h4 {
  color: #278bce;    
}

.sheet-edit-combat b {
  color: gold;    
  font-size: medium;
}

.sheet-edit-ability b {
  color: gold;    
  font-size: medium;
}

.sheet-edit-repeating-skills h4 {
  color: #278bce;    
  grid-template-columns: 100px 125px 60px 52px 52px 60px 52px 52px 100px 52px 52px;
}

.sheet-skills-content {
  display: none;
}

.sheet-skills-content.show {
  display: block;
}



/* END OF EDIT SKILLS & COMBAT PAGE */

/* START OF INVENTORY EDIT PAGE */

/* Inventory Display Menu */
.sheet-display_toggle[name="attr_armor-display"][value="0"] ~ .sheet-inventory-armor ,
.sheet-display_toggle[name="attr_melee-display"][value="0"] ~ .sheet-inventory-melee,
.sheet-display_toggle[name="attr_ranged-display"][value="0"] ~ .sheet-inventory-ranged,
.sheet-display_toggle[name="attr_explosives-display"][value="0"] ~ .sheet-inventory-explosives,
.sheet-display_toggle[name="attr_items-display"][value="0"] ~ .sheet-edit-inventory-entries,
.sheet-display_toggle[name="attr_artifacts-display"][value="0"] ~ .sheet-edit-inventory-artifacts,
.sheet-display_toggle[name="attr_contacts-display"][value="0"] ~ .sheet-edit-inventory-contact-entries {
  display: none !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons {
  --blue: #278bce;
  --black: #282828;
  --yellow: #ffd700;
  background: black;
  background: rgb(51, 60, 87);
  border: 4px solid var(--blue);
  border-width: 0 5px;
  padding: 2px 5px;
  display: flex;
  grid-area: display-menu;
}
.charsheet .sheet-edit-inventory-weapon-buttons h4 {
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
  flex: 1;
}
.charsheet .sheet-edit-inventory-weapon-buttons label {
  display: flex;
  justify-content: space-around;
  flex: 1;
  padding: 5px;
  margin: 5px;

  background-color: var(--black);
  text-align: center;
  
  border: 1px solid #000;
  border-width: 1px 5px;
  cursor: pointer;
  order: 2;
}

.charsheet .sheet-edit-inventory-weapon-buttons input[type=checkbox] {
  appearance: none;
  border: none;
  background: none;
  flex: 0;
}
.charsheet .sheet-edit-inventory-weapon-buttons input[type=hidden][value="on"] + label {
  order: 1;
  background-color: var(--blue);
}
.charsheet .sheet-edit-inventory-weapon-buttons input[type=hidden][value="on"] + label h4 {
  color: var(--black);
}
.charsheet div.sheet-edit-inventory-grid-section{
  display: grid;
  grid-gap: 5px;  
  grid-template-columns: 100%;
  /* grid-template-rows: auto auto auto auto; */
  grid-template-areas:     
  "display-menu"
  "edit-inventory-weapon-buttons"
  "edit-armor"
  "edit-melee"
  "edit-ranged"
  "edit-explosives"
  "edit-artifacts"
  "edit-inventory"
  "edit-contacts"
}
 .sheet-inventory-armor {
  grid-area: edit-armor;
} 
.sheet-inventory-melee {
  grid-area: edit-melee;
}
.sheet-inventory-ranged {
  grid-area: edit-ranged;  
}
.sheet-inventory-explosives {
  grid-area: edit-explosives;
}
.sheet-edit-inventory-entries {
  grid-area: edit-inventory;
}
.sheet-edit-inventory-artifacts {
  grid-area: edit-artifacts;
}

.charsheet div.sheet-edit-armor-entries {
  grid-area: edit-armor;    
  display: grid;
  grid-template-columns: 100px 45px 45px 60px 45px 45px 45px 45px 45px 45px 45px 45px 45px 60px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
  column-gap: 5px;
  column-gap: 5px;  
  text-align: center;
  color:#278bce;
}

.charsheet div.sheet-edit-armor-entries  h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }

.sheet-edit-weapon-entries {
  grid-area: edit-weapons;  
  width: 100%;
  display: grid;
  grid-template-columns: 75px 52px 75px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  color:#278bce;
}

.ui-dialog .charsheet div.sheet-edit-weapon-entries input {
  width: 100%;
}

.sheet-edit-weapon-entries h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }

.sheet-edit-explosives-entries {
  grid-area: edit-explosives;  
  display: grid;
  grid-template-columns: 100px 60px 60px 100px 60px 60px 60px 60px 100px 60px 60px 52px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
  column-gap: 1px;  
  color:#278bce;
}

.ui-dialog .charsheet div.sheet-edit-explosives input {
  width: 100%;
}

.charsheet div.sheet-edit-explosives h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }
 
.sheet-edit-artifact-entries {
  grid-area: edit-artifacts;  
  display: grid;
  grid-template-columns: 120px 75px 100px 65px 70px 60px 60px 60px 60px 60px 60px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 1px;    
  column-gap: 3px;  
  color:#278bce;
}

.ui-dialog .charsheet div.sheet-edit-artifact-entries input {
  width: 100%;
}

.charsheet div.sheet-edit-artifact-entries h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }


 
div.sheet-edit-armor-entries {
  grid-area: edit-armor;    
  display: grid;
  grid-template-columns: 100px 45px 45px 60px 45px 45px 45px 45px 45px 45px 45px 45px 45px 60px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
  column-gap: 5px;
  column-gap: 5px;  
  text-align: center;
  color:#278bce;
}

.ui-dialog .charsheet div.sheet-edit-armor-entries input {
  width: 100%;
}

.sheet-edit-armor-entries h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }
 .sheet-edit-melee-entries {
  grid-area: edit-melee;  
  display: grid;
  grid-template-columns: 100px 52px 52px 60px 60px 52px 52px 52px 60px 60px 60px 52px 52px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 3px;    
  column-gap: 5px;  
  color:#278bce;
}

.ui-dialog .charsheet div.sheet-edit-melee-entries input {
  width: 100%;
}

.charsheet div.sheet-edit-melee-entries h4 {   
  grid-row: 1;
  text-align: center;
  color: gold;
 }

 div.edit-inventory-weapon-buttons{        
  grid-area: psi-buttons;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;    
  grid-auto-rows: 28px;
  grid-gap: 5px;                
}

.charsheet div.sheet-edit-inventory-entries {
  grid-area: edit-inventory;  
  grid-template-columns: 125px 400px 52px 60px 60px 52px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 5px;    
  column-gap: 5px;  
  
}

.charsheet div.sheet-edit-inventory-entries h4 { 
  grid-column: 7 / -7; 
  grid-row: 1;
  text-align: center;
  color: gold;
 }

.charsheet div.sheet-edit-inventory-contact-entries {
  grid-area: edit-contacts;
  grid-template-columns: 125px 400px ;
  grid-template-rows: auto;        
  grid-gap: 10px;    
  column-gap: normal;  
  
}

.charsheet div.sheet-edit-inventory-contact-entries h4 { 
  grid-column: 7 / -7; 
  grid-row: 1;
  text-align: center;
  color: gold;
 }

/* END OF INVENTORY EDIT PAGE */

/* START OF CHARACTER EDIT PAGE */
.charsheet .sheet-edit-character-grid-section {
    display: grid;
    grid-gap: 5px;
    column-gap: 5px;
    grid-template-columns: 415px 415px ;
    grid-template-rows: 28px; 
    grid-template-areas:     
    "edit-character-header edit-character-header"    
    "edit-core-stats edit-core-stats"
    "edit-health edit-health"
    "edit-"
    
}

.charsheet div.sheet-edit-character-header {
  grid-area: edit-character-header;    
  grid-template-columns: 133.33px 133.33px 133.33px 133.33px 133.33px 133.33px;
  grid-template-rows: 1;  
}

.charsheet div.sheet-edit-character-core-stats {
  display: grid;
  grid-area: edit-core-stats;
  grid-template-columns: 52px 50px 50px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px 52px;
  grid-template-rows: 25px;    
  grid-auto-rows: 25px;    
  grid-gap: 2px;    
  column-gap: auto;  
  text-align: center;
}

.charsheet div.sheet-edit-character-health {  
  display: grid;
  grid-area: edit-health;  
  grid-template-columns: 52px 60px 60px 60px 60px 60px 52px 52px 52px 52px 52px 52px 52px 52px 52px;  
  color:#278bce;    
  text-align: center;
  font-size: small;
}

.charsheet div.sheet-edit-character-armor {
  display: grid;
  grid-area: edit-armor;    
  grid-template-columns: 52px 52px 52px 52px 52px 52px 52px 52px;  
  color:#278bce;    
  text-align: center;
  font-size: small;
}

.charsheet div.sheet-edit-character-header h4 {  
  color:gold;
  font-variant-caps: small-caps;
  font-size: large;  
  text-align: center;
}

.charsheet div.sheet-edit-character-core-stats h4 {  
  color:#278bce;  
  text-align: center;
}

.charsheet .sheet-core-bd {
  color:#2cff01;
  text-align: center;
}

.charsheet .sheet-core-ca {
  color: gold;
  text-align: center;
}
.charsheet .sheet-core-df {
  color: silver;
  text-align: center;
}

.charsheet .sheet-core-dm {
  color:orangered;
  text-align: center;
}

.charsheet .sheet-core-cl {
  color: lightseagreen;
  text-align: center;
}

.charsheet .sheet-core-q {
  color:white;
  text-align: center;
}

.charsheet .sheet-core-tk {
  color: rgb(243, 26, 189);
  text-align: center;
}

.charsheet div.sheet-edit-character-core-stats b {  
  color:#278bce;  
  text-align: center;
}

.charsheet div.sheet-edit-character-grid-section h3 {
    grid-column: 1 / -1;    
    text-align: center;
    grid-row: 1;    
}
/* END OF CHARACTER EDIT PAGE */



/* START OF PSIONICS EDIT PAGE */
.charsheet .sheet-edit-psionics-grid-section {
  display: grid;
  grid-template-columns: 827px;
  grid-template-areas: 
    "life-energy life-energy life-energy life-energy"
    "psi-buttons psi-buttons psi-buttons psi-buttons"
    "edit-psionics edit-psionics edit-psionics edit-psionics"
    "psi-sub-skills psi-sub-skills psi-sub-skills psi-sub-skills";
}

.sheet-edit-life-energy {
  display: grid;
  grid-area: life-energy;
  width: 827px;  
  grid-template-columns: 60px 60px 25px 60px 60px 52px 52px 52px 60px 52px 60px 52px 52px 52px;
  grid-auto-rows: 28px;
  grid-gap: 3px;  
  font-size: small;
}

.sheet-edit-psi-buttons {
  display: flexbox;
  grid-area: psi-buttons;
  width: 827px;
  font-size: 16px;
  grid-template-columns: 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px 60px;
  grid-auto-rows: 28px;
  grid-gap: auto;
  padding: 3px;
}

.psionics-buttons h3 {
  grid-column: 1 / -1;
  text-align: center;
  grid-row: 1;
}

.sheet-edit-psi-body-discipline {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 52px 60px 60px 60px 60px 60px 60px 60px 60px 60px;
  grid-auto-rows: 28px;
  grid-gap: auto;
  font-size: small;
}

.sheet-edit-repeating-body-discipline {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: auto auto auto auto auto auto auto auto auto; 
  /* grid-template-columns: 75px 120px 52px 52px 52px 52px 75px 75px 230px ; */
  grid-auto-rows: 28px;
  grid-gap: auto;
  font-size: small;
}

.sheet-edit-psi-causation {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 41px 41px 41px 51px 35px 35px 35px 35px 35px 35px 35px 35px 35px 35px;
  grid-auto-rows: 28px;
  grid-gap: 2px;
  font-size: small;
}

.sheet-edit-repeating-causation {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 120px 110px 52px 90px 52px 75px 75px 190px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-clairvoyance {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;  
  grid-template-columns: 60px 120px 52px 52px 60px 60px 90px 60px 60px 60px 60px;
  grid-auto-rows: 25px;
  grid-gap: auto;
  text-align: center;  
}

.sheet-edit-repeating-clairvoyance {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 75px 100px 52px 52px 110px 52px 52px 75px 230px; 
  grid-auto-rows: 25px;
  grid-gap: 4px;  
  font-size: small;
}

.sheet-edit-psi-deflection {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 120px 120px 120px 120px 120px 120px;
  grid-auto-rows: 25px;
  grid-gap: 2px;
  text-align: center;
  font-size: small;
}

.sheet-edit-repeating-deflection {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 110px 52px 52px 110px 60px 60px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-domination {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 120px 60px 60px 60px 60px 60px 120px;
  grid-auto-rows: 28px;
  grid-gap: auto;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-domination {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-energy-communion {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 60px 60px 60px 60px 120px 60px 60px; /* 60px 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-energy-communion {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-molecular-alteration {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 120px 75px 75px 75px 75px 75px 75px; /* 60px 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-molecular-alteration {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-pyrokinesis {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 120px 60px 60px 60px 60px 60px 60px; /* 60px 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-pyrokinesis {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-subatomic-alteration {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 50px 60px 60px 60px 50px 90px 60px 90px 60px; /* 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-subatomic-alteration {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-telekinesis {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 120px 60px 60px 60px 60px 60px 60px; /* 60px 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-telekinesis {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-edit-psi-anti-psionics {
  grid-area: edit-psionics;
  display: grid;
  width: 827px;
  grid-template-columns: 60px 120px 120px 60px 60px 60px 60px 60px 60px; /* 60px 60px */
  grid-auto-rows: 28px;
  grid-gap: 2px;
  text-align: left;
  font-size: small;
}

.sheet-edit-repeating-anti-psionics {
  grid-area: psi-sub-skills;
  display: grid;
  width: 827px;
  grid-template-columns: 70px 100px 52px 52px 110px 52px 52px 75px 230px;
  grid-auto-rows: 25px;
  grid-gap: 4px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-repeating-skills {
  grid-area: psi-sub-skills;
  display: flex;
  grid-template-columns: 60px 100px 100px 522px;
  grid-auto-rows: 28px;
  grid-gap: 5px;
}

.edit-psi-bd h3 {
  grid-area: edit-psionics;
  grid-template-columns: auto;
  /* grid-columns: 1 / 4; */
  grid-auto-rows: 25px;
  grid-gap: 5px;
  font-size: 16px;
  text-align: center;
}


.sheet-psionics h3 {
  grid-column: 1 / -1;
  text-align: center;
  grid-row: 1;
}

/* END OF PSIONICS EDIT PAGE */

/* START OF SHIP PAGE */
.sheet-edit-ship {
  display: grid;
  width: 100%;  
  grid-gap: 2px;    
  grid-template-columns: 275px 275px 277px; 
  font-size: small;
  grid-template-rows: auto;
  grid-template-areas:
  "health   health    ship"
  "weapons  defenses  defenses"
  "drive    drive     drive"
  "equipment equipment equipment"
}
.sheet-ship-health {
  grid-area: health;
  display: grid;
  width: 100%; /* Adjust the width to fill the available space */
  box-sizing: border-box; 
  height: auto;
  text-align: center;  
  grid-template-columns: 75px 60px 60px 52px 60px 60px 60px 60px 60px;  
  grid-auto-rows: 28px;
  font-size: small;  
}
  /*
.sheet-ship-health {
  grid-area: health;
  display: grid;
  width: 98%;  
  height: auto;
  text-align: left;
  grid-gap: 1px;
  grid-template-columns: 75px 75px 75px 52px 60px 60px 60px 60px 60px;  
  grid-auto-rows: 28px;
  font-size: small;  
}
*/
.sheet-ship-weapons {
  grid-area: weapons;
  display: grid;
  width: 98%;
  grid-template-columns: auto auto auto;
  grid-template-rows: 28px;
  font-size: small;  
}
.sheet-ship-defenses {
  grid-area: defenses;
  display: grid;
  width: 98%;
  height: auto;
  grid-template-columns: auto auto auto;
  grid-template-rows: 28px;
  font-size: small;
}
.sheet-ship {
  grid-area: ship;
  display: grid;
  width: 267px; /* Adjust the width to match grid-template-columns */
  grid-template-columns: 250px;
  grid-template-rows: 28px;  
  font-size: small;
  box-sizing: border-box; /* Add this to include padding and border in total width and height */
}
/*
.sheet-ship {
  grid-area: ship;
  display: grid;
  width: 267px;  
  grid-template-columns: 250px;
  grid-template-rows: 28px;  
  font-size: small;
}
*/
.sheet-ship-drive{
  grid-area: drive;
  display: flexbox;
  width: 810px;
  height: auto;
  grid-template-columns: 75px 75px 100px 120px 60px 60px 75px;
  grid-template-rows: 28px;
  font-size: small;
}

.sheet-weapon,
.sheet-equipment {
    display: none;
}

/* Updated the selector to be correct */
.sheet-type:checked[value="1"] ~ .sheet-weapon {
  display: grid;  
  grid-template-columns: 80px 52px 75px 75px 52px 52px 52px 52px 52px 60px 60px 60px 52px 52px;
  grid-template-rows: auto;    
  grid-auto-rows: 28px;    
  grid-gap: 3px;    
  column-gap: 1px;  
  color:#278bce;
}

.sheet-type:checked[value="0"] ~ .sheet-equipment {
    display: grid; /* Updated from flexbox to flex */
    /* Other styles remain the same */
    text-align: center;
    width: 98%;
    grid-gap: auto;
  /* overflow: scroll; */
    height: auto;
    grid-template-columns: 75px 200px 60px 60px 60px 200px;
    grid-template-rows: 28px;
    font-size: small;
}


/* START OF NPC SECTIONS */

.sheet-npc-grid {
  display: grid;
  width: 827px;
  grid-gap: 1px;
  grid-template-columns: auto auto auto auto auto auto auto auto auto auto auto;
  grid-template-rows: 28px;
  font-size: smaller; 
  grid-template-areas: 
  "defense-header"
  "defense"
  "sheet"  
  "attack-header""
  "attack"
  "notes"
}

.sheet-npc-defense-header {
  grid-area: defense-header;
  display: grid;
  grid-template-columns: 75px 75px 52px 52px 52px 52px 52px 52px 52px 52px 52px 75px 75px;
  grid-auto-rows: 28px;
  grid-gap: 2px;
  font-size: small;
  padding-bottom: 5px;
}

.sheet-npc-defense {
  grid-area: defense;
  display: grid;
  grid-template-columns: 60px 60px 52px 52px 52px 52px 52px 52px 52px 52px 52px 60px 60px;
  grid-auto-rows: 25px;
  grid-gap: 1px;
  font-size: small;
}

.sheet-npc-attack-header {
  grid-area: attack-header;
  display: grid;
  grid-template-columns: 60px 110px 100px 90px 60px 60px 60px 60px 60px 60px 52px 52px;
  grid-auto-rows: 25px;
  grid-gap: 1px;
  font-size: smaller;
}

.sheet-npc-attack{
  grid-area: attack;
  display: grid;
  grid-template-columns: 60px 110px 100px 90px 60px 60px 60px 60px 60px 60px 52px 52px;
  grid-auto-rows: 25px;
  grid-gap: 1px;
  font-size: smaller;
}

.sheet-npc-notes {
  grid-area: notes;
  display: grid;
  grid-template-columns: 800px;
  grid-auto-rows: 25px;
  grid-gap: 1px;
  font-size: small;
}

/* END OF NPC SECTIONS */
.sheet-psi-scrollable-130 {
  overflow: visible;
  height: auto;
  max-height: none;
}

.sheet-psi-scrollable-200 {
  overflow: visible;
  height: auto;
  max-height: none;
}


/* // BUTTONS CSS */

.sheet-scrollable-400 {
  overflow: auto;
  height: 400px;
}

.sheet-combat-scrollable-300 {
    overflow: auto;
    height: 300px;
  }

button[type="roll"].sheet-button-roll:before {
  content: "t ";
}

button[type="roll"].sheet-ship-button {
  content: "";
  text-shadow: none;
  color: #278bce;
  font-size: 8px;
  text-align: left;
  line-height: 20px;
  height: 20px;
  width: 52px;
  /* min-width: 50px; */  
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-ship-button:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-ship-button:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll {
  content: "";
  text-shadow: none;
  color: #278bce;
  font-size: 11px;
  text-align: center;
  line-height: 20px;
  height: 20px;
  width: 52px;
  /* min-width: 50px; */
  padding: 2px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-roll {
  content: "";
  text-shadow: none;
  color: #5ed0ea;
  font-size: 12px;
  text-align: center;
  line-height: 10px;
  height: 16px;
  width: auto;
  min-width: 50px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-roll:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-roll:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll-skills:before {
  content: "t ";
}

button[type="roll"].sheet-button-roll-skills {
  content: "";
  text-shadow: none;
  color: #278bce;
  font-size: 10px;
  text-align: center;
  line-height: 20px;
  height: 20px;
  width: 52px;
  /* min-width: 50px; */  
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll-skills:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll-skills:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="roll"].sheet-button-roll2:before {
    content: "t ";
  }
  
  button[type="roll"].sheet-button-roll2 {
    content: "";
    text-shadow: none;
    color: #278bce;
    font-size: 24px;
    text-align: center;
    line-height: 1px;
    height: 20px;
    width: 60px;    
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px outset rgba(255, 255, 255, 0.2);
  }
  
  button[type="roll"].sheet-button-roll2:hover {
    text-shadow: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px inset rgba(255, 255, 255, 0.2);
  }
  
  button[type="roll"].sheet-button-roll2:focus {
    text-shadow: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px inset rgba(255, 255, 255, 0.2);
  }
  
  button[type="action"].sheet-button-roll2 {
    content: "";
    text-shadow: none;
    color: #5ed0ea;
    font-size: 10px;
    text-align: center;
    line-height: 10px;
    height: 10px;
    width: 60px;    
    padding: 5px;    
    background: rgba(0, 0, 0, 0.2);
    border: 1px outset rgba(255, 255, 255, 0.2);
  }
  
  button[type="action"].sheet-button-roll2:hover {
    text-shadow: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px inset rgba(255, 255, 255, 0.2);
  }
  
  button[type="action"].sheet-button-roll2:focus {
    text-shadow: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px inset rgba(255, 255, 255, 0.2);
  }

  /* Skills Buttons on main page */
button[type="roll"].sheet-button-rolls:before {
  content: "t ";
}

button[type="roll"].sheet-button-rolls {
  content: "";
  text-shadow: none;
  color: #2788ce;
  font-size: small;
  text-align: center;
  line-height: 10px;
  height: 8px;
  width: 60px;
  min-width: 25px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgb(243, 7, 7);
}

button[type="roll"].sheet-button-rolls:hover {
  text-shadow: none;
  background: rgba(229, 69, 69, 0.15);
  border: 1px inset rgba(233, 8, 8, 0.607);
}

button[type="roll"].sheet-button-rolls:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}


/* Clairvoyance Buttons No Dice, Just Names */

button[type="roll"].sheet-button-rollc:before {
  content: "t ";
}

/* Equipped Buttons */
button[type="roll"].sheet-button-rollw:before {
  content: "t ";
}

button[type="roll"].sheet-button-rollw {
  content: "";
  text-shadow: none;
  color: #2788ce;
  font-size: small;
  text-align: center;
  line-height: 20px;
  height: 20px;
  width: 65px;
  min-width: 25px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgb(243, 7, 7);
}

button[type="roll"].sheet-button-rollw:hover {
  text-shadow: none;
  background: rgba(229, 69, 69, 0.15);
  border: 1px inset rgba(233, 8, 8, 0.607);
}

button[type="roll"].sheet-button-rollw:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-rollw {
  content: "";
  text-shadow: none;
  color: #5ed0ea;
  font-size: 8px;
  text-align: center;
  line-height: 10px;
  height: 16px;
  width: 6.5em;
  min-width: 50px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-rollw:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-rollw:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

/* Clairvoyance Buttons No Dice, Just Names */

button[type="roll"].sheet-button-rollc:before {
  content: "t ";
}

button[type="roll"].sheet-button-rollc {
  content: "";
  text-shadow: none;
  color: #2788ce;
  font-size: small;
  text-align: left;
  line-height: 0px;
  height: 18px;
  width: 50px;
  min-width: 25px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset #2788ce;
}

button[type="roll"].sheet-button-rollc:hover {
  text-shadow: none;
  background: rgba(229, 69, 69, 0.15);
  border: 1px inset #2788ce;
}

button[type="roll"].sheet-button-rollc:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset #2788ce;
}

button[type="action"].sheet-button-rollc {
  content: "";
  text-shadow: none;
  color: #000000;
  font-size: 8px;
  text-align: left;
  line-height: 10px;
  height: 16px;
  width: 6.5em;
  min-width: 50px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px outset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-rollc:hover {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}

button[type="action"].sheet-button-rollc:focus {
  text-shadow: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px inset rgba(255, 255, 255, 0.2);
}
/*
.sheet-button-roll {
    background-color: rgb(red, green, blue)  ;
    font-family: dicefontd6;
    content: "l"; 
    color: #500000;
    width: 2em;
}
*/
.sheet-block-a,
.charsheet .sheet-block-switch:checked ~ .sheet-block-b {
  display: block;
}

.charsheet .sheet-block-b,
.charsheet .sheet-block-switch:checked ~ .sheet-block-a {
  display: none;
}
/* Standalone App Shell */
:root {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #1a1d26;
  color: #d7e4ef;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.app-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 12px;
  border-bottom: 1px solid #273647;
  background: linear-gradient(180deg, #101722 0%, #0f1620 100%);
}

.app-toolbar-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.density-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9bc4df;
  margin-left: 2px;
}

.density-group select {
  border: 1px solid #345a7a;
  background: #12263a;
  color: #d5efff;
  border-radius: 4px;
  height: 24px;
  padding: 0 8px;
}

.app-toolbar button,
.roll-panel button,
.repeat-add,
.repeat-remove {
  border: 1px solid #345a7a;
  background: #12263a;
  color: #d5efff;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

.app-toolbar button:hover,
.roll-panel button:hover,
.repeat-add:hover,
.repeat-remove:hover {
  background: #17324b;
}

.save-status {
  color: #9bc4df;
  font-size: 12px;
  min-height: 16px;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(860px, 1fr) 320px;
  gap: 8px;
  align-items: start;
  padding: 8px;
}

.sheet-area {
  overflow: auto;
  min-width: 0;
  min-height: calc(100vh - 70px);
}

.roll-panel {
  position: sticky;
  top: 60px;
  align-self: start;
  border: 1px solid #2c3f54;
  border-radius: 6px;
  background: #0f1620;
  max-height: calc(100vh - 82px);
  display: flex;
  flex-direction: column;
}

.roll-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px solid #2c3f54;
}

.roll-log {
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.roll-card {
  border: 1px solid #324962;
  border-radius: 6px;
  background: rgba(11, 26, 41, 0.9);
}

.roll-card header {
  padding: 6px 8px;
  font-weight: 700;
  color: #ffd700;
  border-bottom: 1px solid #2f475f;
}

.roll-card section {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.roll-detail {
  margin-top: 4px;
  color: #8bd9ff;
}

.roll-detail span {
  display: block;
  color: #5ba6cb;
  font-size: 11px;
  margin-top: 1px;
  word-break: break-word;
}

.repeat-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.repeat-row {
  position: relative;
  padding-top: 20px;
  margin-bottom: 6px;
  border-top: 1px dotted #33587a;
}

.repeat-remove {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 11px;
  padding: 2px 6px;
}

@media (max-width: 1320px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .roll-panel {
    position: static;
    max-height: 420px;
  }
}

/* Browser polish and alignment overrides */
.sheet-area {
  padding: 6px;
  scrollbar-gutter: stable both-edges;
}

.sheet-area .charsheet {
  width: max-content;
  min-width: 827px;
  transform-origin: top left;
  zoom: 1;
}

.charsheet {
  --ctl-h: 24px;
  --ctl-h-compact: 22px;
  --ctl-font-size: 12px;
  --btn-w-xs: 52px;
  --btn-w-sm: 60px;
  --btn-w-md: 75px;
  --btn-w-lg: 100px;
  --field-w-xs: 52px;
  --field-w-sm: 60px;
  --field-w-md: 75px;
  --field-w-lg: 120px;
  --field-w-xl: 200px;
  --gutter-sm: 4px;
  --gutter-md: 6px;
  --panel-radius: 6px;
  --panel-pad: 6px;
  --panel-border: #2e5d84;
  --panel-bg: rgba(15, 20, 28, 0.38);
}

body.density-compact .charsheet {
  --ctl-h: 22px;
  --ctl-font-size: 11px;
  --btn-w-xs: 48px;
  --btn-w-sm: 56px;
  --btn-w-md: 70px;
  --btn-w-lg: 92px;
  --field-w-xs: 48px;
  --field-w-sm: 56px;
  --field-w-md: 70px;
  --field-w-lg: 112px;
  --field-w-xl: 188px;
  --gutter-sm: 3px;
  --gutter-md: 5px;
  --panel-pad: 5px;
}

body.density-balanced .charsheet {
  --ctl-h: 24px;
  --ctl-font-size: 12px;
}

body.density-readable .charsheet {
  --ctl-h: 28px;
  --ctl-font-size: 13px;
  --btn-w-xs: 58px;
  --btn-w-sm: 66px;
  --btn-w-md: 82px;
  --btn-w-lg: 110px;
  --field-w-xs: 58px;
  --field-w-sm: 66px;
  --field-w-md: 82px;
  --field-w-lg: 128px;
  --field-w-xl: 212px;
  --gutter-sm: 5px;
  --gutter-md: 8px;
  --panel-pad: 8px;
}

.charsheet button[type="roll"]::before,
.charsheet button[type="action"]::before {
  content: none !important;
}

.charsheet div.sheet-main-buttons {
  width: 100% !important;
  max-width: 827px;
  grid-template-columns: repeat(8, minmax(90px, 1fr)) !important;
  grid-auto-rows: var(--ctl-h) !important;
  gap: var(--gutter-sm) !important;
  align-items: stretch;
}

.charsheet button[type="roll"],
.charsheet button[type="action"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctl-h);
  min-height: var(--ctl-h);
  line-height: 1.1;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  font-size: var(--ctl-font-size);
}

/* Button type standards */
.charsheet button[type="roll"].sheet-button-roll,
.charsheet button[type="action"].sheet-button-roll {
  min-width: var(--btn-w-xs);
}

.charsheet button[type="roll"].sheet-button-rollw,
.charsheet button[type="action"].sheet-button-rollw {
  min-width: var(--btn-w-lg);
}

.charsheet button[type="roll"].sheet-button-rollc,
.charsheet button[type="action"].sheet-button-rollc {
  min-width: var(--btn-w-sm);
}

/* Attribute button style: left label, right value, consistent sizing */
.charsheet .sheet-core-stats {
  gap: var(--gutter-md) !important;
  grid-auto-rows: var(--ctl-h) !important;
}

.charsheet .sheet-core-stats .sheet-button-roll {
  width: 100% !important;
  min-width: 120px;
  justify-content: flex-start !important;
  padding: 0 10px !important;
  gap: 8px;
  letter-spacing: 0.15px;
}

.charsheet .sheet-core-stats .sheet-button-roll span[name^="attr_"] {
  margin-left: auto;
  min-width: 18px;
  justify-content: flex-end;
  text-align: right;
}

/* Uniform panel/box system */
.charsheet div,
.charsheet section,
.charsheet article,
.charsheet fieldset {
  box-sizing: border-box;
}

.charsheet .sheet-block,
.charsheet .sheet-block-2px,
.charsheet .sheet-borderedContainer,
.charsheet .repeat-row,
.charsheet fieldset[class*="repeating_"] {
  border-radius: var(--panel-radius) !important;
}

.charsheet .sheet-block,
.charsheet .sheet-block-2px {
  border: 1px solid var(--panel-border) !important;
  background: var(--panel-bg);
  padding: var(--panel-pad) !important;
}

.charsheet fieldset[class*="repeating_"] {
  margin: 0;
  padding: var(--gutter-sm);
  border: 1px solid rgba(85, 110, 136, 0.75);
}

.charsheet :is(
  .sheet-character,
  .sheet-equipped,
  .sheet-editskills,
  .sheet-inventory,
  .sheet-editcharacter,
  .sheet-editpsionics,
  .sheet-editship,
  .sheet-npc
) {
  width: 100%;
}

.charsheet :is(
  .sheet-grid-section,
  .sheet-equipped-grid,
  .sheet-edit-character-grid,
  .sheet-edit-skills-grid,
  .sheet-edit-psionics-grid,
  .sheet-edit-ship,
  .sheet-npc-grid
) {
  width: 100% !important;
  max-width: 827px;
  margin-inline: auto;
}

.charsheet :is(
  .sheet-core-health,
  .sheet-equipped-armor,
  .sheet-equipped-combat-melee,
  .sheet-equipped-combat-ranged,
  .sheet-edit-core-character,
  .sheet-edit-life-energy,
  .sheet-edit-psi-body-discipline,
  .sheet-ship-health,
  .sheet-ship-defenses,
  .sheet-ship-weapons,
  .sheet-ship-drive,
  .sheet-ship,
  .sheet-npc-defense,
  .sheet-npc-defense-header,
  .sheet-npc-attack,
  .sheet-npc-attack-header,
  .sheet-npc-notes
) {
  width: 100% !important;
  max-width: 827px;
}

/* Psionics layout fixes */
.charsheet .sheet-edit-psi-buttons {
  display: grid !important;
  width: 100% !important;
  max-width: 827px;
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  grid-auto-rows: var(--ctl-h);
  gap: var(--gutter-sm) !important;
  align-items: center;
  padding: var(--gutter-sm) 0;
}

.charsheet .sheet-edit-psi-buttons > * {
  width: 100% !important;
  min-width: 0;
}

.charsheet .sheet-editpsionics :is(
  .sheet-edit-psi-body-discipline,
  .sheet-edit-psi-causation,
  .sheet-edit-psi-clairvoyance,
  .sheet-edit-psi-deflection,
  .sheet-edit-psi-domination,
  .sheet-edit-psi-energy-communion,
  .sheet-edit-psi-molecular-alteration,
  .sheet-edit-psi-pyrokinesis,
  .sheet-edit-psi-subatomic-alteration,
  .sheet-edit-psi-telekinesis,
  .sheet-edit-psi-anti-psionics,
  .sheet-edit-repeating-body-discipline,
  .sheet-edit-repeating-causation,
  .sheet-edit-repeating-clairvoyance,
  .sheet-edit-repeating-deflection,
  .sheet-edit-repeating-domination,
  .sheet-edit-repeating-energy-communion,
  .sheet-edit-repeating-molecular-alteration,
  .sheet-edit-repeating-pyrokinesis,
  .sheet-edit-repeating-subatomic-alteration,
  .sheet-edit-repeating-telekinesis,
  .sheet-edit-repeating-anti-psionics
) {
  width: 100% !important;
  max-width: 827px;
  gap: var(--gutter-sm) !important;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.charsheet .sheet-editpsionics :is(
  .sheet-edit-psi-body-discipline,
  .sheet-edit-psi-causation,
  .sheet-edit-psi-clairvoyance,
  .sheet-edit-psi-deflection,
  .sheet-edit-psi-domination,
  .sheet-edit-psi-energy-communion,
  .sheet-edit-psi-molecular-alteration,
  .sheet-edit-psi-pyrokinesis,
  .sheet-edit-psi-subatomic-alteration,
  .sheet-edit-psi-telekinesis,
  .sheet-edit-psi-anti-psionics,
  .sheet-edit-repeating-body-discipline,
  .sheet-edit-repeating-causation,
  .sheet-edit-repeating-clairvoyance,
  .sheet-edit-repeating-deflection,
  .sheet-edit-repeating-domination,
  .sheet-edit-repeating-energy-communion,
  .sheet-edit-repeating-molecular-alteration,
  .sheet-edit-repeating-pyrokinesis,
  .sheet-edit-repeating-subatomic-alteration,
  .sheet-edit-repeating-telekinesis,
  .sheet-edit-repeating-anti-psionics
) > * {
  min-width: 0;
}

.charsheet .sheet-editpsionics :is(
  .sheet-edit-psi-body-discipline,
  .sheet-edit-psi-causation,
  .sheet-edit-psi-clairvoyance,
  .sheet-edit-psi-deflection,
  .sheet-edit-psi-domination,
  .sheet-edit-psi-energy-communion,
  .sheet-edit-psi-molecular-alteration,
  .sheet-edit-psi-pyrokinesis,
  .sheet-edit-psi-subatomic-alteration,
  .sheet-edit-psi-telekinesis,
  .sheet-edit-psi-anti-psionics,
  .sheet-edit-repeating-body-discipline,
  .sheet-edit-repeating-causation,
  .sheet-edit-repeating-clairvoyance,
  .sheet-edit-repeating-deflection,
  .sheet-edit-repeating-domination,
  .sheet-edit-repeating-energy-communion,
  .sheet-edit-repeating-molecular-alteration,
  .sheet-edit-repeating-pyrokinesis,
  .sheet-edit-repeating-subatomic-alteration,
  .sheet-edit-repeating-telekinesis,
  .sheet-edit-repeating-anti-psionics
) :is(input, select, button, textarea) {
  width: 100% !important;
  min-width: 0 !important;
}

/* Edit Character readability spacing */
.charsheet .sheet-editcharacter .sheet-edit-character-core-stats,
.charsheet .sheet-editcharacter .sheet-edit-character-health {
  width: 100% !important;
  max-width: 827px;
  grid-auto-rows: calc(var(--ctl-h) + 4px) !important;
  row-gap: calc(var(--gutter-sm) + 2px) !important;
  column-gap: calc(var(--gutter-sm) + 2px) !important;
  padding: calc(var(--panel-pad) + 2px) !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats {
  grid-template-columns: repeat(15, minmax(52px, 1fr)) !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-health {
  grid-template-columns: repeat(15, minmax(52px, 1fr)) !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats :is(input, select, button, textarea),
.charsheet .sheet-editcharacter .sheet-edit-character-health :is(input, select, button, textarea) {
  width: 100% !important;
  min-width: 0;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats :is(span, b),
.charsheet .sheet-editcharacter .sheet-edit-character-health :is(span, b) {
  min-height: calc(var(--ctl-h) + 4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Inventory redesign: clean, futuristic, manageable */
.charsheet .sheet-inventory {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  display: grid;
  gap: calc(var(--gutter-md) + 4px);
}

.charsheet .sheet-inventory > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: var(--gutter-sm) var(--gutter-md);
  padding: calc(var(--panel-pad) + 2px);
  border: 1px solid rgba(66, 119, 168, 0.85);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(12, 20, 33, 0.95), rgba(18, 35, 55, 0.8));
}

.charsheet .sheet-inventory > div:first-child input[type="hidden"] {
  display: none !important;
}

.charsheet .sheet-inventory > div:first-child span[name$="_header"] {
  font-weight: 700;
  letter-spacing: 0.25px;
  white-space: nowrap;
  padding-left: 0 !important;
}

.charsheet .sheet-edit-inventory-grid-section {
  gap: calc(var(--gutter-md) + 4px) !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gutter-sm) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons input[type="hidden"] {
  display: none !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(var(--ctl-h) + 4px);
  border-radius: 999px;
  border: 1px solid rgba(77, 116, 153, 0.9);
  background: linear-gradient(180deg, rgba(14, 24, 38, 0.95), rgba(12, 19, 31, 0.85));
  box-shadow: inset 0 0 0 1px rgba(40, 69, 97, 0.35);
  cursor: pointer;
  margin: 0 !important;
  padding: 0 8px !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons label h4 {
  margin: 0;
  font-size: 12px !important;
  color: #8fd3ff !important;
  letter-spacing: 0.2px;
  line-height: 1;
}

.charsheet .sheet-edit-inventory-weapon-buttons label input[type="checkbox"] {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"]:checked),
.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"][value="1"]),
.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"][value="on"]) {
  border-color: rgba(64, 207, 255, 0.95);
  background: linear-gradient(180deg, rgba(20, 75, 111, 0.95), rgba(15, 54, 82, 0.88));
  box-shadow: 0 0 0 1px rgba(92, 216, 255, 0.25), 0 0 16px rgba(45, 174, 231, 0.22);
}

.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"]:checked) h4,
.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"][value="1"]) h4,
.charsheet .sheet-edit-inventory-weapon-buttons label:has(input[type="checkbox"][value="on"]) h4 {
  color: #e8fbff !important;
}

.charsheet .sheet-inventory :is(
  .sheet-inventory-armor,
  .sheet-inventory-melee,
  .sheet-inventory-ranged,
  .sheet-inventory-explosives,
  .sheet-edit-inventory-artifacts,
  .sheet-edit-inventory-contact-entries
) {
  border: 1px solid rgba(66, 108, 145, 0.8);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(13, 20, 30, 0.95), rgba(16, 25, 38, 0.8));
  padding: calc(var(--panel-pad) + 2px);
  overflow: auto;
}

.charsheet .sheet-inventory :is(
  .sheet-edit-armor-entries,
  .sheet-edit-melee-entries,
  .sheet-edit-weapon-entries,
  .sheet-edit-explosives-entries,
  .sheet-edit-artifact-entries,
  .sheet-edit-inventory-contact-entries
) {
  min-width: max-content;
  gap: var(--gutter-sm) !important;
  align-items: center;
}

.charsheet .sheet-inventory :is(
  .sheet-edit-armor-entries,
  .sheet-edit-melee-entries,
  .sheet-edit-weapon-entries,
  .sheet-edit-explosives-entries,
  .sheet-edit-artifact-entries,
  .sheet-edit-inventory-contact-entries
) > :is(h3, h4, span, input, select, button) {
  min-height: var(--ctl-h);
}

.charsheet .sheet-inventory h2 {
  margin-bottom: calc(var(--gutter-sm) + 2px);
  border: 1px solid rgba(77, 143, 194, 0.85);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(23, 46, 69, 0.9), rgba(13, 25, 39, 0.95));
  letter-spacing: 0.45px;
}

.charsheet .sheet-inventory :is(input, select, span, h3, h4) {
  text-overflow: ellipsis;
}

/* Inventory toggles: fixed position on/off chips */
.charsheet .sheet-edit-inventory-weapon-buttons {
  position: sticky;
  top: 0;
  z-index: 6;
}

.charsheet .inventory-toggle-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gutter-sm);
  width: 100%;
}

.charsheet .inventory-toggle-btn {
  height: calc(var(--ctl-h) + 4px);
  min-height: calc(var(--ctl-h) + 4px);
  border-radius: 999px;
  border: 1px solid rgba(73, 110, 143, 0.9);
  background: linear-gradient(180deg, rgba(18, 26, 39, 0.95), rgba(12, 19, 31, 0.9));
  color: #97c9ed;
  letter-spacing: 0.2px;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease, color 120ms ease, border-color 120ms ease;
}

.charsheet .inventory-toggle-btn:hover {
  border-color: rgba(96, 150, 192, 0.95);
}

.charsheet .inventory-toggle-btn.is-open {
  color: #ecfbff;
  border-color: rgba(66, 207, 255, 0.98);
  background: linear-gradient(180deg, rgba(20, 84, 124, 0.96), rgba(15, 58, 88, 0.9));
  box-shadow: 0 0 0 1px rgba(93, 217, 255, 0.25), 0 0 16px rgba(44, 173, 230, 0.24);
}

/* Inventory fluid grids: no horizontal scroll */
.charsheet .sheet-inventory :is(
  .sheet-inventory-armor,
  .sheet-inventory-melee,
  .sheet-inventory-ranged,
  .sheet-inventory-explosives,
  .sheet-edit-inventory-artifacts,
  .sheet-edit-inventory-contact-entries
) {
  overflow-x: hidden !important;
}

.charsheet .sheet-inventory .repeat-row {
  overflow: hidden;
}

.charsheet .sheet-inventory :is(
  .sheet-edit-armor-entries,
  .sheet-edit-melee-entries,
  .sheet-edit-weapon-entries,
  .sheet-edit-explosives-entries,
  .sheet-edit-artifact-entries,
  .sheet-edit-inventory-contact-entries
) {
  width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-inventory .sheet-edit-armor-entries {
  grid-template-columns: 1.7fr repeat(13, minmax(0, 1fr)) !important;
}

.charsheet .sheet-inventory .sheet-edit-melee-entries {
  grid-template-columns: 1.7fr repeat(12, minmax(0, 1fr)) !important;
}

.charsheet .sheet-inventory .sheet-edit-weapon-entries {
  grid-template-columns: 1.8fr repeat(14, minmax(0, 1fr)) !important;
}

.charsheet .sheet-inventory .sheet-edit-explosives-entries {
  grid-template-columns: 1.7fr repeat(11, minmax(0, 1fr)) !important;
}

.charsheet .sheet-inventory .sheet-edit-artifact-entries {
  grid-template-columns: 1.8fr 1.25fr 1.35fr repeat(8, minmax(0, 1fr)) !important;
}

.charsheet .sheet-inventory .sheet-edit-inventory-contact-entries {
  grid-template-columns: 1.1fr 4fr !important;
}

.charsheet .sheet-inventory :is(
  .sheet-edit-armor-entries,
  .sheet-edit-melee-entries,
  .sheet-edit-weapon-entries,
  .sheet-edit-explosives-entries,
  .sheet-edit-artifact-entries,
  .sheet-edit-inventory-contact-entries
) > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-inventory :is(input, select, button) {
  width: 100% !important;
  min-width: 0 !important;
}

/* Tone down pink glow */
.charsheet .sheet-pink-color {
  color: #c690ad !important;
}

/* Equipped combat dashboard */
.charsheet .sheet-equipped-grid {
  width: 100% !important;
  max-width: 827px;
  margin-inline: auto;
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  grid-template-areas:
    "hud hud hud hud hud hud hud hud hud hud hud hud"
    "armor armor armor armor armor armor armor armor armor armor armor armor"
    "melee melee melee melee melee melee melee melee melee melee melee melee"
    "ranged ranged ranged ranged ranged ranged ranged ranged ranged ranged ranged ranged" !important;
  gap: calc(var(--gutter-md) + 2px) !important;
}

.charsheet .sheet-equipped-hud {
  grid-area: hud;
}

.charsheet .sheet-equipped-hud-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr 1.2fr;
  gap: var(--gutter-md);
  align-items: stretch;
}

.charsheet .sheet-equipped-card {
  border: 1px solid rgba(69, 112, 149, 0.78);
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(11, 18, 28, 0.96), rgba(16, 29, 44, 0.78));
  padding: calc(var(--panel-pad) + 1px);
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: var(--gutter-sm);
}

.charsheet .sheet-equipped-card h3 {
  margin: 0;
  padding: 0 8px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(80, 145, 199, 0.75);
  border-radius: 6px;
  color: #ffd700;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.charsheet .sheet-hud-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(70px, 1fr);
  align-items: center;
  gap: var(--gutter-sm);
}

.charsheet .sheet-hud-row > span:first-child {
  color: #8fc6ef;
  font-size: 12px;
  justify-content: flex-start;
}

.charsheet .sheet-hud-row > span:last-child {
  justify-content: flex-end;
}

.charsheet .sheet-hud-status-head,
.charsheet .sheet-hud-status-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(64px, 1fr) minmax(64px, 1fr);
  align-items: center;
  gap: 3px;
}

.charsheet .sheet-hud-status-head {
  padding: 0 1px;
}

.charsheet .sheet-hud-status-head > span {
  color: #8fc6ef;
  font-size: 10px;
  font-weight: 600;
}

.charsheet .sheet-hud-status-head > span:first-child,
.charsheet .sheet-hud-status-row > span:first-child {
  justify-content: flex-start;
}

.charsheet .sheet-hud-status-head > span:not(:first-child),
.charsheet .sheet-hud-status-row > span:last-child {
  justify-content: flex-end;
}

.charsheet .sheet-hud-status-row > input {
  width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-hud-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter-sm);
  align-items: center;
}

.charsheet .sheet-hud-attr-grid > span:nth-child(odd) {
  justify-content: flex-start;
  color: #95c9ef;
}

.charsheet .sheet-hud-attr-grid > span:nth-child(even) {
  justify-content: flex-end;
}

.charsheet .sheet-hud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter-sm);
  margin-top: 2px;
}

.charsheet .sheet-hud-skill-row {
  display: grid;
  grid-template-columns: 56px 1fr 58px;
  gap: var(--gutter-sm);
  align-items: center;
}

.charsheet .sheet-hud-skill-row > * {
  width: 100% !important;
  min-width: 0;
}

.charsheet .sheet-equipped-armor,
.charsheet .sheet-equipped-combat-melee,
.charsheet .sheet-equipped-repeating-ranged {
  width: 100% !important;
  max-width: 827px;
}

.charsheet .sheet-equipped-armor > h2,
.charsheet .sheet-equipped-combat-melee > h2,
.charsheet .sheet-equipped-repeating-ranged > h2 {
  width: 100% !important;
}

@media (max-width: 1200px) {
  .charsheet .sheet-equipped-hud-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 840px) {
  .charsheet .sheet-equipped-hud-grid {
    grid-template-columns: 1fr;
  }

  .charsheet .sheet-hud-actions {
    grid-template-columns: 1fr;
  }
}

/* Ship image uploader */
.charsheet .sheet-ship {
  grid-template-columns: 1fr !important;
  grid-auto-rows: min-content;
  gap: var(--gutter-sm);
}

.charsheet .sheet-ship .ship-design-image {
  width: 100%;
  max-width: 100%;
  min-height: 180px;
  max-height: 320px;
  object-fit: contain;
  background: rgba(8, 12, 18, 0.75);
  border: 1px solid rgba(69, 107, 141, 0.8);
  border-radius: 8px;
}

.charsheet .sheet-ship .ship-upload-controls {
  display: flex;
  gap: var(--gutter-sm);
  align-items: center;
  justify-content: flex-start;
}

.charsheet .sheet-ship .ship-upload-btn {
  border: 1px solid #3f6688;
  background: #17314b;
  color: #d6edff;
  border-radius: 6px;
  height: var(--ctl-h);
  padding: 0 10px;
  cursor: pointer;
}

.charsheet .sheet-ship .ship-upload-btn:hover {
  background: #1e3f5f;
}

/* Input type standards */
.charsheet input[type="text"],
.charsheet input[type="number"],
.charsheet select,
.charsheet textarea {
  height: var(--ctl-h);
  line-height: calc(var(--ctl-h) - 2px);
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  font-size: var(--ctl-font-size);
  box-sizing: border-box;
}

.charsheet .sheet-inputfield52 {
  width: var(--field-w-xs) !important;
}

.charsheet .sheet-inputfield60 {
  width: var(--field-w-sm) !important;
}

.charsheet .sheet-inputfield75 {
  width: var(--field-w-md) !important;
}

.charsheet .sheet-inputfield120 {
  width: var(--field-w-lg) !important;
}

.charsheet .sheet-inputfield200 {
  width: var(--field-w-xl) !important;
}

.charsheet span[name^="attr_"],
.charsheet .sheet-core-health > span,
.charsheet .sheet-skill-headers > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  min-height: var(--ctl-h);
  font-variant-numeric: tabular-nums;
}

.charsheet .sheet-core-health {
  align-items: center;
  grid-auto-rows: var(--ctl-h) !important;
  row-gap: var(--gutter-sm) !important;
  column-gap: var(--gutter-md) !important;
}

.charsheet .sheet-core-health span[name^="attr_"] {
  font-size: inherit;
}

.charsheet .sheet-grid-section,
.charsheet .sheet-equipped-grid,
.charsheet .sheet-edit-character-grid,
.charsheet .sheet-edit-skills-grid,
.charsheet .sheet-edit-psionics-grid,
.charsheet .sheet-edit-ship,
.charsheet .sheet-npc-grid {
  gap: var(--gutter-md) !important;
}

.charsheet .sheet-skill-headers,
.charsheet .repeat-row > .sheet-core-skills {
  width: 100% !important;
  max-width: 827px;
  display: grid !important;
  grid-template-columns: 60px 110px 90px 46px 46px 90px 46px 46px 46px 52px 52px 80px !important;
  gap: var(--gutter-sm) !important;
  align-items: center;
  grid-auto-rows: var(--ctl-h);
}

.charsheet .repeat-row > .sheet-core-skills > * {
  width: 100% !important;
  min-width: 0;
}

.repeat-row {
  padding-top: 24px;
  margin-bottom: 8px;
  border-top: 1px dotted #2d4f6b;
}

.repeat-remove {
  right: 4px;
  top: 2px;
}

@media (max-width: 980px) {
  .charsheet div.sheet-main-buttons {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
    grid-auto-rows: var(--ctl-h) !important;
  }
}

/* Final fit pass: keep panels and dense grids inside their borders */
.charsheet .sheet-editcharacter {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  overflow-x: hidden;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats,
.charsheet .sheet-editcharacter .sheet-edit-character-health {
  width: 100% !important;
  max-width: 827px;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  padding: var(--panel-pad) !important;
  overflow: hidden;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats {
  grid-template-columns: repeat(15, minmax(0, 1fr)) !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-health {
  grid-template-columns: repeat(15, minmax(0, 1fr)) !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats > *,
.charsheet .sheet-editcharacter .sheet-edit-character-health > * {
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats :is(input, select, button, textarea, span, b),
.charsheet .sheet-editcharacter .sheet-edit-character-health :is(input, select, button, textarea, span, b) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.charsheet .sheet-editcharacter .sheet-edit-character-core-stats :is(span, b),
.charsheet .sheet-editcharacter .sheet-edit-character-health :is(span, b) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.charsheet .sheet-editcharacter .sheet-power-armor-label {
  grid-column: span 2;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1 !important;
}

.charsheet .sheet-editcharacter .sheet-power-armor-spacer {
  display: none !important;
}

.charsheet .sheet-editship,
.charsheet .sheet-edit-ship {
  width: 100% !important;
  max-width: 827px;
  margin-inline: auto;
}

.charsheet .sheet-edit-ship {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.35fr) minmax(0, 1fr) !important;
  gap: var(--gutter-sm) !important;
  align-items: start;
}

.charsheet .sheet-ship-health,
.charsheet .sheet-ship,
.charsheet .sheet-ship-drive {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-ship {
  grid-template-columns: 1fr !important;
}

.charsheet .sheet-ship > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-edit-ship .sheet-center,
.charsheet .sheet-npc .sheet-center {
  margin: 0 !important;
}

.charsheet .sheet-ship input[name="attr_image_url"] {
  display: none !important;
}

.charsheet .sheet-ship .ship-upload-controls {
  width: 100%;
  flex-wrap: wrap;
}

.charsheet .sheet-npc {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  overflow-x: hidden;
}

.charsheet .sheet-npc-grid,
.charsheet .sheet-npc-defense-header,
.charsheet .sheet-npc-defense,
.charsheet .sheet-npc-attack-header,
.charsheet .sheet-npc-attack,
.charsheet .sheet-npc-notes {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-npc-defense-header,
.charsheet .sheet-npc-defense {
  grid-template-columns: 1.1fr 1.1fr repeat(9, minmax(0, 0.9fr)) 1fr 1fr !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-npc-attack-header,
.charsheet .sheet-npc-attack {
  grid-template-columns: 1fr 1.8fr 1.5fr 1.35fr repeat(6, minmax(0, 1fr)) 0.9fr 0.9fr !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-npc :is(.sheet-npc-defense-header, .sheet-npc-defense, .sheet-npc-attack-header, .sheet-npc-attack) > * {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.charsheet .sheet-npc-notes {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: minmax(var(--ctl-h), auto) !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-npc-notes input.sheet-inputfield {
  width: 100% !important;
}

.charsheet fieldset.repeating_npc_notes .repeat-row {
  padding-top: calc(var(--ctl-h) - 2px) !important;
  margin-bottom: 0 !important;
}

.charsheet :is(.sheet-block, .sheet-block-2px, .sheet-borderedContainer, fieldset[class*="repeating_"]) {
  max-width: 100% !important;
}

@media (max-width: 1050px) {
  .charsheet .sheet-edit-ship {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas:
      "health health"
      "ship ship"
      "drive drive" !important;
  }
}

@media (max-width: 760px) {
  .charsheet .sheet-edit-ship {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "health"
      "ship"
      "drive" !important;
  }
}

/* Scientific holographic UI rebuild */
body {
  background:
    radial-gradient(1200px 420px at 50% -120px, rgba(39, 132, 206, 0.23), transparent 62%),
    radial-gradient(900px 380px at 15% 0%, rgba(27, 191, 255, 0.14), transparent 58%),
    linear-gradient(180deg, #08111d 0%, #0b1727 50%, #0a1321 100%);
}

.app-toolbar {
  background: linear-gradient(180deg, rgba(8, 16, 29, 0.95), rgba(7, 14, 24, 0.92));
  border-bottom: 1px solid rgba(84, 141, 186, 0.42);
  box-shadow: 0 10px 30px rgba(0, 12, 26, 0.5);
  backdrop-filter: blur(6px);
}

.app-toolbar button,
.roll-panel button,
.repeat-add,
.repeat-remove {
  border: 1px solid rgba(88, 158, 212, 0.8);
  background: linear-gradient(180deg, rgba(13, 35, 58, 0.92), rgba(9, 26, 43, 0.9));
  color: #d8f2ff;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(57, 103, 142, 0.25), 0 0 0 1px rgba(26, 63, 95, 0.2);
}

.app-toolbar button:hover,
.roll-panel button:hover,
.repeat-add:hover,
.repeat-remove:hover {
  border-color: rgba(112, 191, 248, 0.95);
  background: linear-gradient(180deg, rgba(17, 49, 78, 0.95), rgba(10, 33, 54, 0.92));
}

.sheet-area {
  background-image:
    radial-gradient(circle at 30% 15%, rgba(38, 150, 225, 0.08), transparent 32%),
    radial-gradient(circle at 70% 12%, rgba(46, 204, 255, 0.07), transparent 28%);
}

.sheet-area .charsheet {
  width: 827px !important;
  min-width: 827px !important;
  max-width: 827px !important;
  border: 1px solid rgba(73, 139, 188, 0.5);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(10, 18, 31, 0.92), rgba(7, 14, 23, 0.92));
  box-shadow: 0 18px 44px rgba(2, 10, 21, 0.58), inset 0 0 80px rgba(18, 62, 96, 0.14);
  padding: 8px;
}

.charsheet {
  --panel-border: rgba(80, 150, 202, 0.68);
  --panel-bg: linear-gradient(165deg, rgba(10, 22, 38, 0.86), rgba(8, 17, 30, 0.85));
  font-family: "Orbitron", "Segoe UI", sans-serif;
}

.charsheet :is(.sheet-block, .sheet-block-2px, .sheet-borderedContainer, .sheet-equipped-card, fieldset[class*="repeating_"]) {
  border: 1px solid rgba(80, 150, 202, 0.68) !important;
  border-radius: 10px !important;
  background: linear-gradient(165deg, rgba(10, 22, 38, 0.86), rgba(8, 17, 30, 0.85)) !important;
  box-shadow: inset 0 0 0 1px rgba(31, 75, 114, 0.18), 0 8px 20px rgba(2, 10, 21, 0.32);
}

.charsheet h2,
.charsheet .sheet-equipped-card h3 {
  border: 1px solid rgba(86, 164, 221, 0.7) !important;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 52, 84, 0.82), rgba(17, 33, 53, 0.78)) !important;
  text-shadow: 0 0 8px rgba(115, 201, 255, 0.25);
}

.charsheet input[type="text"],
.charsheet input[type="number"],
.charsheet select,
.charsheet textarea {
  border: 1px solid rgba(82, 143, 191, 0.8) !important;
  background: linear-gradient(180deg, rgba(3, 9, 17, 0.9), rgba(4, 12, 22, 0.92));
  color: #bfe9ff;
  box-shadow: inset 0 0 0 1px rgba(31, 65, 95, 0.24);
}

.charsheet input[type="text"]:focus,
.charsheet input[type="number"]:focus,
.charsheet select:focus,
.charsheet textarea:focus {
  border-color: rgba(120, 211, 255, 0.95) !important;
  box-shadow: inset 0 0 0 1px rgba(53, 125, 180, 0.4), 0 0 0 2px rgba(83, 184, 245, 0.18);
}

.charsheet button[type="roll"],
.charsheet button[type="action"],
.charsheet button[type="button"] {
  border: 1px solid rgba(88, 163, 218, 0.8);
  background: linear-gradient(180deg, rgba(13, 37, 60, 0.92), rgba(9, 27, 45, 0.9));
  color: #d6f3ff;
  box-shadow: inset 0 0 0 1px rgba(44, 94, 136, 0.25);
}

.charsheet button[type="roll"]:hover,
.charsheet button[type="action"]:hover,
.charsheet button[type="button"]:hover {
  border-color: rgba(120, 209, 255, 0.95);
}

.charsheet :is(.sheet-editcharacter, .sheet-editpsionics, .sheet-equipped) {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  overflow-x: hidden;
}

.charsheet .sheet-equipped-grid,
.charsheet .sheet-editpsionics .sheet-edit-psionics-grid-section {
  width: 100% !important;
  max-width: 827px !important;
  margin-inline: auto;
}

.charsheet .sheet-equipped :is(.sheet-equipped-armor, .sheet-equipped-combat-melee, .sheet-equipped-repeating-ranged) {
  overflow: hidden;
}

.charsheet .sheet-hud-actions {
  grid-template-columns: 1fr !important;
}

.charsheet .sheet-equipped-card fieldset.repeating_equippedquickskills {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  display: grid;
  gap: var(--gutter-sm);
}

.charsheet .sheet-equipped-card fieldset.repeating_equippedquickskills .repeat-controls {
  margin-bottom: var(--gutter-sm);
}

.charsheet fieldset.repeating_equippedquickskills .repeat-row {
  padding-top: calc(var(--ctl-h) + 2px) !important;
  margin-bottom: var(--gutter-sm) !important;
  border-top: 1px solid rgba(63, 117, 160, 0.5);
}

.charsheet fieldset.repeating_equippedquickskills .repeat-remove {
  top: 1px;
}

.charsheet .sheet-equipped-card fieldset.repeating_equippedquickskills .repeat-add,
.charsheet .sheet-equipped-card fieldset.repeating_equippedquickskills .repeat-remove {
  font-size: 11px;
}

.charsheet .sheet-hud-skill-row {
  grid-template-columns: 58px 1fr 62px;
  align-items: stretch !important;
}

.charsheet .hud-quick-skill-lvl {
  min-height: var(--ctl-h);
  height: var(--ctl-h);
  border: 1px solid rgba(82, 143, 191, 0.8);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(3, 9, 17, 0.9), rgba(4, 12, 22, 0.92));
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  margin: 0 !important;
  padding: 0;
}

.charsheet .sheet-hud-skill-row .hud-quick-roll {
  height: var(--ctl-h);
  min-height: var(--ctl-h);
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.charsheet .sheet-hud-skill-row select.hud-quick-skill-select {
  height: var(--ctl-h);
  min-height: var(--ctl-h);
  margin: 0 !important;
  text-align: center;
  text-align-last: center;
  line-height: 1;
}

.charsheet .sheet-editpsionics h2 {
  width: 100% !important;
  max-width: 100% !important;
}

.charsheet .sheet-edit-psi-buttons {
  width: 100% !important;
  max-width: 827px !important;
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-edit-psi-buttons > * {
  min-width: 0 !important;
}

.charsheet .sheet-editpsionics :is(
  [class*="sheet-edit-psi-"],
  [class*="sheet-edit-repeating-"],
  .sheet-edit-life-energy
) {
  width: 100% !important;
  max-width: 827px !important;
  margin-inline: auto;
}

.charsheet .sheet-editpsionics :is(
  .sheet-edit-psi-body-discipline,
  .sheet-edit-psi-causation,
  .sheet-edit-psi-clairvoyance,
  .sheet-edit-psi-deflection,
  .sheet-edit-psi-domination,
  .sheet-edit-psi-energy-communion,
  .sheet-edit-psi-molecular-alteration,
  .sheet-edit-psi-pyrokinesis,
  .sheet-edit-psi-subatomic-alteration,
  .sheet-edit-psi-telekinesis,
  .sheet-edit-psi-anti-psionics
) {
  overflow-x: auto;
}

.charsheet .sheet-edit-inventory-weapon-buttons {
  width: 100% !important;
  max-width: 827px !important;
  margin-inline: auto;
}

.charsheet .inventory-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter-sm);
  width: 100%;
}

.charsheet .inventory-toggle-btn {
  flex: 1 1 104px;
  min-width: 104px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
  font-size: 11px;
}

/* Final polish pass from QA */
.charsheet .sheet-main-buttons button.is-active-tab {
  border-color: rgba(124, 214, 255, 0.98) !important;
  color: #effcff !important;
  background: linear-gradient(180deg, rgba(20, 92, 132, 0.96), rgba(14, 61, 90, 0.92)) !important;
  box-shadow: 0 0 0 1px rgba(118, 216, 255, 0.3), 0 0 18px rgba(47, 174, 232, 0.24);
}

.charsheet .sheet-edit-psi-buttons button {
  border-radius: 999px !important;
}

.charsheet .sheet-edit-psi-buttons button.is-active-subtab {
  border-color: rgba(124, 214, 255, 0.98) !important;
  color: #effcff !important;
  background: linear-gradient(180deg, rgba(20, 92, 132, 0.96), rgba(14, 61, 90, 0.92)) !important;
  box-shadow: 0 0 0 1px rgba(118, 216, 255, 0.3), 0 0 16px rgba(47, 174, 232, 0.24);
}

.charsheet .sheet-grid-section,
.charsheet .sheet-edit-skills-grid-section,
.charsheet .sheet-edit-psionics-grid-section,
.charsheet .sheet-edit-inventory-grid-section {
  gap: calc(var(--gutter-md) + 4px) !important;
}

/* Character tab */
.charsheet .sheet-character .sheet-blue-color {
  color: #8fd8ff !important;
}

.charsheet .sheet-character .sheet-green-color {
  color: #7dffad !important;
}

.charsheet .sheet-character .sheet-red-color {
  color: #ff6a5c !important;
}

.charsheet .sheet-character .sheet-core-health > * {
  min-width: 0 !important;
}

.charsheet .sheet-character .sheet-core-health {
  grid-template-columns:
    minmax(0, 1.44fr)
    minmax(0, 1.44fr)
    minmax(0, 1.63fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1.15fr)
    minmax(0, 1.15fr)
    minmax(0, 1.15fr)
    minmax(0, 1fr) !important;
  column-gap: var(--gutter-sm) !important;
  overflow: hidden !important;
}

.charsheet .sheet-character .sheet-core-health button[type="roll"][value*="Initiative"],
.charsheet .sheet-character .sheet-core-health input[name="attr_misc_init_bonus"] {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  align-self: center;
  justify-self: stretch !important;
}

/* Equipped tab */
.charsheet .sheet-equipped-hud-grid {
  align-items: stretch !important;
}

.charsheet .sheet-equipped :is(
  .sheet-equipped-armor,
  .sheet-equipped-combat-melee,
  .sheet-equipped-repeating-ranged
) > h2 {
  width: 100% !important;
  min-height: calc(var(--ctl-h) + 8px) !important;
  height: auto !important;
  margin: 4px 0 calc(var(--gutter-sm) + 2px) 0 !important;
  padding: 3px 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  box-sizing: border-box;
}

.charsheet .sheet-equipped-hud > h2 {
  width: 100% !important;
  min-height: calc(var(--ctl-h) + 8px) !important;
  height: auto !important;
  margin: 4px 0 calc(var(--gutter-sm) + 2px) 0 !important;
  padding: 3px 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1.05 !important;
  box-sizing: border-box;
}

.charsheet .sheet-equipped-card h3 {
  min-height: calc(var(--ctl-h) + 2px);
  height: calc(var(--ctl-h) + 2px);
  margin: 0 0 var(--gutter-sm) 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.charsheet .sheet-equipped-armor {
  grid-template-columns:
    minmax(118px, 1.65fr)
    minmax(76px, 1fr)
    minmax(70px, 0.95fr)
    repeat(9, minmax(52px, 0.84fr)) !important;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  align-items: center;
}

.charsheet .sheet-equipped-armor > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-equipped-armor > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
  font-size: 12px;
}

.charsheet .sheet-equipped-armor :is(input, select, textarea, button) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-equipped-combat-melee {
  grid-template-columns: 1.4fr 1.2fr repeat(9, minmax(0, 1fr)) !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-equipped-combat-melee > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-equipped-combat-melee :is(input, select, textarea, button) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.charsheet .sheet-equipped-combat-melee :is(b, span) {
  min-width: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.charsheet .sheet-equipped-ranged-weapons {
  grid-template-columns: 1.65fr repeat(10, minmax(0, 1fr)) !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .sheet-equipped-ranged-weapons > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.charsheet .sheet-equipped-ranged-weapons input[name="attr_equippedweaponnotesdata"] {
  width: 100% !important;
  max-width: 100% !important;
  grid-column: 3 / -1;
}

/* Skills tab */
.charsheet .sheet-editskills {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  overflow-x: hidden;
}

.charsheet .sheet-editskills .sheet-edit-skills-grid-section {
  width: 100% !important;
  max-width: 827px;
}

.charsheet .sheet-editskills fieldset.repeating_skills {
  overflow: hidden;
  padding: var(--gutter-sm) !important;
}

.charsheet .sheet-editskills .repeat-row {
  padding-top: calc(var(--ctl-h) + 2px) !important;
  margin-bottom: var(--gutter-sm) !important;
}

.charsheet .sheet-skill-headers > span,
.charsheet .sheet-edit-skill-headers > span,
.charsheet .sheet-editskills h3,
.charsheet .sheet-editskills h4 {
  font-family: "Orbitron", "Segoe UI", sans-serif !important;
  font-size: 11px !important;
  letter-spacing: 0.25px;
  color: #8fd6ff !important;
}

/* Inventory tab left rail + content to right */
.charsheet .sheet-edit-inventory-grid-section {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) !important;
  grid-template-areas:
    "menu armor"
    "menu melee"
    "menu ranged"
    "menu explosives"
    "menu items"
    "menu artifacts"
    "menu notes";
  column-gap: calc(var(--gutter-md) + 6px) !important;
  row-gap: calc(var(--gutter-md) + 6px) !important;
  align-items: start;
}

.charsheet .sheet-edit-inventory-weapon-buttons {
  grid-area: menu !important;
  position: sticky;
  top: 6px;
  align-self: start;
}

.charsheet .sheet-inventory-armor { grid-area: armor; }
.charsheet .sheet-inventory-melee { grid-area: melee; }
.charsheet .sheet-inventory-ranged { grid-area: ranged; }
.charsheet .sheet-inventory-explosives { grid-area: explosives; }
.charsheet .sheet-edit-inventory-entries { grid-area: items; }
.charsheet .sheet-edit-inventory-artifacts { grid-area: artifacts; }
.charsheet .sheet-edit-inventory-contact-entries { grid-area: notes; }

.charsheet .sheet-edit-inventory-grid-section :is(
  .sheet-inventory-armor,
  .sheet-inventory-melee,
  .sheet-inventory-ranged,
  .sheet-inventory-explosives,
  .sheet-edit-inventory-entries,
  .sheet-edit-inventory-artifacts,
  .sheet-edit-inventory-contact-entries
) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.charsheet .inventory-toggle-bar {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 112px !important;
  gap: var(--gutter-sm) !important;
}

.charsheet .inventory-toggle-btn {
  width: 112px !important;
  min-width: 112px !important;
  flex: 0 0 auto !important;
  height: calc(var(--ctl-h) + 1px);
  min-height: calc(var(--ctl-h) + 1px);
  font-size: 11px !important;
}

/* Edit Psionics fit and spacing */
.charsheet .sheet-editpsionics {
  width: 100%;
  max-width: 827px;
  margin-inline: auto;
  overflow-x: hidden;
}

.charsheet .sheet-editpsionics :is(
  .sheet-body-discipline,
  .sheet-causation,
  .sheet-clairvoyance,
  .sheet-deflection,
  .sheet-domination,
  .sheet-energy-communion,
  .sheet-molecular-alteration,
  .sheet-pyrokinesis,
  .sheet-subatomic-alteration,
  .sheet-telekinesis,
  .sheet-anti-psionics
) {
  width: 100%;
  max-width: 827px;
  margin: 0 auto var(--gutter-md);
}

.charsheet .sheet-editpsionics :is(
  .sheet-body-discipline,
  .sheet-causation,
  .sheet-clairvoyance,
  .sheet-deflection,
  .sheet-domination,
  .sheet-energy-communion,
  .sheet-molecular-alteration,
  .sheet-pyrokinesis,
  .sheet-subatomic-alteration,
  .sheet-telekinesis,
  .sheet-anti-psionics
) > h2 {
  width: 100% !important;
  margin: 0 0 var(--gutter-sm) !important;
}

.charsheet .sheet-psi-scrollable-130,
.charsheet .sheet-psi-scrollable-200 {
  overflow-y: visible !important;
  overflow-x: hidden !important;
  height: auto !important;
  max-height: none !important;
}

.charsheet .sheet-editpsionics :is(
  .sheet-edit-life-energy,
  .sheet-edit-psi-body-discipline,
  .sheet-edit-repeating-body-discipline,
  .sheet-edit-psi-causation,
  .sheet-edit-repeating-causation,
  .sheet-edit-psi-clairvoyance,
  .sheet-edit-repeating-clairvoyance,
  .sheet-edit-psi-deflection,
  .sheet-edit-repeating-deflection,
  .sheet-edit-psi-domination,
  .sheet-edit-repeating-domination,
  .sheet-edit-psi-energy-communion,
  .sheet-edit-repeating-energy-communion,
  .sheet-edit-psi-molecular-alteration,
  .sheet-edit-repeating-molecular-alteration,
  .sheet-edit-psi-pyrokinesis,
  .sheet-edit-repeating-pyrokinesis,
  .sheet-edit-psi-subatomic-alteration,
  .sheet-edit-repeating-subatomic-alteration,
  .sheet-edit-psi-telekinesis,
  .sheet-edit-repeating-telekinesis,
  .sheet-edit-psi-anti-psionics,
  .sheet-edit-repeating-anti-psionics
) {
  width: 100% !important;
  max-width: 827px !important;
  gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  column-gap: var(--gutter-sm) !important;
  grid-auto-rows: calc(var(--ctl-h) + 2px) !important;
  padding: var(--panel-pad) !important;
  overflow: hidden;
}

.charsheet .sheet-edit-life-energy { grid-template-columns: repeat(14, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-body-discipline { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-body-discipline { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-causation { grid-template-columns: repeat(14, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-causation { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-clairvoyance { grid-template-columns: repeat(11, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-clairvoyance { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-deflection { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-deflection { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-domination { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-domination { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-energy-communion { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-energy-communion { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-molecular-alteration { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-molecular-alteration { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-pyrokinesis { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-pyrokinesis { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-subatomic-alteration { grid-template-columns: repeat(11, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-subatomic-alteration { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-telekinesis { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-telekinesis { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-psi-anti-psionics { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
.charsheet .sheet-edit-repeating-anti-psionics { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }

/* Repeat remove controls compact */
.charsheet .repeat-remove.repeat-remove-compact {
  min-height: 18px;
  height: 18px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  top: 1px;
  right: 4px;
}

.charsheet fieldset.repeating_skills .repeat-row,
.charsheet fieldset.repeating_npc_notes .repeat-row {
  padding-top: calc(var(--ctl-h) + 2px) !important;
  margin-bottom: var(--gutter-sm) !important;
}

.charsheet .sheet-npc-notes {
  padding: var(--gutter-sm) !important;
}

.charsheet .sheet-npc-notes input.sheet-inputfield {
  width: 100% !important;
  max-width: 100% !important;
}

/* Typography standardization */
.charsheet {
  --font-ui: "Orbitron", "Segoe UI", sans-serif;
  --fs-xxs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 14px;
  --text-main: #bfe9ff;
  --text-label: #8fd8ff;
  --text-heading: #ffd700;
}

.charsheet,
.charsheet * {
  font-family: var(--font-ui);
}

.charsheet :is(input, select, textarea) {
  font-size: var(--fs-md) !important;
  font-weight: 500;
  color: var(--text-main);
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"], .repeat-add, .repeat-remove) {
  font-size: var(--fs-sm) !important;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.charsheet :is(span, b, label, h3, h4) {
  font-size: var(--fs-sm);
  line-height: 1.1;
}

.charsheet h2 {
  font-size: var(--fs-lg) !important;
  font-weight: 700;
  color: var(--text-heading);
}

.charsheet h3 {
  font-size: var(--fs-md) !important;
  font-weight: 700;
  color: var(--text-heading);
}

.charsheet h4 {
  font-size: var(--fs-sm) !important;
  font-weight: 600;
  color: var(--text-label);
}

.charsheet :is(.sheet-blue-color, .sheet-red-color, .sheet-green-color, .sheet-pink-color, .sheet-white-color, .sheet-silver-color, .sheet-gold-color) {
  font-size: var(--fs-sm);
}

/* Legacy inline font-size cleanup */
.charsheet [style*="font-size: x-small"],
.charsheet [style*="font-size:x-small"],
.charsheet [style*="font-size: small"],
.charsheet [style*="font-size:small"],
.charsheet [style*="font-size: smaller"],
.charsheet [style*="font-size:smaller"] {
  font-size: var(--fs-xs) !important;
}

/* Status row value alignment (supports input or span in Current column) */
.charsheet .sheet-hud-status-row > :nth-child(2) {
  justify-self: stretch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.charsheet .sheet-hud-status-row > span:nth-child(2) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Inventory rail + content flow: removes left dead gutter and keeps menu top-left */
.charsheet .sheet-edit-inventory-grid-section {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) !important;
  grid-template-areas: none !important;
  column-gap: calc(var(--gutter-md) + 6px) !important;
  row-gap: calc(var(--gutter-md) + 6px) !important;
  align-items: start !important;
}

.charsheet .sheet-edit-inventory-weapon-buttons {
  grid-column: 1 !important;
  grid-row: 1 / span 20 !important;
  align-self: start !important;
  justify-self: start !important;
  top: 0 !important;
  margin: 0 !important;
}

.charsheet .sheet-edit-inventory-grid-section > :is(
  .sheet-inventory-armor,
  .sheet-inventory-melee,
  .sheet-inventory-ranged,
  .sheet-inventory-explosives,
  .sheet-edit-inventory-entries,
  .sheet-edit-inventory-artifacts,
  .sheet-edit-inventory-contact-entries
) {
  grid-column: 2 !important;
  grid-row: auto !important;
  margin: 0 !important;
}

/* Psionics top section fit */
.charsheet .sheet-editpsionics .sheet-edit-psionics-grid-section {
  width: 100% !important;
  max-width: 827px !important;
  margin-inline: auto !important;
  overflow: hidden;
}

.charsheet .sheet-edit-life-energy {
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(0, 1fr)
    minmax(0, 0.28fr)
    minmax(0, 1fr)
    minmax(0, 0.82fr)
    minmax(0, 0.45fr)
    minmax(0, 0.42fr)
    minmax(0, 0.72fr)
    minmax(0, 0.62fr)
    minmax(0, 0.72fr)
    minmax(0, 0.7fr)
    minmax(0, 0.6fr)
    minmax(0, 0.58fr)
    minmax(0, 0.42fr) !important;
}

.charsheet .sheet-edit-life-energy > * {
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.charsheet .sheet-edit-life-energy {
  align-items: center !important;
}

.charsheet .sheet-edit-life-energy > :is(span, b) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: var(--ctl-h);
  line-height: 1 !important;
}

.charsheet .sheet-edit-life-energy :is(input, select, textarea) {
  width: 100% !important;
  align-self: center !important;
}

.charsheet .sheet-edit-life-energy > :last-child {
  text-align: left;
  justify-self: start;
  justify-content: flex-start !important;
}

/* Edit Psionics border alignment: force one shared fluid width model */
.charsheet .sheet-editpsionics {
  width: 100% !important;
  max-width: 827px !important;
  margin-inline: auto !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.charsheet .sheet-editpsionics .sheet-edit-psionics-grid-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 var(--gutter-sm) 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  overflow: hidden !important;
}

.charsheet .sheet-editpsionics .sheet-edit-life-energy,
.charsheet .sheet-editpsionics .sheet-edit-psi-buttons {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.charsheet .sheet-editpsionics .sheet-edit-psi-buttons {
  padding: 0 !important;
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
}

.charsheet .sheet-editpsionics .sheet-edit-psi-buttons > button {
  width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-editpsionics :is(
  .sheet-body-discipline,
  .sheet-causation,
  .sheet-clairvoyance,
  .sheet-deflection,
  .sheet-domination,
  .sheet-energy-communion,
  .sheet-molecular-alteration,
  .sheet-pyrokinesis,
  .sheet-subatomic-alteration,
  .sheet-telekinesis,
  .sheet-anti-psionics
) {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 var(--gutter-md) 0 !important;
  box-sizing: border-box;
}

/* Ship spacing cleanup */
.charsheet .sheet-ship-health {
  grid-template-columns: minmax(74px, 1.2fr) repeat(8, minmax(0, 1fr)) !important;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  align-items: center;
}

.charsheet .sheet-ship-health > h2 {
  width: 100% !important;
  margin: 0 0 var(--gutter-sm) 0 !important;
}

.charsheet .sheet-ship-health > * {
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* NPC spacing + notes library cards */
.charsheet .sheet-npc-grid > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.charsheet .sheet-npc-notes {
  display: block !important;
  padding: var(--panel-pad) !important;
}

.charsheet .sheet-npc-notes > h2 {
  margin: 0 0 var(--gutter-sm) 0 !important;
}

.charsheet .sheet-npc-notes fieldset.repeating_npc_notes {
  border: 1px solid rgba(74, 124, 167, 0.72) !important;
  border-radius: 10px !important;
  padding: var(--gutter-sm) !important;
  background: linear-gradient(180deg, rgba(6, 16, 28, 0.72), rgba(5, 13, 24, 0.78));
}

.charsheet .sheet-npc-note-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: var(--gutter-sm);
  align-items: center;
}

.charsheet .sheet-npc-note-card textarea[name="attr_npc_note_body"] {
  grid-column: 1 / -1;
  min-height: 86px;
  resize: vertical;
  text-align: left;
  line-height: 1.3;
  padding: 6px 8px;
}

.charsheet .sheet-npc-note-card .npc-note-save {
  width: 100% !important;
}

.charsheet fieldset.repeating_npc_notes .repeat-controls {
  margin-bottom: var(--gutter-sm);
}

.charsheet fieldset.repeating_npc_notes .repeat-row.is-saved-flash {
  box-shadow: 0 0 0 1px rgba(104, 208, 255, 0.5), 0 0 12px rgba(58, 178, 235, 0.35);
}

/* Skills tab overlap fix */
.charsheet .sheet-editskills .sheet-edit-skill-headers,
.charsheet .sheet-editskills .sheet-edit-repeating-skills {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(0, 2.2fr)
    minmax(0, 1.8fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1.8fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1.1fr)
    minmax(0, 1.1fr)
    minmax(0, 1.4fr)
    minmax(0, 1.9fr) !important;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  align-items: center;
  grid-auto-rows: var(--ctl-h) !important;
  box-sizing: border-box;
}

.charsheet .sheet-editskills .sheet-edit-skill-headers > span,
.charsheet .sheet-editskills .sheet-edit-repeating-skills > * {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.charsheet .sheet-editskills .sheet-edit-repeating-skills :is(
  select[name="attr_skillattribute"],
  select[name="attr_skillpsionic"],
  input[name="attr_skilldice"],
  select[name="attr_skill_progression_difficulty"]
) {
  width: 100% !important;
}

.charsheet .sheet-editskills .sheet-edit-repeating-skills .sheet-skill-prog {
  font-size: var(--fs-xs) !important;
}

.charsheet fieldset.repeating_skills .repeat-controls {
  margin-bottom: calc(var(--gutter-sm) + 2px) !important;
}

.charsheet fieldset.repeating_skills .repeat-row {
  padding-top: calc(var(--ctl-h) + 6px) !important;
  margin-bottom: calc(var(--gutter-sm) + 2px) !important;
}

.charsheet fieldset.repeating_skills .repeat-remove {
  top: 2px !important;
  right: 4px !important;
  z-index: 2;
}

/* Skills top header bar: longer + taller */
.charsheet .sheet-editskills .sheet-edit-melee > h2 {
  width: calc(100% + (var(--panel-pad) * 2)) !important;
  min-height: calc(var(--ctl-h) + 8px) !important;
  height: auto !important;
  margin: 2px calc(var(--panel-pad) * -1) calc(var(--gutter-sm) + 2px) calc(var(--panel-pad) * -1) !important;
  padding: 3px 12px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1.05 !important;
}

/* Character tab right-edge fit: prevent border overlap */
.charsheet .sheet-character .sheet-grid-section {
  width: 100% !important;
  max-width: 827px !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  column-gap: var(--gutter-sm) !important;
  row-gap: var(--gutter-sm) !important;
  overflow: hidden;
}

.charsheet .sheet-character .sheet-skill-headers {
  width: 100% !important;
  max-width: 827px !important;
}

.charsheet .sheet-character fieldset.repeating_skills {
  width: 100% !important;
  max-width: 827px !important;
  margin: 0 !important;
  padding: var(--gutter-sm) !important;
  overflow: hidden !important;
}

.charsheet .sheet-character fieldset.repeating_skills .sheet-core-skills {
  width: 100% !important;
  max-width: 100% !important;
}

/* Dropdown menu theme (Chrome-focused) */
.charsheet :is(select, .sheet-dropdown) {
  background-color: #071424 !important;
  color: #c5ecff !important;
  border-color: rgba(84, 159, 212, 0.88) !important;
  color-scheme: dark;
}

.charsheet :is(select, .sheet-dropdown) option {
  background-color: #0b1a2b !important;
  color: #d9f4ff !important;
}

.charsheet :is(select, .sheet-dropdown) option:checked,
.charsheet :is(select, .sheet-dropdown) option[selected] {
  background-color: #1a4d77 !important;
  color: #f1fcff !important;
}

.charsheet :is(select, .sheet-dropdown) option:disabled {
  background-color: #0b1623 !important;
  color: #6e91ad !important;
}

/* Button affordance pass: clear press feedback without sticky focus highlight */
.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]) {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(0);
  transition:
    transform 80ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(44, 94, 136, 0.25),
    0 2px 0 rgba(7, 19, 33, 0.95);
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]):hover {
  border-color: rgba(132, 212, 255, 0.95) !important;
  background: linear-gradient(180deg, rgba(18, 48, 76, 0.95), rgba(12, 33, 54, 0.92)) !important;
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]):active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(155, 221, 255, 0.18),
    inset 0 0 0 1px rgba(35, 82, 120, 0.45),
    0 1px 0 rgba(5, 12, 22, 0.95);
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]):focus {
  outline: none !important;
  border-color: rgba(88, 163, 218, 0.8) !important;
  color: #d6f3ff !important;
  background: linear-gradient(180deg, rgba(13, 37, 60, 0.92), rgba(9, 27, 45, 0.9)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(44, 94, 136, 0.25),
    0 2px 0 rgba(7, 19, 33, 0.95) !important;
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]):focus:not(:focus-visible) {
  border-color: rgba(88, 163, 218, 0.8) !important;
  box-shadow:
    inset 0 0 0 1px rgba(44, 94, 136, 0.25),
    0 2px 0 rgba(7, 19, 33, 0.95) !important;
}

.charsheet :is(button[type="roll"], button[type="action"], button[type="button"]):focus-visible {
  box-shadow:
    inset 0 0 0 1px rgba(44, 94, 136, 0.25),
    0 2px 0 rgba(7, 19, 33, 0.95),
    0 0 0 2px rgba(93, 188, 241, 0.28);
}

.print-workspace {
  display: none;
}

.auth-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(34, 106, 158, 0.2), transparent 42%),
    radial-gradient(circle at 84% 12%, rgba(22, 61, 109, 0.16), transparent 40%),
    linear-gradient(140deg, #041323 0%, #030b15 52%, #020814 100%);
}

html.auth-preload body .app-main,
body.auth-pending .app-main,
body.auth-locked .app-main {
  display: none !important;
}

html.auth-preload body .auth-gate,
body.auth-pending .auth-gate,
body.auth-locked .auth-gate {
  display: flex !important;
}

.auth-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(86, 164, 221, 0.75);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(11, 35, 61, 0.92), rgba(5, 17, 33, 0.95)),
    repeating-linear-gradient(180deg, rgba(145, 218, 255, 0.03) 0 1px, transparent 1px 4px);
  box-shadow:
    0 16px 40px rgba(2, 10, 18, 0.75),
    0 0 0 1px rgba(83, 176, 232, 0.2),
    0 0 22px rgba(67, 165, 228, 0.16);
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% -10%, rgba(140, 224, 255, 0.22), transparent 34%),
    radial-gradient(circle at -6% 80%, rgba(92, 168, 223, 0.16), transparent 32%);
}

.auth-card h1 {
  margin: 0;
  font-size: 24px;
  color: #d7f3ff;
  letter-spacing: 0.4px;
  text-shadow: 0 0 12px rgba(106, 207, 255, 0.25);
}

.auth-card p {
  margin: 0 0 4px 0;
  color: #8cc7ec;
  font-size: 13px;
}

.auth-card label {
  color: #a9ddff;
  font-size: 12px;
  font-weight: 600;
}

.auth-card input {
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(82, 143, 191, 0.8);
  background: linear-gradient(180deg, rgba(3, 9, 17, 0.95), rgba(4, 12, 22, 0.96));
  color: #c7ecff;
  padding: 0 10px;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(31, 65, 95, 0.28);
}

.auth-card input:focus {
  outline: none;
  border-color: rgba(124, 214, 255, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(56, 127, 179, 0.45),
    0 0 0 2px rgba(84, 186, 247, 0.22);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.auth-actions > button {
  min-height: 32px;
}

body.auth-locked .auth-gate {
  display: flex;
}

body.auth-locked .app-main {
  display: none !important;
}

/* Device profiles */
body.device-tablet .app-main,
body.device-phone .app-main {
  grid-template-columns: 1fr !important;
  gap: var(--gutter-md) !important;
}

body.device-tablet .roll-panel,
body.device-phone .roll-panel {
  width: 100% !important;
  max-width: none !important;
  min-height: 120px;
}

body.device-tablet .sheet-area .charsheet,
body.device-phone .sheet-area .charsheet {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: var(--gutter-sm) !important;
}

body.device-tablet .charsheet div.sheet-main-buttons {
  width: 100% !important;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) !important;
  grid-auto-rows: var(--ctl-h) !important;
  gap: var(--gutter-sm) !important;
}

body.device-phone .charsheet div.sheet-main-buttons {
  width: 100% !important;
  grid-template-columns: repeat(2, minmax(110px, 1fr)) !important;
  grid-auto-rows: var(--ctl-h) !important;
  gap: var(--gutter-sm) !important;
}

body.device-tablet .charsheet :is(
  .sheet-grid-section,
  .sheet-equipped-grid,
  .sheet-edit-character-grid,
  .sheet-edit-skills-grid,
  .sheet-edit-psionics-grid,
  .sheet-edit-ship,
  .sheet-npc-grid
) {
  width: 100% !important;
  max-width: 100% !important;
}

body.device-phone .charsheet :is(
  .sheet-grid-section,
  .sheet-equipped-grid,
  .sheet-edit-character-grid,
  .sheet-edit-skills-grid,
  .sheet-edit-psionics-grid,
  .sheet-edit-ship,
  .sheet-npc-grid
) {
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

body.device-phone .charsheet :is(
  .sheet-core-stats,
  .sheet-core-health,
  .sheet-equipped-armor,
  .sheet-equipped-combat-melee,
  .sheet-equipped-ranged-weapons,
  .sheet-edit-character-core-stats,
  .sheet-edit-character-health,
  .sheet-edit-life-energy,
  .sheet-edit-psi-buttons,
  .sheet-npc-defense-header,
  .sheet-npc-defense,
  .sheet-npc-attack-header,
  .sheet-npc-attack
) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(var(--ctl-h), auto) !important;
  gap: var(--gutter-sm) !important;
}

body.device-phone .charsheet :is(
  .sheet-skill-headers,
  .sheet-core-skills,
  .sheet-edit-skill-headers,
  .sheet-edit-repeating-skills
) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--gutter-sm) !important;
}

body.device-tablet .charsheet :is(
  .sheet-core-health,
  .sheet-edit-life-energy,
  .sheet-edit-character-core-stats,
  .sheet-edit-character-health
) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: var(--gutter-sm) !important;
}

body.device-phone .charsheet :is(
  .sheet-scrollable-400,
  .sheet-combat-scrollable-300,
  .sheet-psi-scrollable-130,
  .sheet-psi-scrollable-200
) {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.35in;
  }

  body.print-prep {
    background: #fff !important;
    color: #000 !important;
  }

  body.print-prep .app-toolbar,
  body.print-prep .app-main,
  body.print-prep .roll-panel,
  body.print-prep .no-print {
    display: none !important;
  }

  body.print-prep .print-workspace {
    display: block !important;
    background: #fff !important;
    color: #111 !important;
    font-family: "Segoe UI", Arial, sans-serif;
  }

  body.print-prep .print-sheet-page {
    break-after: page;
    page-break-after: always;
    margin: 0;
    padding: 0;
  }

  body.print-prep .print-sheet-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.print-prep .print-page-heading {
    margin: 0 0 10px 0;
    padding: 6px 8px;
    border: 1px solid #687a8b;
    border-radius: 4px;
    background: #f3f6f9 !important;
    color: #142739 !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
  }

  body.print-prep .print-sheet {
    width: 100% !important;
    max-width: none !important;
    background: #fff !important;
    color: #111 !important;
  }

  body.print-prep .print-sheet * {
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
  }

  body.print-prep .print-sheet :is(div, section, article, fieldset, h2, h3, h4) {
    background: transparent !important;
    color: #111 !important;
    border-color: #6b7a89 !important;
  }

  body.print-prep .print-sheet :is(span, b, strong, label, p, h1, h2, h3, h4) {
    color: #111 !important;
  }

  body.print-prep .print-sheet :is(
    input[type="text"],
    input[type="number"],
    input[type="hidden"],
    select,
    textarea,
    button[type="roll"],
    button[type="action"],
    button[type="button"]
  ) {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #6d7d8c !important;
  }

  body.print-prep .print-sheet button[type="roll"]::before,
  body.print-prep .print-sheet button[type="action"]::before {
    content: "" !important;
  }

  body.print-prep .print-sheet :is(
    .repeat-controls,
    .repeat-remove,
    .ship-upload-controls,
    .inventory-toggle-bar,
    .sheet-edit-psi-buttons,
    .sheet-main-buttons
  ) {
    display: none !important;
  }

  body.print-prep .print-sheet :is(
    .sheet-scrollable-400,
    .sheet-combat-scrollable-300,
    .sheet-edit-psi-body-discipline,
    .sheet-edit-psi-causation,
    .sheet-edit-psi-clairvoyance,
    .sheet-edit-psi-deflection,
    .sheet-edit-psi-domination,
    .sheet-edit-psi-energy-communion,
    .sheet-edit-psi-molecular-alteration,
    .sheet-edit-psi-pyrokinesis,
    .sheet-edit-psi-subatomic-alteration,
    .sheet-edit-psi-telekinesis,
    .sheet-edit-psi-anti-psionics
  ) {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  body.print-prep .print-sheet.print-expand-psionics :is(
    div.sheet-body-discipline,
    div.sheet-causation,
    div.sheet-clairvoyance,
    div.sheet-deflection,
    div.sheet-domination,
    div.sheet-energy-communion,
    div.sheet-molecular-alteration,
    div.sheet-pyrokinesis,
    div.sheet-subatomic-alteration,
    div.sheet-telekinesis,
    div.sheet-anti-psionics
  ) {
    display: block !important;
  }

  body.print-prep .print-sheet.print-expand-inventory :is(
    div.sheet-inventory-melee,
    div.sheet-inventory-ranged,
    div.sheet-inventory-explosives
  ) {
    display: block !important;
  }

  body.print-prep .print-sheet.print-expand-inventory :is(
    .sheet-display_toggle[name="attr_armor-display"] ~ .sheet-inventory-armor,
    .sheet-display_toggle[name="attr_melee-display"] ~ .sheet-inventory-melee,
    .sheet-display_toggle[name="attr_ranged-display"] ~ .sheet-inventory-ranged,
    .sheet-display_toggle[name="attr_explosives-display"] ~ .sheet-inventory-explosives
  ) {
    display: block !important;
  }
}
