/* Compact desktop controls; touch devices retain larger hit areas. */
.topbar{height:56px;padding-inline:20px}
.workspace{height:calc(100dvh - 56px)}
.tabs{padding:4px 10px 0}
.tabs button{min-height:38px;padding:8px 4px}
.controls{padding:14px;scroll-padding-block:52px 12px}
.controls h2{font-size:18px;margin-bottom:14px}
.controls h3{margin-bottom:10px}
.controls .fields{gap:10px}
.controls label,.controls .color-field{gap:4px;font-size:13px}
.controls input,.controls select,.controls textarea{min-height:34px;padding:6px 8px}
.controls select{padding-right:28px}
.controls input[type=range]{padding:0}
.controls input[type=color]{height:34px;padding:3px}
.controls textarea{min-height:72px}
.controls button{min-height:34px;padding:6px 10px;font-size:13px}
.controls .select-toggle{padding:0}
.controls .pair{gap:8px}
.controls .check{min-height:32px;gap:8px}
.controls .check input{min-height:17px;padding:0}
.controls .color-trigger{padding:5px 8px}
.controls .color-swatch{width:22px;height:22px}
.controls .divider{margin:14px 0}
.controls .section-actions{margin-top:12px;gap:6px}
.controls details{padding:0;margin:0 0 8px;border:1px solid var(--line);border-radius:7px;background:var(--card)}
.controls details>summary{min-height:40px;padding:7px 10px;gap:8px;border-radius:6px;overflow-wrap:anywhere}
.controls details>summary::-webkit-details-marker{display:none}
.controls details>summary:hover{background:var(--accent-soft)}
.controls details[open]{border-color:var(--focus)}
.controls details[open]>summary{margin:0 0 10px;border-bottom:1px solid var(--line);border-radius:6px 6px 0 0;background:var(--accent-soft)}
.controls>details[open]>summary,.controls #blocks>details[open]>summary{position:sticky;top:-14px;z-index:5}
.controls details>.fields{padding:0 10px 10px}
.controls details .block-actions{padding:0 10px;margin:0 0 10px}
.controls details details{margin-bottom:0}
.controls .section-footer{border-top:1px solid var(--line);padding:4px 8px;text-align:right;background:var(--page);border-radius:0 0 6px 6px}
.controls .section-footer button{background:transparent;border-color:transparent;color:var(--accent);font-size:12px}
.controls .section-footer button:hover{background:var(--accent-soft)}
.controls .player-thumb{width:28px;height:28px}
.controls .block-card:not(details){padding:8px;margin-bottom:0}
.controls .field-tokens button{min-height:28px;padding:3px 5px;font-size:12px}
#builtins,#customs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.controls .template-choice{padding:0;margin:0;min-width:0}
.controls .template-choice>span{padding:7px 8px;font-size:12px}
.controls .section-label{margin-top:18px}
.controls .background-choice{padding:0}
.controls .background-choice img{height:52px}
.controls .background-choice span{padding:5px 7px;font-size:12px}
.controls .background-picker .background-gallery{max-height:240px}
@media(max-width:620px){
  .topbar{height:52px;padding-inline:12px}
  .workspace{height:calc(100dvh - 52px)}
  .controls{padding:10px}
  .controls>details[open]>summary,.controls #blocks>details[open]>summary{top:-10px}
}
@media(pointer:coarse){
  .controls button,.controls input:not([type=checkbox]),.controls select,.controls details>summary,.tabs button{min-height:44px}
  .controls .check{min-height:44px}
  .controls input,.controls select,.controls textarea{font-size:16px}
}

.custom-template-card{position:relative;min-width:0}
.custom-template-card .template-choice{width:100%;height:100%}
.controls .custom-template-card .template-choice>span{padding-right:48px}
.controls .template-delete{position:absolute;right:2px;bottom:2px;width:44px;height:44px;padding:10px;display:grid;place-items:center;background:var(--card)}

.flair-control{border:0;padding:0;margin:0}.flair-control legend{margin-bottom:8px}.flair-control button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}
