.mobile-sheet-nav,
.mobile-section-heading,
.mobile-fold-toggle,
.mobile-combat-view{
  display:none;
}

@media screen and (max-width:760px){
  html,
  body{
    overflow-x:clip;
  }

  #editorView{
    --sheet-action-height:30px;
    --sheet-icon-size:30px;
    --sheet-action-font:10.5px;
  }

  #editorView .toolbar{
    position:relative;
    top:auto;
    display:grid;
    grid-template-columns:minmax(68px,1fr) 40px 40px repeat(3,36px)!important;
    gap:5px;
    padding:7px 8px;
  }

  #editorView .toolbar-title{
    grid-column:1!important;
    grid-row:1!important;
  }

  #editorView .toolbar .gurps-plaque{
    min-height:36px;
    padding:4px 8px;
    font-size:16px;
  }

  #editorView #charactersBtn,
  #editorView #editorCampaignsBtn,
  #editorView #viewModeBtn,
  #editorView .toolbar-account,
  #editorView #mobileMenuBtn{
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
    min-height:36px!important;
  }

  #editorView #charactersBtn{grid-column:2!important}
  #editorView #editorCampaignsBtn{grid-column:3!important}
  #editorView #viewModeBtn{grid-column:4!important}
  #editorView .toolbar-account{grid-column:5!important;margin:0}
  #editorView #mobileMenuBtn{display:block!important;grid-column:6!important}

  #editorView :is(#charactersBtn,#editorCampaignsBtn){
    position:relative;
    padding:0!important;
    overflow:hidden;
    font-size:0!important;
  }

  #editorView :is(#charactersBtn,#editorCampaignsBtn)::before{
    content:"";
    position:absolute;
    inset:0;
    display:block;
    background:currentColor;
    -webkit-mask-position:center;
    -webkit-mask-repeat:no-repeat;
    -webkit-mask-size:19px 19px;
    mask-position:center;
    mask-repeat:no-repeat;
    mask-size:19px 19px;
  }

  #editorView #charactersBtn::before{
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='3.25' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5.5 20v-2.25A5.75 5.75 0 0 1 11.25 12h1.5a5.75 5.75 0 0 1 5.75 5.75V20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='3.25' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5.5 20v-2.25A5.75 5.75 0 0 1 11.25 12h1.5a5.75 5.75 0 0 1 5.75 5.75V20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  #editorView #editorCampaignsBtn::before{
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 21V4m0 1h11l-2 4 2 4H6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 21V4m0 1h11l-2 4 2 4H6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }

  #editorView .toolbar-controls{
    position:absolute;
    top:calc(100% + 5px);
    right:8px;
    left:8px;
    z-index:2;
    display:none;
    max-height:calc(100dvh - 64px);
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:10px;
    overflow-y:auto;
    border:1px solid var(--ui-border-strong,var(--ui-border));
    border-radius:0;
    background:var(--toolbar-bg);
    box-shadow:0 12px 30px rgba(0,0,0,.42);
  }

  #editorView .toolbar.mobile-menu-open .toolbar-controls{
    display:grid;
  }

  #editorView .toolbar-controls > *{
    min-width:0;
    width:100%;
    min-height:40px;
    margin:0;
  }

  #editorView .toolbar-controls .status{
    grid-column:1 / -1;
  }

  html:not(.print-mode) #editorView .mobile-sheet-nav{
    position:fixed;
    right:0;
    bottom:0;
    left:0;
    z-index:75;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    padding:0 0 env(safe-area-inset-bottom);
    border-top:1px solid var(--ui-border-strong,var(--ui-border));
    background:var(--ui-paper,var(--paper));
    box-shadow:0 -5px 16px rgba(0,0,0,.18);
  }

  #editorView .mobile-sheet-nav button{
    position:relative;
    display:flex;
    min-width:0;
    min-height:62px;
    padding:6px 2px 5px;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    border:0;
    border-radius:0!important;
    background:transparent;
    box-shadow:none!important;
    color:var(--ui-secondary);
    font:750 9.5px/1.1 var(--font-heading);
    white-space:nowrap;
  }

  #editorView .mobile-sheet-nav button::before{
    content:"";
    position:absolute;
    top:0;
    right:8px;
    left:8px;
    height:2px;
    background:transparent;
  }

  #editorView .mobile-sheet-nav button[aria-current]{
    color:var(--ui-accent);
    background:var(--ui-accent-soft);
  }

  #editorView .mobile-sheet-nav button[aria-current]::before{
    background:var(--ui-accent);
  }

  #editorView .mobile-nav-icon{
    display:grid;
    width:23px;
    height:23px;
    place-items:center;
  }

  #editorView .mobile-nav-icon svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  #editorView .character-sheet{
    width:100%;
    max-width:100%;
    margin:0;
    padding:6px 6px calc(78px + env(safe-area-inset-bottom));
    box-sizing:border-box;
  }

  html:not(.print-mode) #editorView .character-sheet > .mobile-section-heading{
    display:block;
    margin:2px 0 8px;
    padding:0 4px;
    color:var(--ui-text);
    font:850 19px/1.25 var(--font-heading);
  }

  html:not(.print-mode) #editorView .character-sheet > :is(
    .identity-bar,
    .physical-macro,
    .mobile-combat-view,
    .social-macro,
    .hero-attacks,
    .traits-macro,
    .inventory-block
  ),
  html:not(.print-mode) #editorView .character-sheet > #journalDetails{
    display:none!important;
  }

  html:not(.print-mode) #editorView .character-sheet > :is(
    .identity-bar,
    .physical-macro,
    .social-macro
  ).mobile-panel-active{
    display:grid!important;
  }

  html:not(.print-mode) #editorView .character-sheet > :is(
    .mobile-combat-view,
    .hero-attacks,
    .inventory-block,
    #journalDetails
  ).mobile-panel-active{
    display:block!important;
  }

  html:not(.print-mode) #editorView .character-sheet > .traits-macro.mobile-panel-active{
    display:flex!important;
  }

  html:not(.print-mode) #editorView .character-sheet > .traits-macro > .stack{
    display:none!important;
  }

  html:not(.print-mode) #editorView .character-sheet > .traits-macro > .stack.mobile-subpanel-active{
    display:flex!important;
  }

  html:not(.print-mode) #editorView .character-sheet > .traits-macro.collapsed > .stack{
    display:none!important;
  }

  html:not(.print-mode) #editorView .character-sheet .sheet-macro > .macro-collapse-btn{
    display:none!important;
  }

  .character-sheet :is(.mobile-foldable,.sheet-macro,#journalDetails,.traits-column){
    scroll-margin-top:8px;
  }

  #editorView .character-sheet .mobile-fold-toggle{
    display:flex!important;
    width:100%;
    min-height:36px!important;
    padding:7px 8px!important;
    align-items:center;
    justify-content:space-between;
    border:0!important;
    border-bottom:1px solid var(--ui-border)!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--ui-text)!important;
    font-size:12px!important;
    font-weight:750;
    text-align:left;
  }

  .mobile-fold-toggle::after{
    content:'−';
    font-size:18px;
  }

  .mobile-fold-toggle[aria-expanded=false]::after{
    content:'+';
  }

  #editorView .character-sheet .mobile-foldable > .block-title,
  #editorView .character-sheet .skills-card > .block-title,
  #editorView .character-sheet .inventory-block > .block-title{
    display:none!important;
  }

  #editorView .character-sheet .mobile-folded > :not(.mobile-fold-toggle){
    display:none!important;
  }

  #editorView .character-sheet .mobile-folded{
    min-height:0!important;
    height:auto!important;
  }

  #editorView .character-sheet :is(
    .portrait,
    .portrait-actions > label,
    .portrait-actions > button,
    .identity-bar input,
    .mobile-fold-toggle,
    .language-row input,
    .language-row select,
    .language-row-points,
    .culture-superhead input,
    .inventory-section,
    .inventory-section-title,
    .attacks-title-add,
    .add-row,
    .remove,
    .level-button,
    .skill-row input,
    .skill-row select
  ){
    border-radius:0!important;
    box-shadow:none!important;
  }

  /* Overview: the portrait is large enough to identify the character without taking over the page. */
  #editorView .character-sheet .identity-bar{
    grid-template-columns:116px minmax(0,1fr)!important;
    gap:5px!important;
    align-items:stretch!important;
  }

  #editorView .character-sheet .identity-bar > .portrait-card{
    grid-column:1!important;
    grid-row:1 / 5!important;
    width:100%!important;
    min-width:0!important;
    min-height:174px!important;
    margin:0!important;
    border:0!important;
    align-self:stretch;
  }

  #editorView .character-sheet .identity-bar .portrait-card .block-body{
    height:100%!important;
    padding:0!important;
  }

  #editorView .character-sheet .identity-bar .portrait{
    width:100%!important;
    height:100%!important;
    min-height:174px!important;
    max-height:none!important;
    border:1px solid var(--ui-border-strong,var(--ui-border))!important;
  }

  #editorView .character-sheet .identity-bar .portrait-placeholder{
    padding:8px 5px 36px;
    font-size:10px!important;
  }

  #editorView .character-sheet .identity-bar .portrait-actions{
    right:0;
    bottom:0;
    left:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:0;
    padding:0;
    opacity:1;
  }

  #editorView .character-sheet .identity-bar .portrait-actions > :is(label,button){
    min-width:0!important;
    min-height:30px!important;
    padding:4px 2px!important;
    border-color:var(--ui-border-strong,var(--ui-border))!important;
    background:color-mix(in srgb,var(--ui-paper,var(--paper)) 94%,transparent)!important;
    color:var(--ui-text)!important;
    font-size:9.5px!important;
  }

  #editorView .character-sheet .identity-bar .portrait-actions > button{
    border-left:0!important;
  }

  #editorView .character-sheet .identity-bar > .identity-name{
    grid-column:2!important;
    grid-row:1!important;
  }

  #editorView .character-sheet .identity-bar > .identity-player{
    grid-column:2!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .identity-bar > .identity-race{
    grid-column:2!important;
    grid-row:3!important;
  }

  #editorView .character-sheet .identity-bar > .identity-appearance{
    grid-column:2!important;
    grid-row:4!important;
  }

  #editorView .character-sheet .identity-bar > :is(.identity-age,.identity-height,.identity-weight,.identity-sm){
    grid-row:5!important;
  }

  #editorView .character-sheet .identity-bar > .identity-age{grid-column:1!important}
  #editorView .character-sheet .identity-bar > .identity-height{grid-column:2!important}
  #editorView .character-sheet .identity-bar > .identity-weight{grid-column:1!important;grid-row:6!important}
  #editorView .character-sheet .identity-bar > .identity-sm{grid-column:2!important;grid-row:6!important}

  #editorView .character-sheet .identity-bar > .identity-points{
    grid-column:1 / -1!important;
    grid-row:7!important;
    grid-template-columns:72px minmax(0,1fr)!important;
  }

  #editorView .character-sheet .identity-bar .field input,
  #editorView .character-sheet .identity-bar .identity-unspent input{
    height:32px!important;
    min-height:32px!important;
  }

  /* Overview keeps statistics and protection; active defenses belong to Combat. */
  #editorView .character-sheet .physical-macro{
    grid-template-areas:'stats' 'dr' 'encumbrance'!important;
    grid-template-rows:auto!important;
    padding-top:36px!important;
    box-sizing:border-box;
  }

  html:not(.print-mode) #editorView:is(#editorView) .character-sheet .physical-macro > .macro-collapse-btn{
    --tab-shape:none;
    position:absolute;
    top:0!important;
    right:0!important;
    left:0!important;
    z-index:8;
    display:flex!important;
    width:100%!important;
    height:36px!important;
    min-height:36px!important;
    padding:0 32px 0 8px!important;
    align-items:center;
    justify-content:flex-start;
    border:0!important;
    border-bottom:1px solid var(--ui-border)!important;
    background:transparent!important;
    color:var(--ui-text)!important;
    font:750 12px/1.2 var(--font-heading)!important;
    text-align:left;
  }

  html:not(.print-mode) #editorView:is(#editorView) .character-sheet .physical-macro > .macro-collapse-btn::before{
    content:'Характеристики';
    position:static;
    inset:auto;
    z-index:auto;
    clip-path:none;
    background:transparent;
  }

  html:not(.print-mode) #editorView:is(#editorView) .character-sheet .physical-macro > .macro-collapse-btn::after{
    display:none;
  }

  html:not(.print-mode) #editorView:is(#editorView) .character-sheet .physical-macro > .macro-collapse-btn > .collapse-chevron{
    top:12px;
    right:11px;
    left:auto;
  }

  html:not(.print-mode) #editorView:is(#editorView) .character-sheet .physical-macro > .macro-collapse-btn[aria-expanded=false] > .collapse-chevron{
    top:9px;
  }

  html:not(.print-mode) #editorView .character-sheet .physical-macro.collapsed{
    height:36px!important;
    min-height:36px!important;
    padding-top:36px!important;
  }

  html:not(.print-mode) #editorView .character-sheet .physical-macro.collapsed::before{
    display:none!important;
  }

  #editorView .character-sheet .dashboard-profile{
    display:none!important;
  }

  #editorView .character-sheet .characteristics-card > .block-body{
    height:auto!important;
    gap:4px;
    padding:4px 6px!important;
  }

  #editorView .character-sheet .stat-column-head,
  #editorView .character-sheet .stat-pair{
    display:grid!important;
    grid-template-columns:26px minmax(30px,1fr) 25px 32px minmax(30px,1fr) minmax(30px,1fr) 25px!important;
    gap:2px!important;
  }

  #editorView .character-sheet .stat-column-head{
    min-height:16px;
    font-size:8px!important;
  }

  #editorView .character-sheet .stat-pairs{
    grid-template-rows:16px repeat(4,34px)!important;
  }

  #editorView .character-sheet .stat-pair{
    min-height:34px!important;
    padding:0;
  }

  #editorView .character-sheet .stat-label{
    font-size:18px!important;
  }

  #editorView .character-sheet .stat-value,
  #editorView .character-sheet .stat-current{
    width:100%!important;
    min-width:0!important;
    height:30px!important;
    min-height:30px!important;
    padding:1px!important;
    font-size:16px!important;
  }

  #editorView .character-sheet .derived-row{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  #editorView .character-sheet .derived{
    grid-template-columns:minmax(0,1fr) 23px!important;
    gap:1px!important;
    padding:2px;
  }

  #editorView .character-sheet .armor-defense-card > .block-body{
    padding:3px!important;
  }

  #editorView .character-sheet .armor-defense-card .dr-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,auto)!important;
    gap:2px!important;
    height:auto!important;
  }

  #editorView .character-sheet .armor-defense-card .dr-row{
    position:relative;
    grid-template-columns:minmax(0,1fr) 30px!important;
    grid-template-rows:30px!important;
    gap:2px!important;
    padding:0 3px!important;
  }

  #editorView .character-sheet .dr-location{
    align-self:center;
    font-size:10px!important;
  }

  #editorView .character-sheet .dr-value{
    width:30px!important;
    align-self:center;
  }

  #editorView .character-sheet .dr-source{
    display:none!important;
  }

  /* Combat: active defenses are a first-class block before attacks. */
  #editorView .character-sheet .mobile-combat-view{
    width:100%;
    margin:0 0 8px;
    border:0;
    background:transparent;
  }

  #editorView .character-sheet .mobile-combat-view > .active-defense-card{
    width:100%!important;
    margin:0!important;
    border:1px solid var(--ui-border)!important;
    background:transparent!important;
  }

  #editorView .character-sheet .active-defense-card .defense-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  #editorView .character-sheet .active-defense-card .defense-column{
    grid-template-rows:auto auto!important;
  }

  #editorView .character-sheet .active-defense-card .defense{
    min-height:82px!important;
    grid-template-rows:14px 30px 30px!important;
  }

  #editorView .character-sheet .active-defense-card .defense-result{
    min-height:30px!important;
    font-size:20px!important;
  }

  #editorView .character-sheet .active-defense-card .defense-breakdown{
    min-height:0!important;
    padding:3px 2px;
    font-size:9px!important;
  }

  #editorView .character-sheet .hero-attacks:not(.collapsed) > .block-title{
    display:grid!important;
    height:auto!important;
    min-height:36px!important;
    grid-template-columns:minmax(0,1fr) auto;
    gap:5px;
    padding:6px 8px!important;
    overflow:visible;
  }

  #editorView .character-sheet .hero-attacks .attacks-bonus-control{
    justify-self:end;
  }

  #editorView .character-sheet .attacks-add-actions{
    display:grid!important;
    grid-column:1 / -1;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:4px;
    width:100%;
    margin:0!important;
  }

  #editorView .character-sheet .attacks-title-add{
    width:100%!important;
    min-height:30px!important;
    padding:4px 5px!important;
    font-size:10px!important;
  }

  #editorView .character-sheet .hero-attacks .attack-table{
    margin:0 3px;
    overflow:visible;
  }

  #editorView .character-sheet .hero-attacks .attack-table .attack-table-head{
    display:none!important;
  }

  #editorView .character-sheet .hero-attacks .attack-table .attack-table-row,
  html:not(.print-mode) #editorView:not(.view-mode) .character-sheet .hero-attacks .attack-table .attack-table-row{
    min-width:0!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    padding:3px 0!important;
  }

  #editorView .character-sheet .hero-attacks .attack-table .attack-card-head{
    grid-column:1 / -1!important;
    min-height:30px!important;
  }

  #editorView .character-sheet .hero-attacks .attack-stat{
    display:flex!important;
    min-height:36px;
    padding:4px 5px!important;
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
  }

  #editorView .character-sheet .hero-attacks .attack-stat::before{
    content:attr(data-mobile-label);
    color:var(--ui-secondary);
    font-size:9px;
  }

  #editorView .character-sheet .hero-attacks .attack-stat b{
    white-space:normal;
    overflow-wrap:anywhere;
  }

  /* Traits and social tables keep the desktop paper language, with touch-sized actions. */
  #editorView .character-sheet .traits-macro{
    min-height:0!important;
    flex-direction:column;
  }

  #editorView .character-sheet :is(
    .traits-column,
    .skills-column,
    .advantages-card,
    .disadvantages-card,
    .skills-card
  ){
    width:100%!important;
    min-height:0!important;
    flex:none;
  }

  #editorView .character-sheet :is(.traits-paper-fill,.social-paper-fill){
    display:none!important;
  }

  #editorView .character-sheet .traits-macro .trait-head,
  #editorView .character-sheet .traits-macro .skill-head{
    display:none!important;
  }

  #editorView .character-sheet :is(#advantages,#disadvantages) .list-row{
    min-height:34px!important;
    grid-template-columns:minmax(0,1fr) 8px 42px 30px!important;
  }

  #editorView .character-sheet :is(.reaction-row,.cultural-row){
    min-height:34px!important;
  }

  #editorView .character-sheet .reaction-row{
    grid-template-columns:minmax(0,1fr) 52px 30px!important;
  }

  #editorView .character-sheet .cultural-row{
    grid-template-columns:minmax(0,1fr) 48px 30px!important;
  }

  #editorView .character-sheet .remove{
    width:30px!important;
    min-width:30px!important;
    height:30px!important;
    min-height:30px!important;
  }

  #editorView .character-sheet .add-row{
    min-height:30px!important;
  }

  /* A language uses exactly two compact lines: identity/points, then spoken/written. */
  #editorView .character-sheet .language-row{
    grid-template-columns:repeat(6,minmax(0,1fr)) 42px 30px!important;
    grid-template-rows:30px 30px;
    gap:4px 2px!important;
    min-height:68px!important;
    padding:2px 0!important;
  }

  #editorView .character-sheet .language-row > .language-name-field{
    grid-column:1 / 7!important;
    grid-row:1!important;
  }

  #editorView .character-sheet .language-row > label:nth-of-type(2){
    grid-column:1 / 5!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .language-row > label:nth-of-type(3){
    grid-column:5 / 9!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .language-row > .language-row-points{
    grid-column:7!important;
    grid-row:1!important;
    width:42px;
    height:30px;
  }

  #editorView .character-sheet .language-row > .remove{
    grid-column:8!important;
    grid-row:1!important;
  }

  #editorView .character-sheet .language-row label,
  #editorView .character-sheet .language-name-wrap,
  #editorView .character-sheet .language-row :is(input,select){
    width:100%;
    height:30px!important;
    min-height:30px!important;
  }

  #editorView .character-sheet .language-row .inventory-mobile-label{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    overflow:hidden!important;
    clip:rect(0 0 0 0);
    clip-path:inset(50%);
    white-space:nowrap;
  }

  /* One skill is always two lines; totals stay visible and controls no longer wrap. */
  #editorView .character-sheet .traits-macro .skill-row{
    grid-template-columns:minmax(30px,1fr) 36px 30px 34px 30px 38px 42px 30px!important;
    grid-template-rows:30px 30px!important;
    gap:2px!important;
    height:67px!important;
    min-height:67px!important;
    padding:2px!important;
    box-sizing:border-box;
  }

  #editorView .character-sheet .skill-row > *{
    min-width:0!important;
  }

  #editorView .character-sheet .skill-row > :is(
    input,
    select,
    button,
    .skill-relative,
    .skill-total,
    .skill-points
  ){
    height:30px!important;
    min-height:30px!important;
    align-self:stretch;
  }

  #editorView .character-sheet .skill-row .skill-name{
    grid-column:1 / 7!important;
    grid-row:1!important;
  }

  #editorView .character-sheet .skill-row select[data-skill-prop=attribute]{
    grid-column:1!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row select[data-skill-prop=difficulty]{
    grid-column:2!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row .level-button[data-skill-delta='-1']{
    grid-column:3!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row .skill-relative{
    grid-column:4!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row .level-button[data-skill-delta='1']{
    grid-column:5!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row input[data-skill-prop=bonus]{
    grid-column:6!important;
    grid-row:2!important;
  }

  #editorView .character-sheet .skill-row .skill-total{
    grid-column:7!important;
    grid-row:1!important;
    display:flex!important;
    width:auto!important;
    height:30px!important;
    flex-direction:column;
    justify-content:center;
    gap:0;
  }

  #editorView .character-sheet .skill-row .skill-total small{
    display:none!important;
  }

  #editorView .character-sheet .skill-row :is(.skill-points,.manual-skill-points){
    grid-column:7 / 9!important;
    grid-row:2!important;
    width:auto!important;
    height:30px!important;
  }

  #editorView .character-sheet .skill-row .remove{
    grid-column:8!important;
    grid-row:1!important;
  }

  #editorView .character-sheet .skills-card > .block-body{
    padding-top:0!important;
  }

  /* Inventory headings use a full-width action row instead of tiny wrapped buttons. */
  #editorView .character-sheet .inventory-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  #editorView .character-sheet .inventory-section-title{
    display:grid!important;
    min-height:36px;
    grid-template-columns:minmax(0,1fr) auto;
    gap:5px;
    padding:6px 32px 6px 8px;
    align-items:center;
  }

  #editorView .character-sheet .inventory-section-title > strong{
    grid-column:1;
    grid-row:1;
  }

  #editorView .character-sheet .inventory-section-title > .bag-toggle,
  #editorView .character-sheet .inventory-section-title > .compact-add{
    grid-column:2;
    grid-row:1;
  }

  #editorView .character-sheet .inventory-add-actions{
    display:grid!important;
    grid-column:1 / -1;
    grid-row:2;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:4px;
    width:100%;
  }

  #editorView .character-sheet .inventory-section-title .compact-add{
    width:100%!important;
    min-height:30px!important;
    padding:4px!important;
    font-size:10px!important;
  }

  #editorView .character-sheet .inventory-section-body{
    overflow:visible;
  }

  #editorView .character-sheet .inventory-head{
    display:none!important;
  }

  #editorView .character-sheet .health-status-list:has(.health-status-reminder.is-empty){
    display:none;
  }
}

/* The 721–760 px tablet edge keeps the established full toolbar used by print workflows. */
@media screen and (min-width:721px) and (max-width:760px){
  #editorView .toolbar{
    display:flex;
    grid-template-columns:none!important;
    gap:8px;
    padding:8px 14px;
    flex-wrap:wrap;
  }

  #editorView :is(
    .toolbar-title,
    #charactersBtn,
    #editorCampaignsBtn,
    #viewModeBtn,
    .toolbar-account,
    #mobileMenuBtn
  ){
    grid-column:auto!important;
    grid-row:auto!important;
  }

  #editorView :is(#charactersBtn,#editorCampaignsBtn){
    width:auto!important;
    min-width:0!important;
    padding:4px 10px!important;
    overflow:visible;
    font-size:12px!important;
  }

  #editorView :is(#charactersBtn,#editorCampaignsBtn)::before{
    display:none;
  }

  #editorView #viewModeBtn,
  #editorView .toolbar-account{
    width:44px!important;
    min-width:44px!important;
  }

  #editorView #mobileMenuBtn{
    display:none!important;
  }

  #editorView .toolbar-controls,
  #editorView .toolbar.mobile-menu-open .toolbar-controls{
    position:static;
    z-index:auto;
    display:flex;
    width:auto;
    max-height:none;
    padding:0;
    flex:1 1 auto;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
    overflow:visible;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  #editorView .toolbar-controls > *{
    width:auto;
    min-height:32px;
  }

  #editorView .toolbar-controls .status{
    grid-column:auto;
  }
}
