/* editor.css — professional slide-editor chrome (tool UI). */

:root {
  --ink: #0c1624;
  --ink-soft: #4a5b6e;
  --paper: #ffffff;
  --panel: #f4f6f9;
  --well: #c8d0db;
  --line: #c9d2de;
  --line-soft: #e4e9f0;
  --accent: #0d5f5b;
  --accent-hover: #0a4c49;
  --accent-soft: #e4f2f1;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --focus: #0d5f5b;
  --shadow: 0 1px 2px rgba(12, 22, 36, .05), 0 10px 28px rgba(12, 22, 36, .08);
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --radius: 8px;
  --top-h: 52px;
  --bar-h: 44px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #e7ecf2;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---- App shell ---- */
.ed-shell {
  display: grid;
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---- Top bar ---- */
.ed-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: var(--top-h);
  padding: 0 14px 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  z-index: 80;
  position: relative;
}
.ed-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
}
.ed-brand h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.ed-brand .ed-mark {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.ed-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  /* Reason: overflow-x:auto also clips overflow-y, which hid the Add shape dropdown. */
  overflow: visible;
}
.ed-tools::-webkit-scrollbar { display: none; }

.ed-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  flex: none;
}
.ed-cluster > button,
.ed-cluster > label.file,
.ed-cluster > .shape-add-wrap > button {
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 6px 10px;
  box-shadow: none;
}
.ed-cluster > button:hover,
.ed-cluster > label.file:hover,
.ed-cluster > .shape-add-wrap > button:hover {
  background: #fff;
  border-color: transparent;
}
.ed-cluster > button:active:not(:disabled),
.ed-cluster > label.file:active,
.ed-cluster > .shape-add-wrap > button:active:not(:disabled) {
  background: var(--accent-soft);
}
.ed-cluster > button.primary {
  background: var(--accent);
  color: #fff;
}
.ed-cluster > button.primary:hover { background: var(--accent-hover); }
.ed-cluster > button.primary:active:not(:disabled) { background: var(--accent-hover); filter: brightness(.95); }
.ed-cluster > button.danger {
  color: var(--danger);
  background: transparent;
}
.ed-cluster > button.danger:hover { background: var(--danger-soft); }
.ed-cluster > button:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: transparent !important;
}

.ed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  justify-content: flex-end;
}
.ed-status {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  min-width: 0;
}
.ed-status #status {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button, select, label.file, input[type="text"], input[type="number"], textarea {
  font-family: var(--font);
  font-size: 12.5px;
}
button, select, label.file {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
button:hover, label.file:hover { background: var(--panel); border-color: #b4bfcc; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger {
  color: var(--danger);
  border-color: #f0d0cb;
  background: #fff;
}
button.danger:hover { background: var(--danger-soft); }
button:disabled { opacity: .45; cursor: not-allowed; }
label.file.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
label.file.primary:hover { background: var(--accent-hover); }

.dirty-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #f0d4a0;
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex: none;
}
#save.needs-save { box-shadow: 0 0 0 2px rgba(13, 95, 91, .25); }
#save { min-width: 78px; font-weight: 600; }

/* ---- Workspace ---- */
.ed-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  /* Reason: grid items default min-height:auto and grow past the viewport, killing sidebar scroll. */
  align-items: stretch;
}
.ed-main > .ed-canvas-col,
.ed-main > #side {
  min-height: 0;
  max-height: 100%;
}

.ed-canvas-col {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  /* Reason: keep stage bleed (frames, broken imgs) out of the sidebar. */
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(13, 95, 91, .06), transparent 55%),
    linear-gradient(180deg, #edf1f6 0%, #e2e8ef 100%);
}

.ed-canvas-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: var(--bar-h);
  padding: 6px 16px;
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  overflow-x: auto;
}
.ed-canvas-bar label.ed-field {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ed-canvas-bar #sceneSel {
  min-width: 160px;
  max-width: min(280px, 28vw);
  background: #fff;
}
.ed-layout-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: min(220px, 24vw);
  min-width: 0;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
}
.ed-layout-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  flex: none;
}
.ed-layout-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-canvas-bar #changeLayout {
  flex: none;
}
.snap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  user-select: none;
}
.snap-toggle input { accent-color: var(--accent); }

/* Template picker modal */
.ed-tpl-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 22, 36, .42);
  backdrop-filter: blur(4px);
}
.ed-tpl-modal.open,
.ed-tpl-modal:not([hidden]) {
  display: flex;
}
.ed-tpl-modal[hidden] { display: none !important; }
.chart-prompt-slides {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.chart-prompt-slide {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.ed-tpl-box {
  background: #fff;
  border-radius: 14px;
  width: min(820px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 18px 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.ed-tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.ed-tpl-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.ed-tpl-hint { margin: 0 0 14px; font-size: 12.5px; }
.ed-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.ed-tpl-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.ed-tpl-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.ed-tpl-card.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(13, 95, 91, .22);
}
.ed-tpl-card.new {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.ed-tpl-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f8fafc;
  line-height: 0;
}
.ed-tpl-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ed-tpl-name {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-soft);
  line-height: 1.25;
  padding: 7px 9px 9px;
}
.ed-tpl-id { display: none; }

.ed-canvas-well {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px 16px;
  overflow: hidden;
}
#stagebox {
  position: relative;
  /* Reason: width/height set by layoutStageBox() so the 16:9 stage fits the well. */
  width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
  max-width: 100%;
  max-height: 100%;
  background: var(--paper);
  border: 1px solid #aeb8c6;
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 18px 40px rgba(12, 22, 36, .16);
}
#stage { position: absolute; inset: 0; overflow: hidden; }

.ed-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  pointer-events: none;
  background:
    linear-gradient(135deg, #fafbfc 0%, #f1f4f8 100%);
}
.ed-empty[hidden] { display: none !important; }
.ed-empty strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.ed-empty span {
  font-size: 13px;
  line-height: 1.45;
  max-width: 320px;
}

.ed-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .55);
  border-top: 1px solid var(--line-soft);
}

/* ---- Stage elements ---- */
.el {
  position: absolute;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  touch-action: none;
  transition: box-shadow .15s ease;
}
.el.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 40;
  box-shadow: 0 0 0 3px rgba(13, 95, 91, .16);
}
.el.dragging {
  cursor: grabbing;
  transition: none;
  opacity: .97;
  box-shadow: 0 16px 32px rgba(12, 22, 36, .2);
  z-index: 50;
}
.el-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 2px;
}
.el-body .katex { font-size: 1em; }
.el-body .katex-display { margin: 0.1em 0; }
.el-body .frame-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.el-body .frame-crop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.el .handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
  cursor: nwse-resize;
  z-index: 30;
  box-shadow: 0 2px 6px rgba(12, 22, 36, .28);
}
.el .handle svg { display: block; pointer-events: none; }
.el.selected .handle { display: flex; }
.el .handle:hover { background: var(--accent-hover); }
.el .el-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 5px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: none;
  z-index: 40;
  align-items: center;
  justify-content: center;
}
.el.selected .el-del { display: flex; }
.el .el-del:hover { background: #912018; }
.guide {
  position: absolute;
  background: #c2410c;
  opacity: .55;
  pointer-events: none;
  border-radius: 1px;
}

/* ---- Inspector ---- */
#side {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-left: 1px solid var(--line);
  overflow: hidden;
}
.ed-side-head {
  flex: none;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfcfd, #f3f6f9);
}
.ed-side-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ed-side-head p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.ed-side-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 28px;
  /* Reason: make it obvious more inspector tools are below the fold. */
  scrollbar-gutter: stable;
}

.tool-block {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 12px;
  background: var(--panel);
}
.tool-block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ---- Text formatting (Word-like) ---- */
.text-style-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}
.text-style-bar.is-disabled { opacity: .55; }
.ts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ts-row select {
  flex: 1;
  min-width: 0;
}
.ts-font-row {
  flex-wrap: wrap;
}
#tsFontSearch {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.ts-font-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}
#tsFont { flex: 1.4; }
.ts-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
#tsSize {
  width: 56px;
  min-width: 56px;
  text-align: center;
  font-size: 12px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.ts-size-btn {
  min-width: 28px !important;
  padding: 6px 8px !important;
  font-size: 14px;
  line-height: 1;
}
.ts-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  flex: none;
}
.ts-color input[type="color"] {
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  background: transparent;
}
.ts-toggles .ts-btn {
  min-width: 40px;
  padding: 6px 10px;
  font-weight: 700;
}
.ts-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
#tsItalic { font-style: italic; font-weight: 600; }
#tsUnderline { text-decoration: underline; }

.shape-add-wrap { position: relative; display: inline-flex; }
.shape-popover {
  position: fixed;
  z-index: 200;
  width: min(320px, 70vw);
  max-height: min(320px, 60vh);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px;
}
.shape-popover[hidden] { display: none !important; }
.shape-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.shape-pick {
  text-align: left;
  font-size: 12px;
  padding: 7px 9px;
}
.shape-pick:hover { background: var(--accent-soft); border-color: var(--accent); }
.ed-cluster label.file.primary {
  display: inline-flex;
  align-items: center;
}
.ed-cluster label.file.is-disabled {
  opacity: .4;
  pointer-events: none;
  cursor: not-allowed;
}

.tool-block .row,
.row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0;
  font-size: 13px;
}
#side h2.section {
  margin: 16px 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .07em;
}
#side h2.section:first-child { margin-top: 0; }

textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  resize: vertical;
  color: var(--ink);
}
input[type="text"], input[type="number"] {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.field-inline input { width: 72px; }
.field-inline input[type="range"] { width: 110px; }

.prop-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.prop-row .prop-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.prop-row select,
.prop-row input[type="number"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.prop-row .prop-range {
  width: 100%;
  min-width: 0;
}
.prop-row .prop-val {
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 2.5em;
  text-align: right;
}
.prop-row .ts-color { justify-self: start; }
.prop-row-stroke {
  grid-template-columns: 72px 34px minmax(56px, 1fr) auto;
}
.prop-row-bg {
  grid-template-columns: 72px auto 34px;
}

#imgPreview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: none;
  margin-top: 8px;
  object-fit: contain;
  background: #f1f4f8;
}
.muted { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }

.script-line {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
  background: #fff;
}
.script-line.dirty {
  border-color: #f0c674;
  background: var(--warn-soft);
}
.script-line textarea { min-height: 64px; }

@media (max-width: 980px) {
  body { overflow: auto; }
  .ed-shell { height: auto; min-height: 100dvh; }
  .ed-main {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .ed-canvas-col {
    min-height: min(70vh, 640px);
    max-height: none;
  }
  .ed-canvas-well {
    min-height: 220px;
  }
  #side {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: min(70vh, 720px);
    min-height: 240px;
  }
  .ed-side-body {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .ed-top {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .ed-status { max-width: none; }
}

/* Image frame picker — always visible (Canva-style library) */
.frame-picker { margin-top: 10px; }
.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.frame-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.frame-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.frame-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(13, 95, 91, .2); }
.frame-thumb {
  display: block;
  width: 48px;
  height: 36px;
  overflow: hidden;
  background: linear-gradient(180deg, #dbeafe 0%, #dbeafe 55%, #86efac 55%, #4ade80 100%);
}
.frame-name { font-size: 10px; color: var(--ink-soft); text-align: center; line-height: 1.2; }
.palrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pal-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}
.pal-strip {
  display: flex;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.pal-strip:hover { border-color: var(--line); }
.pal-strip.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(13, 95, 91, .22);
}
.pal-swatch { flex: 1; height: 100%; min-width: 0; }
.pal-strip-auto {
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #f8fafc, #e2e8f0 40%, #cbd5e1 70%, #94a3b8);
}
.pal-auto-label {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}
.palchip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  font-size: 9px;
  line-height: 1;
  color: #334155;
  background: #f1f5f9;
}
.palchip.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(13, 95, 91, .25);
}
.palchip-ground {
  border: 1px solid var(--line);
}
.el-body .frame-empty-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  font: 600 12px/1.2 system-ui, sans-serif;
  color: #334155;
  text-shadow: 0 1px 0 #fff;
  background: rgba(248, 250, 252, 0.2);
}
.el.frame-drop-target {
  outline: 3px solid #0d5f5b;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(13, 95, 91, .28);
}
.el.frame-drop-target .frame-empty-badge {
  background: rgba(13, 95, 91, .35);
  color: #fff;
  text-shadow: none;
  font-size: 13px;
}
.el.frame-drop-target .frame-empty-badge::after {
  content: ' — release to fill';
}
