/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  touch-action: none;
  user-select: none;
}

/* ── App Shell ─────────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f7f4ec;
}

/* ── Layered Architecture ─────────────────────────────────────── */
.scene-root {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.scene-root.is-file-drag-over::after {
  content: 'Dateien hier ablegen';
  position: absolute;
  inset: 18px;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(46, 124, 230, 0.58);
  border-radius: 24px;
  background: rgba(239, 246, 255, 0.28);
  color: #1d4ed8;
  font-size: 18px;
  font-weight: 750;
  pointer-events: none;
}

.file-import-input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#camera-hit-test-blocker {
  position: absolute;
  inset: 0;
  z-index: 9000;
  display: none;
  cursor: inherit;
}

.scene-root[data-camera-state="moving"] #camera-hit-test-blocker {
  display: block;
}

#camera-container {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  overflow: visible;
  transform-origin: 0 0;
}

#world-root {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

#canvas-bg-layer {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  pointer-events: none;
  display: block;
  /* Size, position and transform-origin are set in JS (canvas-bg.js) to
     account for the overscan margin used during gesture preview. */
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
}

#connectors-layer {
  position: absolute;
  z-index: 280;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

#connectors-layer svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

#chunks-layer {
  position: absolute;
  z-index: 300;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.chunk {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  contain: layout style;
}

#chunks-layer .shape {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  contain: size layout;
  transform-origin: 0 0;
}

#chunks-layer .shape svg {
  display: block;
}

#chunks-layer .shape.zone-shape {
  z-index: 0;
}

#chunks-layer .shape.text-shape {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
  overflow: hidden;
}

#chunks-layer .shape.text-shape .text-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 1em;
  outline: none;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
}

#chunks-layer .shape.text-shape.selected,
#chunks-layer .shape.text-shape.editing {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(46, 124, 230, 0.85);
  box-shadow: 0 0 0 2px rgba(46, 124, 230, 0.16);
}

#chunks-layer .shape.text-shape.editing {
  pointer-events: auto;
}

#chunks-layer .shape.text-shape.editing .text-content {
  pointer-events: auto;
  cursor: text;
  user-select: text;
}

#chunks-layer .shape.text-shape.editing .text-content:empty::before {
  color: rgba(26, 26, 26, 0.38);
  content: 'Text eingeben';
}

#chunks-layer .shape.md-shape {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 8px;
  overflow: auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

#chunks-layer .shape.md-shape.selected,
#chunks-layer .shape.md-shape.editing {
  border-color: rgba(46, 124, 230, 0.85);
  box-shadow: 0 0 0 2px rgba(46, 124, 230, 0.16);
}

#chunks-layer .shape.md-shape.editing {
  pointer-events: auto;
}

#chunks-layer .shape.md-shape .md-content {
  flex: 1;
  width: 100%;
  min-height: 1em;
  word-wrap: break-word;
}

#chunks-layer .shape.md-shape .md-content h1,
#chunks-layer .shape.md-shape .md-content h2,
#chunks-layer .shape.md-shape .md-content h3,
#chunks-layer .shape.md-shape .md-content h4,
#chunks-layer .shape.md-shape .md-content h5,
#chunks-layer .shape.md-shape .md-content h6 {
  margin: 0.6em 0 0.35em;
  line-height: 1.25;
  font-weight: 600;
}

#chunks-layer .shape.md-shape .md-content h1 { font-size: 1.6em; }
#chunks-layer .shape.md-shape .md-content h2 { font-size: 1.35em; }
#chunks-layer .shape.md-shape .md-content h3 { font-size: 1.15em; }

#chunks-layer .shape.md-shape .md-content p {
  margin: 0.4em 0;
}

#chunks-layer .shape.md-shape .md-content ul,
#chunks-layer .shape.md-shape .md-content ol {
  margin: 0.4em 0;
  padding-left: 1.4em;
}

#chunks-layer .shape.md-shape .md-content li {
  margin: 0.15em 0;
}

#chunks-layer .shape.md-shape .md-content code {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: rgba(23, 32, 51, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

#chunks-layer .shape.md-shape .md-content pre {
  margin: 0.5em 0;
  padding: 0.6em 0.75em;
  background: rgba(23, 32, 51, 0.06);
  border-radius: 6px;
  overflow: auto;
}

#chunks-layer .shape.md-shape .md-content pre code {
  background: none;
  padding: 0;
}

#chunks-layer .shape.md-shape .md-content blockquote {
  margin: 0.5em 0;
  padding-left: 0.75em;
  border-left: 3px solid rgba(46, 124, 230, 0.45);
  color: rgba(26, 26, 26, 0.75);
}

#chunks-layer .shape.md-shape .md-content hr {
  border: none;
  border-top: 1px solid rgba(23, 32, 51, 0.12);
  margin: 0.75em 0;
}

#chunks-layer .shape.md-shape .md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: 0.92em;
}

#chunks-layer .shape.md-shape .md-content th,
#chunks-layer .shape.md-shape .md-content td {
  border: 1px solid rgba(23, 32, 51, 0.12);
  padding: 0.3em 0.5em;
  text-align: left;
}

#chunks-layer .shape.md-shape .md-content th {
  background: rgba(23, 32, 51, 0.04);
  font-weight: 600;
}

#chunks-layer .shape.md-shape .md-content a {
  color: #2e7ce6;
  text-decoration: underline;
}

#chunks-layer .shape.md-shape .md-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

#chunks-layer .shape.md-shape .md-source {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 4em;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: "SF Mono", ui-monospace, monospace;
  line-height: 1.45;
  pointer-events: auto;
  user-select: text;
}

#chunks-layer .shape.data-chart-shape {
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.data-chart-inner {
  width: 100%;
  height: 100%;
}

.data-chart-title {
  margin: 0 0 10px;
  color: #172033;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.data-chart-host {
  width: 100%;
  min-height: 80px;
  color: #172033;
  font-size: 12px;
}

#chunks-layer .shape.org-card-shape {
  overflow: visible;
  border-radius: 18px;
  color: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  filter: drop-shadow(0 18px 26px rgba(31, 41, 55, 0.18));
}

.org-card-inner {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: 54px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 243, 255, 0.9)),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.24), transparent 45%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.org-card-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  opacity: 0.92;
}

.org-card-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(30, 64, 175, 0.22);
  color: white;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.org-card-copy {
  min-width: 0;
}

.org-card-name {
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-card-department {
  margin-top: 3px;
  overflow: hidden;
  color: #536179;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.org-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.org-card-skill {
  max-width: 88px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chunks-layer .shape.clock-shape {
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.24));
}

.clock-inner {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.clock-inner svg {
  display: block;
  width: 100%;
  height: 100%;
}

#chunks-layer .shape.calculator-shape {
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(31, 41, 55, 0.2));
}

.calculator-inner {
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.calculator-body {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  background: linear-gradient(165deg, #f2f5f9 0%, #e8ecf2 55%, #dde3eb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.calculator-display {
  position: relative;
  overflow: hidden;
  height: 26%;
  min-height: 52px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #a8bca7 0%, #9bb19a 48%, #8fa58e 100%);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.calculator-display-gloss {
  position: absolute;
  inset: 0 0 52% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.calculator-display-value {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 0 14px;
  color: #1f2a22;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: clamp(18px, 5.5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  height: calc(74% - 12px);
}

.calc-btn {
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: clamp(14px, 4vw, 20px);
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 4px 10px rgba(31, 41, 55, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.calc-btn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.calc-btn-dark {
  background: linear-gradient(180deg, #4f5a72 0%, #424c61 100%);
}

.calc-btn-dark:hover {
  background: linear-gradient(180deg, #59657f 0%, #4f5a72 100%);
}

.calc-btn-tan {
  background: linear-gradient(180deg, #beb395 0%, #b0a58b 100%);
  color: #2f2a22;
}

.calc-btn-tan:hover {
  background: linear-gradient(180deg, #c9bf9f 0%, #beb395 100%);
}

.calc-btn-orange {
  background: linear-gradient(180deg, #ff9447 0%, #f38033 100%);
}

.calc-btn-orange:hover {
  background: linear-gradient(180deg, #ffa35e 0%, #ff9447 100%);
}

.calc-btn-equals {
  grid-column: 1 / -1;
  grid-row: 5;
}

.component-placeholder-label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

#chunks-layer .shape.component-placeholder-shape {
  overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(31, 41, 55, 0.14));
}

.component-placeholder-inner {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 16px;
  border: 2px dashed rgba(100, 116, 139, 0.35);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92));
}

.component-placeholder-icon {
  color: #64748b;
  font-size: 22px;
  line-height: 1;
}

#chunks-layer .shape.file-shape {
  overflow: visible;
  filter: drop-shadow(0 10px 20px rgba(31, 41, 55, 0.16));
}

.file-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.file-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 70px;
  border-radius: 12px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.file-card-body {
  min-width: 0;
}

.file-card-name {
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-meta {
  overflow: hidden;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-link {
  pointer-events: auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.file-card-link:hover {
  background: #e2e8f0;
}

/* ── PDF ───────────────────────────────────────────────────────── */
#chunks-layer .shape.pdf-shape {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 10px;
  box-shadow: none;
}

#chunks-layer .shape.pdf-shape.selected,
#chunks-layer .shape.pdf-shape.active {
  border-color: rgba(46, 124, 230, 0.85);
  box-shadow: 0 0 0 2px rgba(46, 124, 230, 0.16);
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 10px;
  background: #ffffff;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
}

.pdf-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pdf-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #ffffff;
  pointer-events: none;
}

.pdf-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Only an activated PDF captures pointer input (scroll/select); otherwise the
   canvas owns the gesture so the object stays draggable/selectable. */
#chunks-layer .shape.pdf-shape.active {
  pointer-events: auto;
}

#chunks-layer .shape.pdf-shape.active .pdf-frame {
  pointer-events: auto;
}

#chunks-layer .shape.dragging {
  opacity: 1;
}

#chunks-layer .shape.connector-source {
  filter: drop-shadow(0 0 0 2px rgba(46, 124, 230, 0.9)) drop-shadow(0 0 10px rgba(46, 124, 230, 0.55));
}

#chunks-layer[data-lod="low"] .shape svg {
  opacity: 0.9;
}

#chunks-layer[data-lod="very-low"] .shape svg {
  opacity: 0.75;
}

/* During a gesture, promote the whole scene to a GPU layer so pinch-zoom
   composites a cached bitmap (smooth, slightly soft) instead of re-rasterising
   all shapes every frame. The idle pass re-rasterises crisply afterwards. */
#camera-container.is-interacting {
  will-change: transform;
}

#camera-container.is-interacting .shape {
  box-shadow: none !important;
  filter: none !important;
  transition: none !important;
}

#pen-tiles-layer {
  position: absolute;
  z-index: 350;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.pen-tile {
  position: absolute;
  pointer-events: none;
}

#overlays-layer {
  position: absolute;
  z-index: 500;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

/* ── Selection overlay ────────────────────────────────────────── */
.selection-overlay-root {
  --sel-scale: 1;
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.selection-box {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  border: calc(1px * var(--sel-scale)) solid #2e7ce6;
  border-radius: calc(2px * var(--sel-scale));
  box-shadow: 0 0 0 calc(1px * var(--sel-scale)) rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.selection-handle {
  position: absolute;
  width: calc(8px * var(--sel-scale));
  height: calc(8px * var(--sel-scale));
  background: #ffffff;
  border: calc(1px * var(--sel-scale)) solid #2e7ce6;
  border-radius: calc(1px * var(--sel-scale));
  box-shadow: 0 0 0 calc(1px * var(--sel-scale)) rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
  pointer-events: auto;
}

.selection-handle-nw {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
}

.selection-handle-ne {
  top: 0;
  left: 100%;
  transform: translate(-50%, -50%);
}

.selection-handle-sw {
  top: 100%;
  left: 0;
  transform: translate(-50%, -50%);
}

.selection-handle-se {
  top: 100%;
  left: 100%;
  transform: translate(-50%, -50%);
}

.selection-handle.selection-handle-edge {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  height: auto;
}

.selection-handle-n,
.selection-handle-s {
  left: 0;
  width: 100%;
  height: calc(10px * var(--sel-scale));
}

.selection-handle-n {
  top: 0;
  transform: translateY(-50%);
}

.selection-handle-s {
  top: 100%;
  transform: translateY(-50%);
}

.selection-handle-w,
.selection-handle-e {
  top: 0;
  height: 100%;
  width: calc(10px * var(--sel-scale));
}

.selection-handle-w {
  left: 0;
  transform: translateX(-50%);
}

.selection-handle-e {
  left: 100%;
  transform: translateX(-50%);
}

.selection-marquee {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  border: calc(1px * var(--sel-scale)) dashed #95aefa;
  background: rgba(149, 174, 250, 0.16);
  pointer-events: none;
}

.shape-preview {
  opacity: 0.72;
  pointer-events: none;
  filter: drop-shadow(0 0 0 calc(1px * var(--sel-scale)) rgba(46, 124, 230, 0.42));
}

/* ── Main Toolbar ─────────────────────────────────────────────── */
.toolbar-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 2px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  user-select: none;
}

.main-toolbar {
  position: fixed;
  z-index: 10000;
  transform-origin: top left;
}

.object-toolbar {
  position: fixed;
  z-index: 10020;
  transform: translateX(-50%);
}

.toolbar-shell-horizontal {
  flex-direction: row;
  align-items: center;
}

.toolbar-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 28px;
  color: #6b7280;
  font-size: 14px;
  cursor: grab;
  border-radius: 10px;
}

.toolbar-shell-horizontal .toolbar-handle {
  width: 28px;
  height: 42px;
}

.toolbar-handle:active {
  cursor: grabbing;
}

.toolbar-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar-shell-horizontal .toolbar-tools {
  flex-direction: row;
}

.toolbar-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: #374151;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-tool-btn:hover {
  background: #f3f4f6;
}

.toolbar-tool-btn.active {
  background: #eef2ff;
  color: #4f46e5;
}

.toolbar-spacer {
  width: 32px;
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.toolbar-shell-horizontal .toolbar-spacer {
  width: 1px;
  height: 32px;
  margin: 0 4px;
}

.toolbar-tool-btn.exit {
  color: #ef4444;
}

.toolbar-zoom-btn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.toolbar-tool-icon,
.toolbar-icon,
.toolbar-segment-icon,
.toolbar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.toolbar-tool-icon svg,
.toolbar-icon svg,
.toolbar-segment-icon svg,
.toolbar-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Toolbar Panel Host ───────────────────────────────────────── */
.toolbar-panel-host {
  position: absolute;
  top: 0;
  left: calc(100% + 7px);
  transform: translateY(-50%) scale(0.75);
  transform-origin: top left;
}

.toolbar-shell-horizontal .toolbar-panel-host {
  top: calc(100% + 7px);
  left: 0;
  transform: scale(0.75);
}

.toolbar-panel {
  width: 320px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 18px 18px 22px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Object Toolbar (object inspector) ────────────────────────── */
.object-inspector-floating {
  position: fixed;
  z-index: 10020;
  transform: translateX(-50%) scale(var(--ui-scale, 1));
  transform-origin: top center;
  pointer-events: auto;
}

.object-inspector-toolbar {
  padding: 2px;
}

.object-inspector-toolbar .object-inspector-handle {
  flex: 0 0 auto;
  width: 28px;
  height: auto;
  min-height: 42px;
  align-self: stretch;
  cursor: grab;
}

.object-inspector-empty {
  color: #6b7280;
  font-size: 14px;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.inspector-field:first-child {
  margin-top: 0;
}

.inspector-label {
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.inspector-input {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.inspector-textarea {
  width: 100%;
  min-height: 260px;
  padding: 10px 12px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font: 12px/1.45 "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
  user-select: text;
}

.inspector-textarea.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.inspector-error {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.4;
}

.toolbar-panel-zone-list {
  max-height: min(420px, calc(100vh - 100px));
}

.zone-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.zone-list-empty {
  padding: 12px;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  font-size: 13px;
}

.zone-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #374151;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  cursor: grab;
}

.zone-list-item:hover,
.zone-list-item.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: rgba(46, 124, 230, 0.36);
}

.zone-list-item:active {
  cursor: grabbing;
}

.zone-list-drag {
  flex: 0 0 auto;
  color: #9ca3af;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -2px;
}

.zone-list-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-number-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspector-unit {
  min-width: 24px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.inspector-toggle {
  height: 36px;
  padding: 0 12px;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.inspector-toggle.active {
  color: #4f46e5;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.inspector-readonly {
  color: #6b7280;
  font-size: 14px;
}

.toolbar-panel-zoom {
  width: 260px;
}

.toolbar-panel::-webkit-scrollbar {
  width: 6px;
}

.toolbar-panel::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

/* ── Panel Sections ───────────────────────────────────────────── */
.toolbar-section {
  margin-top: 18px;
}

.toolbar-section:first-child {
  margin-top: 0;
}

.toolbar-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.toolbar-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 14px;
  margin-bottom: 16px;
}

.toolbar-tab {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-tab.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Rows ─────────────────────────────────────────────────────── */
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-alignment-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-zoom-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar-zoom-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}

.toolbar-zoom-range {
  width: 100%;
  accent-color: #4f46e5;
}

.toolbar-zoom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-zoom-input {
  flex: 1;
  height: 38px;
  padding: 8px 10px;
  font-size: 15px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.toolbar-zoom-percent {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.toolbar-zoom-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.toolbar-zoom-preset {
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.toolbar-zoom-preset:hover {
  background: #e5e7eb;
}

.toolbar-zoom-preset.active {
  color: #4f46e5;
  background: #eef2ff;
  border-color: #4f46e5;
}

/* ── Select ───────────────────────────────────────────────────── */
.toolbar-select-wrap {
  position: relative;
  flex: 1;
}

.toolbar-select {
  width: 100%;
  padding: 9px 30px 9px 12px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  appearance: none;
  cursor: pointer;
}

.toolbar-select-wrap::after {
  content: '⌄';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-60%);
  font-size: 16px;
  color: #6b7280;
  pointer-events: none;
}

/* ── Segmented Button ─────────────────────────────────────────── */
.toolbar-segmented {
  display: flex;
  gap: 0;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 3px;
}

.toolbar-segment-btn {
  flex: 1;
  padding: 2px 2px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-segment-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Toggle Group ─────────────────────────────────────────────── */
.toolbar-toggle-group {
  display: flex;
  gap: 4px;
}

.toolbar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-toggle-btn.active {
  background: #eef2ff;
  color: #4f46e5;
}

.toolbar-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.toolbar-action-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.toolbar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px;
  color: #4b5563;
  background: #f3f4f6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}

.toolbar-action-btn:hover {
  background: #eef2ff;
  color: #4f46e5;
}

.toolbar-action-btn:active {
  transform: translateY(1px);
}

.toolbar-action-icon,
.toolbar-action-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.toolbar-panel-transform .toolbar-section + .toolbar-section {
  margin-top: 14px;
}

.toolbar-transform-metrics .inspector-field {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.toolbar-transform-metrics .inspector-number-wrap {
  min-width: 0;
}

.toolbar-transform-metrics .inspector-input {
  min-width: 0;
  padding-inline: 8px;
}

#chunks-layer .shape.locked {
  opacity: 0.72;
  pointer-events: none;
}

/* ── Color Grid ───────────────────────────────────────────────── */
.toolbar-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.toolbar-color-swatch {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
}

.toolbar-color-swatch:hover {
  transform: scale(1.08);
}

.toolbar-color-swatch.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #4f46e5;
}

.toolbar-color-swatch[style*="transparent"] {
  background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
                    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
                    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

/* ── Opacity Grid ─────────────────────────────────────────────── */
.toolbar-opacity-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.toolbar-opacity-swatch {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.toolbar-opacity-swatch.is-transparent {
  background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
                    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
                    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.toolbar-opacity-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.toolbar-opacity-swatch:hover {
  transform: scale(1.06);
}

.toolbar-opacity-swatch.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #4f46e5;
}

/* ── Width Grid ───────────────────────────────────────────────── */
.toolbar-width-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.toolbar-width-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.toolbar-width-swatch:hover {
  background: #f3f4f6;
}

.toolbar-width-swatch.active {
  background: #eef2ff;
  border-color: #4f46e5;
}

.toolbar-width-line {
  display: block;
  width: 100%;
  min-width: 18px;
  border-radius: 999px;
}

/* ── Size Chips ───────────────────────────────────────────────── */
.toolbar-size-chips {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.toolbar-size-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.toolbar-size-chip:hover {
  background: #e5e7eb;
}

.toolbar-size-chip.active {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #4f46e5;
}

/* ── Component Grid ───────────────────────────────────────────── */
.toolbar-component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toolbar-panel-components .toolbar-component-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toolbar-component-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 8px;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.toolbar-panel-components .toolbar-component-tile {
  aspect-ratio: 1 / 1;
  min-height: 0;
  gap: 3px;
  padding: 5px 4px;
}

.toolbar-component-tile:hover {
  background: #e5e7eb;
}

.toolbar-component-tile.active {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #4f46e5;
}

.toolbar-component-icon,
.toolbar-component-icon svg {
  width: 22px;
  height: 22px;
}

.toolbar-component-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

/* ── Pages Panel ──────────────────────────────────────────────── */
.toolbar-panel-pages {
  width: 280px;
}

.toolbar-page-browser {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolbar-page-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.toolbar-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toolbar-page-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: #4b5563;
  background: #f3f4f6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-page-nav-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.toolbar-page-counter {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.toolbar-page-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-page-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  background: #d1d5db;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}

.toolbar-page-dot.active {
  background: #4f46e5;
  transform: scale(1.15);
}

.toolbar-page-actions {
  display: flex;
  gap: 8px;
}

.toolbar-page-action-btn {
  flex: 1;
  height: 36px;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.toolbar-page-action-btn:hover {
  background: #e5e7eb;
}

.toolbar-page-action-btn.add {
  color: #4f46e5;
}

.toolbar-page-action-btn.delete {
  color: #ef4444;
}

.toolbar-page-action-btn.delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toolbar-pages-theme {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-pages-reset {
  width: 100%;
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.toolbar-pages-reset:hover {
  background: #e5e7eb;
}

.toolbar-pages-reset.active {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #4f46e5;
}

/* ── Canvas Picker ─────────────────────────────────────────────── */
.canvas-picker {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #f7f4ec;
  color: #1f2430;
  user-select: none;
  overflow: hidden;
  /* Fullscreen overlay: counter-size so it still fills the viewport while its
     content renders at native pixel size on high-DPI panels. */
  width: calc(100vw / var(--ui-scale, 1));
  height: calc(100vh / var(--ui-scale, 1));
  transform: scale(var(--ui-scale, 1));
  transform-origin: top left;
}

.picker-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

.picker-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.picker-brand-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2e7ce6, #6c4fe0);
  box-shadow: 0 4px 12px rgba(46, 124, 230, 0.35);
}

.picker-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.picker-brand-name {
  font-size: 16px;
  font-weight: 700;
}

.picker-brand-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #8a8f9c;
}

.picker-search {
  flex: 1 1 auto;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #f1efe7;
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 12px;
}

.picker-search:focus-within {
  border-color: #2e7ce6;
  background: #fff;
}

.picker-search-icon {
  display: inline-flex;
  color: #8a8f9c;
}

.picker-search-icon svg {
  width: 16px;
  height: 16px;
}

.picker-search-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: inherit;
}

.picker-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #2e7ce6;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

.picker-new-btn:hover {
  background: #1f6ad4;
}

.picker-new-btn:active {
  transform: translateY(1px);
}

.picker-new-icon svg {
  width: 15px;
  height: 15px;
}

.picker-avatar-wrap {
  position: relative;
}

.picker-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f0883e, #e0564f);
  box-shadow: 0 3px 8px rgba(224, 86, 79, 0.35);
}

.picker-avatar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.picker-avatar-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 51;
  min-width: 180px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
}

.picker-avatar-item {
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  color: #1f2430;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.picker-avatar-item:hover {
  background: #f1efe7;
}

.picker-avatar-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(31, 36, 48, 0.08);
}

.picker-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 28px 28px 60px;
}

.picker-group {
  margin-bottom: 36px;
}

.picker-group-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8f9c;
  margin-bottom: 16px;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.picker-card {
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.1s;
}

.picker-card:hover {
  transform: translateY(-2px);
}

.picker-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffffff, #efeadf);
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.picker-card:hover .picker-thumb {
  border-color: rgba(46, 124, 230, 0.5);
  box-shadow: 0 10px 28px rgba(46, 124, 230, 0.18);
}

.picker-thumb-icon {
  color: rgba(31, 36, 48, 0.22);
}

.picker-thumb-icon svg {
  width: 56px;
  height: 56px;
}

.picker-card-pages,
.picker-card-date {
  position: absolute;
  bottom: 9px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6170;
  background: rgba(255, 255, 255, 0.82);
  padding: 3px 8px;
  border-radius: 7px;
  backdrop-filter: blur(4px);
}

.picker-card-pages {
  left: 9px;
}

.picker-card-date {
  right: 9px;
}

.picker-card-name {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2430;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.picker-card-name-input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 10px;
  padding: 4px 6px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #1f2430;
  background: #ffffff;
  border: 1px solid rgba(46, 124, 230, 0.55);
  border-radius: 7px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 124, 230, 0.12);
}

.picker-empty {
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
  color: #8a8f9c;
}

/* ── Picker context menu ───────────────────────────────────────── */
.picker-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11000;
}

.picker-context-menu {
  position: fixed;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(31, 36, 48, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.picker-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  font-size: 13px;
  color: #1f2430;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.picker-context-item:hover {
  background: #f1efe7;
}

.picker-context-item.danger {
  color: #d9352c;
}

.picker-context-item.danger:hover {
  background: #fdecec;
}

.picker-context-icon {
  display: inline-flex;
  color: currentColor;
}

.picker-context-icon svg {
  width: 15px;
  height: 15px;
}

.picker-context-label {
  flex: 1 1 auto;
}

.picker-context-shortcut {
  font-size: 11px;
  color: #a0a4ae;
}
