:root {
  --ink: #16181d;
  --sub: #6b7280;
  --line: #e5e7eb;
  --bg2: #f5f6f8;
  --blue: #2f6bff;
  --tint: #eef3ff;
}

* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100%; margin: 0 }
body {
  overflow: hidden;
  overscroll-behavior: none;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h2, h3, p, ul, ol, figure { margin: 0; padding: 0 }
ul, ol { list-style: none }
a { color: inherit; text-decoration: none }
button, input { font: inherit; color: inherit }
button { padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap }
button:disabled { cursor: default }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px }
.bar svg, .side svg, .tabs svg, .pane svg, .dlg svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

.app {
  display: grid;
  grid-template: "bar bar bar" 56px "side stage panel" minmax(0, 1fr) / 208px minmax(0, 1fr) 384px;
  height: 100vh;
  height: 100dvh;
}

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; font-weight: 600 }
.btn:hover { background: #1f58e6; border-color: #1f58e6 }
.btn.line { background: #fff; border-color: #cfd4dc; color: var(--ink) }
.btn.line:hover { background: #fff; border-color: var(--ink) }
.btn:disabled { opacity: .45 }
.sm { min-height: 44px; padding: 0 12px; border: 1px solid #d8dce3; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 500 }
.sm:hover:enabled { border-color: var(--ink) }
.sm:disabled { opacity: .45 }
.sm[aria-pressed=true] { border-color: var(--blue); background: var(--tint); color: var(--blue) }

.bar { grid-area: bar; position: relative; z-index: 5; display: flex; align-items: center; gap: 2px; padding: 0 12px 0 4px; border-bottom: 1px solid var(--line); background: #fff }
.back { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 44px; height: 44px; padding: 0 10px 0 6px; border-radius: 8px; color: #3d424d; font-weight: 500 }
.back:hover, .ic:hover:enabled, .acts button:hover { background: var(--bg2) }
#title { width: 240px; min-width: 0; height: 40px; margin: 0 8px 0 4px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: none; font-weight: 600; text-overflow: ellipsis }
#title:hover { border-color: var(--line) }
#title:focus { border-color: var(--blue); outline: 0 }
.ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 8px }
.ic:disabled { opacity: .3 }
.acts { display: flex; margin-left: auto }
.acts button { height: 44px; padding: 0 12px; border-radius: 8px; color: #3d424d; font-weight: 500 }
.more { display: none }
.more svg { stroke-width: 2.6 }
.bar .btn { margin-left: 8px }

.side { grid-area: side; overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--line) }
.side h2 { margin: 0 4px 8px; color: var(--sub); font-size: 13px; font-weight: 600 }
.layers { margin-top: 24px }
.seg { display: flex; margin-bottom: 6px; padding: 3px; border-radius: 10px; background: var(--bg2) }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 8px; color: #4b5160; font-weight: 500 }
.seg [aria-pressed=true] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 24, 29, .14) }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 8px; border-radius: 8px; text-align: left }
.tg:hover { background: var(--bg2) }
.tg i { position: relative; flex: none; width: 32px; height: 18px; border-radius: 9px; background: #cfd4dc; transition: background .15s }
.tg i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s }
.tg[aria-pressed=true] i { background: var(--blue) }
.tg[aria-pressed=true] i::after { transform: translateX(14px) }
.lay { display: none }
.brush { display: block; padding: 6px 8px 2px }
.brush span { display: flex; justify-content: space-between; font-size: 14px }
.brush output { color: var(--sub); font-variant-numeric: tabular-nums }
.brush input { display: block; width: 100%; height: 44px; margin: -6px 0; accent-color: var(--blue) }

.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg2) }
.stage canvas { display: block; width: 100%; height: 100%; outline: 0; touch-action: none }
/* 머리는 가운데에 꽉 차게 잡혀서 아래에 두면 긴 머리 끝을 가린다 */
.views { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px }
.views button { width: 60px; height: 44px; border: 1px solid #d8dce3; border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500 }
.views button:hover { border-color: var(--ink) }
.wait { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg2); color: var(--sub); text-align: center }
.spin { display: inline-block; width: 24px; height: 24px; border: 2.5px solid #d8dce3; border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

.panel { grid-area: panel; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: #fff }
.target { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; padding: 6px 8px 6px 20px; border-bottom: 1px solid var(--line) }
.target.on { background: var(--tint) }
.target strong { min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.35 }
.target.on strong { color: var(--blue) }
.target div { display: flex; flex: none }
.target button { height: 44px; padding: 0 8px; border-radius: 8px; color: #3d424d; font-size: 14px; font-weight: 500 }
.target button:hover { background: rgba(22, 24, 29, .06) }

.tabs { display: flex; flex: none; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none }
.tabs::-webkit-scrollbar { display: none }
.tabs [role=tab] { flex: 1 0 auto; min-width: 44px; height: 44px; padding: 0 10px; border-bottom: 2px solid transparent; color: var(--sub); font-weight: 500 }
.tabs [role=tab]:hover { color: var(--ink) }
.tabs [aria-selected=true] { border-color: var(--ink); color: var(--ink); font-weight: 700 }
.fold { display: none }

.pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 28px }
.pane h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-top: 10px; font-size: 14px; font-weight: 700 }
.pane h3 span { color: var(--sub); font-weight: 500; font-variant-numeric: tabular-nums }
.pane h3 em, .val em { padding: 1px 7px; border-radius: 4px; background: var(--tint); color: var(--blue); font-size: 12px; font-style: normal; font-weight: 600 }
.tip { margin-top: 8px; color: var(--sub); font-size: 13px }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px }
.dim { opacity: .5 }

.chips { display: flex; gap: 6px }
.chips button { display: grid; place-items: center; flex: 1; min-width: 0; min-height: 44px; padding: 4px 6px; border: 1px solid #d8dce3; border-radius: 8px; font-weight: 500; line-height: 1.25 }
.chips button:hover { border-color: var(--ink) }
.chips small { display: block; color: var(--sub); font-size: 12px; font-weight: 400 }
.chips [aria-pressed=true] { border-color: var(--blue); background: var(--tint); box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); font-weight: 700 }
.chips [aria-pressed=true] small { color: var(--blue) }
.chips.wrap { flex-wrap: wrap }
.chips.wrap button { flex: 1 0 30% }

.dial { display: flex; flex-direction: column; align-items: center }
.dial > svg { width: 100%; max-width: 224px; overflow: visible; outline: 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none }
.dial > svg:focus-visible .knob { stroke-width: 6 }
.trk { fill: none; stroke: #e3e6eb; stroke-width: 6; stroke-linecap: round }
.dial .fill { fill: none; stroke: var(--blue); stroke-width: 6; stroke-linecap: round }
.tick { stroke: #b6bcc7; stroke-width: 1.2 }
.tick.b { stroke: var(--sub); stroke-width: 1.6 }
.dial text { fill: var(--sub); stroke: none; font-size: 13px; text-anchor: middle; dominant-baseline: central }
.dial text.s { text-anchor: start }
.dial text.e { text-anchor: end }
.grab { fill: transparent; stroke: none }
.knob { fill: #fff; stroke: var(--blue); stroke-width: 3.5 }
.art { fill: #eceef2; stroke: #c0c6d0; stroke-width: 1.4 }
.ndl { stroke: var(--ink); stroke-width: 3 }
.ndl.pt { fill: var(--ink); stroke-width: 1.5 }
.real { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 4 5 }
#d-az svg, #d-el svg { max-width: 272px }
#d-el .fill { display: none }
.dial.mixed .knob { stroke: #9aa1ad }
.dial.mixed .fill { stroke: #c5cad3 }
.val { position: relative; display: flex; align-items: center; gap: 4px; width: 100%; max-width: 224px; margin-top: 6px }
.val button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 8px }
.val button:hover { background: var(--bg2) }
.val label { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 2px; min-width: 0; height: 44px; padding: 0 8px; border: 1px solid #cfd4dc; border-radius: 8px; line-height: 42px; cursor: text }
.val label:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 107, 255, .15) }
.val input { width: 3.1em; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right }
.val span { color: var(--sub); font-size: 13px }
.val em { display: none; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); white-space: nowrap }
.dial.mixed .val em { display: block }

.secs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px }
.sec { display: flex; border: 1px solid #d8dce3; border-radius: 10px }
.sec.cur { border-color: var(--blue); background: var(--tint); box-shadow: inset 0 0 0 1px var(--blue) }
.pk { flex: 1; min-width: 0; padding: 6px 0 6px 10px; border-radius: 10px 0 0 10px; line-height: 1.3; text-align: left }
.pk b { display: block; font-weight: 700 }
.pk small { color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums }
.sec.off .pk b { color: #8a909c }
.ox { display: grid; place-items: center; flex: none; width: 44px; min-height: 52px; border-radius: 0 10px 10px 0 }
.ox svg { stroke: #9aa1ad; stroke-width: 2.4 }
.ox .o, .ox[aria-pressed=true] .x { display: none }
.ox[aria-pressed=true] .o { display: inline; stroke: var(--blue) }
.span { position: relative; display: flex; height: 12px; margin: 18px 4px 28px; touch-action: none }
.span i { height: 100%; background: #dfe3ea }
.span i.on { background: #a9c1ff }
.span i.cur { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); z-index: 1 }
.span i:first-child { border-radius: 6px 0 0 6px }
.span i:nth-child(3) { border-radius: 0 6px 6px 0 }
.hd { position: absolute; z-index: 2; top: -16px; width: 44px; height: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none }
.hd::before { content: ''; position: absolute; left: 17px; top: 8px; width: 10px; height: 28px; border: 2px solid var(--ink); border-radius: 5px; background: #fff }
.hd span { position: absolute; left: 50%; top: 38px; color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums; transform: translateX(-50%) }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.pair text { font-size: 15px }
.pair.off .dial { opacity: .45 }
.quick { display: flex; gap: 4px; margin-bottom: 10px }
.quick button { flex: 1; min-width: 0; height: 44px; border: 1px solid #d8dce3; border-radius: 8px; font-size: 14px; font-weight: 500 }
.quick button:hover { border-color: var(--ink) }
.prev { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px }
.prev svg { display: block; width: 100%; height: 220px; background: #fafbfc }
.prev path { stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke }
.prev .h { fill: #eceef2; stroke: #c0c6d0; stroke-width: 1.2 }
.prev .ax { stroke: #b6bcc7; stroke-width: 1.2; stroke-dasharray: 3 4 }
.prev .st { stroke: var(--ink); stroke-width: 2 }
.prev .on { stroke: #7da0ff; stroke-width: 3 }
.prev .on.cur { stroke: var(--blue); stroke-width: 3.6 }

.regs li { display: flex; align-items: center; gap: 4px; min-height: 52px; border-bottom: 1px solid var(--line) }
.regs b { flex: none; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 13px; line-height: 26px; text-align: center }
/* 3D 영역 색 레이어와 같은 색(overlay.js REGION) */
.regs li:nth-child(1) b { background: #2f80ed }
.regs li:nth-child(2) b { background: #e53935 }
.regs li:nth-child(3) b { background: #7b3fe4 }
.regs li:nth-child(4) b { background: #c79a00 }
.regs li:nth-child(5) b { background: #27ae60 }
.regs li:nth-child(6) b { background: #e91e9c }
.regs li:nth-child(7) b { background: #f57c00 }
.regs span { flex: 1; min-width: 0; margin-left: 6px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap }
.regs li.off b { opacity: .35 }
.regs li.off span { color: #9aa1ad }
.regs button { flex: none; height: 44px; padding: 0 9px; border-radius: 8px; color: #3d424d; font-size: 14px; font-weight: 500 }
.regs button:hover, .zlist button:hover { background: var(--bg2) }
.eye .off { display: none }
.eye[aria-pressed=false] { color: #9aa1ad }
.eye[aria-pressed=false] .off { display: inline }

.zed { padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: 10px }
#zpts { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 10px; font-size: 14px; font-weight: 600 }
#zpts li + li::before { content: '›'; margin: 0 6px; color: var(--sub); font-weight: 400 }
#zpts .no { color: var(--sub); font-weight: 400 }
.zsave { display: flex; gap: 6px; margin-top: 10px }
.zsave input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #cfd4dc; border-radius: 8px }
.zsave input:focus { border-color: var(--blue); outline: 0 }
.zlist { margin-top: 10px }
.zlist li { display: flex; align-items: center; gap: 4px; min-height: 52px; border-bottom: 1px solid var(--line) }
.zlist p { flex: 1; min-width: 0 }
.zlist strong, .zlist small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.zlist strong { font-size: 14px; font-weight: 600 }
.zlist small { color: var(--sub); font-size: 12px }
.zlist button { flex: none; height: 44px; padding: 0 9px; border-radius: 8px; color: #3d424d; font-size: 14px; font-weight: 500 }

.dlg { width: min(480px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgba(22, 24, 29, .28) }
.dlg.wide { width: min(760px, calc(100vw - 24px)) }
/* 닫힌 dialog 에 display 를 주면 화면에 그대로 나온다 */
.dlg[open] { display: flex; flex-direction: column }
.dlg::backdrop { background: rgba(22, 24, 29, .45) }
.dlg header { display: flex; flex: none; align-items: center; justify-content: space-between; padding: 8px 8px 0 20px }
.dlg h2 { font-size: 17px; font-weight: 700 }
.dlg .body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px }
.dlg .tip a { color: var(--blue); font-weight: 600; text-decoration: underline }
.dlg .tip strong { color: var(--ink); font-weight: 600 }
/* 가로로 눕힌 폰에서는 창이 낮아서 내용이 스크롤된다. 버튼 줄은 늘 보이게 */
.row.end { position: sticky; bottom: -20px; justify-content: flex-end; margin: 6px -20px -20px; padding: 12px 20px 20px; background: #fff }
.err { margin-top: 10px; color: #d92d20; font-size: 14px }
#ask-t, #save-msg { padding-top: 18px; font-size: 16px }

.fld { display: block; margin-top: 14px; font-size: 14px; font-weight: 600 }
.fld input, .fld textarea { display: block; width: 100%; margin-top: 6px; padding: 0 12px; border: 1px solid #cfd4dc; border-radius: 8px; font: inherit; font-weight: 400; color: inherit }
.fld input { height: 44px }
.fld textarea { min-height: 88px; padding: 10px 12px; resize: vertical }
.fld input:focus, .fld textarea:focus { border-color: var(--blue); outline: 0 }
.fld + .ck { margin-top: 8px }
.ck { display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer }
.ck input, .regs input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--blue) }
.ck span { font-weight: 500; line-height: 1.35 }

.srcs { display: flex; margin-top: 6px; padding: 3px; border-radius: 10px; background: var(--bg2) }
.srcs button { flex: 1; height: 44px; border-radius: 8px; color: #4b5160; font-weight: 500 }
.srcs [aria-pressed=true] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 24, 29, .14) }
#load-tip { margin-top: 14px }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; margin-top: 14px }
.cards button { display: block; width: 100%; border-radius: 10px; text-align: left }
.cards .th { display: grid; place-items: center; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--sub); font-size: 13px }
.cards button:hover .th { border-color: var(--ink) }
.cards img { width: 100%; height: 100%; object-fit: cover }
.cards strong { display: block; margin-top: 6px; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis }
.cards small { display: block; color: var(--sub); font-size: 12px }
#load-more { width: 100%; margin-top: 14px }
.regs label { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 0; min-height: 52px; padding: 0 4px; cursor: pointer }
.regs label input { margin-right: 8px }
.regs small { flex: none; color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums }
.sheet { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2) }
.sheet img { display: block; max-width: 100%; max-height: calc(100dvh - 190px); margin: 0 auto }

@media (min-width: 1024px) and (max-width: 1279px) {
  .app { grid-template-columns: 184px minmax(0, 1fr) 360px }
  .acts button { padding: 0 9px }
  #title { width: 180px }
}

@media (max-width: 1023px) {
  .app { grid-template: "bar" 52px "stage" minmax(0, 46fr) "panel" minmax(0, 54fr) / minmax(0, 1fr) }
  .app.folded { grid-template-rows: 52px minmax(0, 1fr) auto }
  .app.folded .pane { display: none }
  .app.folded .fold svg { transform: rotate(180deg) }

  .bar { gap: 0; padding: 0 8px 0 0 }
  .back span { display: none }
  .back { padding: 0 8px }
  #title { flex: 1; width: auto; margin: 0 4px 0 0; padding: 0 8px }
  .more { display: grid }
  .acts { display: none; position: absolute; right: 8px; top: 48px; flex-direction: column; min-width: 184px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(22, 24, 29, .16) }
  .bar.open .acts { display: flex }
  .acts button { padding: 0 12px; text-align: left }
  .bar .btn { margin-left: 4px; padding: 0 14px }

  .side { z-index: 2; grid-area: stage; position: relative; overflow: visible; padding: 8px; border: 0; pointer-events: none }
  .side h2 { display: none }
  .tools { display: flex; flex-direction: column; align-items: flex-start; gap: 6px }
  .tools > *, .selopt > *, .layers { pointer-events: auto }
  .seg { flex-direction: column; width: 52px; margin: 0; padding: 0; overflow: hidden; border: 1px solid #d8dce3; border-radius: 10px; background: #fff }
  .seg button { flex: none; flex-direction: column; gap: 0; height: 50px; border-radius: 0; font-size: 12px; line-height: 1.3 }
  .seg [aria-pressed=true] { background: var(--ink); box-shadow: none; color: #fff }
  .tools .tg { justify-content: center; width: 52px; min-height: 46px; padding: 0 4px; border: 1px solid #d8dce3; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 500; line-height: 1.25; text-align: center; white-space: normal }
  .tools .tg i { display: none }
  .tools .tg[aria-pressed=true], .lay[aria-expanded=true] { border-color: var(--blue); background: var(--blue); color: #fff }
  .lay { display: flex }
  .selopt { display: contents }
  .brush { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid #d8dce3; border-radius: 10px; background: #fff }
  .brush span { gap: 6px; white-space: nowrap }
  .brush input { width: 110px; margin: 0 }
  .layers { display: none; position: absolute; left: 68px; top: 8px; width: 196px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(22, 24, 29, .16) }
  .side.open .layers { display: block }

  .views { right: 8px; top: 8px }
  .views button { width: 52px }

  .panel { border-left: 0; border-top: 1px solid var(--line) }
  .target { min-height: 52px; padding: 2px 4px 2px 16px }
  .target strong { font-size: 15px }
  .tabs [role=tab] { padding: 0 9px }
  .fold { display: grid; place-items: center; flex: none; position: sticky; right: 0; width: 44px; height: 44px; background: #fff; color: var(--sub) }
  .pane { padding: 0 16px 20px }
  .pane h3 { min-height: 40px; margin-top: 6px }
  .inl { display: flex; align-items: center; gap: 12px; margin-top: 8px }
  .inl h3 { flex: none; margin: 0 }
  .inl .chips { flex: 1 }
  .dial > svg, .val { max-width: 196px }
  #d-az svg, #d-el svg { max-width: 248px }
  /* 16px 보다 작으면 아이폰이 입력할 때 화면을 키운다 */
  #title, .zsave input, .fld input, .fld textarea { font-size: 16px }
}

@media (max-width: 599px) {
  .dlg, .dlg.wide { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0 }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .dlg .row.end > * { flex: 1 }
  .sheet img { max-height: calc(92dvh - 170px) }
}

@media (max-width: 1023px) and (orientation: landscape) and (max-height: 560px) {
  .app, .app.folded { grid-template: "bar bar" 48px "stage panel" minmax(0, 1fr) / minmax(0, 1fr) 340px }
  .app.folded .pane { display: block }
  .panel { border-top: 0; border-left: 1px solid var(--line) }
  .fold { display: none }
}
