@font-face{font-family:Malichus;src:url(media/identity/malichus-400.woff) format("woff");font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:Malichus;src:url(media/identity/malichus-700.woff) format("woff");font-style:normal;font-weight:700;font-display:swap}
:root{
  --terra:#A04933;--terra-deep:#6E2D1E;--terra-lift:#BE6046;
  --cream:#FAF5E0;--blush:#F1D5C9;--gold:#F3DFAE;
  --ink:#35271f;--surface:#4a3027;--atelier:#38251f;--atelier-panel:#4a3027;
  --line:#896b59;--hair:#896b59;--metal:var(--gold);--brass:var(--gold);--paper:var(--cream);
  --type:Malichus,serif;--display:Malichus,serif;--serif:Malichus,serif;--ui:Malichus,serif;--arabic:Malichus,serif
}
body :is(h1,h2,h3,button,label,summary,a,p,small,strong),body{font-family:Malichus,serif}
body>header:first-of-type,.newHome .mast,.studio .top{
  background:linear-gradient(105deg,var(--terra-deep),var(--terra) 65%,#8b402d);
  color:var(--cream);border-bottom:1px solid #c2976a
}
body header :is(.signature,.mark,.brand,.wordmark,.roomWord){
  display:inline-flex;align-items:center;gap:8px;white-space:nowrap;
  color:var(--cream)!important;letter-spacing:normal
}
/* The emblem in the header is a link home, and on a narrow phone it shrank to 26x29 — below
   the 44px a fingertip needs (WCAG 2.5.5). The mark keeps its drawn size; the link around it
   grows to meet the finger. */
body header a:is(.signature,.mark,.brand,.wordmark,.roomWord){min-height:44px;padding-inline:4px}
.mzEmblem{display:block;width:32px;height:34px;object-fit:contain;flex:none}
.mzArabic{font:700 23px/1.35 Malichus,serif}
.mzEnglish{font:700 12px/1.3 Malichus,serif;letter-spacing:.12em}
html[lang^=ar] .mzEnglish,html:not([lang^=ar]) .mzArabic{display:none}
.paperSeal:has(.mzEmblem){display:grid;place-items:center;background:var(--terra-deep);border-color:#bd9370}
.paperSeal .mzEmblem{width:78%;height:78%}
.newHome .roomRail,.roomPin:not(.paperPin):before,.roomDock,.studio .scene-tools button{background:#48291fed;color:var(--cream);border-color:#ac866c}
.newHome .paperPin:before{background:var(--cream);border-color:#b78e61}
.roomRail [aria-pressed=true]{background:var(--terra);color:var(--cream)!important}
body:has(.buildMap){background:#faf5e0;color:#35271f;color-scheme:light}
.buildMap .mapIntro p,.buildMap li p{color:#624b3c}
.buildMap li,.buildMap .missions li,.buildMap .missions li.locked{background:#fffdf5;border-color:#d9c9ad}
.buildMap li.current,.buildMap .missions li.available{background:#f7ecd5;border-color:var(--terra);box-shadow:inset 0 -2px var(--terra)}
.buildMap li :is(small,span),.buildMap .missions li small,.buildMap a,.buildMap .mapIntro .textLink{color:#843b29}
.buildMap .mapIntro .brassBtn,body .primary,.studio .helpTab,#workOrder #buildLink{background:var(--terra);color:var(--cream);border-color:var(--terra-deep)}
.guideSheet,.studio .console,body .roomHelp,body .roomDock,.newHome #drawer,body .toolbox{background-color:#3c2922;color:var(--cream);border-color:#997a62}
body :is(button,a,input):focus-visible{outline:3px solid #d9a93f;outline-offset:2px}
@media(max-width:460px){.mzEmblem{width:26px;height:29px}.mzArabic{font-size:20px}.mzEnglish{font-size:10px}.studio .wordmark{gap:4px}}

/* Keep navigation clear of the hands and protect the interactive surfaces on touch screens. */
.gamesExit{display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:44px;padding-inline:10px;color:inherit;text-decoration:none;white-space:nowrap;font:600 15px/1.3 Malichus,serif}
/* Whatever ends up first in a room's header is the way back, and it reads as one. */
body>header>.gamesExit,body>header>.roomBack{border-inline-end:1px solid #c69778}
dialog>.gamesExit{margin-top:10px;border:1px solid currentColor;border-radius:6px}
:is(canvas,.worktable,.roomStage,.optic,.scopeArea,.practiceGrid,.piece,.stage),:is(.worktable,.roomStage,.optic,.scopeArea,.practiceGrid,.piece,.stage) *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
:is(.worktable,.roomStage,.scopeArea,.stage) img{-webkit-user-drag:none}
#seatTarget:not([hidden]){position:absolute;z-index:2;display:grid;place-content:center;transform:translate(-50%,-50%);width:46px;height:46px;border:2px solid #ffdf91;border-radius:50%;background:#38250a87;color:white;box-shadow:0 0 0 2px #302720ab;font:700 24px/1 sans-serif;touch-action:manipulation}
.newHome .roomRail a:not([href]){visibility:hidden}
.newHome .roomRail a{touch-action:manipulation}
/* One lead action, then the side rooms. The rail used to carry two filled buttons of equal
   weight — the bench order and the part practice — so neither read as the way in. */
#startWatch{background:transparent;color:var(--cream)!important;font-weight:normal}
@media(max-width:700px){
  body>header:first-of-type{padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right));gap:4px}
  body>header :is(.mzArabic,.mzEnglish){display:none}
  .newHome .roomRail{width:min(94%,440px);display:grid;grid-template-columns:repeat(3,1fr);text-align:center;white-space:normal}
  .newHome #guidedOrder{grid-column:1/-1;justify-content:center;font-size:17px}
  .studio .worktable{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
  .studio .scene-heading{position:relative;inset:auto;height:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:#192c25e8}
  .studio .headingInk{max-width:none;min-width:0}
  .studio .scene-heading h1{font-size:clamp(20px,5.5vw,26px)}
  .studio .scene-heading .helpTab{position:static;min-height:44px;border:1px solid #be956d;border-radius:6px}
  .studio #viewport,.studio #viewport.factory,.studio #viewport.instrument{position:relative;inset:auto;height:100%}
  .studio #viewport.factory #stationVisual,.studio #bridgeWork:not([hidden]){inset:0;width:100%;height:100%;border-radius:0;box-shadow:none}
  .studio .scene-tools,.studio[dir=ltr] .scene-tools,[dir=ltr] .studio .scene-tools{top:4px;left:6px;right:auto;bottom:auto}
  .studio .scene-tools button{min-height:40px;min-width:40px}
  .studio .worktable .console,.studio[data-mode=instrument] .worktable .console,.studio .worktable .console:has(#after:not([hidden])){position:relative;inset:auto;transform:none;box-sizing:border-box;width:100%;min-width:0;max-width:none;max-height:40dvh;margin:0;padding:7px 12px calc(12px + env(safe-area-inset-bottom));border-radius:0;background:#20362e}
  .studio .console .tray-label{display:flex;align-items:center;justify-content:space-between}
  .studio .console .tray-label span{display:block;font-size:13px;color:#e9dcc1}
  .studio .console #parts{display:grid;grid-template-columns:1fr}
  .studio #parts .card{display:flex;flex-direction:row;justify-content:center;gap:14px;min-height:50px;font-size:16px}
  .studio #parts .card canvas{width:72px;height:38px}
}
.studio #parts:has(.stem-reference){display:grid;grid-template-columns:1.4fr 1fr;gap:6px}
.studio #parts .stem-reference{display:flex;align-items:center;justify-content:center;gap:6px;padding:3px 6px;min-height:46px;border:1px solid #6e877b;border-radius:6px;background:#20372d;color:#f4e6cc;font-size:13px}
.stem-reference img{width:35px;height:35px;object-fit:cover;border-radius:50%}

.studio .stepMeta{flex-wrap:wrap;gap:2px 10px}
.studio .stepMeta #count{direction:inherit;font:inherit;white-space:nowrap}

.newHome #guidedOrder{background:#b9833f;color:#1e140b!important;font-weight:bold;text-align:center;min-height:52px}
@media(max-width:700px){
  .newHome .roomRail{grid-template-columns:repeat(4,minmax(0,1fr))}
  .newHome .roomRail>*{grid-column:span 1;font-size:13px}
  .newHome .roomRail #guidedOrder{grid-column:1/-1;font-size:17px;white-space:normal;justify-content:center}
}

/* A tap target has to be reachable: the level mark measured 105x19, under the 24px floor
   that WCAG 2.2 SC 2.5.8 sets for a control that is not inline in a sentence. */
.studio #levelMark{display:inline-flex;align-items:center;min-height:30px;padding-block:5px}

/* iOS raised text-selection handles over the bench while a part was being dragged, which put
   a blue highlight across the movement and the drawer. Nothing in a game room is text to
   select, so the whole chrome opts out; a long press on a reading surface still works. */
body:is(.order,.studio,.gameRoom,.atelier-home,.newHome){
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent
}
body:is(.order,.studio,.gameRoom,.atelier-home,.newHome) :is(p,li,h1,h2,h3,dd,dt,blockquote,code,input,textarea){
  -webkit-user-select:text;user-select:text
}
body:is(.order,.studio,.gameRoom) :is(.benchNote,#hint,.roomDock,.task,.drawer,#rack,#controls,#toolRail){
  -webkit-user-select:none;user-select:none
}
