#boss-editor {
  width: min(530px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  border: 3px solid #161b2b;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 5px 6px 0 #131522;
}
#boss-editor::backdrop { background: #121626c4; backdrop-filter: blur(3px); }
.boss-heading {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 18px;
  background: var(--mint); border-bottom: 3px solid var(--ink);
}
.boss-heading h2 {
  margin: 0; outline: none;
  font-family: inherit; font-size: clamp(21px, 4vw, 25px); font-weight: 900; line-height: 1.2;
  letter-spacing: .04em;
}
.boss-badge {
  display: block; position: relative; width: 30px; height: 23px; flex: 0 0 auto;
  background: #fff3d4; border: 2px solid var(--ink); box-shadow: 2px 2px var(--ink);
}
.boss-badge::before {
  content: ''; position: absolute; top: 4px; left: 4px; width: 5px; height: 5px;
  background: #40354b; box-shadow: -1px 6px #40354b, 1px 6px #40354b;
}
.boss-badge::after {
  content: ''; position: absolute; right: 3px; top: 6px; width: 8px; height: 2px;
  background: #5f7a70; box-shadow: 0 5px #5f7a70;
}
.boss-editor-body { padding: 17px 17px 13px; }
.boss-profile-card {
  display: grid; grid-template-columns: clamp(158px, 47vw, 218px) minmax(0,1fr);
  align-items: center; column-gap: clamp(10px, 3.4vw, 21px);
  border: 2px solid #494747; border-radius: 2px;
  background: #fff9e7; padding: 10px 13px 10px 10px; box-shadow: 2px 3px 0 #d5c9a9;
}
.boss-portrait {
  width: 100%; height: auto; aspect-ratio: 1; display: block;
  border: 2px solid var(--ink); background: #c9dfd1; image-rendering: pixelated;
}
.boss-id-info { min-width: 0; display: grid; align-content: center; }
.boss-look-title {
  display: block; margin: 0 0 clamp(12px, 4vw, 23px); padding-bottom: 9px;
  border-bottom: 2px solid #d7cdb6; color: var(--ink);
  font-size: clamp(18px, 4.5vw, 28px); font-weight: 950; line-height: 1.27; letter-spacing: .01em;
}
.boss-id-info label, .boss-looks legend { font-size: 15px; font-weight: 850; color: #333140; }
#office-boss-name {
  width: 100%; min-width: 0; min-height: 44px; margin: 6px 0 2px; padding: 7px 8px;
  border: 1px solid #8e897d; border-bottom: 3px solid #4c675c; border-radius: 2px;
  background: #fffdf4; color: #292739; font: inherit; font-size: 16px; font-weight: 750;
}
#office-boss-name::placeholder { color: #68675f; opacity: 1; }
#office-boss-name:focus-visible { outline: 3px solid #14877b; outline-offset: 1px; }
#boss-name-limit { margin-top: 1px; font-size: 12px; color: #666459; }
.boss-looks { margin: 15px 0 0; padding: 0; border: 0; min-width: 0; }
.boss-looks legend { padding: 0; margin: 0 0 7px; }
.boss-options { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: clamp(4px,1.4vw,9px); }
.boss-look {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative; cursor: pointer; min-width: 0; -webkit-tap-highlight-color: transparent;
}
.boss-look input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.boss-swatch {
  display: block; position: relative; width: 100%; aspect-ratio: 1;
  border: 2px solid #9a9c8e;
  background: #d7e6d5; overflow: hidden; border-radius: 2px;
}
.boss-swatch img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.boss-look input:checked + .boss-swatch {
  border-color: var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.boss-look input:checked + .boss-swatch::after {
  content: ''; position: absolute; top: 0; right: 0; width: 13px; height: 13px;
  border: solid var(--ink); border-width: 0 0 1px 1px; background: var(--yellow);
}
.boss-look input:checked + .boss-swatch::before {
  content: ''; position: absolute; z-index: 1; top: 2px; right: 3px; width: 4px; height: 7px;
  transform: rotate(40deg); border: solid var(--ink); border-width: 0 2px 2px 0;
}
.boss-look input:focus-visible + .boss-swatch { outline: 3px solid #14877b; outline-offset: 2px; }
.boss-look-name { font-weight: 650; font-size: clamp(11px, 3.1vw, 13px); line-height: 1.35; text-align: center; }
.boss-look input:checked ~ .boss-look-name { font-weight: 900; }
.boss-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px dashed #9a8d74; padding: 10px 17px 14px; margin-top: 3px;
}
.boss-back { min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); font-weight: 800; }
.boss-actions .actionMain { min-height: 44px; min-width: 114px; }
@media (max-width: 380px) {
  #boss-editor { width: calc(100% - 16px); max-width: calc(100% - 16px); }
  .boss-heading { padding: 10px 12px; }
  .boss-editor-body { padding: 11px 9px 9px; }
  .boss-profile-card { column-gap: 8px; padding: 6px; }
  .boss-look-title { margin-bottom: 10px; padding-bottom: 6px; }
  .boss-id-info label { font-size: 13px; }
  .boss-looks { margin-top: 12px; }
  .boss-actions { padding: 8px 12px 12px; }
}
@media (max-width: 350px) {
  .boss-profile-card { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (max-height: 450px) and (min-width: 500px) {
  #boss-editor { width: min(720px, calc(100vw - 24px)); }
  .boss-heading { padding: 7px 13px; }
  .boss-editor-body {
    display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 12px;
    align-items: center; padding: 10px 13px;
  }
  .boss-profile-card { grid-template-columns: clamp(102px, 19vw, 149px) minmax(0,1fr); gap: 8px; padding: 6px; }
  .boss-look-title { font-size: 17px; margin-bottom: 7px; padding-bottom: 4px; }
  .boss-id-info label { font-size: 12px; }
  #office-boss-name { margin-top: 3px; }
  .boss-looks { margin: 0; }
  .boss-options { gap: 4px; }
  .boss-look-name { font-size: 11px; }
  .boss-actions { padding: 6px 14px 10px; }
}

.boss-board-name-note {
  margin: 9px 0 0; color: #565146; font-size: 13px; line-height: 1.45;
}
@media (max-height: 450px) and (min-width: 500px) {
  .boss-board-name-note { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}
