/* The editor keeps the game's white paper / black ink language. Guides are the only
   colour: blue = tight bounding box, green = silhouette and ground line, red = blocked
   collision cells. */
:root {
  --paper: #fff;
  --ink: #000;
  --gap: 6px;
  --font: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --fs: 13px;
  --guide-box: #00f;
  --guide-shape: #090;
  --guide-blocked: rgba(255, 0, 0, 0.28);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--paper); color: var(--ink); font: var(--fs)/1.3 var(--font); overflow: hidden; }
button, input, select { font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--ink); border-radius: 0; }
button { cursor: pointer; padding: 1px 8px; }
button:hover { background: var(--ink); color: var(--paper); }
button.primary { font-weight: 700; }
button.on { background: var(--ink); color: var(--paper); }
button.on::before { content: "\2611  "; }
button:disabled { opacity: .4; cursor: default; }
button:disabled:hover { background: var(--paper); color: var(--ink); }
:focus-visible { outline: 1px dashed var(--ink); outline-offset: 2px; }
canvas { image-rendering: pixelated; display: block; }
h2 { font: inherit; font-weight: 700; border-bottom: 1px solid var(--ink); padding-bottom: 2px; margin: 0 0 var(--gap); display: flex; justify-content: space-between; gap: 4px; }
kbd { border: 1px solid var(--ink); padding: 0 3px; font: inherit; font-size: 11px; }
.spacer { flex: 1; }
.muted { opacity: .55; }
.small { font-size: 11px; }

#app {
  /* Panel widths live in custom properties so the borders can drag them and they persist. */
  --lib-w: 280px;
  --insp-w: 310px;
  height: 100%; display: grid; gap: var(--gap); padding: var(--gap);
  grid-template-columns: var(--lib-w) 5px 1fr 5px var(--insp-w);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top top top top top" "left lr view rr right" "status status status status status";
}

/* Drag a border to resize; double-click it to go back to the default width. */
.resizer { cursor: col-resize; touch-action: none; border-radius: 2px; }
#view { min-width: 300px; }
.resizer:hover, .resizer.active { background: var(--ink); opacity: .55; }
#resize-left { grid-area: lr; }
#resize-right { grid-area: rr; }

/* ---------- header ---------- */
#bar { grid-area: top; display: flex; align-items: center; gap: var(--gap); border: 1px solid var(--ink); padding: 3px var(--gap); min-width: 0; white-space: nowrap; overflow-x: auto; }
#bar .brand { letter-spacing: .5px; }
#bar .field { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#bar select { max-width: 190px; }
#bar button { white-space: nowrap; }
#bar .dirty { border: 1px solid var(--ink); padding: 0 4px; font-size: 11px; }
#bar .dirty::before { content: "\25CF "; }

/* ---------- panels ---------- */
#library, #inspector { border: 1px solid var(--ink); padding: var(--gap); overflow: auto; min-width: 0; min-height: 0; }
#library { grid-area: left; display: flex; flex-direction: column; gap: var(--gap); overflow: hidden; }
#inspector { grid-area: right; overflow: hidden auto; }
#statusbar { grid-area: status; display: flex; align-items: center; gap: 12px; border: 1px solid var(--ink); padding: 1px var(--gap); min-width: 0; font-size: 12px; }
#statusbar > span { white-space: nowrap; }

/* ---------- view ---------- */
#view { grid-area: view; position: relative; overflow: hidden; border: 1px solid var(--ink); background: var(--paper); cursor: crosshair; }
#view canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#view.panning { cursor: grabbing; }
#view.picking { cursor: cell; }
#view.over-prop { cursor: move; }
#view.over-utility { cursor: move; }
#view.dropping { outline: 3px dashed var(--ink); outline-offset: -6px; }

/* floating view toolbar */
.viewbars { position: absolute; top: 6px; left: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: calc(100% - 12px); z-index: 2; }
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--paper); border: 1px solid var(--ink); padding: 2px 4px; max-width: 100%; }
.collision-bar b { margin-right: 2px; }
.viewbar .group { display: flex; gap: 2px; align-items: center; }
.viewbar .sep { width: 1px; align-self: stretch; background: var(--ink); margin: 0 2px; }
.viewbar button { padding: 0 6px; }
.viewbar .zoom { min-width: 42px; text-align: center; }
.vp-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--paper); border: 1px solid var(--ink); padding: 4px 10px; text-align: center; pointer-events: none; }
.vp-legend { position: absolute; right: 6px; bottom: 6px; background: var(--paper); border: 1px solid var(--ink); padding: 2px 6px; font-size: 11px; pointer-events: none; }
.vp-legend i { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--ink); margin-right: 3px; vertical-align: -1px; }

/* ---------- library ---------- */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.asset { position: relative; border: 1px solid var(--ink); background: var(--paper); padding: 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: grab; user-select: none; }
.asset:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.asset.sel { background: var(--ink); color: var(--paper); }
.asset .thumb { width: 100%; height: 54px; display: grid; place-items: center; }
.asset img { max-width: 100%; max-height: 54px; image-rendering: pixelated; }
.asset .name { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset .tools { position: absolute; top: 0; right: 0; display: none; gap: 2px; }
.asset:hover .tools { display: flex; }
.asset .tools button { padding: 0 3px; font-size: 11px; line-height: 1.1; }
.asset.broken { border-style: dashed; }
.asset .badge { position: absolute; left: 2px; top: 0; font-size: 9px; opacity: .6; }
.asset .cat { width: 100%; font: inherit; font-size: 9px; padding: 0 1px; border: 1px solid var(--line); background: var(--paper); color: inherit; cursor: pointer; }
.asset.sel .cat { background: var(--paper); color: var(--ink); }
/* Art groups: one collapsible section per drawing category. */
.art-groups { display: flex; flex-direction: column; gap: 2px; }
.art-group { border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.group-head { display: flex; align-items: center; gap: 5px; width: 100%; font: inherit; font-size: 11px; font-weight: 700; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 3px 2px; cursor: pointer; }
.group-head:hover { background: #eee; }
.group-head .chev { width: 10px; }
.group-head .count { margin-left: auto; font-weight: 400; opacity: .6; }
.art-group .assets { padding: 4px 0; }
.art-group .assets[hidden] { display: none; }
.group-empty { color: var(--muted); font-size: 10px; padding: 2px 4px 6px; }
.icon-tile { cursor: pointer; }
.icon-tile .thumb img { max-height: 54px; image-rendering: pixelated; }
.icon-new { border: 1px dashed var(--line); background: var(--paper); font: inherit; font-size: 11px; padding: 2px 6px; cursor: pointer; align-self: center; min-height: 54px; }
.icon-new:hover { background: #eee; }

.library-actions { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.drop-hint { border: 1px dashed var(--ink); padding: 6px; text-align: center; font-size: 11px; }
.drop-hint.hot { background: var(--ink); color: var(--paper); }

/* ---------- inspector ---------- */
.inspector section { margin-bottom: var(--gap); }
.prop-head { display: flex; gap: var(--gap); align-items: center; margin-bottom: var(--gap); }
.prop-head .thumb { width: 54px; height: 54px; border: 1px solid var(--ink); display: grid; place-items: center; flex: none; }
.prop-head .thumb img { max-width: 52px; max-height: 52px; image-rendering: pixelated; }
.prop-head .meta { min-width: 0; }
.prop-head .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dl.kv { display: grid; grid-template-columns: 1fr auto; gap: 1px var(--gap); margin: 0 0 var(--gap); }
dl.kv dt { opacity: .7; }
dl.kv dd { text-align: right; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 4px; margin-bottom: 3px; }
.row input[type="number"], .row input[type="text"] { width: 100%; padding: 1px 3px; }
.row.check { grid-template-columns: auto 1fr; }
.row.check label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
textarea { width: 100%; font: inherit; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.info-line { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; }
.warn { border: 1px solid var(--ink); padding: 3px 5px; font-size: 11px; margin-bottom: var(--gap); }
.warn::before { content: "\26A0  "; }
.empty-state { opacity: .6; font-size: 12px; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: grid; place-items: center; z-index: 20; padding: 12px; }
.modal-box { background: var(--paper); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); display: flex; flex-direction: column; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); min-width: 320px; }
.modal-head { display: flex; align-items: center; gap: var(--gap); border-bottom: 1px solid var(--ink); padding: 4px var(--gap); }
.modal-head b { margin-right: auto; }
.modal-body { padding: var(--gap); overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: var(--gap); border-top: 1px solid var(--ink); padding: 4px var(--gap); }
.modal-foot .spacer { flex: 1; }
.mask-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: var(--gap); }
.mask-tools .sep { width: 1px; align-self: stretch; background: var(--ink); margin: 0 2px; }
.mask-canvas-wrap { position: relative; border: 1px solid var(--ink); overflow: auto; max-height: 62vh; background: #fff; }
.mask-canvas-wrap canvas { cursor: crosshair; }
.mask-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; margin-top: var(--gap); }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.form-grid input { padding: 1px 4px; width: 100%; }

/* help */
.help { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; align-items: baseline; }
.help dt { white-space: nowrap; }
.help dd { margin: 0; }

/* ---------- library search + scrolling list ---------- */
.library-head { display: flex; flex-direction: column; gap: 4px; }
.library-search { width: 100%; padding: 2px 5px; }
.library-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 1px; }
.library-actions { display: flex; flex-direction: column; gap: 4px; }

/* ---------- library tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ink); padding-bottom: 4px; flex: none; }
.tabs .tab { flex: 1; }
.tabs .tab.active { background: var(--ink); color: var(--paper); }
.pane { display: flex; flex-direction: column; gap: var(--gap); flex: 1; min-height: 0; }

/* ---------- utilities list ---------- */
.utilities { display: flex; flex-direction: column; }
.utility { display: grid; grid-template-columns: 16px 1fr auto 18px; gap: 5px; align-items: center; padding: 3px 2px; border-bottom: 1px dotted rgba(0, 0, 0, .3); cursor: pointer; }
.utility:hover { outline: 1px solid var(--ink); outline-offset: -1px; }
.utility.sel { background: var(--ink); color: var(--paper); }
.utility .u-mode { border: 1px solid currentColor; display: grid; place-items: center; height: 15px; font-size: 10px; line-height: 1; }
.utility .u-body { display: flex; flex-direction: column; min-width: 0; }
.utility .u-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utility .u-tags { display: flex; gap: 2px; }
.utility .tag { border: 1px solid currentColor; font-size: 10px; line-height: 1.1; padding: 0 2px; opacity: .8; }
.utility > button { padding: 0; border-color: currentColor; background: transparent; color: inherit; }
.utility.sel > button:hover, .utility > button:hover { background: var(--ink); color: var(--paper); }

/* ---------- utility inspector ---------- */
.msg { border: 1px solid var(--ink); padding: 4px; margin-bottom: 5px; display: flex; flex-direction: column; gap: 3px; }
.msg-head { display: flex; align-items: center; gap: 4px; }
.msg-head .spacer { flex: 1; }
.msg input[type="text"] { width: 100%; padding: 1px 3px; }
.msg textarea { resize: vertical; font-size: 12px; }
.mode-hint { font-size: 11px; opacity: .65; margin-bottom: 4px; }

/* Folded action lists on dialogue nodes and choices (Run code lives in there too). */
.actions-fold { margin: 4px 0 6px; border-top: 1px dotted var(--line); padding-top: 4px; }
.actions-fold > summary { cursor: pointer; font-weight: 700; font-size: 11px; letter-spacing: .02em; }
.actions-fold > summary::marker { content: "▸ "; }
.actions-fold[open] > summary { margin-bottom: 4px; }
.actions-fold .actions-section h3 { font-size: 11px; margin: 4px 0 2px; }
.actions-fold .action { border: 1px solid var(--line); padding: 4px; margin-bottom: 4px; }
.u-badge { display: grid; place-items: center; font-size: 18px; font-weight: 700; }
h3 { font: inherit; font-weight: 700; font-size: 12px; margin: 8px 0 4px; border-bottom: 1px dotted var(--ink); padding-bottom: 1px; }
.sub { border-left: 2px solid var(--ink); padding-left: 6px; margin-top: 6px; }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.inline { display: flex; gap: 4px; min-width: 0; }
.inline select { flex: 1; min-width: 0; }

.item-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.item-row { display: grid; grid-template-columns: 1fr 52px 20px; gap: 3px; align-items: center; }
.item-row select, .item-row input { min-width: 0; padding: 1px 3px; width: 100%; }
.item-row button { padding: 0 4px; }

.msg-list { display: flex; flex-direction: column; gap: 4px; }
.action { border: 1px solid var(--ink); padding: 4px; margin-bottom: 5px; }
.action-head { display: flex; align-items: center; gap: 3px; margin-bottom: 3px; }
.action-head b { font-size: 12px; }
.action-head button { padding: 0 4px; }
.action-add { display: flex; gap: 4px; }
.action-add select { flex: 1; min-width: 0; }
.quest-lines { border: 1px solid var(--ink); padding: 3px 4px; margin: 4px 0; }
.quest-lines summary { cursor: pointer; font-weight: 700; }
.quest-lines > .msg-list { margin-top: 4px; }

/* ---------- prop editor ---------- */
.pixel-editor { width: min(1080px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px)); }
.pixel-editor .modal-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow: hidden; }
.pixel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pixel-tools .sep { width: 1px; align-self: stretch; background: var(--ink); margin: 0 2px; }
.pixel-tools input[type="number"] { width: 58px; padding: 1px 3px; }
.pixel-main { display: flex; gap: var(--gap); align-items: stretch; margin-top: 4px; flex: 1; min-height: 0; }
.pixel-canvas-wrap {
  flex: 1; min-width: 240px; min-height: 0; display: grid; place-items: center; overflow: auto;
  border: 1px solid var(--ink);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%, transparent 75%, #ececec 75%),
    linear-gradient(45deg, #ececec 25%, transparent 25%, transparent 75%, #ececec 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.pixel-canvas-wrap canvas { margin: auto; box-shadow: 0 0 0 1px rgba(0,0,0,.15); cursor: crosshair; }
.pixel-side { width: 210px; flex: none; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.pixel-side .preview { border: 1px solid var(--ink); display: grid; place-items: center; height: 158px; padding: 2px; background: #fff; }
.pixel-side .preview canvas { max-width: 100%; max-height: 150px; }
.pixel-side dl.kv { margin: 0; font-size: 12px; }
.pixel-name { display: flex; align-items: center; gap: 6px; }
.pixel-name input { width: 200px; padding: 1px 4px; }

/* ---------------------------------------------------------------- content library */
/* Map / Content groups, the definition document and the small widgets it uses. */
.tabs.groups { border-bottom: none; padding-bottom: 0; }
.tabs.groups .tab { flex: 1; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; }
.content-pane .utility-row { cursor: pointer; }
.utility-row.selected { background: var(--ink); color: var(--paper); }
.utility-row.selected .small, .utility-row.selected .tag { color: var(--paper); }
.tag { border: 1px solid currentColor; border-radius: 9px; padding: 0 5px; font-size: 9px; line-height: 14px; }
.self-center { align-self: center; }
.definition-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.definition-bar .primary { font-weight: 700; }
.notice { border: 1px dashed currentColor; padding: 4px 6px; font-size: 11px; }
.notice.warn { border-style: solid; }
.notice ul { margin: 2px 0 0 14px; padding: 0; }
.sprite-preview { display: flex; justify-content: center; border: 1px dashed rgba(0,0,0,.25); padding: 4px; }
.sprite-preview img { image-rendering: pixelated; max-width: 100%; max-height: 120px; }
.quest-picks { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow: auto; }
.check { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.check input { width: auto; }
.line-group { border-top: 1px dashed rgba(0,0,0,.25); padding-top: 4px; }
.line-group h4 { margin: 2px 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.stock-head { display: grid; grid-template-columns: 1fr 40px 30px; gap: 3px; }

/* Motion preview: the same kinds shared/animation.js drives in the game. */
.sprite-preview img { transform-origin: 50% 100%; }
.sprite-preview.motion-bob img { animation: motion-bob 2.4s ease-in-out infinite; }
.sprite-preview.motion-sway img { animation: motion-sway 3.2s ease-in-out infinite; }
.sprite-preview.motion-flicker img { animation: motion-flicker .4s steps(2, end) infinite; }
.sprite-preview.motion-drift img { animation: motion-drift 6s linear infinite; }
.sprite-preview.motion-pulse img { animation: motion-pulse 1.8s ease-in-out infinite; }
@keyframes motion-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
@keyframes motion-sway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes motion-flicker { 0% { opacity: 1; } 50% { opacity: .55; } }
@keyframes motion-drift { 0% { transform: translate(0,0); } 25% { transform: translate(3%, -3%); } 50% { transform: translate(0, -6%); } 75% { transform: translate(-3%, -3%); } 100% { transform: translate(0,0); } }
@keyframes motion-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* Animation editor: frame strip + preview */
.anim-preview { width: 100%; height: auto; border: 1px solid var(--ink); image-rendering: pixelated; background: #fff; }
.frame-list { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: auto; }
.frame-row { display: grid; grid-template-columns: 16px 1fr 22px 20px 20px 20px; gap: 3px; align-items: center; }
.frame-row select { min-width: 0; padding: 1px 3px; }
.frame-row button { padding: 0; }
.frame-index { font-size: 10px; opacity: .6; text-align: right; }
.tree-json { width: 100%; font-family: ui-monospace, monospace; font-size: 10px; line-height: 1.35; }

/* Dialogue tree editor: one card per node, choices nested inside. */
.node-card { border: 1px solid var(--ink); padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.node-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed rgba(0,0,0,.3); padding-bottom: 2px; }
.node-head button { padding: 0 4px; }
.node-card h4 { margin: 4px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.choice-card { border-left: 2px solid var(--ink); padding-left: 5px; display: flex; flex-direction: column; gap: 2px; }
.entry-row { display: grid; grid-template-columns: 1fr 1fr 20px; gap: 3px; align-items: center; }
.entry-row input, .entry-row select { min-width: 0; }
.link { border: none; text-decoration: underline; padding: 0; text-align: left; background: none; font-size: 11px; }
.frame-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-row { grid-template-columns: 16px 1fr 20px 20px 20px 20px; }
/* Animator frame rows: thumb, number, up, down, delete */
#frames .thumb { grid-template-columns: 1fr auto auto auto auto; }

/* New drawing dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 20; }
.modal { background: var(--paper); border: 1px solid var(--ink); padding: 12px 14px; width: 320px; display: flex; flex-direction: column; gap: 8px; box-shadow: 6px 6px 0 rgba(0,0,0,.2); }
.modal h2 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.modal label { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 6px; font-size: 11px; }
.modal input, .modal select { font: inherit; font-size: 11px; padding: 3px 5px; border: 1px solid var(--ink); background: var(--paper); }
.modal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.modal-actions button { font: inherit; font-size: 11px; padding: 3px 10px; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
/* Object form */
.object-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.object-group h4 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.object-field { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.object-field > label { font-size: 10px; }
.object-field textarea, .object-field select { font: inherit; font-size: 11px; border: 1px solid var(--ink); background: var(--paper); padding: 2px 4px; width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.stat-grid label { display: flex; flex-direction: column; font-size: 9px; gap: 1px; }
.stat-grid input, .loot-row input { font: inherit; font-size: 11px; width: 100%; border: 1px solid var(--ink); background: var(--paper); padding: 1px 2px; }
.loot-row { grid-template-columns: 1fr 44px 40px 40px 18px; }
.hooks-box textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; width: 100%; border: 1px solid var(--ink); background: #f7f7f7; }
.icon-field { display: flex; gap: 8px; align-items: flex-start; }
.icon-preview { width: 64px; height: 64px; flex: none; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; image-rendering: pixelated; }
.icon-preview canvas, .icon-preview img { image-rendering: pixelated; }
.icon-field-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.icon-field-controls select { font: inherit; font-size: 11px; border: 1px solid var(--ink); background: var(--paper); padding: 2px 4px; width: 100%; }
.small.warn { color: #8a2b2b; }
.icon-field-row { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.icon-field-row select, .icon-field-row button { font: inherit; font-size: 10px; padding: 1px 4px; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
