/* The model workshop (/editor/models.html): what it lays out differently from the map workshop (editor.css). */
.models#app { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.models #work { gap: 0; }
.models #bar a { color: var(--limb); }
.models label.tick { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.models #left .card { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 0; }
.models #right .card { flex: 0 0 auto; }
/* the two lists keep a height worth scrolling in: with tall cards above them the column scrolls, they are not squeezed to their headings */
.models #right #anims { flex: 3 0 auto; min-height: 190px; max-height: 46vh; } .models #right #bones { flex: 1 0 auto; min-height: 150px; max-height: 40vh; }
.models #right .card[id] > h2 { display: flex; align-items: center; cursor: pointer; user-select: none; }
.models #right .card[id] > h2::after { content: ""; margin-left: auto; width: .42em; height: .42em; border: solid var(--haze); border-width: 0 1.5px 1.5px 0; transform: translateY(-.15em) rotate(45deg); flex: none; }
.models #right .card[id] > h2:hover::after { border-color: var(--cloud); }
.models #right .card.is-folded { flex: 0 0 auto !important; min-height: 0 !important; } .models #right .card.is-folded > h2 { margin-bottom: 0; } .models #right .card.is-folded > h2::after { transform: translateX(-.15em) rotate(-45deg); }
.models #right .card.is-folded > :not(h2) { display: none !important; }
.models #right p { margin: 0; color: var(--haze); font-size: 13px; }
#find { width: 100%; padding: 4px 8px; }
#tree details > summary { padding: 3px 6px; border-radius: 3px; cursor: pointer; font: 12px/1.3 var(--mono); color: var(--haze); }
#tree details > summary:hover { background: var(--fill-hover); color: var(--cloud); }
#tree details[open] > summary { color: var(--cloud); }
#tree details > div { margin-left: 10px; }

#stage { flex: 1 1 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
#stage .pane { flex: 1 1 0; }
#stage canvas { cursor: grab; }
#stage .tag { color: var(--haze); text-shadow: 0 0 4px var(--paper), 0 0 4px var(--paper); }
#time { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
#time button { min-width: 5em; padding: 4px 10px; }
#time select { padding: 4px 6px; max-width: 14em; }
#time { flex-wrap: wrap; }
.track { position: relative; flex: 1 1 160px; min-width: 60px; display: flex; padding-bottom: 7px; }
#frame { flex: 1 1 0; min-width: 0; margin: 0; accent-color: var(--limb); }
#keystrip button { position: absolute; bottom: 0; width: 7px; height: 7px; min-width: 0; margin-left: -3.5px; padding: 0; border: 0; border-radius: 1px; background: var(--haze); transform: rotate(45deg); }
#keystrip button.is-mine { background: var(--sun); }
#keytools { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; order: 9; color: var(--haze); font-size: 12px; }
#keytools button { min-width: 0; padding: 2px 9px; font-size: 12px; } #keytools select { padding: 2px 6px; font-size: 12px; }
#key-bone { font-family: var(--mono); margin-right: auto; }
#shape { margin-top: 8px; font-size: 13px; } #shape summary { cursor: pointer; color: var(--limb); }
.shape { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.shape label { margin: 0 !important; } .shape input { width: 4.2em; padding: 2px 4px; font: 12px/1.3 var(--mono); color: var(--cloud); background: var(--well); border: 1px solid var(--line); border-radius: 3px; }
.shape button, #revert { padding: 2px 10px; font-size: 12px; } #revert { margin-top: 8px; }
#frame-n { min-width: 13em; color: var(--haze); font: 12px var(--mono); text-align: right; }
#time label { color: var(--haze); font-size: 13px; white-space: nowrap; }

#about dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0; font-size: 13px; }
#about dt { color: var(--haze); } #about dd { margin: 0; overflow-wrap: anywhere; }
#about label { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--haze); font-size: 13px; }
#about select { padding: 3px 6px; }
#surf-list { display: grid; gap: 6px; }
.surf { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; }
.surf canvas { grid-row: 1 / 3; width: 40px; height: 40px; border: 1px solid var(--line-soft); border-radius: 3px; background: var(--deep); }
.surf b { font: 12px/1.3 var(--mono); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surf input[type=text] { grid-column: 2 / 4; width: 100%; padding: 2px 6px; font: 12px/1.3 var(--mono); }
.surf input.is-missing { border-color: var(--sun); }
.anim-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 6px 8px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 3px; font-size: 12px; color: var(--haze); }
.anim-edit input[type=text] { flex: 1 1 100%; padding: 2px 6px; font: 12px/1.3 var(--mono); }
.anim-edit input[type=number] { width: 4em; padding: 2px 4px; font: 12px/1.3 var(--mono); color: var(--cloud); background: var(--well); border: 1px solid var(--line); border-radius: 3px; }
.anim-edit button, .anim-more button { width: auto; padding: 2px 9px; border: 1px solid var(--line); background: var(--fill); font: inherit; font-size: 12px; }
.anim-edit select { padding: 2px 4px; font: 12px/1.3 var(--mono); max-width: 11em; } .anim-edit .uses { flex: 1 1 100%; }
.anim-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px; }
#tree details > summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bone-list button { padding-top: 1px; padding-bottom: 1px; }
/* a narrow screen: the page scrolls (editor.css), the model first, then the list, then the panels */
@media (max-width: 1000px) { #stage { order: -1; flex: none; height: 76vh; } .models #left .card { flex: none; height: 46vh; } .models #right #anims, .models #right #bones { flex: none; max-height: 46vh; } #frame-n { min-width: 0; } }
#posetools { display: flex; gap: 4px; } #posetools button { min-width: 0; padding: 4px 9px; font-size: 12px; }
.tints { display: flex; align-items: center; gap: 10px; color: var(--haze); font-size: 12px; } .tints label { display: inline-flex; align-items: center; gap: 4px; }
.tints input { width: 28px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: none; }
/* a phone: the menus hold everything, so the toolbar keeps only what is switched often */
@media (max-width: 700px) { .models #bar :is(#open-b, #try-b, #export-b, .gap) { display: none; } .models #bar .seg { flex: 1 1 auto; display: flex; } .models #bar .seg button { flex: 1 1 0; padding-left: 4px; padding-right: 4px; } }
#painttools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); color: var(--haze); font-size: 12px; }
#painttools label { display: inline-flex; align-items: center; gap: 6px; } #painttools input[type=range] { width: 90px; accent-color: var(--limb); } #painttools input[type=color] { width: 30px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: none; }
.surf .picrow { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; } .surf .picrow button { padding: 1px 8px; font-size: 11px; }
.shaperow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--haze); font-size: 12px; } .shaperow button { padding: 2px 9px; font-size: 12px; } .shaperow input { width: 4.5em; padding: 2px 4px; font: 12px/1.3 var(--mono); color: var(--cloud); background: var(--well); border: 1px solid var(--line); border-radius: 3px; }
.models #right #shapetools { flex: 0 0 auto; }
#ring, #uvring { position: absolute; border: 1px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #000a, inset 0 0 0 1px #000a; pointer-events: none; }
#ring[hidden], #uvring[hidden] { display: none; }
#panes { flex: 1 1 0; display: flex; gap: 0; min-width: 0; min-height: 0; }
#panes > .split:has(+ #uvpane[hidden]) { display: none; }
/* what the view shows: on the view, in its corner */
.viewopts { position: absolute; right: 6px; top: 5px; display: flex; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 12px); padding: 3px 8px; border-radius: 3px; background: rgb(7 12 22 / .72); color: var(--haze); }
.viewopts label.tick { font-size: 12px; } .viewopts label.tick:hover, .viewopts label.tick:has(:checked) { color: var(--cloud); }
#title { max-width: calc(100% - 290px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* nothing open yet: what to do, in the middle of the view */
#empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 20px; text-align: center; color: var(--haze); pointer-events: none; }
#empty p { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; } #empty p:first-child { color: var(--cloud); font-size: 17px; } #empty p:last-child { margin-top: 10px; } #empty button { pointer-events: auto; padding: 6px 14px; }
#title:not(:empty) ~ #empty { display: none; }
#uvpane[hidden] { display: none; }
#stage #uv { cursor: crosshair; }
#uvpane .tag select, #uvpane .tag button { pointer-events: auto; font-size: 12px; padding: 1px 6px; opacity: 1; }
@media (max-width: 1000px) { #panes { flex-direction: column; } }
.bonesrow { border-top: 1px solid var(--line-soft); padding-top: 6px; } .bonesrow b { color: var(--haze); font-weight: normal; } #bone-n { width: 3.5em; }
#painttools.no-colour label:first-child { display: none; }
#joint-name { width: 8em; font-size: 12px; padding: 2px 6px; }
#maps p { color: var(--haze); font-size: 12px; margin: 0 0 8px; } .mapcols { display: flex; flex-wrap: wrap; gap: 10px; } .mapcols fieldset { flex: 1 1 160px; border: 1px solid var(--line-soft); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; } .mapcols canvas { width: 96px; aspect-ratio: 1; background: #070c16; border-radius: 3px; } .mapcols label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--haze); } .mapcols input[type=range] { flex: 1; min-width: 0; }
@media (max-width: 1000px) { #panes > .split { display: none; } #panes { gap: 8px; } .models #left { margin-bottom: 8px; } #stage { margin-bottom: 8px; } }
@media (max-width: 700px) { #title { top: auto; bottom: 5px; max-width: calc(100% - 12px); } }
/* the party: one row a member (name, dance, the one you play, out), then who to add and how they stand */
.party-row { display: flex; align-items: center; gap: 6px; margin: 2px 6px; padding: 2px 4px; border: 1px solid transparent; border-radius: 3px; font-size: 12px; color: var(--haze); }
.party-row.is-current { border-color: var(--line); background: var(--fill); }
.party-row .party-name { flex: 1 1 0; min-width: 0; width: auto; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; text-align: left; border: 0; background: none; font: 12px/1.3 var(--mono); color: var(--cloud); }
.party-row select, .party-add select { padding: 2px 4px; font: 12px/1.3 var(--mono); }
.party-row select { flex: 0 1 6.4em; min-width: 0; }
.party-row .party-out { width: auto; padding: 0 7px; border: 1px solid var(--line); background: var(--fill); font: inherit; line-height: 1.5; }
.party-add, .party-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px; }
.party-add select { flex: 1 1 0; max-width: none; }
.party-add button, .party-more button { width: auto; padding: 2px 9px; border: 1px solid var(--line); background: var(--fill); font: inherit; font-size: 12px; }
.party-more button.is-current { border-color: var(--sky, #6db5f2); color: var(--cloud); }
#party-list p { margin: 4px 8px; font-size: 12px; color: var(--haze); }
#shape-nums label { display: inline-flex; align-items: center; gap: 4px; } #shape-nums input { width: 52px; }
#band { position: absolute; border: 1px dashed var(--edge, #6db5f2); background: rgb(110 181 242 / .12); pointer-events: none; } #band[hidden] { display: none; }
#shape-surfs select { max-width: 11em; }
#sheet { padding: 6px 10px; max-height: 168px; overflow-y: auto; font-size: 12px; --now: 0; }
.sheet-row { display: flex; align-items: center; gap: 8px; height: 18px; }
.sheet-row .sheet-name { flex: 0 0 11em; min-width: 0; padding: 0; border: 0; background: none; color: var(--haze); font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.sheet-row.is-current .sheet-name, .sheet-row.is-all .sheet-name { color: var(--cloud); }
.sheet-lane { position: relative; flex: 1 1 0; height: 100%; border-bottom: 1px solid var(--line, #ffffff14); cursor: pointer; }
.sheet-lane::after { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; left: calc(8px + (100% - 16px) * var(--now)); background: var(--limb); pointer-events: none; }
.sheet-lane button { position: absolute; top: 5px; width: 8px; height: 8px; min-width: 0; margin-left: -4px; padding: 0; border: 0; border-radius: 1px; background: var(--haze); transform: rotate(45deg); cursor: ew-resize; touch-action: none; }
.sheet-row.is-current .sheet-lane button, .sheet-row.is-all .sheet-lane button { background: var(--sun); }
.sheet-lane button.is-moving { outline: 1px solid var(--cloud); }
