:root {
  --accent: #6d5dfc;
  --accent-2: #8b5cf6;
  --accent-soft: #eeebff;
  --bg: #eceef3;
  --panel: #ffffff;
  --fg: #1f2330;
  --muted: #6b7183;
  --line: #e3e5ec;
  --guide: #ec4899;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 13px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  display: grid;
  grid-template-rows: 54px 1fr;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
kbd { font: 11px "JetBrains Mono", monospace; opacity: .6; margin-left: auto; }

/* ================= Top bar ================= */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(90deg, #4f46e5, #7c3aed 55%, #a855f7);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  position: relative;
  z-index: 50;
}
.brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.logo { background: #fff; color: #6d28d9; font-weight: 900; font-size: 11px; padding: 3px 6px; border-radius: 6px; letter-spacing: .5px; }
.doc-name {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: #fff; padding: 6px 8px; width: 220px; font-weight: 500;
}
.doc-name:hover { border-color: rgba(255,255,255,.35); }
.doc-name:focus { outline: none; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.5); }
.tb-group { display: flex; gap: 2px; background: rgba(255,255,255,.12); border-radius: 8px; padding: 2px; }
.tb-btn {
  border: 0; background: transparent; color: inherit;
  height: 32px; min-width: 32px; padding: 0 10px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; white-space: nowrap; list-style: none;
}
.tb-btn::-webkit-details-marker { display: none; }
.tb-btn:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.tb-btn.toggle.active { background: rgba(255,255,255,.25); }
.tb-btn.ghost { border: 1px solid rgba(255,255,255,.45); }
.tb-btn.primary { background: #fff; color: #5b21b6; font-weight: 600; }
.tb-btn.primary:hover { background: #f3f0ff; }
.tb-btn.ghost.dark { border-color: var(--line); color: var(--fg); }
.tb-btn.ghost.dark:hover { background: #f4f5f8; }
.zoom-label { min-width: 58px; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }

.menu { position: relative; }
.menu summary { cursor: pointer; }
.menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px;
  background: #fff; color: var(--fg); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(20,20,50,.18), 0 0 0 1px rgba(0,0,0,.05);
  display: flex; flex-direction: column;
}
.menu-list.right { left: auto; right: 0; width: 300px; }
.menu-list button {
  border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-list button:not(:has(small)) { flex-direction: row; align-items: center; }
.menu-list button:hover { background: var(--accent-soft); }
.menu-list small { color: var(--muted); font-size: 12px; }

/* ================= Layout ================= */
.app { display: grid; grid-template-columns: 268px 1fr 292px; min-height: 0; }
.sidebar { background: var(--panel); min-height: 0; overflow-y: auto; }
.sidebar.left { border-right: 1px solid var(--line); }
.sidebar.right { border-left: 1px solid var(--line); }

.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tab { flex: 1; border: 0; background: none; padding: 12px 2px; font-weight: 600; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 14px; }
.tab-panel.active { display: block; }
.tab-panel h4 { margin: 4px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.tab-panel h4:not(:first-child) { margin-top: 22px; }

.add-text {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  border: 1px solid var(--line); background: #f8f9fb; border-radius: var(--radius); padding: 10px 12px;
}
.add-text:hover { border-color: var(--accent); background: var(--accent-soft); }
.add-text.heading { font: 700 22px Montserrat, sans-serif; }
.add-text.sub { font: 600 16px Inter, sans-serif; }
.add-text.body { font-size: 13px; color: #4b5060; }

.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.palette button {
  border: 1px solid var(--line); background: #f8f9fb; border-radius: var(--radius);
  padding: 12px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px;
}
.palette button:hover { border-color: var(--accent); background: var(--accent-soft); }
.ico { height: 26px; display: grid; place-items: center; font-size: 20px; }
.ico-rect { width: 34px; height: 24px; background: #a5b4fc; border-radius: 4px; }
.ico-ellipse { width: 26px; height: 26px; background: #fcd34d; border-radius: 50%; }
.ico-line { width: 34px; height: 3px; background: #6b7280; margin: 11px 0; }
.ico-badge { font: 700 12px Inter; background: var(--accent); color: #fff; padding: 0 8px; height: 22px; border-radius: 99px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.5; }

.templates { display: grid; gap: 10px; }
.tpl {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0; text-align: left; overflow: hidden;
}
.tpl:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(109,93,252,.15); }
.tpl-thumb { height: 92px; display: grid; place-items: center; font-size: 34px; }
.tpl-body { padding: 10px 12px; }
.tpl-body strong { display: block; }
.tpl-body span { color: var(--muted); font-size: 12px; }

.layers-head { font-weight: 600; margin-bottom: 8px; }
.layers { display: flex; flex-direction: column; gap: 2px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.layer:hover { background: #f4f5f8; }
.layer.active { background: var(--accent-soft); color: #4c3fd6; }
.layer-icon { width: 22px; text-align: center; color: var(--muted); }
.layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 10px 2px; }

/* ================= Workspace / pages ================= */
.workspace { overflow: auto; position: relative; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 36px 40px 80px; min-width: max-content; }
.page-block { display: flex; flex-direction: column; gap: 6px; }
.page-bar { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 12px; }
.page-actions { display: flex; gap: 2px; }
.page-actions button { border: 0; background: none; width: 26px; height: 24px; border-radius: 5px; }
.page-actions button:hover:not(:disabled) { background: #dfe1e8; }
.page-wrap { position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 20px rgba(30,30,60,.08); outline: 2px solid transparent; outline-offset: 3px; border-radius: 1px; }
.page-wrap.current { outline-color: rgba(109,93,252,.35); }
.page { position: absolute; top: 0; left: 0; transform-origin: 0 0; background: #fff; }
.page .clip { position: absolute; inset: 0; overflow: hidden; }
.page .clip *, .render-host * { box-sizing: border-box; margin: 0; }
.add-page {
  border: 2px dashed #c9ccd8; background: transparent; color: var(--muted); border-radius: 10px;
  padding: 12px 28px; font-weight: 600;
}
.add-page:hover { border-color: var(--accent); color: var(--accent); background: rgba(109,93,252,.04); }

.el { cursor: move; user-select: none; }
.el:hover { outline: calc(1px / var(--z, 1)) solid rgba(109,93,252,.6); }
.el.locked { cursor: default; }
.el.editing { cursor: text; user-select: text; outline: calc(1.5px / var(--z, 1)) solid var(--accent) !important; }
.el.editing:focus { outline-style: solid; }
.el img { pointer-events: none; }

.img-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #f1f2f6; border: 2px dashed #c9ccd8; color: #8b90a0; font: 12px Inter, sans-serif; text-align: center; padding: 6px;
}
.img-ph b { font-size: 26px; font-weight: 400; }
/* small link badge on linked elements (editor only) */
.el.has-link::after {
  content: '🔗'; position: absolute; top: calc(-8px / var(--z, 1)); right: calc(-8px / var(--z, 1));
  font-size: calc(10px / var(--z, 1)); line-height: 1; pointer-events: none; opacity: .85;
}
.code-err {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #fef2f2; border: 2px dashed #fca5a5; color: #b91c1c; font: 11px Inter, sans-serif; text-align: center; padding: 4px;
}

.sel-box { position: absolute; pointer-events: none; outline: calc(1.5px / var(--z, 1)) solid var(--accent); z-index: 10000; }
.sel-box.locked { outline-style: dashed; outline-color: #9ca3af; }
.handle {
  position: absolute; width: calc(11px / var(--z, 1)); height: calc(11px / var(--z, 1));
  background: #fff; border: calc(1.5px / var(--z, 1)) solid var(--accent); border-radius: 50%;
  pointer-events: auto; transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.h-nw { left: 0; top: 0; cursor: nwse-resize; }
.h-n  { left: 50%; top: 0; cursor: ns-resize; }
.h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.h-e  { left: 100%; top: 50%; cursor: ew-resize; }
.h-se { left: 100%; top: 100%; cursor: nwse-resize; }
.h-s  { left: 50%; top: 100%; cursor: ns-resize; }
.h-sw { left: 0; top: 100%; cursor: nesw-resize; }
.h-w  { left: 0; top: 50%; cursor: ew-resize; }
.size-tip {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, calc(10px / var(--z, 1))) scale(calc(1 / var(--z, 1)));
  transform-origin: top center; background: #1f2330; color: #fff; font: 600 11px Inter, sans-serif;
  padding: 3px 7px; border-radius: 5px; white-space: nowrap;
}
.guide { position: absolute; background: var(--guide); z-index: 10001; pointer-events: none; }
.guide.v { top: 0; bottom: 0; width: calc(1px / var(--z, 1)); }
.guide.h { left: 0; right: 0; height: calc(1px / var(--z, 1)); }

/* ================= Properties panel ================= */
.props { padding: 0 0 40px; }
.props-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.props-head strong { font-size: 14px; }
.head-actions { display: flex; gap: 2px; }
.icon-btn { border: 0; background: none; width: 30px; height: 30px; border-radius: 6px; font-size: 14px; }
.icon-btn:hover { background: #f1f2f6; }
.section { padding: 14px; border-bottom: 1px solid var(--line); }
.section h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 11px; color: var(--muted); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 6px; }
.field input[type=number], .field input[type=text], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fbfbfd;
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field textarea.mono { font: 12px/1.5 "JetBrains Mono", monospace; white-space: pre; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(109,93,252,.15); }
.color-field { display: flex; gap: 6px; align-items: center; }
.color-field input[type=color] { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: none; }
.color-field input[type=text] { flex: 1; min-width: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; height: 30px; min-width: 30px; padding: 0 8px; flex: none; }
.mini:hover { border-color: var(--accent); color: var(--accent); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; height: 30px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: #f4f5f8; }
.seg button.on { background: var(--accent-soft); color: #4c3fd6; font-weight: 700; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row .mini { flex: 1; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row output { width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.note code { background: #f1f2f6; padding: 1px 4px; border-radius: 4px; font-size: 11px; }
.tips { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-size: 12px; }
.tips kbd { opacity: 1; background: #f1f2f6; border-radius: 4px; padding: 0 4px; margin: 0; }
.danger:hover { color: #dc2626 !important; border-color: #fca5a5 !important; }

/* ================= Page background, security & safety ================= */
.bg-layer, .security-layer { pointer-events: none; }
.safe-area {
  position: absolute; pointer-events: none; z-index: 9999;
  outline: calc(1px / var(--z, 1)) dashed rgba(236, 72, 153, .75);
}
.safe-area[hidden] { display: none; }
.add-text.page-setup { font-size: 12.5px; font-weight: 500; }
.btn-row .mini.danger { flex: none; }
.sub-block { border-left: 2px solid var(--accent-soft); padding-left: 10px; margin: -2px 0 12px 6px; }

/* ================= Header / footer zones ================= */
.zone-band { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 9998; }
.zone-band.header { top: 0; border-bottom: calc(1px / var(--z, 1)) dashed rgba(14,165,233,.7); }
.zone-band.footer { bottom: 0; border-top: calc(1px / var(--z, 1)) dashed rgba(14,165,233,.7); }
.zone-band.active { background: rgba(14,165,233,.06); border-color: #0ea5e9; border-style: solid; }
.zone-label {
  position: absolute; right: calc(6px / var(--z, 1)); font: 600 10px Inter, sans-serif; color: #0369a1;
  background: rgba(224,242,254,.95); padding: 2px 6px; border-radius: 4px; opacity: 0; transition: opacity .15s;
  transform: scale(calc(1 / var(--z, 1))); transform-origin: right center; white-space: nowrap;
}
.zone-band.header .zone-label { bottom: calc(4px / var(--z, 1)); transform-origin: right bottom; }
.zone-band.footer .zone-label { top: calc(4px / var(--z, 1)); transform-origin: right top; }
.page:hover .zone-label, .zone-band.active .zone-label { opacity: 1; }
/* outside edit mode, shared elements are read-only; while editing a zone, page content is dimmed */
.pages:not(.zone-edit) .el[data-zone="header"], .pages:not(.zone-edit) .el[data-zone="footer"] { pointer-events: none; }
.pages.zone-edit .el[data-zone="page"] { pointer-events: none; opacity: .3; }
.pages[data-zone="header"] .el[data-zone="footer"], .pages[data-zone="footer"] .el[data-zone="header"] { pointer-events: none; opacity: .45; }
.zone-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  margin: 0 auto; padding: 9px 14px; background: #0ea5e9; color: #fff; font-weight: 500;
  box-shadow: 0 4px 14px rgba(14,165,233,.35);
}
.zone-bar[hidden] { display: none; }
.zone-bar span:nth-child(2) { flex: 1; }
.zone-bar .mini { color: #0369a1; border-color: #fff; font-weight: 600; }
.hf-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hf-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.props-head .mini { height: 28px; }

/* ================= Variables ================= */
/* on-canvas chips; no padding so text metrics match the exported PDF */
.var-chip { background: rgba(109,93,252,.16); box-shadow: 0 0 0 1px rgba(109,93,252,.5); border-radius: 3px; }
.var-chip.builtin { background: rgba(14,165,233,.15); box-shadow: 0 0 0 1px rgba(14,165,233,.5); }
.var-chip.filled { background: rgba(16,185,129,.14); box-shadow: 0 0 0 1px rgba(16,185,129,.5); }
.el.editing .var-chip { background: none; box-shadow: none; }

.variables .note code, .var-code { font: 12px "JetBrains Mono", monospace; background: var(--accent-soft); color: #4c3fd6; padding: 1px 5px; border-radius: 4px; }
.var-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; background: #fbfbfd; }
.var-card.builtin { background: #f5fbff; }
.var-top { display: flex; align-items: center; gap: 4px; }
.var-top .var-code { flex: 1; }
.var-brace { font: 600 12px "JetBrains Mono", monospace; color: var(--accent); }
.var-card input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: #fff; min-width: 0; }
.var-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,93,252,.15); }
.var-name { flex: 1; font: 600 12px "JetBrains Mono", monospace; color: #4c3fd6; }
.var-sample { flex: 1; }
.var-unused { color: var(--muted); font-size: 11px; }
.add-var { width: 100%; height: 34px; }
.var-insert { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: -2px 0 12px; }
.var-insert > span { font-size: 11px; color: var(--muted); width: 100%; }
.var-pill { border: 1px solid rgba(109,93,252,.35); background: var(--accent-soft); color: #4c3fd6; border-radius: 99px; padding: 2px 9px; font: 11.5px "JetBrains Mono", monospace; }
.var-pill:hover { background: #e0dbff; }
.var-pill.builtin { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.var-pill.new { background: #fff; border-style: dashed; font-family: Inter, sans-serif; }

/* ================= Code modal ================= */
.modal { position: fixed; inset: 0; background: rgba(17,19,30,.55); display: grid; place-items: center; z-index: 100; padding: 24px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; width: min(1100px, 100%); height: min(820px, 100%); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.modal-head .tb-btn:hover { background: #f1f2f6; }
.code-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.code-tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); }
.code-tabs button:hover { background: #f4f5f8; }
.code-tabs button.on { background: var(--accent-soft); color: #4c3fd6; font-weight: 600; }
.code-hint { margin: 0; padding: 10px 16px; background: #fafaff; border-bottom: 1px solid var(--line); color: #4b5060; font-size: 12.5px; line-height: 1.5; }
.code-hint code { background: #eeebff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.code-view { flex: 1; margin: 0; overflow: auto; background: #0f1220; color: #d7dcf0; padding: 16px 18px; font: 12.5px/1.6 "JetBrains Mono", Consolas, monospace; tab-size: 2; }
.code-view .c-tag { color: #7dd3fc; }
.code-view .c-attr { color: #c4b5fd; }
.code-view .c-str { color: #a7f3d0; }
.code-view .c-com { color: #6b7394; font-style: italic; }
.code-view .c-key { color: #f9a8d4; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.code-meta { flex: 1; color: var(--muted); font-size: 12px; }

/* ================= PDF viewer ================= */
.viewer { position: fixed; inset: 0; z-index: 90; background: #2a2d3a; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px; flex: none; color: #fff;
  background: linear-gradient(90deg, #4f46e5, #7c3aed 55%, #a855f7);
}
.v-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-pagebox { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; font-variant-numeric: tabular-nums; }
.v-pagebox input { width: 46px; height: 26px; border: 0; border-radius: 5px; text-align: center; background: rgba(255,255,255,.9); color: #1f2330; }
.viewer-scroll { flex: 1; overflow: auto; }
.viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px; min-width: max-content; }
.v-page { position: relative; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,.35); }
.v-page canvas { display: block; }
.v-msg { color: #d7dcf0; padding: 60px; font-size: 14px; }
/* minimal PDF.js text layer (makes text selectable) */
.textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; opacity: 1; forced-color-adjust: none; transform-origin: 0 0; }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer ::selection { background: rgba(109,93,252,.35); }

/* ================= Import dialog ================= */
.modal-card.small { width: min(560px, 100%); height: auto; }
.imp-file { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.imp-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.imp-opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.imp-opt:hover { border-color: #c4bdfd; }
.imp-opt.on { border-color: var(--accent); background: #faf9ff; }
.imp-opt input { margin-top: 3px; accent-color: var(--accent); }
.imp-opt strong { display: block; margin-bottom: 3px; }
.imp-opt small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.imp-opt code { background: var(--accent-soft); color: #4c3fd6; padding: 0 4px; border-radius: 4px; font-size: 11.5px; }
.imp-sub { margin: 8px 0 0; font-size: 12.5px; }
.imp-status { margin: 0; min-height: 18px; color: #4c3fd6; font-weight: 500; }
.tb-btn.primary.solid { background: var(--accent); color: #fff; }
.tb-btn.primary.solid:hover { background: #5b4bf0; }
.tb-btn.primary.solid:disabled { opacity: .5; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* ================= Misc ================= */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2330; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500;
}
.toast[hidden] { display: none; }
.render-host { position: fixed; left: -100000px; top: 0; }
.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; }
