[hidden] { display: none !important; }
h1, h2, h3, p, span, strong, code, label, li, summary { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.card { margin-bottom: 20px; min-width: 0; }
.top-gap { margin-top: 12px; }
.num { font-family: var(--mono); }
code { font-family: var(--mono); font-size: 13px; }
.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; }
input, select, textarea { max-width: 100%; min-height: 44px; font-size: 16px; }
textarea { width: 100%; box-sizing: border-box; font-family: var(--mono); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; max-width: 100%; white-space: normal; text-align: center; }
header.top { flex-wrap: wrap; gap: 8px 14px; }
.chk { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px; cursor: pointer; }
.chk input { width: 24px; height: 24px; min-height: 24px; margin: 0; flex: none; }
.err-msg { color: var(--warn); font-weight: 600; margin: 10px 0 0; }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; }
.status-line { min-height: 1.2em; }
.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.cv-wrap { margin-top: 10px; border: 1px solid var(--field-line); border-radius: 10px; overflow: hidden; }
#cad { display: block; width: 100%; height: 56vh; min-height: 300px; max-height: 620px; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
#cad .sel { stroke: var(--accent); stroke-width: 6; stroke-opacity: .45; fill: none; stroke-linecap: round; }
#cad .pv { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
#cad .snapmk { fill: none; stroke: var(--accent); stroke-width: 2; }
.swatch-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 44px; height: 44px; border-radius: 8px; border: 2px solid var(--field-line); padding: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); }
.list li.on { border-color: var(--accent); background: var(--chip); }
.list .grow { flex: 1 1 140px; min-width: 0; }
.lay-row input[type="text"] { flex: 1 1 120px; min-width: 0; }
.lay-row input[type="color"] { width: 56px; padding: 2px; }
.gl-wrap { margin-top: 10px; border: 1px solid var(--field-line); border-radius: 10px; overflow: hidden; background: var(--chip); }
#gl { display: block; width: 100%; height: 260px; touch-action: none; }
details.card summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row > button, .row > .btn { min-width: 44px; flex-shrink: 0; }
