@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
:root {
  --paper: #fbf6ee; --ink: #1a1410; --muted: #6b5d52; --line: #ece2d5; --line-2: #dccdbd;
  --coal: #17110d; --molten: #ff5a0a; --molten-ink: #c23f00; --rose: #e0245e; --gold: #ffb43a;
  --desk: #ebe1d3;
  --display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--body); color: var(--ink); background: var(--paper); display: flex; flex-direction: column; overflow: hidden; }
:focus-visible { outline: 3px solid var(--molten); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 6px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 56px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 20; }
.bar-start, .bar-end { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-end { justify-content: flex-end; }
.brand { font: 750 20px/1 var(--display); letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--molten); }
.app-name { font: 600 15px/1 var(--display); color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); margin-right: 6px; white-space: nowrap; }
.tools { display: flex; align-items: center; gap: 2px; }
.btn, .tools .menu > summary {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; line-height: 1.3; white-space: nowrap;
}
.btn:hover, .tools .menu > summary:hover { border-color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.tools .menu { margin-right: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 9px; cursor: pointer; color: var(--ink); padding: 0; font: 700 15px/1 var(--display); }
.icon-btn:hover { background: #f1e7da; }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.icon-btn.round { border-radius: 999px; border: 1px solid var(--line-2); width: 32px; height: 32px; background: #fff; }
.icon-btn.round:hover { border-color: var(--ink); }

.views { display: inline-flex; background: #f1e8dc; border-radius: 999px; padding: 3px; gap: 2px; }
.views [role="tab"] { border: 0; background: none; border-radius: 999px; padding: 6px 18px; cursor: pointer; font: 650 14px/1.2 var(--display); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.views [role="tab"]:hover { color: var(--ink); }
.views [role="tab"][aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(60, 30, 0, .14); }
.tab-alert { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--rose); color: #fff; font: 800 11px/1 var(--body); }

.zoom { display: inline-flex; align-items: center; }
.zoom .icon-btn { width: 28px; height: 30px; }
.zoom-label { border: 0; background: none; min-width: 48px; font: 600 13px/1 var(--body); font-variant-numeric: tabular-nums; cursor: pointer; padding: 8px 2px; border-radius: 8px; color: var(--muted); }
.zoom-label:hover { background: #f1e7da; color: var(--ink); }

.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: #fff; }
.lang button { border: 0; background: none; padding: 6px 9px; font: 650 12px/1 var(--body); cursor: pointer; color: var(--muted); letter-spacing: .02em; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.download { display: inline-flex; align-items: stretch; }
button.primary, .primary {
  display: inline-flex; align-items: center; gap: 8px; background: var(--molten); color: #fff; border: 0; border-radius: 999px;
  padding: 8px 18px; font: 650 14px/1.2 var(--display); cursor: pointer; white-space: nowrap;
}
button.primary:hover { background: #ec4f00; }
.download > .primary { border-radius: 999px 0 0 999px; padding-right: 14px; }
.download .menu > summary.caret { border-radius: 0 999px 999px 0; padding: 8px 10px 8px 8px; height: 100%; border-left: 1px solid rgba(255, 255, 255, .35); }
.download .menu { display: flex; }
.download .menu > summary.caret:hover { background: #ec4f00; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.tools .menu > summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.tools .menu[open] > summary { background: var(--ink); color: #fff; border-color: var(--ink); }
.tools .menu[open] > summary::after { border-color: #fff; }
.menu-list { position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 18px 40px rgba(60, 20, 0, .16); display: flex; flex-direction: column; z-index: 30; }
.menu-right .menu-list { left: auto; right: 0; }
.menu-list button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 550; font-size: 14px; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--paper); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-head { margin: 4px 12px 4px; font-size: 12.5px; color: var(--muted); }
.menu-check { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 550; }
.menu-check:hover { background: var(--paper); }
.menu-check input { accent-color: var(--molten); width: 15px; height: 15px; margin: 0; }

/* ---------- layout ---------- */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr) 304px; }
.side { overflow: auto; background: var(--paper); }
/* The left side: the data scrolls, and the parts to add stay in sight below it. */
.side.left { display: flex; flex-direction: column; overflow: hidden; }
.data-panel { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.data-scroll { flex: 0 1 auto; min-height: 84px; overflow: auto; margin: 0 -6px; padding: 0 6px 2px; }
.parts-panel { flex: none; }
.side.left { border-right: 1px solid var(--line); }
.side.right { border-left: 1px solid var(--line); }
.panel { padding: 18px 18px 20px; }
.panel + .panel { border-top: 1px solid var(--line); }
.panel h2 { font: 700 18px/1.2 var(--display); letter-spacing: -.01em; margin: 0 0 4px; }
.panel h3 { font: 650 14px/1.2 var(--display); margin: 18px 0 4px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.msg { font-size: 12.5px; color: var(--muted); margin: 0; }
.msg.bad { color: #b3261e; }
.msg-hint { color: var(--muted); }
.problem-details { margin-top: 6px; color: var(--muted); font-size: 12px; }
.problem-details summary { cursor: pointer; font-weight: 600; }
.problem-details pre { margin: 6px 0 0; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; word-break: break-word; font: 11.5px/1.45 var(--code); color: #5b4b40; max-height: 160px; overflow: auto; }
.msg.good { color: #2f7d3a; }

/* ---------- your data ---------- */
.fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fields ul { list-style: none; margin: 4px 0 2px 14px; padding: 0 0 0 10px; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--line); }
.field-btn, .parts button {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 6px 10px; cursor: grab; font-weight: 600; font-size: 13.5px;
}
.field-btn:hover, .parts button:hover { border-color: var(--molten); }
.field-btn:active, .parts button:active { cursor: grabbing; }
.field-btn .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grip { width: 6px; height: 12px; flex: none; background: radial-gradient(circle, var(--line-2) 1.1px, transparent 1.3px) 0 0 / 3px 4px; }
.field-btn:hover .grip { background-image: radial-gradient(circle, var(--molten) 1.1px, transparent 1.3px); }
.type { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.type[data-t="Number"], .type[data-t="Whole number"] { color: #8a4b00; }
.type[data-t="Date"] { color: #1f5b8a; }
.type[data-t="List"] { color: #a0143f; }
.type[data-t="Yes/no"] { color: #2f6b2f; }
.fields .empty { color: var(--muted); font-size: 13px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 10px; }
.fields .note { color: var(--muted); font-size: 12px; margin: 2px 0 0 10px; }
.data-tools { flex: none; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.data-tools .msg:empty { display: none; }
.sub { width: 100%; }
.sub > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); padding: 2px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.sub > summary::-webkit-details-marker { display: none; }
.sub > summary::before { content: ""; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.sub[open] > summary::before { transform: rotate(45deg); }
.sub > .hint { margin: 6px 0; font-size: 12.5px; }
#data, #params { width: 100%; resize: vertical; min-height: 120px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font: 12px/1.45 var(--code); background: #fff; margin-top: 6px; }
#params { min-height: 60px; }
.files-note { margin-top: 12px; }

/* ---------- add to the page ---------- */
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.parts button { padding: 6px 7px; gap: 6px; font-size: 12.5px; line-height: 1.2; min-height: 34px; }
.parts button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; border-radius: 3px; position: relative; }
.ico-text::before { content: "T"; font: 800 15px/18px var(--display); color: var(--molten); position: absolute; inset: 0; text-align: center; }
.ico-field { background: #ffe8c7; border-radius: 5px; box-shadow: inset 0 0 0 1.2px var(--gold); }
.ico-field::before { content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: var(--molten); border-radius: 1px; }
.ico-line { background: linear-gradient(var(--molten), var(--molten)) center / 100% 2px no-repeat; }
.ico-rect { border: 2px solid var(--molten); width: 18px; height: 14px; margin: 2px 0; }
.ico-ellipse { border: 2px solid var(--molten); border-radius: 50%; }
.ico-image { background: linear-gradient(135deg, transparent 50%, var(--gold) 50%), #fde6c8; border: 1px solid var(--gold); }
.ico-num::before { content: "#"; font: 800 15px/18px var(--display); color: var(--rose); position: absolute; inset: 0; text-align: center; }
.ico-date::before { content: "24"; font: 800 9.5px/15px var(--display); color: var(--rose); position: absolute; inset: 1px; text-align: center; border: 1.5px solid var(--rose); border-top-width: 3px; border-radius: 3px; }

/* ---------- center: the page ---------- */
.center { min-width: 0; min-height: 0; display: flex; background: var(--desk); position: relative; }
.stage { flex: 1; overflow: auto; padding: 28px 24px 120px 8px; position: relative; outline: none; }
.sheet { position: relative; margin: 0 auto; }
.page { position: absolute; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 16px 48px rgba(80, 40, 10, .14); }
.margin-guide { position: absolute; border: 1px dashed rgba(26, 20, 16, .08); pointer-events: none; }
.band { position: absolute; transform-origin: 0 0; z-index: 1; border-bottom: 1px dashed #d8c8b6; }
.band.has-selection { z-index: 3; }
.band.detail:not(.empty-band) { background-color: rgba(255, 180, 58, .045); }
.band.empty-band { border: 0; }
.band-strip {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 0 12px; margin: 0; background: transparent; cursor: pointer;
  border: 1px dashed #dfd0bf; border-top-color: transparent; text-align: left; font-size: 12.5px; white-space: nowrap; overflow: hidden; z-index: 2;
}
.band-strip b { font-weight: 600; color: #7d6d60; }
.band-strip .add-here { color: #b3a191; font-weight: 500; }
.band-strip.detail { background: rgba(255, 180, 58, .09); }
.band-strip.detail b { color: var(--ink); }
.band-strip:hover { background: rgba(255, 90, 10, .05); }
.band-strip:hover .add-here, .band-strip.selected .add-here, .band-strip.drop .add-here { color: var(--molten-ink); }
.band-strip.selected { border-color: var(--molten); border-style: solid; background: rgba(255, 180, 58, .10); }
.band-strip.drop { background: rgba(255, 90, 10, .10); border: 1.5px solid var(--molten); }
.band.grid { background-image: radial-gradient(circle, rgba(26, 20, 16, .14) .6px, transparent .7px); }
.band.selected:not(.empty-band) { background-color: rgba(255, 180, 58, .09); box-shadow: inset 3px 0 0 var(--molten); }
.band.drop { background-color: rgba(255, 90, 10, .10) !important; box-shadow: inset 0 0 0 1.5px var(--molten); }
.band-resize { position: absolute; left: 0; right: 0; bottom: -4px; height: 7px; cursor: ns-resize; z-index: 5; }
.band-resize:hover, .band-resize.active { background: rgba(255, 90, 10, .35); }
.band-label {
  position: absolute; left: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-end;
  padding: 4px 12px 0 0; text-align: right; border: 0; background: none; cursor: pointer; border-right: 3px solid transparent; overflow: hidden;
}
.band-label b { font: 620 12.5px/1.2 var(--body); color: var(--ink); max-width: 100%; }
.band-label small { font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.band-label:hover b { color: var(--molten-ink); }
.band-label.selected { border-right-color: var(--molten); }
.band-label.selected b { color: var(--molten-ink); }

.el { position: absolute; cursor: move; user-select: none; outline: none; }
.el.text { display: flex; overflow: hidden; line-height: 1.15; white-space: pre-wrap; word-break: break-word; box-shadow: inset 0 0 0 .5px rgba(26, 20, 16, .18); }
.el.text > span { width: 100%; }
.pill { display: inline; background: rgba(255, 180, 58, .32); border-radius: .3em; padding: 0 .28em; box-shadow: inset 0 0 0 .06em rgba(232, 140, 20, .55); white-space: nowrap; }
.pill-other { background: rgba(224, 36, 94, .10); box-shadow: inset 0 0 0 .06em rgba(224, 36, 94, .35); }
.pill-empty { color: #a06a3a; font-style: italic; }
.el .fx { font: italic 700 1em/1 Georgia, serif; color: var(--molten-ink); margin-right: .25em; }
.el .code { color: #8a7a6c; font-family: var(--code); font-size: .85em; }
.el.container { box-shadow: inset 0 0 0 .5px rgba(26, 20, 16, .35); }
.el.container > .el-tag { display: none; }
.el.container:hover > .el-tag, .el.container.selected > .el-tag { display: block; }
.el.container > .el-tag, .el.other > .el-tag { position: absolute; right: 1px; top: 1px; font: 600 7px/1 var(--body); color: #fff; background: rgba(26, 20, 16, .55); padding: 1px 3px; border-radius: 2px; pointer-events: none; }
.el.other { background: repeating-linear-gradient(45deg, rgba(26, 20, 16, .05) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 .5px rgba(26, 20, 16, .35); }
.el.image { display: flex; align-items: center; justify-content: center; background: #f6efe6; box-shadow: inset 0 0 0 .5px rgba(26, 20, 16, .3); overflow: hidden; color: var(--muted); font-size: 8px; }
.el.image img { width: 100%; height: 100%; object-fit: contain; }
.el.image.fill img { object-fit: fill; }
.el.image.clip img { object-fit: none; object-position: 0 0; }
.el svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; stroke-width: initial; }
.el.line { min-width: 1px; min-height: 1px; }
.el.selected { outline: calc(1.5px / var(--sc, 1)) solid var(--molten); z-index: 4; }
.el:focus-visible { outline: calc(2.5px / var(--sc, 1)) solid var(--molten); outline-offset: calc(1px / var(--sc, 1)); }
.handle { position: absolute; background: #fff; border: calc(1.2px / var(--sc, 1)) solid var(--molten); border-radius: 1px; z-index: 6; }
.handle[data-h="n"], .handle[data-h="s"] { cursor: ns-resize; }
.handle[data-h="e"], .handle[data-h="w"] { cursor: ew-resize; }
.handle[data-h="nw"], .handle[data-h="se"] { cursor: nwse-resize; }
.handle[data-h="ne"], .handle[data-h="sw"] { cursor: nesw-resize; }
.drop-ghost { position: absolute; border: 1.5px dashed var(--molten); background: rgba(255, 90, 10, .08); pointer-events: none; z-index: 8; }

/* ---------- center: the preview ---------- */
.preview { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #ddd2c4; }
.preview-head { margin: 0; padding: 8px 18px; }
.preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.preview-error { margin: 0 18px 14px; padding: 14px 16px; background: #fff; border-left: 4px solid var(--rose); border-radius: 10px; max-height: 50%; overflow: auto; }
.problem-title { margin: 0; font: 650 15px/1.3 var(--display); color: #8c1d18; }
.problem-hint { margin: 4px 0 0; font-size: 13.5px; color: var(--ink); }
.stage-problem { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 40px)); z-index: 10; display: flex; align-items: flex-start; gap: 8px; padding: 12px 10px 12px 16px; background: #fff; border-left: 4px solid var(--rose); border-radius: 12px; box-shadow: 0 10px 30px rgba(80, 20, 0, .14); }
.stage-problem .problem { flex: 1; min-width: 0; }
body.previewing .stage-problem { display: none !important; }

/* ---------- properties ---------- */
.props-panel { padding-bottom: 40px; }
.props-panel > .hint { margin-bottom: 4px; }
#props { display: flex; flex-direction: column; }
.psec { border-top: 1px solid var(--line); padding: 12px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.psec:first-child { margin-top: 10px; }
.psec h3 { font: 650 14px/1.2 var(--display); margin: 0; }
.psec.fold { padding: 0; gap: 0; }
.psec.fold > summary { list-style: none; cursor: pointer; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; }
.psec.fold > summary::-webkit-details-marker { display: none; }
.psec.fold > summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.psec.fold[open] > summary::after { transform: rotate(-135deg); }
.psec.fold[open] { padding-bottom: 14px; }
.psec.fold > :not(summary) + :not(summary) { margin-top: 10px; }
.prop { display: flex; flex-direction: column; gap: 4px; position: relative; }
.prop > label, .prop > .label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.prop input[type="text"], .prop input[type="number"], .prop select, .prop textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; background: #fff; font-size: 13.5px;
}
.prop textarea { resize: vertical; min-height: 40px; }
.prop .help, .psec > .help { font-size: 12px; color: var(--muted); margin: 0; }
.help.strong { color: var(--ink); font-size: 13px; }
.tech { font-size: 11.5px; color: var(--muted); margin: 0; }
.code-input, .prop textarea.code-input { font: 12.5px/1.45 var(--code) !important; }

.text-prop textarea { font-size: 15px; line-height: 1.4; padding: 8px 10px; min-height: 64px; border-color: var(--line-2); }
.text-prop textarea:focus { border-color: var(--molten); outline: 2px solid rgba(255, 90, 10, .25); outline-offset: 0; }
.text-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.insert-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--molten-ink); }
.insert-btn:hover { text-decoration: underline; }
.insert-btn .pill { font-weight: 800; padding: 0 .4em; }
.formula-note { margin: 0; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: #f3ebe0; color: var(--ink); }
.formula-note .insert-btn { display: inline; margin-left: 4px; }
.formula.is-formula textarea { border-color: var(--gold); background: #fffaf2; }

.picker { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; list-style: none; margin: 0; padding: 5px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 36px rgba(60, 20, 0, .18); max-height: 260px; overflow: auto; }
.text-prop .picker { top: 72px; }
.picker li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.picker li.active, .picker li:hover { background: var(--paper); }
.picker li.active { box-shadow: inset 3px 0 0 var(--molten); }
.picker li small { color: var(--muted); font-size: 11.5px; }
.picker .picker-empty { color: var(--muted); cursor: default; }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.font-row { grid-template-columns: 1.6fr 1fr; }
.grid4 label, .grid2 label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.grid4 input, .grid2 input, .grid2 select { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 6px; background: #fff; font-size: 13.5px; color: var(--ink); }
.grid4 input { padding: 6px 4px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.grid4 input::-webkit-inner-spin-button, .grid4 input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; align-self: flex-start; max-width: 100%; }
.seg button { border: 0; background: none; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 12.5px; min-width: 36px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--paper); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.align-row { display: flex; gap: 14px; flex-wrap: wrap; }
.seg .ico-svg { display: inline-flex; }
.seg button:has(.ico-svg) { padding: 6px 8px; min-width: 32px; }
.toggles { display: flex; flex-direction: column; gap: 8px; }
.colors { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.colors > label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.colors select { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 6px; background: #fff; font-size: 13px; color: var(--ink); }
.colors input[type="number"] { width: 64px; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 6px; background: #fff; color: var(--ink); }
label.inline { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; font-size: 13px !important; font-weight: 550 !important; color: var(--ink) !important; cursor: pointer; padding-bottom: 5px; }
label.inline input { accent-color: var(--molten); width: 15px; height: 15px; margin: 0; }
input[type="color"] { width: 46px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-btns button, .prop-actions button {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.row-btns button:hover, .prop-actions button:hover { border-color: var(--ink); }
.prop-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.prop-actions .ico-svg { display: inline-flex; }
.prop-actions svg { width: 14px; height: 14px; }
.prop-actions button.danger { color: #b3261e; border-color: #f0c4be; }
.prop-actions button.danger:hover { border-color: #b3261e; }
.kept { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 20px; padding: 28px 30px 24px; max-width: 600px; width: calc(100vw - 40px); color: var(--ink); background: var(--paper); box-shadow: 0 30px 80px rgba(40, 15, 0, .35); }
dialog::backdrop { background: rgba(23, 17, 13, .5); }
dialog h2 { font: 750 24px/1.15 var(--display); letter-spacing: -.015em; margin: 0 0 14px; }
dialog table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
dialog th { text-align: left; font-weight: 600; padding: 6px 14px 6px 0; vertical-align: top; }
dialog td { color: var(--muted); padding: 6px 0; }
dialog tr + tr th, dialog tr + tr td { border-top: 1px solid var(--line); }
dialog p { color: var(--muted); font-size: 13px; }
.dialog-close { position: absolute; top: 14px; right: 14px; margin: 0; }
#guide { max-width: 720px; padding: 34px 36px 26px; }
#guide h2 { font-size: 30px; margin-bottom: 22px; max-width: 24ch; }
.steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.steps b { color: var(--ink); font: 650 16px/1.25 var(--display); }
.step-n { font: 750 40px/1 var(--display); color: var(--molten); letter-spacing: -.03em; margin-bottom: 4px; }
.guide-how { font: 650 15px/1.2 var(--display); color: var(--ink) !important; margin: 0 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.guide-start { display: flex; gap: 10px; flex-wrap: wrap; }
.guide-start .primary { padding: 10px 20px; font-size: 15px; }
.guide-start .btn { padding: 9px 18px; font-size: 14px; }
.guide-note { margin: 16px 0 0; font-size: 12.5px !important; }
kbd { font: 600 11.5px var(--code); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--coal); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px; max-width: min(720px, 90vw);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3); transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #8c1d18; }

@media (max-width: 1440px) {
  .work { grid-template-columns: 240px minmax(0, 1fr) 288px; }
  .panel { padding: 16px 16px 18px; }
}
@media (max-width: 1280px) {
  .app-name { display: none; }
  .views [role="tab"] { padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
