
@media(min-width:861px){
  /* Align each toolbar to the real content rail directly below it. */
  #masteryCard > .mastery-toolbar.workspace-toolbar{
    width:93%!important;
    max-width:1140px!important;
    margin-left:0!important;
    margin-right:auto!important;
  }
  #facilitiesCard > .facility-toolbar.workspace-toolbar{
    width:80%!important;
    max-width:80%!important;
    margin-left:0!important;
    margin-right:auto!important;
  }
}
@media(min-width:861px) and (max-width:1180px){
  #masteryCard > .mastery-toolbar.workspace-toolbar{
    width:96%!important;
    max-width:96%!important;
  }
}
@media(min-width:901px){
  #specializationPanel .specialization-workspace-toolbar.workspace-toolbar{
    width:min(1182px,100%)!important;
    max-width:1182px!important;
    margin-left:0!important;
    margin-right:auto!important;
  }
}
@media(max-width:900px) and (min-width:761px){
  #masteryCard > .mastery-toolbar.workspace-toolbar,
  #facilitiesCard > .facility-toolbar.workspace-toolbar,
  #specializationPanel .specialization-workspace-toolbar.workspace-toolbar{
    width:100%!important;
    max-width:100%!important;
  }
}

/* Explicit toolbar order: actions -> presets -> live stats -> help -> rail edge. */
#masteryCard .mastery-toolbar-tools,
#facilitiesCard .facility-toolbar-tools{
  flex-wrap:nowrap!important;
}

#masteryCard .mastery-toolbar-stats,
#facilitiesCard .facility-toolbar-stats{
  min-width:0!important;
  flex:1 1 auto!important;
}

#masteryCard .mastery-toolbar-help,
#facilitiesCard .facility-toolbar-help{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.workspace-toolbar .pc-preset-slot{
  position:relative!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  overflow:visible!important;
  font-size:10.5px!important;
  letter-spacing:.02em!important;
}
#masteryCard .pc-preset-slot-mastery{
  width:48px!important;
  min-width:48px!important;
  flex:0 0 48px!important;
}
#facilitiesCard .pc-preset-slot-facility{
  width:34px!important;
  min-width:34px!important;
  flex:0 0 34px!important;
}

/* Saved-preset marker: same low-volume signal language as Mobile. */
.workspace-toolbar .pc-preset-slot.has-data{
  color:#d8c47b!important;
  border-color:rgba(215,181,90,.19)!important;
  background:linear-gradient(180deg,rgba(215,181,90,.055),rgba(215,181,90,.022))!important;
}
.workspace-toolbar .pc-preset-slot.has-data::after{
  content:"";
  position:absolute;
  right:4px;
  top:4px;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#d8b85f;
  box-shadow:0 0 0 2px rgba(13,18,23,.90),0 0 7px rgba(215,181,90,.20);
}
.workspace-toolbar .pc-preset-save-button{
  color:#aeb7c0!important;
}

/* Modal */
#pcPresetBackdrop{
  position:fixed;
  inset:0;
  z-index:12000;
  display:none;
  background:rgba(0,0,0,.54);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
#pcPresetBackdrop.show{display:block}

#pcPresetModal{
  position:fixed;
  left:50%;
  top:50%;
  z-index:12010;
  width:min(430px,calc(100vw - 34px));
  transform:translate(-50%,-48%) scale(.985);
  opacity:0;
  pointer-events:none;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:
    linear-gradient(180deg,rgba(19,26,33,.985),rgba(9,14,19,.995));
  box-shadow:
    0 30px 90px rgba(0,0,0,.52),
    inset 0 1px 0 rgba(255,255,255,.035);
  overflow:hidden;
  transition:opacity .16s ease,transform .18s cubic-bezier(.22,.78,.24,1);
}
#pcPresetModal.show{
  opacity:1;
  pointer-events:auto;
  transform:translate(-50%,-50%) scale(1);
}
.pc-preset-modal-head{
  min-height:68px;
  padding:13px 15px 11px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.065);
}
.pc-preset-modal-head small{
  display:block;
  color:#766a4c;
  font-size:8px;
  font-weight:850;
  letter-spacing:.14em;
}
.pc-preset-modal-head strong{
  display:block;
  margin-top:4px;
  color:#e6ebef;
  font-size:15px;
  font-weight:850;
}
.pc-preset-modal-head span{
  display:block;
  margin-top:4px;
  color:#727e88;
  font-size:9px;
  line-height:1.45;
}
.pc-preset-close{
  width:30px;height:30px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:9px;
  background:rgba(255,255,255,.018);
  color:#87929a;
  font-size:18px;
  cursor:pointer;
}
.pc-preset-modal-body{padding:13px 15px 15px}
.pc-preset-warning{
  padding:10px 11px;
  border:1px solid rgba(215,181,90,.10);
  border-radius:10px;
  background:rgba(215,181,90,.035);
  color:#9d916e;
  font-size:9.5px;
  line-height:1.55;
}
.pc-preset-slot-list{
  display:grid;
  gap:7px;
}
.pc-preset-slot-card{
  width:100%;
  min-height:48px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:10px;
  background:rgba(255,255,255,.018);
  color:#cbd2d7;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;
  cursor:pointer;
}
.pc-preset-slot-card:hover{
  border-color:rgba(215,181,90,.18);
  background:rgba(215,181,90,.035);
}
.pc-preset-slot-card strong{font-size:11px}
.pc-preset-slot-card span{font-size:8.5px;color:#6f7b84}
.pc-preset-slot-card.occupied strong{color:#dec879}
.pc-preset-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  margin-top:12px;
}
.pc-preset-modal-action{
  min-width:78px;
  height:34px;
  padding:0 11px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:9px;
  background:rgba(255,255,255,.02);
  color:#aeb7bf;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.pc-preset-modal-action.primary{
  color:#ddc77c;
  border-color:rgba(215,181,90,.22);
  background:rgba(215,181,90,.055);
}
.pc-preset-modal-action.danger{
  color:#dca08f;
  border-color:rgba(204,113,85,.24);
  background:rgba(204,113,85,.055);
}

/* Tiny feedback toast */
#pcPresetToast{
  position:fixed;
  left:50%;
  top:22px;
  z-index:12100;
  transform:translate(-50%,-7px);
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:999px;
  background:rgba(13,19,24,.96);
  color:#cbd3d9;
  box-shadow:0 10px 28px rgba(0,0,0,.30);
  font-size:9px;
  font-weight:800;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease,transform .18s ease;
}
#pcPresetToast.show{
  opacity:1;
  transform:translate(-50%,0);
}
