[hidden] { display: none !important; }
h1, h2, h3, p, span, strong, code, label, li { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.card { margin-bottom: 16px; min-width: 0; }
header.top { flex-wrap: wrap; gap: 8px 14px; align-items: center; }
header.top a { min-height: 44px; display: inline-flex; align-items: center; }
input, select, textarea { max-width: 100%; }
textarea { width: 100%; font-family: var(--mono); font-size: 13px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }
button:disabled { opacity: .5; cursor: default; }
.bar { margin: 8px 0; }
.lbl { margin: 8px 0 4px; font-weight: 600; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 10px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.fgrid input, .fgrid select { width: 100%; }
input[type="color"] { min-width: 44px; min-height: 44px; padding: 2px; vertical-align: middle; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); gap: 8px; }
.tool-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--chip); font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }
.stage { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--chip); overflow: hidden; }
.stage-svg { display: block; width: 100%; height: auto; max-height: 68vh; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; background: repeating-conic-gradient(#d9d6cc 0% 25%, #f1eee6 0% 50%) 0 0 / 16px 16px; border-radius: 4px; }
.stage-svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.sw { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 10px; border: 2px solid var(--field-line); }
.sw[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); }
.sw-none { background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--line) 6px 8px); font-size: 12px; }
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list li[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.list li input[type="text"] { flex: 1 1 140px; min-width: 0; }
.list .meta { flex: 1 1 100%; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; }
code { font-family: var(--mono); font-size: 13px; }
details.card summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
