/* ============================================================
   Шаблон конверта — editor UI
   Tokens first, then layout, chrome, panels, controls, overlays.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f4f4f6;
  --canvas: #ececef;
  --canvas-dot: rgba(23, 24, 28, 0.085);
  --panel: #ffffff;
  --panel-2: #f7f7f9;
  --panel-3: #efeff3;
  --hover: rgba(23, 24, 28, 0.045);
  --press: rgba(23, 24, 28, 0.08);
  --line: #e6e6eb;
  --line-2: #d9d9e0;
  --text: #17181c;
  --text-2: #565966;
  --text-3: #6c6f7b;
  --accent: #5361e8;
  --accent-hover: #4351dc;
  --accent-press: #3a47c9;
  --accent-ink: #ffffff;
  --accent-soft: rgba(83, 97, 232, 0.1);
  --accent-soft-2: rgba(83, 97, 232, 0.18);
  --ring: 0 0 0 3px rgba(83, 97, 232, 0.28);
  --danger: #d6453d;
  --danger-soft: rgba(214, 69, 61, 0.1);
  --ok: #1f9d63;
  --warn: #c98a12;
  --input: #ffffff;
  --input-line: #dcdce3;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 17, 20, 0.05), 0 6px 18px -6px rgba(16, 17, 20, 0.14);
  --shadow-lg: 0 2px 6px rgba(16, 17, 20, 0.05), 0 24px 56px -16px rgba(16, 17, 20, 0.28);
  --shadow-sheet: 0 0 0 1px rgba(16, 17, 20, 0.06), 0 2px 4px rgba(16, 17, 20, 0.04), 0 18px 48px -18px rgba(16, 17, 20, 0.26);
  --sel: #5361e8;
  --ruler-bg: #f7f7f9;
  --ruler-ink: #8a8d99;
  --ruler-tick: #c9cad3;
  --ruler-sheet: rgba(83, 97, 232, 0.04);
  --ruler-sel: rgba(83, 97, 232, 0.16);
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --top-h: 56px;
  --left-w: 272px;
  --right-w: 316px;
  --ruler: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --line-strong: var(--input-line);
  --text-dim: var(--text-2);
  --text-mute: var(--text-3);
  --accent-fill: var(--accent-hover);
  --accent-2: var(--accent);
  --font-sans: var(--font);
  --font-display: var(--font);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font: 13px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--text);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214;
  --canvas: #0c0d0f;
  --canvas-dot: rgba(255, 255, 255, 0.055);
  --panel: #18191c;
  --panel-2: #1d1e22;
  --panel-3: #24252a;
  --hover: rgba(255, 255, 255, 0.05);
  --press: rgba(255, 255, 255, 0.09);
  --line: #2a2b30;
  --line-2: #36373e;
  --text: #ececf1;
  --text-2: #a7a9b5;
  --text-3: #8d909b;
  --accent: #7380ff;
  --accent-hover: #8590ff;
  --accent-press: #6470f0;
  --accent-ink: #0d0e12;
  --accent-soft: rgba(115, 128, 255, 0.14);
  --accent-soft-2: rgba(115, 128, 255, 0.24);
  --ring: 0 0 0 3px rgba(115, 128, 255, 0.35);
  --danger: #f06a60;
  --danger-soft: rgba(240, 106, 96, 0.14);
  --input: #131417;
  --input-line: #33343b;
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4), 0 28px 64px -16px rgba(0, 0, 0, 0.75);
  --shadow-sheet: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --sel: #7380ff;
  --ruler-bg: #16171a;
  --ruler-ink: #74767f;
  --ruler-tick: #3a3b42;
  --ruler-sheet: rgba(115, 128, 255, 0.05);
  --ruler-sel: rgba(115, 128, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214;
    --canvas: #0c0d0f;
    --canvas-dot: rgba(255, 255, 255, 0.055);
    --panel: #18191c;
    --panel-2: #1d1e22;
    --panel-3: #24252a;
    --hover: rgba(255, 255, 255, 0.05);
    --press: rgba(255, 255, 255, 0.09);
    --line: #2a2b30;
    --line-2: #36373e;
    --text: #ececf1;
    --text-2: #a7a9b5;
    --text-3: #8d909b;
    --accent: #7380ff;
    --accent-hover: #8590ff;
    --accent-press: #6470f0;
    --accent-ink: #0d0e12;
    --accent-soft: rgba(115, 128, 255, 0.14);
    --accent-soft-2: rgba(115, 128, 255, 0.24);
    --ring: 0 0 0 3px rgba(115, 128, 255, 0.35);
    --danger: #f06a60;
    --danger-soft: rgba(240, 106, 96, 0.14);
    --input: #131417;
    --input-line: #33343b;
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4), 0 28px 64px -16px rgba(0, 0, 0, 0.75);
    --shadow-sheet: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 24px 60px -20px rgba(0, 0, 0, 0.8);
    --sel: #7380ff;
    --ruler-bg: #16171a;
    --ruler-ink: #74767f;
    --ruler-tick: #3a3b42;
    --ruler-sheet: rgba(115, 128, 255, 0.05);
    --ruler-sel: rgba(115, 128, 255, 0.2);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.4; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
::selection { background: var(--accent-soft-2); }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; display: block; flex: none; }
kbd {
  display: inline-flex; align-items: center; min-width: 22px; height: 22px; padding: 0 6px; justify-content: center;
  font: 500 11.5px/1 var(--font); color: var(--text-2); background: var(--panel-2);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px;
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; background-clip: content-box; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */

.app { height: 100%; display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr); }
.workspace { display: grid; grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w); min-height: 0; }

/* ---------- top bar ---------- */

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.tb-left, .tb-right, .tb-center { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-center { gap: 10px; }
.tb-group { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line); }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tb-panel { display: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 4px 6px 4px 2px; border-radius: var(--r-sm); min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  color: #fff; background: linear-gradient(145deg, #6b78ff, #4554e0 60%, #3a46c4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 6px -2px rgba(69, 84, 224, 0.6);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.015em; white-space: nowrap; }
.chip {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); white-space: nowrap; min-width: 0;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--panel-2); border-color: var(--line-2); }
.chip-name { font-weight: 600; }
.chip-note { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip-caret { width: 16px; height: 16px; color: var(--text-3); }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-grid; place-items: center; flex: none;
  color: var(--text-2); transition: background 0.12s, color 0.12s;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn:active:not(:disabled) { background: var(--press); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.icon-btn.ghost { width: 28px; height: 28px; }
.zoom-pct {
  min-width: 54px; height: 32px; padding: 0 6px; border-radius: var(--r-sm);
  font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
}
.zoom-pct:hover { background: var(--hover); }

.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; margin-right: 6px; white-space: nowrap; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.save-state[data-state="saving"] i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); animation: pulse 1s infinite; }
.save-state[data-state="error"] { color: var(--danger); }
.save-state[data-state="error"] i { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.35; } }
.count:empty { display: none; }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--panel-3); color: var(--text-2); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r-sm); font-weight: 600; font-size: 13px; white-space: nowrap;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn .ic, .btn-ic .ic { width: 16px; height: 16px; }
.btn-ic { display: inline-grid; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 2px rgba(40, 50, 160, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: transparent; }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; }
.btn-ghost-danger { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost-danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-presets { padding: 0 10px; }
.tb-reset { padding: 0 10px; color: var(--text-2); }
.tb-reset:hover { color: var(--text); }

.account-btn {
  height: 32px; max-width: 160px; padding: 0 12px 0 10px; margin-left: 2px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600;
  border: 1px solid var(--line); color: var(--text); background: var(--panel);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-btn::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #8a94ff, #4c59de);
  -webkit-mask: radial-gradient(circle at 50% 38%, #000 27%, transparent 28%), radial-gradient(circle at 50% 108%, #000 46%, transparent 47%);
  mask: radial-gradient(circle at 50% 38%, #000 27%, transparent 28%), radial-gradient(circle at 50% 108%, #000 46%, transparent 47%);
}
.account-btn:hover { background: var(--panel-2); }

/* ---------- panels ---------- */

.panel { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; z-index: 10; }
.panel-left { border-right: 1px solid var(--line); }
.panel-right { border-left: 1px solid var(--line); }
.panel-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 10px 12px 8px; padding: 3px; background: var(--panel-3); border-radius: var(--r-md); }
.panel-tab { height: 30px; border-radius: 7px; font-weight: 600; color: var(--text-2); transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.panel-tab:hover { color: var(--text); }
.panel-tab.on { color: var(--text); }
.panel-scroll { flex: 1; min-height: 0; overflow: auto; }
.panel-foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.add-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border-radius: var(--r-md);
  border: 1px dashed var(--line-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; transition: all 0.15s;
}
.add-btn:hover { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.panel-lead { margin: 2px 16px 12px; color: var(--text-3); font-size: 12px; line-height: 1.5; }

/* layers */
.layer-tools { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 2px 12px 8px; }
.layer-search {
  padding-left: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8d99' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 15px; background-position: 10px 50%;
}
.layer-list { padding: 0 8px 16px; }
.region { border-radius: var(--r-md); margin-bottom: 2px; transition: background 0.15s, box-shadow 0.15s; }
.region.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.region-head {
  width: 100%; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 4px; border-radius: var(--r-sm);
  color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; text-align: left;
}
.region-head:not(.static):hover { color: var(--text-2); background: var(--hover); }
.region-head.static { padding-left: 10px; margin-top: 6px; }
.region-head .chev { display: grid; place-items: center; width: 16px; }
.region-head .chev .ic { width: 14px; height: 14px; }
.region-name { flex: 1; }
.region-count { font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--panel-3); border-radius: 8px; padding: 1px 6px; letter-spacing: 0; }
.region-body { padding: 0 0 6px; }
.region-empty { margin: 2px 8px 4px 26px; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); color: var(--text-3); font-size: 11.5px; }
.row {
  position: relative; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 2px;
  border-radius: var(--r-sm); cursor: default; color: var(--text); user-select: none;
}
.row:hover { background: var(--hover); }
.row:focus-visible { box-shadow: var(--ring); }
.row.selected { background: var(--accent-soft); }
.row.selected::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2.5px; border-radius: 2px; background: var(--accent); }
.row.child { margin-left: 22px; }
.row.child::after { content: ""; position: absolute; left: -10px; top: -4px; height: 20px; width: 8px; border-left: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-bottom-left-radius: 6px; }
.row.dragging { opacity: 0.4; }
.row.drop-into { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.row.hidden-obj .row-name, .row.hidden-obj .row-ic, .row.hidden-obj .row-thumb { opacity: 0.45; }
.row.empty .row-name { color: var(--text-3); font-style: italic; }
.grip { width: 14px; display: grid; place-items: center; color: var(--text-3); opacity: 0; cursor: grab; flex: none; }
.grip .ic { width: 14px; height: 14px; }
.row:hover .grip { opacity: 1; }
.row-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-2); background: var(--panel-3); flex: none; }
.row-ic .ic { width: 14px; height: 14px; }
.row.selected .row-ic { color: var(--accent); background: var(--panel); }
.row-thumb { width: 22px; height: 22px; border-radius: 6px; overflow: hidden; flex: none; background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row-meta { color: var(--text-3); font-size: 11px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-warn { width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; flex: none; }
.row-eye { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); opacity: 0; flex: none; }
.row-eye .ic { width: 15px; height: 15px; }
.row:hover .row-eye, .row-eye.off, .row.selected .row-eye { opacity: 1; }
.row-eye:hover { background: var(--press); color: var(--text); }
.rename { flex: 1; min-width: 0; height: 24px; border: 1px solid var(--accent); border-radius: 5px; padding: 0 6px; background: var(--input); box-shadow: var(--ring); }

/* cuts */
.cut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px 16px; }
.cut-tile {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 10px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--panel); text-align: left; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cut-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cut-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.cut-tile-art { display: block; aspect-ratio: 210 / 297; border-radius: var(--r-sm); overflow: hidden; background: #fff; margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.cut-tile-art svg { width: 100%; height: 100%; display: block; }
.cut-tile-name { font-weight: 600; font-size: 12.5px; }
.cut-tile-note { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cut-check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(40, 50, 160, 0.35); }
.cut-check .ic { width: 14px; height: 14px; stroke-width: 2.4; }

/* ---------- canvas ---------- */

.canvas {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1.2px);
  background-size: 20px 20px;
  display: grid; grid-template-columns: var(--ruler) minmax(0, 1fr); grid-template-rows: var(--ruler) minmax(0, 1fr);
}
.ruler-corner { grid-area: 1 / 1; background: var(--ruler-bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); z-index: 3; }
.ruler { display: block; width: 100%; height: 100%; background: var(--ruler-bg); z-index: 2; }
.ruler-top { grid-area: 1 / 2; border-bottom: 1px solid var(--line); }
.ruler-left { grid-area: 2 / 1; border-right: 1px solid var(--line); }
.stage { grid-area: 2 / 2; overflow: auto; position: relative; overscroll-behavior: contain; }
.stage-inner { min-width: 100%; min-height: 100%; width: max-content; display: grid; place-items: center; padding: 56px 56px 120px; }
svg.page { display: block; background: #fff; box-shadow: var(--shadow-sheet); touch-action: none; user-select: none; border-radius: 2px; }
.stage.can-pan, .stage.can-pan * { cursor: grab !important; }
.stage.panning, .stage.panning * { cursor: grabbing !important; }
svg.page.grabbing, svg.page.grabbing * { cursor: grabbing !important; }
svg.page [data-kind="plate"], svg.page [data-kind="text"] { cursor: move; }
svg.page image[data-kind="image"] { cursor: grab; }
svg.page.dragging, svg.page.dragging * { cursor: move !important; }

/* sheet overlays (sized by --k = mm per screen pixel) */
.layer-ui { pointer-events: none; }
.layer-ui .handle, .layer-ui .knob { pointer-events: all; }
.sel-frame { fill: none; stroke: var(--sel); stroke-width: calc(var(--k) * 1.5px); vector-effect: none; }
.sel-frame.dashed, .hover-frame.dashed { stroke-dasharray: calc(var(--k) * 5px) calc(var(--k) * 3px); }
.hover-frame { fill: none; stroke: var(--sel); stroke-opacity: 0.55; stroke-width: calc(var(--k) * 1px); }
.multi-frame { fill: var(--sel); fill-opacity: 0.05; pointer-events: none; }
.multi-box { fill: none; stroke: var(--sel); stroke-opacity: 0.7; stroke-width: calc(var(--k) * 1px); stroke-dasharray: calc(var(--k) * 4px) calc(var(--k) * 3px); pointer-events: none; }
.handle { fill: #fff; stroke: var(--sel); stroke-width: calc(var(--k) * 1.4px); }
.knob { fill: #fff; stroke: var(--sel); stroke-width: calc(var(--k) * 1.4px); cursor: grab; }
.knob:hover, .handle:hover { fill: var(--sel); }
.knob-stem { stroke: var(--sel); stroke-width: calc(var(--k) * 1px); }
.badge rect { fill: var(--sel); }
.badge text { fill: #fff; font-family: var(--font); font-weight: 600; font-variant-numeric: tabular-nums; }
.guide-axis { stroke: #e0563b; stroke-width: 0.18; stroke-dasharray: 1.2 1; }
.guide-line { stroke: #e0563b; stroke-width: 0.22; stroke-dasharray: 1.6 1; }
.snap-line { stroke: #ff3d7f; stroke-width: calc(var(--k, 0.3) * 1px); }

/* dock */
.dock {
  position: absolute; left: calc(50% + var(--ruler) / 2); bottom: 44px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.dock-btn { height: 36px; padding: 0 12px 0 10px; border-radius: var(--r-md); display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text-2); transition: background 0.12s, color 0.12s; }
.dock-btn.icon-only { width: 36px; padding: 0; justify-content: center; }
.dock-btn:hover { background: var(--hover); color: var(--text); }
.dock-btn.on { background: var(--accent-soft); color: var(--accent); }
.dock-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.canvas.no-art .dock-btn[data-add="image"] { color: var(--accent); background: var(--accent-soft); }

.status {
  position: absolute; left: var(--ruler); right: 0; bottom: 0; height: 28px; z-index: 4; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--canvas) 92%, transparent), transparent);
}

.drop-veil {
  position: absolute; inset: var(--ruler) 0 0 var(--ruler); z-index: 6; display: grid; place-items: start center; padding-top: 18px; pointer-events: none;
  opacity: 0; transition: opacity 0.15s; background: color-mix(in srgb, var(--accent) 6%, transparent); box-shadow: inset 0 0 0 2px var(--accent);
}
.drop-veil span { background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-md); }
.canvas.dropping .drop-veil { opacity: 1; }

.onboard {
  position: absolute; top: calc(var(--ruler) + 14px); left: calc(var(--ruler) + 14px); z-index: 5; width: 270px; padding: 14px 16px 14px;
  border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: rise 0.35s var(--ease);
}
.onboard strong { display: block; font-size: 13.5px; margin-bottom: 6px; }
.onboard ol { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.onboard-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; }
.onboard-x .ic { width: 15px; height: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- inspector ---------- */

.insp-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line); min-height: 64px; }
.insp-ic { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.insp-titles { flex: 1; min-width: 0; }
.insp-titles h2 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-titles p { margin: 1px 0 0; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-input { font-size: 14.5px !important; font-weight: 650; height: 30px !important; margin-left: -8px; border-color: transparent !important; background: transparent !important; box-shadow: none !important; width: calc(100% + 8px) !important; }
.title-input:hover { border-color: var(--input-line) !important; }
.title-input:focus { border-color: var(--accent) !important; background: var(--input) !important; box-shadow: var(--ring) !important; }
.insp-actions { display: flex; gap: 0; }
.insp-body { flex: 1; min-height: 0; overflow: auto; padding-bottom: 24px; }
.insp-block { padding: 14px 16px 2px; }

.sec { border-bottom: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; }
.sec-toggle { flex: 1; display: flex; align-items: center; gap: 6px; height: 42px; text-align: left; color: var(--text); }
.sec-toggle .chev { width: 18px; display: grid; place-items: center; color: var(--text-3); transition: transform 0.18s var(--ease); }
.sec-toggle .chev .ic { width: 14px; height: 14px; }
.sec.closed .sec-toggle .chev { transform: rotate(-90deg); }
.sec-title { font-weight: 650; font-size: 12.5px; }
.sec-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.hint { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.link { color: var(--accent); font-weight: 600; }
.muted { color: var(--text-3); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.text-input, .text-area {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-sm); background: var(--input);
  border: 1px solid var(--input-line); color: var(--text); transition: border-color 0.12s, box-shadow 0.12s;
}
.text-area { height: auto; padding: 8px 10px; resize: none; line-height: 1.4; min-height: 64px; font-size: 15px; }
.text-input:hover, .text-area:hover { border-color: var(--line-2); }
.text-input:focus, .text-area:focus { border-color: var(--accent); box-shadow: var(--ring); }
.text-input::placeholder, .text-area::placeholder { color: var(--text-3); font-style: normal; font-weight: 400; text-decoration: none; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.addr-lines { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--input-line); border-radius: var(--r-md); overflow: hidden; background: var(--input); }
.addr-line { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; height: 34px !important; font-size: 14.5px; box-shadow: none !important; background: transparent !important; }
.addr-line:last-child { border-bottom: 0 !important; }
.addr-line:focus { background: var(--accent-soft) !important; }

/* number fields */
.num-field {
  display: flex; align-items: center; height: 32px; border-radius: var(--r-sm); background: var(--input);
  border: 1px solid var(--input-line); min-width: 0; transition: border-color 0.12s, box-shadow 0.12s;
}
.num-field:hover { border-color: var(--line-2); }
.num-field:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.num-label { width: 26px; flex: none; text-align: center; color: var(--text-3); font-size: 11.5px; font-weight: 600; user-select: none; }
.num-label.scrub { cursor: ew-resize; }
.num-label.scrub:hover { color: var(--accent); }
.num-label:empty { width: 6px; }
.num-input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; padding: 0 2px; font-variant-numeric: tabular-nums; }
.num-unit { padding: 0 8px 0 2px; color: var(--text-3); font-size: 11px; }
.num-field.compact { width: 76px; flex: none; }
body.scrubbing, body.scrubbing * { cursor: ew-resize !important; user-select: none; }

/* sliders */
.slider-row { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  --p: 50%;
  flex: 1; min-width: 0; height: 18px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: none;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p), var(--panel-3) var(--p)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--panel-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff;
  border: 0; box-shadow: 0 0 0 1px rgba(16, 17, 20, 0.12), 0 1px 3px rgba(16, 17, 20, 0.25); transition: transform 0.12s;
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(16, 17, 20, 0.12), 0 1px 3px rgba(16, 17, 20, 0.25); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type="range"]:focus-visible { box-shadow: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }

/* toggles */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 30px; }
.toggle-text { display: flex; flex-direction: column; gap: 1px; font-weight: 500; }
.toggle-text small { color: var(--text-3); font-size: 11.5px; font-weight: 400; line-height: 1.35; }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; transition: background 0.18s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.18s var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }

/* segmented */
.seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--panel-3); }
.seg-cols { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.seg-btn { flex: 1; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--text-2); font-weight: 600; min-width: 0; transition: background 0.12s, color 0.12s; }
.seg-btn .ic { width: 16px; height: 16px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-btn svg:not(.ic) { width: 34px; height: 10px; }
.face-bold span { font-weight: 800; }
.face-italic span { font-style: italic; font-family: Georgia, serif; font-weight: 600; }
.face-strike span { text-decoration: line-through; }

/* color */
.color-row { display: flex; align-items: center; gap: 8px; }
.color-chip { --c: #ffffff; position: relative; width: 34px; height: 32px; border-radius: var(--r-sm); background: var(--c); box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.14); flex: none; overflow: hidden; }
.color-chip input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; }
.color-chip:focus-within { box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.14), var(--ring); }
.hex-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--input-line); background: var(--input); font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.02em; }
.hex-input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { --c: #fff; width: 20px; height: 20px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.16); transition: transform 0.12s; }
.swatch:hover { transform: scale(1.15); }

/* select-like button */
.select-btn {
  width: 100%; height: 34px; padding: 0 8px 0 10px; display: flex; align-items: center; gap: 8px; border-radius: var(--r-sm);
  border: 1px solid var(--input-line); background: var(--input); text-align: left; transition: border-color 0.12s;
}
.select-btn:hover { border-color: var(--line-2); }
.select-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--ring); }
.font-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.select-caret { color: var(--text-3); }
.select-caret .ic { width: 15px; height: 15px; }

/* position */
.pos-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.pos-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-origin { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pos-origin-cap { font-size: 10.5px; color: var(--text-3); }
.origin-pad { display: grid; grid-template-columns: repeat(3, 14px); grid-template-rows: repeat(3, 14px); gap: 4px; padding: 7px; border-radius: var(--r-sm); background: var(--panel-3); }
.origin-dot { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--text-3); transition: all 0.12s; }
.origin-dot:hover { border-color: var(--accent); }
.origin-dot.on { background: var(--accent); border-color: var(--accent); }
.flip-btn { grid-column: span 1; }
.flip-btn .ic { width: 16px; height: 16px; }

/* image */
.img-card { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.img-thumb { aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: repeating-conic-gradient(var(--panel-3) 0 25%, var(--panel) 0 50%) 0 0 / 12px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.img-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-meta > span { color: var(--text-3); font-size: 12px; }
.img-meta .btn-row { margin-top: 4px; }
.dropzone {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px; border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-2); color: var(--text-2); transition: all 0.15s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dz-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.dropzone > span:last-child { color: var(--text-3); font-size: 12px; }
.rot-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.dial { --deg: 0deg; position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--input-line), var(--shadow-sm); cursor: grab; }
.dial:active { cursor: grabbing; }
.dial-hand { position: absolute; left: 50%; top: 50%; width: 2px; height: 15px; margin: -15px 0 0 -1px; border-radius: 2px; background: var(--accent); transform-origin: 50% 100%; transform: rotate(var(--deg)); }
.dial::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--accent); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.check input:disabled { opacity: 0.6; }

.art-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.art-grid.single { grid-template-columns: 1fr; }
.art-tile {
  position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center;
  border: 1px dashed var(--line-2); background: var(--panel-2); color: var(--text-3); transition: all 0.15s;
}
.art-tile.wide { aspect-ratio: 2.2; }
.art-tile.has { border-style: solid; border-color: var(--line); }
.art-tile:hover { border-color: var(--accent); color: var(--accent); }
.art-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-plus .ic { width: 18px; height: 18px; }
.art-cap { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 10px; font-weight: 600; line-height: 1.2; padding: 3px 4px; border-radius: 5px; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--text-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cut-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-align: left; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line); transition: all 0.15s; }
.cut-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.cut-thumb { display: block; aspect-ratio: 210 / 297; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.cut-thumb svg { width: 100%; height: 100%; display: block; }
.cut-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cut-info > span { color: var(--text-3); font-size: 12px; }
.cut-info .link { font-size: 12px; margin-top: 4px; }

.attach-card { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: var(--r-md); background: var(--accent-soft); }
.attach-ic { color: var(--accent); }
.attach-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attach-text small { color: var(--text-2); font-size: 11px; }
.attach-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.guide-list { display: flex; flex-direction: column; gap: 6px; }
.guide-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; }
.guide-kind { color: #e0563b; }
.guide-kind .ic { width: 16px; height: 16px; }
.num-field.wide { width: 100%; }

/* ---------- popovers & menus ---------- */

.popover {
  position: fixed; z-index: 450; min-width: 200px; max-width: min(360px, calc(100vw - 16px)); padding: 6px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top; transition: opacity 0.14s, transform 0.14s var(--ease);
}
.popover.in { opacity: 1; transform: none; }
.menu { display: flex; flex-direction: column; min-width: 220px; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: var(--r-sm); text-align: left; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); box-shadow: none; }
.menu-item:focus-visible { background: var(--accent-soft); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-ic { color: var(--text-2); }
.menu-item.danger .menu-ic { color: var(--danger); }
.menu-ic .ic { width: 16px; height: 16px; }
.menu-label { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-weight: 500; }
.menu-label small { color: var(--text-3); font-size: 11.5px; font-weight: 400; white-space: nowrap; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.ctx-anchor { position: fixed; width: 1px; height: 1px; pointer-events: none; }

.pop-font { width: 300px; padding: 8px; }
.font-pop { display: flex; flex-direction: column; gap: 6px; }
.pop-search { height: 32px; }
.font-list { max-height: 340px; overflow: auto; margin: 0 -2px; padding: 0 2px; }
.font-group { position: sticky; top: 0; background: var(--panel); padding: 8px 8px 4px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); z-index: 1; }
.font-opt { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); text-align: left; }
.font-opt:hover, .font-opt:focus-visible { background: var(--hover); box-shadow: none; }
.font-opt.on { background: var(--accent-soft); }
.font-sample { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-preview { color: var(--text-3); font-size: 13px; white-space: nowrap; }

/* ---------- modals ---------- */

html.modal-open body { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 13, 16, 0.42); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.18s; }
.modal-card {
  position: relative; width: min(560px, 100%); max-height: min(88vh, 820px); display: flex; flex-direction: column; border-radius: var(--r-xl);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 0.2s, transform 0.22s var(--ease);
}
.modal.in .modal-backdrop { opacity: 1; }
.modal.in .modal-card { opacity: 1; transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-md { width: min(520px, 100%); }
.modal-lg { width: min(940px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 12px 24px; }
.modal-titles { flex: 1; min-width: 0; }
.modal-titles h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; }
.modal-titles p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.modal-x { margin: -4px -4px 0 0; }
.modal-body { padding: 4px 24px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.modal-text { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }

.keys { display: flex; flex-direction: column; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-set { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* presets */
.presets-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: 14px; align-items: stretch; margin-bottom: 20px; }
.save-row { display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--panel-2); border: 1px solid var(--line); }
.save-row .text-input { flex: 1; min-width: 0; }
.usage { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--panel-2); border: 1px solid var(--line); }
.usage-text { display: flex; align-items: baseline; gap: 6px; }
.usage-text strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.usage-text span { color: var(--text-3); }
.meter { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.meter-bar { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.3s var(--ease); }
.plan-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid var(--accent-soft-2); }
.plan-card > div { display: flex; flex-direction: column; }
.plan-card span { color: var(--text-2); font-size: 12px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.preset-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.preset-thumb { display: block; aspect-ratio: 210 / 297; border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s; }
.preset-thumb:hover { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); transform: translateY(-2px); }
.preset-thumb svg { width: 100%; height: 100%; display: block; }
.preset-meta { display: flex; align-items: flex-start; gap: 4px; }
.preset-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.preset-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-text span { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px 30px; }
.empty-hero.small { padding: 28px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--text-3); }
.empty-hero.small p { margin: 0; }
.empty-hero h3 { margin: 4px 0 0; font-size: 17px; }
.empty-hero p { margin: 0 0 6px; max-width: 460px; color: var(--text-2); line-height: 1.55; }
.hero-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hero-ic .ic { width: 24px; height: 24px; }
.form-error { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--danger); background: var(--danger-soft); font-size: 12.5px; }

.pay { display: flex; flex-direction: column; gap: 14px; }
.pay-price { display: flex; align-items: baseline; gap: 6px; }
.pay-price strong { font-size: 30px; letter-spacing: -0.02em; }
.pay-price span { color: var(--text-3); }
.pay-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pay-list li { position: relative; padding-left: 24px; color: var(--text-2); }
.pay-list li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.consent { align-items: flex-start; font-weight: 400; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.consent input { margin-top: 2px; }
.legal { margin: 0; color: var(--text-3); font-size: 11.5px; }

/* toasts: top-right corner of the canvas, next to the properties panel */
.toasts { position: fixed; top: calc(var(--top-h) + var(--ruler) + 12px); right: calc(var(--right-w) + 14px); z-index: 400; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; width: max-content; min-width: 260px; max-width: min(380px, calc(100vw - 32px)); padding: 10px 8px 10px 12px;
  border-radius: var(--r-lg); background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  pointer-events: auto; font-weight: 500; line-height: 1.4;
  opacity: 0; transform: translateX(14px); transition: opacity 0.2s, transform 0.24s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.toast-ic .ic { width: 15px; height: 15px; }
.toast-text { flex: 1; min-width: 0; padding-right: 2px; }
.toast-error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.toast-error::before, .toast-warn::before { content: "!"; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-weight: 800; }
.toast-error::before { background: var(--danger-soft); color: var(--danger); }
.toast-warn::before { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.toast-action { flex: none; height: 28px; padding: 0 10px; border-radius: 7px; font-weight: 650; color: var(--accent); }
.toast-action:hover { background: var(--accent-soft); }

/* mobile nav (hidden on desktop) */
.mobile-nav, .scrim { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1360px) {
  :root { --left-w: 248px; --right-w: 300px; }
  .save-state span { display: none; }
}

@media (max-width: 1180px) {
  .brand-name { display: none; }
  .tb-presets .tb-label, .tb-reset .tb-label { display: none; }
}

/* tablet: layers become a drawer */
@media (max-width: 1099px) {
  .workspace { grid-template-columns: minmax(0, 1fr) var(--right-w); }
  .tb-panel { display: inline-grid; }
  .panel-left {
    position: fixed; top: var(--top-h); bottom: 0; left: 0; width: 288px; z-index: 50; box-shadow: var(--shadow-lg);
    transform: translateX(-102%); transition: transform 0.24s var(--ease);
  }
  body.left-open .panel-left { transform: none; }
  body.left-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 40; background: rgba(12, 13, 16, 0.3); }
}

/* phone: panels are bottom sheets */
@media (max-width: 799px) {
  :root { --top-h: 52px; --ruler: 0px; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 8px; gap: 6px; }
  .tb-center { justify-content: center; }
  .zoom-group, .chip, .tb-sep, .save-state, #printBtn, .tb-presets, .tb-reset, .tb-panel { display: none !important; }
  #exportBtn { padding: 0 10px; }
  #exportBtn .tb-label { display: none; }
  .account-btn { max-width: 110px; padding: 0 10px 0 6px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .ruler, .ruler-corner { display: none; }
  .canvas { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding-bottom: 62px; }
  .stage { grid-area: 1 / 1; }
  .stage-inner { padding: 16px 16px 120px; }
  .status { display: none; }
  .dock { bottom: 74px; left: 50%; }
  .dock-btn span { display: none; }
  .dock-btn { width: 40px; padding: 0; justify-content: center; }
  .onboard { left: 12px; right: 12px; width: auto; top: 12px; }
  .panel-left, .panel-right {
    position: fixed; left: 0; right: 0; bottom: 62px; top: auto; width: auto; height: min(68vh, 560px); z-index: 50;
    border: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform 0.26s var(--ease);
  }
  .panel-left::before, .panel-right::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  body[data-sheet="layers"] .panel-left, body[data-sheet="props"] .panel-right { transform: none; }
  body[data-sheet="layers"] .scrim, body[data-sheet="props"] .scrim { display: block; position: fixed; inset: 0 0 62px 0; z-index: 40; background: rgba(12, 13, 16, 0.28); }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 62px; z-index: 60;
    padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line);
  }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 600; }
  .mobile-nav button.on { color: var(--accent); }
  .mobile-nav .ic { width: 20px; height: 20px; }
  .toasts { top: calc(var(--top-h) + 8px); right: 8px; left: 8px; align-items: stretch; }
  .toast { width: auto; min-width: 0; transform: translateY(-10px); }
  .presets-top { grid-template-columns: 1fr; }
  .modal { padding: 0; place-items: end center; }
  .modal-card { width: 100% !important; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .text-input, .text-area, .num-input, .hex-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- print: only the prepared raster ---------- */

.print-raster { display: none; }
@page { size: A4; margin: 0; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .app, .toasts, .popover, .modal, #authRoot, .ctx-anchor { display: none !important; }
  .print-raster { display: block; width: 210mm; height: 297mm; }
}
.group-frame { fill: var(--sel); fill-opacity: 0.07; stroke: var(--sel); stroke-opacity: 0.5; stroke-width: calc(var(--k) * 1px); }
.row-link { width: 18px; height: 18px; display: grid; place-items: center; color: var(--accent); flex: none; }
.row-link .ic { width: 14px; height: 14px; }

/* shared picture map */
.share-wrap { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.share-map { width: 100%; height: auto; display: block; border-radius: var(--r-md); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.mm-part { fill: transparent; stroke: transparent; cursor: pointer; transition: fill 0.12s; }
.mm-part:hover { fill: var(--accent-soft-2); }
.mm-part.on { fill: var(--accent-soft); }
.mm-part.other { fill: var(--panel-3); }
.mm-part.me { fill: var(--accent-soft-2); stroke: var(--accent); stroke-width: 2.4; cursor: default; }
.mm-pic { pointer-events: none; opacity: 0.75; }
.mm-outline { fill: none; stroke: var(--text-2); stroke-width: 1.4; pointer-events: none; }
.mm-fold { stroke: var(--text-3); stroke-width: 0.9; stroke-dasharray: 3 2; pointer-events: none; }
.share-chips { display: flex; flex-direction: column; gap: 4px; }
.share-chip { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 6px; border-radius: var(--r-sm); text-align: left; font-weight: 500; transition: background 0.12s; }
.share-chip:hover:not(:disabled) { background: var(--hover); }
.share-chip:disabled { opacity: 1; cursor: default; }
.share-chip .chip-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; background: var(--input); transition: all 0.12s; }
.share-chip.on .chip-box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.share-chip.me .chip-box { opacity: 0.55; }
.share-chip .chip-box .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.share-chip .chip-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-chip small { color: var(--text-3); font-size: 11px; }
.art-tile.shared { border-color: var(--accent); }
.art-link { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.art-link .ic { width: 13px; height: 13px; }

/* theme switch */
.theme-btn .ic-sun { display: none; }
.theme-btn.dark .ic-sun { display: block; }
.theme-btn.dark .ic-moon { display: none; }
.theme-btn .ic { transition: transform 0.3s var(--ease); }
.theme-btn:active .ic { transform: rotate(-30deg) scale(0.9); }
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, fill 0.3s ease, box-shadow 0.3s ease !important;
}

/* ============================================================
   Motion
   One set of curves and timings for the whole editor:
   quick feedback (90–140 ms), moves and reveals (180–320 ms),
   larger entrances (420–560 ms). Nothing bounces more than a hair.
   ============================================================ */

:root {
  --e-out: cubic-bezier(0.22, 0.8, 0.25, 1);
  --e-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --e-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --t-fast: 120ms;
  --t-mid: 200ms;
  --t-slow: 320ms;
}

html { -webkit-tap-highlight-color: transparent; }
button, a, .row, .seg-btn, .share-chip { touch-action: manipulation; }

/* press feedback: everything clickable gives a little under the finger */
.icon-btn, .dock-btn, .zoom-pct, .chip, .account-btn, .add-btn, .seg-btn, .share-chip, .art-tile, .cut-tile, .cut-card, .menu-item, .font-opt, .toast-action, .panel-tab, .swatch, .origin-dot {
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease,
    box-shadow var(--t-mid) var(--e-out), transform var(--t-fast) var(--e-out), opacity var(--t-fast) ease;
}
.icon-btn:active:not(:disabled) { transform: scale(0.9); }
.dock-btn:active, .zoom-pct:active, .chip:active, .account-btn:active, .panel-tab:active { transform: scale(0.96); }
.add-btn:active, .art-tile:active, .cut-tile:active, .cut-card:active, .share-chip:active:not(:disabled), .seg-btn:active { transform: scale(0.97); }
.btn { transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-mid) var(--e-out), transform var(--t-fast) var(--e-out); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.16); }

/* focus rings glide in */
:focus-visible { transition: box-shadow var(--t-fast) ease; }

/* top bar: undo/redo blink when a shortcut fires */
.icon-btn.flash { animation: btn-flash 420ms var(--e-out); }
@keyframes btn-flash { 0% { background: var(--accent-soft-2); color: var(--accent); transform: scale(0.92); } 100% { background: transparent; } }
.save-state i { transition: background-color var(--t-slow) ease, box-shadow var(--t-slow) ease; }

/* left panel: sliding tab pill and soft content swap */
.panel-tabs { position: relative; --i: 0; }
.panel-tabs::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 4px); border-radius: 7px;
  background: var(--panel); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transform: translateX(calc(var(--i) * (100% + 2px))); transition: transform var(--t-slow) var(--e-out);
}
.panel-tab { position: relative; z-index: 1; }
.tab-in { animation: tab-in var(--t-mid) var(--e-out); }
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } }

/* layer rows */
.row { transition: background-color var(--t-fast) ease; }
.grip, .row-eye { transition: opacity var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease; }
.region-head .chev { transition: transform var(--t-mid) var(--e-out); }

/* inspector: a new object slides in, the header gets a hairline once the body scrolls */
.panel-right.swap .insp-head, .panel-right.swap .insp-body { animation: insp-in 260ms var(--e-out) both; }
.panel-right.swap .insp-body { animation-delay: 30ms; }
@keyframes insp-in { from { opacity: 0; transform: translateY(6px); } }
.insp-head { position: relative; z-index: 2; transition: box-shadow var(--t-mid) ease; }
.insp-head.scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 14px -12px rgba(16, 17, 20, 0.35); }

/* sections open and close with height, not a jump */
.sec-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-slow) var(--e-out); }
.sec.closed .sec-collapse { grid-template-rows: 0fr; }
.sec-inner { min-height: 0; overflow: hidden; }
.sec-inner > .sec-body { transition: opacity var(--t-mid) ease, transform var(--t-slow) var(--e-out); }
.sec.closed .sec-inner > .sec-body { opacity: 0; transform: translateY(-4px); }
.sec-toggle .chev { transition: transform var(--t-slow) var(--e-out); }

/* switches: thumb stretches while pressed, settles with a hair of spring */
.switch-track { transition: background-color var(--t-mid) ease, box-shadow var(--t-fast) ease; }
.switch-track::after { transition: transform var(--t-slow) var(--e-spring), width var(--t-fast) var(--e-out); }
.switch:active .switch-track::after, .toggle-row:active .switch-track::after { width: 20px; }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch:active input:checked + .switch-track::after, .toggle-row:active input:checked + .switch-track::after { transform: translateX(10px); }

/* segmented and chips */
.seg-btn { transition: background-color var(--t-mid) var(--e-out), color var(--t-fast) ease, box-shadow var(--t-mid) var(--e-out), transform var(--t-fast) var(--e-out); }
.share-chip .chip-box { transition: background-color var(--t-mid) ease, border-color var(--t-mid) ease, transform var(--t-mid) var(--e-spring); }
.share-chip .chip-box.pop { animation: chip-pop 360ms var(--e-spring); }
@keyframes chip-pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
.share-chip .chip-box.pop .ic { animation: check-draw 260ms var(--e-out); }
@keyframes check-draw { from { opacity: 0; transform: scale(0.5) rotate(-12deg); } }
.mm-part { transition: fill var(--t-mid) ease; }
.mm-part.pop { animation: mm-pop 520ms var(--e-out); }
@keyframes mm-pop { 0% { fill: var(--accent); fill-opacity: 0.55; } 100% { fill-opacity: 1; } }

/* sliders: thumb grows while held */
input[type="range"]::-webkit-slider-thumb { transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-fast) ease; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 5px var(--accent-soft), 0 1px 3px rgba(16, 17, 20, 0.3); }
input[type="range"]:active::-moz-range-thumb { transform: scale(1.18); }

/* fields */
.num-field, .text-input, .text-area, .hex-input, .select-btn { transition: border-color var(--t-fast) ease, box-shadow var(--t-mid) var(--e-out), background-color var(--t-fast) ease; }
.color-chip { transition: background-color var(--t-mid) ease, box-shadow var(--t-mid) var(--e-out); }
.dial:active { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }

/* tiles and cards lift on hover; pictures develop instead of popping in */
.art-tile:hover, .cut-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.art-tile img, .img-thumb img { animation: img-in 380ms var(--e-out); }
@keyframes img-in { from { opacity: 0; transform: scale(1.04); } }
.cut-tile { transition: border-color var(--t-mid) ease, box-shadow var(--t-mid) var(--e-out), transform var(--t-mid) var(--e-out); }
.cut-check { animation: chip-pop 380ms var(--e-spring); }

/* popovers and menus grow from their anchor and shrink back */
.popover { transition: opacity 150ms ease, transform 200ms var(--e-out); transform: scale(0.96) translateY(-3px); }
.popover[data-side="above"] { transform: scale(0.96) translateY(3px); }
.popover.in { transform: none; }
.popover.out { opacity: 0; transform: scale(0.97); transition: opacity 120ms ease, transform 140ms ease; }
.menu-item { transition: background-color 90ms ease, color 90ms ease; }

/* modal */
.modal-backdrop { transition: opacity 240ms ease; }
.modal-card { transition: opacity 220ms ease, transform 280ms var(--e-out); transform: translateY(14px) scale(0.975); }
.modal.in .modal-card { transform: none; }

/* toasts: slide in from the right, fold away when leaving */
.toast { position: relative; overflow: hidden; transition: opacity 220ms ease, transform 300ms var(--e-out), height 260ms var(--e-in-out), padding 260ms var(--e-in-out), margin 260ms var(--e-in-out), border-width 260ms ease; }
.toast.out { opacity: 0; transform: translateX(18px) scale(0.98); padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }
.toast-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); opacity: 0.55; transform-origin: left; animation: toast-timer linear forwards; }
.toast.paused .toast-timer { animation-play-state: paused; }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-ic.spin { background: transparent; }
.toast-ic.spin::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tooltips */
.tip {
  position: fixed; z-index: 500; display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 8px 6px 10px;
  border-radius: 8px; background: #1b1c21; color: #f3f3f6; font-size: 12px; font-weight: 500; line-height: 1.35; pointer-events: none;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(-3px) scale(0.98);
  transition: opacity 120ms ease, transform 160ms var(--e-out);
}
.tip[data-side="above"] { transform: translateY(3px) scale(0.98); }
.tip.in { opacity: 1; transform: none; }
.tip kbd { min-width: 0; height: 18px; padding: 0 5px; font-size: 10.5px; color: #c9cbd6; background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.14); border-bottom-width: 1px; }
:root[data-theme="dark"] .tip { background: #2b2c33; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 22px -8px rgba(0, 0, 0, 0.7); }

/* onboarding, dock, drop veil */
.onboard.leaving { opacity: 0; transform: translateY(-6px) scale(0.98); transition: opacity 180ms ease, transform 220ms var(--e-out); }
.dock { animation: dock-in 520ms var(--e-out) 120ms both; }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.drop-veil span { transform: translateY(-6px); transition: transform 240ms var(--e-out); }
.canvas.dropping .drop-veil span { transform: none; }

/* sheet: selection fades in, hover outline softens, picked-up objects lift, new pictures develop */
.sel-g.ui-enter { animation: ui-in 160ms ease-out; }
@keyframes ui-in { from { opacity: 0; } }
.hover-g.fade-in { animation: ui-in 120ms ease-out; }
.handle, .knob { transform-box: fill-box; transform-origin: center; transition: transform 120ms var(--e-out), fill 120ms ease; }
.handle:hover, .knob:hover { transform: scale(1.3); }
.lifted { filter: drop-shadow(0 0.6px 0.9px rgba(16, 17, 20, 0.28)); }
.art-in { animation: art-in 520ms var(--e-out); }
@keyframes art-in { from { opacity: 0; } }
svg.page.cut-swap { animation: cut-swap 420ms var(--e-out); }
@keyframes cut-swap { from { opacity: 0.35; transform: scale(0.992); } }
.badge { animation: ui-in 120ms ease-out; }

/* mobile sheets */
.panel-left, .panel-right { transition: transform 300ms var(--e-out); }
.mobile-nav button { transition: color var(--t-fast) ease, transform var(--t-fast) var(--e-out); }
.mobile-nav button:active { transform: scale(0.92); }

/* skeletons */
.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--panel-3) 0%, var(--panel-2) 40%, var(--panel-3) 80%) 0 0 / 300% 100%; animation: sk 1.3s ease-in-out infinite; }
.preset-thumb.sk { box-shadow: none; }
.sk-line { height: 12px; width: 70%; }
.sk-line.short { width: 40%; height: 10px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* theme: circle reveal (View Transitions) without the default cross-fade */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt-theme::view-transition-old(root) { z-index: 1; }
html.vt-theme::view-transition-new(root) { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .dock, .sel-g.ui-enter, .art-in, .cut-swap, .tab-in, .panel-right.swap .insp-head, .panel-right.swap .insp-body { animation: none !important; }
  .toast-timer { display: none; }
}

/* touch screens: no hover, so the eye and grip stay visible and rows are finger-sized */
@media (hover: none) {
  .row-eye, .grip { opacity: 1; }
  .row { height: 40px; }
  .row-eye { width: 34px; height: 34px; }
  .icon-btn { width: 38px; height: 38px; }
}
@media (hover: none) {
  /* the editor pans and pinches the sheet itself; native scrolling would fight it */
  .stage { touch-action: none; }
}

/* open template in the top bar */
.doc-name { display: inline-flex; align-items: center; gap: 7px; height: 28px; max-width: 220px; padding: 0 10px; border-radius: 999px; color: var(--text-2); font-weight: 500; transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.doc-name:hover { background: var(--hover); color: var(--text); }
.doc-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-name::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; opacity: 0.7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M7 4.5h10a1 1 0 0 1 1 1V20l-6-3.5L6 20V5.5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M7 4.5h10a1 1 0 0 1 1 1V20l-6-3.5L6 20V5.5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.doc-dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; transform: scale(0); transition: transform var(--t-mid) var(--e-spring); }
.doc-name.dirty .doc-dirty { transform: scale(1); }
@media (max-width: 1180px) { .doc-name { max-width: 140px; } }
@media (max-width: 960px) { .doc-name { display: none; } }

/* templates dialog details */
.save-row.two { flex-wrap: wrap; }
.save-row.two .btn:last-child { flex: 1 1 100%; }
.preset-card { position: relative; }
.preset-card.current .preset-thumb { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.preset-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; pointer-events: none; }
.form-error.with-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* preflight list */
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.issues li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; line-height: 1.45; transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.issues li:hover { border-color: var(--accent); background: var(--accent-soft); }
.issue-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--warn); flex: none; }

/* postcode → index stencil */
.index-hint { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r-md); text-align: left;
  background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-soft-2); animation: tab-in 240ms var(--e-out);
  transition: background-color var(--t-fast) ease, transform var(--t-fast) var(--e-out); }
.index-hint:hover { background: var(--accent-soft-2); }
.index-hint:active { transform: scale(0.98); }
.index-hint strong { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.index-hint-ic { color: var(--accent); display: grid; }
.index-hint-ic .ic { width: 18px; height: 18px; }

/* guides pulled from the rulers */
.ruler-top { cursor: row-resize; }
.ruler-left { cursor: col-resize; }
.ruler:hover { background: color-mix(in srgb, var(--ruler-bg) 80%, var(--accent-soft)); }
.guide-hit { stroke: transparent; stroke-width: calc(var(--k, 0.3) * 9px); }
.guide-hit.v { cursor: col-resize; }
.guide-hit.h { cursor: row-resize; }
.guide-hit:hover { stroke: rgba(224, 86, 59, 0.14); }
.guide-line { transition: opacity var(--t-fast) ease; }
.guide-line.leaving { opacity: 0.25; stroke-dasharray: 0.6 1.2; }

/* typing right on the sheet */
.stage-inner { position: relative; }
.inline-edit {
  position: absolute; z-index: 5; margin: 0; padding: 0; border: 0; border-radius: 2px; resize: none; overflow: hidden;
  background: rgba(255, 255, 255, 0.92); caret-color: var(--accent); letter-spacing: normal;
  box-shadow: 0 0 0 1.5px var(--sel), 0 6px 18px -8px rgba(16, 17, 20, 0.35);
  animation: ui-in 140ms ease-out;
}
.inline-edit:focus { outline: none; box-shadow: 0 0 0 1.5px var(--sel), 0 0 0 5px var(--accent-soft), 0 6px 18px -8px rgba(16, 17, 20, 0.35); }
.inline-edit.line { padding: 0 1px; }
.inline-edit::placeholder { color: #a5a8b3; font-style: normal; font-weight: 400; text-decoration: none; }

/* exact zoom in the zoom menu */
.menu-input { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 10px; font-weight: 500; }
.menu-input .num-field { width: 96px; }
.menu-input input::-webkit-inner-spin-button { opacity: 0.4; }

/* part background picker */
.fill-btn { flex-direction: column; height: auto !important; padding: 6px 2px 5px !important; gap: 4px !important; font-size: 11px; }
.fill-sw { width: 30px; height: 22px; border-radius: 5px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); background: #fff; display: block; }
.fill-sw svg { width: 100%; height: 100%; display: block; }
.fill-sw.none { background: linear-gradient(to top right, transparent calc(50% - 0.75px), var(--danger) calc(50% - 0.75px), var(--danger) calc(50% + 0.75px), transparent calc(50% + 0.75px)), var(--panel); }
.align-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--panel-3); }
.align-row .icon-btn { width: 100%; height: 30px; }
.align-row .icon-btn:hover { background: var(--panel); box-shadow: var(--shadow-sm); }

/* assembly guide */
.assembly { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.as-step { display: flex; flex-direction: column; gap: 10px; }
.as-pic { aspect-ratio: 186 / 248; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line); padding: 10px; }
.as-pic svg { width: 100%; height: 100%; display: block; }
.as-paper { fill: #fff; }
.as-hi { fill: var(--accent); fill-opacity: 0.22; }
.as-fold { stroke: var(--text-3); stroke-width: 0.9; stroke-dasharray: 3 2.4; }
.as-outline { fill: none; stroke: var(--text-2); stroke-width: 1.2; }
.as-outline.hi { stroke: var(--accent); stroke-width: 2.4; }
.as-text { display: flex; flex-direction: column; gap: 4px; }
.as-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.as-text p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 799px) { .assembly { grid-template-columns: 1fr 1fr; } }

/* address book */
.book-row { gap: 6px; }
.abook { display: flex; flex-direction: column; gap: 12px; }
.abook-list { display: flex; flex-direction: column; gap: 6px; }
.abook-item { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 0; border-radius: var(--r-md); border: 1px solid var(--line); transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.abook-item:hover { border-color: var(--line-2); background: var(--panel-2); }
.abook-item.self { border-color: var(--accent-soft-2); background: var(--accent-soft); }
.abook-main { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; padding: 8px 10px; text-align: left; }
.abook-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abook-lines { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abook-tag { justify-self: start; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 600; }
.abook-actions { display: flex; }
.abook-edit { display: flex; flex-direction: column; gap: 12px; }
.abook-edit .text-area { min-height: 120px; font-size: 14px; }

/* print by list */
.batch { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.batch-left { display: flex; flex-direction: column; gap: 8px; }
.batch-input { min-height: 260px !important; font-size: 13.5px !important; font-variant-numeric: tabular-nums; }
.batch-right { display: flex; flex-direction: column; gap: 12px; }
.batch-status { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.batch-preview { display: flex; flex-direction: column; gap: 6px; }
.batch-card { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; animation: tab-in 200ms var(--e-out); }
.batch-card span:first-child { font-weight: 600; }
.batch-more { color: var(--text-3); font-size: 12px; padding-left: 4px; }
@media (max-width: 799px) { .batch { grid-template-columns: 1fr; } }

/* three left tabs and the design gallery */
.panel-tabs { grid-template-columns: repeat(3, 1fr); }
.panel-tabs::before { width: calc((100% - 10px) / 3); }
.design-art { position: relative; }
.design-art img { width: 100%; height: 100%; object-fit: cover; display: block; animation: img-in 380ms var(--e-out); }
.design-art.sk { border-radius: var(--r-sm); }

/* custom size */
.custom-plus { display: grid; place-items: center; color: var(--text-3); background: var(--panel-2) !important; }
.custom-plus .ic { width: 28px; height: 28px; }
.custom-tile:hover .custom-plus { color: var(--accent); }
.custom { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.custom-form { display: flex; flex-direction: column; gap: 14px; }
.custom-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 11px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); text-align: left; transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-fast) var(--e-out); }
.chip-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip-btn:active { transform: scale(0.97); }
.chip-btn strong { font-size: 12.5px; }
.chip-btn span { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.custom-more summary { cursor: pointer; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.custom-art { aspect-ratio: 210 / 297; border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-md); }
.custom-art svg { width: 100%; height: 100%; display: block; animation: ui-in 160ms ease-out; }
@media (max-width: 799px) { .custom { grid-template-columns: 1fr; } .custom-art { max-width: 200px; } }
.field.disabled { opacity: 0.45; }
@media print {
  .print-raster { break-after: page; page-break-after: always; }
  .print-raster:last-of-type { break-after: auto; page-break-after: auto; }
}

/* ---------- stickers ---------- */
.popover.stickers-pop { width: 560px; max-width: calc(100vw - 16px); padding: 10px 10px 8px; }
/* Sets on the left, scrolling on their own; stickers of the chosen set on the right. */
.stickers-body { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 10px; height: min(360px, 54vh); }
.stickers .sticker-tabs {
  display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 8px 2px 0; border-right: 1px solid var(--line); scrollbar-width: thin;
}
.sticker-tab { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; text-align: left; color: var(--text-2); background: transparent; transition: background 0.15s, color 0.15s; }
.sticker-tab span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-tab-ic { flex: none; width: 18px; font-size: 15px; line-height: 1; text-align: center; }
.sticker-tab:hover { color: var(--text); background: var(--hover); }
.sticker-tab.on { color: #fff; background: var(--accent); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; min-height: 0; align-content: start; overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
.sticker-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 560px) {
  .stickers-body { grid-template-columns: 50px minmax(0, 1fr); }
  .sticker-tab { justify-content: center; padding: 0; }
  .sticker-tab span:last-child { display: none; }
  .sticker-grid.wide { grid-template-columns: minmax(0, 1fr); }
}
.sticker-cell { height: 42px; border-radius: 9px; font-size: 22px; line-height: 1; color: var(--text); display: grid; place-items: center; transition: background 0.12s, transform 0.18s var(--e-out); }
.sticker-grid.wide .sticker-cell { height: 62px; padding: 6px 8px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.sticker-cell:hover { background: var(--hover); transform: scale(1.08); }
.sticker-grid.wide .sticker-cell:hover { transform: translateY(-1px); border-color: var(--accent); }
.sticker-cell:active { transform: scale(0.96); }
.sticker-svg { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; overflow: visible; }
.sticker-word { font-size: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stickers .hint { margin: 8px 2px 0; }
.multi-hint { margin: 4px 16px 16px; }
.panel-foot { gap: 4px; padding-left: 10px; padding-right: 10px; }
.panel-foot .add-btn { padding: 9px 0 8px; font-size: 10.5px; letter-spacing: -0.015em; min-width: 0; }
.panel-foot .add-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-btn.frame-btn { padding: 4px; }
.seg-btn.frame-btn .sticker-svg { height: 18px; max-width: 100%; }

/* ---------- products: groups, landscape pages, sides ---------- */
.cut-group + .cut-group { margin-top: 6px; }
.cut-group-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 14px 8px; }
.cut-group-head strong { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.cut-group-head span { font-size: 11.5px; color: var(--text-3); }
.cut-tile { position: relative; }
.cut-tile.wide .cut-tile-art { aspect-ratio: 297 / 210; }
.cut-sides { position: absolute; left: 8px; top: 8px; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; color: var(--accent); background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.cut-card.wide .cut-thumb { aspect-ratio: 297 / 210; }
.side-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 9px 10px; border-radius: var(--r-md); background: var(--hover); color: var(--text-2); font-size: 12px; line-height: 1.45; }
.side-note .ic, .side-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent); }
.art-grid.few { grid-template-columns: 1fr 1fr; }

.side-switch {
  position: absolute; z-index: 6; bottom: 100px; left: calc(50% + var(--ruler) / 2); transform: translateX(-50%);
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.side-switch[hidden] { display: none; }
.side-tab { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background 0.15s, color 0.15s; }
.side-tab:hover { color: var(--text); }
.side-tab.on { color: #fff; background: var(--accent); box-shadow: 0 1px 2px rgba(40, 50, 160, 0.25); }
/* Turning a two-sided card over in 3D: a still copy of the old side swings away, the new side swings in. */
svg.page.turn-ghost { position: absolute; margin: 0; z-index: 2; pointer-events: none; }
svg.page.turn-ghost, svg.page.turn-in { backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
svg.page.turn-ghost.turn-out { animation: turn-out 720ms cubic-bezier(0.45, 0.05, 0.2, 1) both; }
svg.page#sheet.turn-in { animation: turn-in 720ms cubic-bezier(0.45, 0.05, 0.2, 1) both; }
@keyframes turn-out {
  0% { transform: perspective(2400px) rotateY(0deg); }
  50% { transform: perspective(2400px) rotateY(calc(var(--turn, 1) * 90deg)) scale(0.92); filter: brightness(0.86); }
  100% { transform: perspective(2400px) rotateY(calc(var(--turn, 1) * 180deg)); }
}
@keyframes turn-in {
  0% { transform: perspective(2400px) rotateY(calc(var(--turn, 1) * -180deg)); }
  50% { transform: perspective(2400px) rotateY(calc(var(--turn, 1) * -90deg)) scale(0.92); filter: brightness(0.86); }
  100% { transform: perspective(2400px) rotateY(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  svg.page.turn-ghost.turn-out, svg.page#sheet.turn-in { animation-duration: 420ms; }
}

/* «Обе стороны»: the sheet being edited and a live view of the other side, front on the left. */
.stage.pair .stage-inner { display: flex; align-items: center; justify-content: center; gap: 48px; }
.sheet-slot { position: relative; flex: none; }
.sheet-slot[hidden] { display: none; }
.sheet-slot svg.page { transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.stage.pair .sheet-slot.live svg.page { box-shadow: var(--shadow-sheet), 0 0 0 2px var(--accent); }
.stage.pair .sheet-slot.idle { cursor: pointer; }
.stage.pair .sheet-slot.idle svg.page > * { pointer-events: none; }
.stage.pair .sheet-slot.idle:hover svg.page { transform: translateY(-2px); box-shadow: var(--shadow-sheet), 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.side-peer-tag {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; background: var(--panel); color: var(--text-2);
  font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-md); pointer-events: none;
  opacity: 0.94; transition: color 0.15s;
}
.side-peer-tag { display: none; }
.stage.pair .sheet-slot.idle .side-peer-tag { display: block; }
.sheet-slot.idle:hover .side-peer-tag { color: var(--accent); }
.side-sep { width: 1px; align-self: stretch; margin: 5px 3px; background: var(--line); }
.side-pair { display: inline-flex; align-items: center; gap: 6px; }
.side-pair .ic { width: 15px; height: 15px; }
@media (max-width: 799px) {
  .stage.pair .stage-inner { flex-direction: column; gap: 20px; }
  .side-pair span { display: none; }
}
@media (max-width: 799px) { .side-switch { bottom: auto; top: 10px; left: 50%; } }

@page landscape { size: A4 landscape; margin: 0; }
@media print {
  .print-raster.landscape { page: landscape; width: 297mm; height: 210mm; }
}

/* Spaces in addresses and stickers look on the sheet exactly as they print. */
svg.page text, .sticker-svg text { white-space: pre; }

/* Two-sided cards: bleed outside the cut, safe zone inside it. */
.bleed-line { fill: none; stroke: #e0607e; stroke-opacity: 0.45; stroke-width: 0.2; stroke-dasharray: 0.8 1; }
.safe-line { fill: none; stroke: #4f8de0; stroke-opacity: 0.45; stroke-width: 0.2; stroke-dasharray: 0.6 1.2; }
.bleed-veil { fill: #fff; fill-opacity: 0.5; }

/* Other copies on the sheet: the same card, faded, not clickable. */
.copy-ghost { opacity: 0.38; }
