[hidden] { display: none !important; }
h1, h2, h3, p, span, strong, code, label, summary, li, dd { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.card { margin-bottom: 20px; min-width: 0; }
.top-gap { margin-top: 12px; }
.lbl-block { display: block; }
.navlink { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 6px; }

.studio-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-bottom: 10px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
input, select, textarea { max-width: 100%; }
input[type="range"] { padding: 0; min-height: 44px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.num { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.canvas-box { width: 100%; max-width: 560px; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--chip); aspect-ratio: 1 / 1; }
#stage { display: block; width: 100%; height: 100%; touch-action: pan-y; }

.compile-status { font-weight: 600; }
.compile-status.bad { color: var(--warn); }
.status-line { margin: 8px 0 0; min-height: 1.2em; }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; }

.swatches { display: flex; gap: 6px; margin-top: 8px; }
.sw { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--field-line); }

.ed { display: flex; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; background: var(--surface); height: 408px; }
.gutter { flex: 0 0 56px; overflow: hidden; background: var(--chip); border-right: 1px solid var(--line); padding: 8px 0 28px; font: 16px/24px var(--mono); color: var(--muted); text-align: right; user-select: none; }
.gutter .ln { height: 24px; padding: 0 8px 0 4px; white-space: nowrap; }
.gutter .ln.bad { background: var(--warn); color: var(--bg); font-weight: 700; }
.code { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; resize: none; font: 16px/24px var(--mono); tab-size: 2; white-space: pre; overflow: auto; padding: 8px 10px; height: 100%; box-sizing: border-box; }

.err-h { margin: 14px 0 6px; font-size: 16px; }
.errlist { list-style: none; padding: 0; margin: 0; }
.errlist li { margin: 0 0 6px; }
.errlist button { width: 100%; justify-content: flex-start; text-align: left; border-color: var(--warn); color: var(--ink); font-family: var(--mono); font-size: 14px; }
.errlist .nl { display: block; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; font-family: var(--mono); font-size: 14px; }

.ref { margin-top: 12px; }
.ref summary, .limits summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.refdl { margin: 0; }
.refdl dt { margin-top: 8px; }
.refdl dd { margin: 2px 0 0; color: var(--muted); }

.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list .nm { flex: 1 1 160px; min-width: 0; font-weight: 600; }
.list .meta { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
