#staff-editor {
  --ink:#27362c;--leaf:#38543f;--paper:#faf7ee;--line:#d9d5c6;
  width:min(730px,calc(100vw - 24px));height:min(590px,calc(100dvh - 28px));
  max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;
  border:1px solid #e8e4d8;border-radius:18px;box-shadow:0 18px 80px #111b1459;
  background:var(--paper);color:var(--ink);touch-action:pan-y;
}
#staff-editor::backdrop {background:#172119a1}
.staff-editor-shell {height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.staff-editor-heading {display:flex;align-items:center;justify-content:space-between;padding:10px 14px 10px 20px;border-bottom:1px solid var(--line)}
.staff-editor-heading h2 {margin:0;font-size:1.16rem;letter-spacing:-.045em}
#staff-editor button,#staff-editor select,#staff-editor input {font:inherit}
#staff-editor button,#staff-editor select {cursor:pointer}
#staff-editor button:disabled,#staff-editor select:disabled {cursor:default}
#staff-editor button:focus-visible,#staff-editor select:focus-visible,#staff-editor input:focus-visible {outline:3px solid #bb8955;outline-offset:1px}
#staff-editor .staff-close {width:42px;height:42px;padding:0;background:transparent;color:var(--ink);border:0;font-size:1.65rem;border-radius:50%}
#staff-editor .staff-close:hover {background:#e4e9dd}
.staff-editor-body {min-height:0;display:grid;grid-template-columns:minmax(195px,.72fr) minmax(0,1fr)}
.staff-preview {
  min-height:0;min-width:0;padding:18px 20px 14px;color:#fffbeb;
  background:radial-gradient(ellipse at 48% 39%,#61785c,#48644d 56%,#314c3c);
  display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:10px;
}
.staff-picker {display:grid;gap:5px;font-weight:650}
.staff-picker span,.staff-turn span {font-size:.86rem;color:#f1f2de}
#staff-editor .staff-picker select {
  display:block;width:100%;min-height:44px;margin:0;padding:5px 9px;color:#fffceb;
  background:#344d3c;border:1px solid #e1e8d68a;border-radius:9px;font-size:1rem;font-weight:600;
}
.staff-picker option {color:white;background:#344d3c}
.staff-portrait {min-width:0;min-height:0;position:relative;display:grid;justify-items:center;align-items:center;overflow:hidden}
.staff-model {position:relative;height:min(100%,325px);max-width:96%;aspect-ratio:104/220;filter:drop-shadow(1px 5px 5px #17291e4d)}
#staff-editor:is([data-section="face"],[data-section="hair"],[data-section="accessories"][data-detail="head"]) .staff-model {position:absolute;top:0;height:180%;max-width:none}
.staff-turn {display:grid;align-items:center;grid-template-columns:auto minmax(0,1fr);column-gap:10px}
.staff-turn input {display:block;width:100%;margin:0;height:36px;accent-color:#f2e3be;touch-action:pan-x}
.staff-wardrobe {min-height:0;min-width:0;display:grid;grid-template-rows:auto minmax(0,1fr);padding:12px 18px 0}
.staff-tabs {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border-bottom:1px solid var(--line)}
#staff-editor .staff-tabs button {
  border:0;border-bottom:3px solid transparent;background:transparent;color:#677064;min-height:43px;
  padding:6px 2px 8px;font-weight:600;font-size:.88rem;
}
#staff-editor .staff-tabs button[aria-selected="true"] {color:#2c4834;border-bottom-color:var(--leaf)}
.staff-options {min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:14px 3px 18px;touch-action:pan-y}
.staff-options fieldset {min-width:0;margin:0 0 17px;padding:0;border:0}
.staff-options fieldset:last-child {margin-bottom:0}
.staff-options legend {padding:0;margin:0 0 7px;font-weight:650;font-size:.92rem;line-height:1.4}
.staff-options .visitor-choices span {min-height:40px;--rule:var(--line)}
.staff-options .visitor-choices input:focus-visible+span {outline:2px solid #967844;outline-offset:1px}
.staff-editor-footer {display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 14px;border-top:1px solid var(--line)}
.staff-status {flex:1 1 180px;margin:0;font-size:.89rem;line-height:1.45;color:#41553d;word-break:keep-all;overflow-wrap:anywhere}
.staff-status:empty {display:none}
#staff-editor .staff-editor-footer button {min-height:43px;border-radius:8px;border:1px solid var(--line);padding:5px 12px;color:#394939;background:#f5f2e9;font-size:.9rem;font-weight:630}
#staff-editor .staff-editor-footer .staff-save {background:var(--leaf);color:#fffbed;border-color:var(--leaf)}
#staff-editor .staff-reset {margin-left:auto}
#staff-editor .staff-editor-footer button:disabled {opacity:.56}
@media(max-width:570px) {
  #staff-editor {height:min(730px,calc(100dvh - 18px));width:min(485px,calc(100vw - 14px));border-radius:14px}
  .staff-editor-heading {padding:5px 9px 5px 15px}
  .staff-editor-body {grid-template-columns:1fr;grid-template-rows:clamp(130px,28dvh,212px) minmax(0,1fr)}
  .staff-preview {grid-template-columns:minmax(138px,.95fr) minmax(90px,1fr);grid-template-rows:1fr 1fr;padding:9px 15px;gap:3px 8px}
  .staff-picker {align-self:center}
  .staff-portrait {grid-row:1/3;grid-column:2}
  .staff-model {height:100%}
  .staff-turn {align-self:end;display:flex;flex-direction:column;align-items:stretch;gap:0}
  .staff-wardrobe {padding:5px 12px 0}
  .staff-options {padding-top:10px}
  .staff-editor-footer {padding:8px 12px}
  .staff-status:not(:empty) {flex-basis:100%}
}
@media(max-height:490px) and (min-aspect-ratio:1/1) {
  #staff-editor {width:min(730px,calc(100vw - 12px));height:calc(100dvh - 8px)}
  .staff-editor-heading,.staff-editor-footer {padding-block:3px}
  .staff-editor-body {grid-template:1fr/minmax(155px,.65fr) minmax(0,1fr)}
  .staff-preview {display:grid;grid-template: auto minmax(0,1fr) auto / 1fr;gap:3px;padding:5px 12px}
  .staff-portrait {grid-area:2/1;min-height:0}
  .staff-turn {display:grid;grid-template-columns:auto minmax(0,1fr)}
  .staff-picker {grid-template-columns:auto minmax(0,1fr);align-items:center}
  .staff-status:not(:empty) {flex-basis:160px}
}
@media(pointer:coarse) {.staff-options .visitor-choices span,#staff-editor .staff-tabs button {min-height:44px}}
