/* ============================================
   PrintFlow — PDF Editor Styles
   All CSS classes used by editor components
   ============================================ */

/* ─── Editor panel root ─── */
.editor-panel {
    background: var(--background);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* ─── Modal max-widths ─── */
.editor-modal-sig {
    max-width: 520px;
}
.editor-modal-share {
    max-width: 440px;
}

/* ─── Animations ─── */
@keyframes pfModalIn {
    from { transform: translateY(12px) scale(0.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes pfEditorIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pfSavePulse {
    0%, 100% { opacity: 0; }
    10%, 80% { opacity: 1; }
}

/* ─── Shared layout primitives ─── */
.editor-bar {
    border-color: color-mix(in oklch, var(--foreground) 8%, transparent);
}
.editor-border {
    border-color: color-mix(in oklch, var(--foreground) 8%, transparent);
}
.editor-muted {
    color: var(--muted-foreground);
}
.editor-separator {
    width: 1px;
    height: 20px;
    background: color-mix(in oklch, var(--foreground) 10%, transparent);
    flex-shrink: 0;
}
.editor-hover {
    transition: all 0.15s;
}
.editor-hover:hover {
    background: color-mix(in oklch, var(--foreground) 5%, transparent);
}
.editor-danger {
    color: #E53E3E;
}
.editor-hint {
    color: var(--muted-foreground);
    opacity: 0.7;
}

/* ─── Buttons ─── */
.editor-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    transition: all 0.15s;
    flex-shrink: 0;
    overflow: visible;
    line-height: 0;
}
.editor-icon-btn svg {
    display: block;
    flex-shrink: 0;
}
.editor-icon-btn:hover {
    background: color-mix(in oklch, var(--foreground) 5%, transparent);
}
.editor-icon-btn.editor-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
.editor-btn-primary {
    background: var(--foreground);
    color: var(--background);
}
.editor-btn-primary:hover {
    opacity: 0.9;
}

/* ─── Header ─── */
.editor-filename {
    max-width: 180px;
}

/* ─── Toolbar ─── */
.editor-tool-group {
    background: color-mix(in oklch, var(--foreground) 3%, transparent);
    border-radius: 8px;
    padding: 2px 4px;
}
.editor-tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
    color: var(--muted-foreground);
    flex-shrink: 0;
    position: relative;
}
.editor-tool-btn:hover {
    background: color-mix(in oklch, var(--foreground) 8%, transparent);
    color: var(--foreground);
}
.editor-tool-btn.active {
    background: var(--foreground);
    color: var(--background);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.editor-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.editor-color-dot.active,
.editor-color-dot:hover {
    border-color: var(--foreground);
    transform: scale(1.15);
}
.editor-color-picker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.editor-select {
    height: 28px;
    border-radius: 8px;
    padding: 0 6px;
    border: 0;
    cursor: pointer;
    background: color-mix(in oklch, var(--foreground) 5%, transparent);
}
.editor-scroll-touch {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
/* Prevent toolbar button clipping */
#editor-tools-bar {
    min-height: 44px;
    overflow-x: auto;
    overflow-y: visible;
    flex-shrink: 0;
}
#editor-tools-bar .editor-tool-btn {
    min-width: 32px;
    min-height: 32px;
}

/* ─── Workspace body ─── */
.editor-body {
    flex: 1 1 auto;
    min-height: 0;
}
.editor-sidebar {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid color-mix(in oklch, var(--foreground) 6%, transparent);
    background: color-mix(in oklch, var(--foreground) 2%, transparent);
    padding: 12px 10px;
    gap: 8px;
}
.editor-workspace {
    background: color-mix(in oklch, var(--foreground) 4%, transparent);
}
.editor-canvas-wrap {
    margin: 20px auto;
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    background: #fff;
    border-radius: 4px;
    transform-origin: top center;
    flex-shrink: 0;
}

/* ─── Multi-page continuous scroll ─── */
.editor-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 10px;
    min-height: 100%;
}
.editor-page-wrap {
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
    overflow: hidden;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 0.2s;
}
.editor-page-wrap.active {
    outline-color: color-mix(in oklch, var(--foreground) 40%, transparent);
}
.editor-page-bg {
    display: block;
    border-radius: 4px;
}
.editor-page-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: auto;
    overflow: visible;
}
/* CRITICAL: Fabric.js creates .canvas-container with position:relative,
   which pushes it below the PDF. Force it to overlay. */
.editor-page-overlay .canvas-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    overflow: visible !important;
}
/* Reset box-sizing inside Fabric canvas — Tailwind's border-box breaks IText calculations */
.canvas-container,
.canvas-container * {
    box-sizing: content-box !important;
}
/* Remove thick border Fabric.js adds to upper-canvas */
.editor-page-overlay .canvas-container canvas {
    border: none !important;
    outline: none !important;
}
.editor-page-overlay .upper-canvas {
    border: none !important;
    outline: none !important;
}
.editor-page-snapshot {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}
.editor-page-label {
    text-align: center;
    font-size: 10px;
    color: var(--muted-foreground);
    padding: 4px 0 0;
    font-variant-numeric: tabular-nums;
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
}

/* ─── Layers panel (right sidebar) ─── */
.editor-layers {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid color-mix(in oklch, var(--foreground) 6%, transparent);
    background: color-mix(in oklch, var(--foreground) 1.5%, transparent);
}
.editor-layers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid color-mix(in oklch, var(--foreground) 6%, transparent);
    color: var(--muted-foreground);
}
.editor-layers-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--muted-foreground);
    transition: all 0.15s;
}
.editor-layers-clear-btn:hover {
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
    color: #E53E3E;
}
.editor-layers-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted-foreground);
}
.editor-layers-info-icon {
    opacity: 0.3;
}
.editor-layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}
.editor-layer-page-header {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
}
.editor-layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}
.editor-layer-item:hover {
    background: color-mix(in oklch, var(--foreground) 4%, transparent);
}
.editor-layer-item.active {
    background: color-mix(in oklch, var(--foreground) 7%, transparent);
}
.editor-layer-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    flex-shrink: 0;
}
.editor-layer-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--foreground);
}
.editor-layer-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.12s;
}
.editor-layer-item:hover .editor-layer-actions {
    opacity: 1;
}
.editor-layer-actions button {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--muted-foreground);
    transition: all 0.12s;
}
.editor-layer-actions button:hover {
    background: color-mix(in oklch, var(--foreground) 8%, transparent);
    color: var(--foreground);
}
.editor-layer-actions button.danger:hover {
    color: #E53E3E;
}

/* ─── Footer ─── */
.editor-footer {
    background: color-mix(in oklch, var(--foreground) 1%, transparent);
}
.editor-page-input {
    width: 32px;
    height: 24px;
    text-align: center;
    font-size: 12px;
    border-radius: 4px;
    border: 0;
    font-variant-numeric: tabular-nums;
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
    color: var(--foreground);
}
.editor-autosave {
    color: var(--muted-foreground);
    opacity: 0;
}
.editor-zoom-level {
    height: 24px;
    padding: 0 8px;
    min-width: 48px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--muted-foreground);
}
.editor-zoom-level:hover {
    background: color-mix(in oklch, var(--foreground) 5%, transparent);
}

/* ─── Sidebar thumbnails ─── */
#editor-sidebar .editor-thumb {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.15s;
    background: #fff;
    flex-shrink: 0;
    padding: 2px;
    outline: 2px solid transparent;
    outline-offset: 1px;
}
#editor-sidebar .editor-thumb:hover {
    outline-color: color-mix(in oklch, var(--foreground) 20%, transparent);
}
#editor-sidebar .editor-thumb.active {
    outline-color: var(--foreground);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
#editor-sidebar .editor-thumb canvas {
    display: block;
    width: 100%;
    height: auto;
}
#editor-sidebar .editor-thumb-label {
    text-align: center;
    font-size: 9px;
    padding: 2px 0;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}
#editor-sidebar .editor-thumb canvas {
    border: none !important;
    outline: none !important;
}
/* Lazy thumbnail placeholder */
.editor-thumb-placeholder {
    display: block;
    width: 100%;
    border-radius: 2px;
}

/* ─── Modal overlay (fixes z-[110] not compiled in Tailwind) ─── */
.editor-modal-overlay {
    z-index: 110;
}
.editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.editor-modal-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.editor-modal-card {
    background: var(--background);
    border-radius: 16px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
    animation: pfModalIn 0.25s ease-out;
}

/* ─── Signature tabs ─── */
.sig-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
}
.sig-tab:hover {
    color: var(--foreground);
}
.sig-tab.active {
    color: var(--foreground);
    border-bottom-color: var(--foreground);
}

/* ─── Signature font options ─── */
.sig-font-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1.5px solid transparent;
}
.sig-font-option:hover {
    background: color-mix(in oklch, var(--foreground) 4%, transparent);
}
.sig-font-option:has(input:checked) {
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
    border-color: color-mix(in oklch, var(--foreground) 15%, transparent);
}
.sig-font-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--foreground);
    flex-shrink: 0;
}
.sig-font-preview {
    font-size: 28px;
    line-height: 1.2;
    color: var(--foreground);
}

/* ─── Signature color dots ─── */
.sig-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.sig-color-dot.active,
.sig-color-dot:hover {
    border-color: color-mix(in oklch, var(--foreground) 50%, transparent);
    transform: scale(1.15);
}

/* ─── Signature canvas ─── */
.editor-sig-canvas {
    width: 100%;
    border-radius: 10px;
    border: 1.5px dashed color-mix(in oklch, var(--foreground) 15%, transparent);
    background: color-mix(in oklch, var(--foreground) 2%, transparent);
    cursor: crosshair;
    touch-action: none;
}
.editor-sig-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

/* ─── Signature upload zone ─── */
.editor-upload-zone {
    border: 1.5px dashed color-mix(in oklch, var(--foreground) 15%, transparent);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: color-mix(in oklch, var(--foreground) 2%, transparent);
}
.editor-upload-zone:hover,
.editor-upload-zone.drag-over {
    border-color: var(--foreground);
    background: color-mix(in oklch, var(--foreground) 5%, transparent);
}
.editor-upload-btn {
    border: 1.5px solid color-mix(in oklch, var(--foreground) 15%, transparent);
    color: var(--foreground);
}
.editor-upload-preview {
    text-align: center;
    padding: 1rem 0;
}
.editor-upload-img {
    max-height: 80px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 6px;
}

/* ─── Inputs ─── */
.editor-input {
    border: 1px solid color-mix(in oklch, var(--foreground) 12%, transparent);
    background: transparent;
    outline: none;
    transition: border-color 0.15s;
    color: var(--foreground);
}
.editor-input:focus {
    border-color: color-mix(in oklch, var(--foreground) 30%, transparent);
}
.editor-initials-col {
    width: 120px;
}
.editor-initials {
    text-transform: uppercase;
}

/* ─── Workspace scrollbar ─── */
#editor-workspace::-webkit-scrollbar { width: 8px; height: 8px; }
#editor-workspace::-webkit-scrollbar-track { background: transparent; }
#editor-workspace::-webkit-scrollbar-thumb {
    background: color-mix(in oklch, var(--foreground) 15%, transparent);
    border-radius: 4px;
}
#editor-workspace::-webkit-scrollbar-thumb:hover {
    background: color-mix(in oklch, var(--foreground) 25%, transparent);
}

/* ============================================
   Contextual text formatting bar (Canva style)
   ============================================ */
.etb-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 42px;
    border-bottom: 1px solid color-mix(in oklch, var(--foreground) 6%, transparent);
    background: color-mix(in oklch, var(--foreground) 1.5%, transparent);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    flex-shrink: 0;
}
.etb-sep {
    width: 1px;
    height: 20px;
    background: color-mix(in oklch, var(--foreground) 8%, transparent);
    flex-shrink: 0;
}
.etb-group {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Font family select */
.etb-select {
    height: 30px;
    border-radius: 6px;
    padding: 0 8px;
    border: 1px solid color-mix(in oklch, var(--foreground) 10%, transparent);
    background: transparent;
    color: var(--foreground);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s;
    outline: none;
}
.etb-select:hover, .etb-select:focus {
    border-color: color-mix(in oklch, var(--foreground) 25%, transparent);
}
.etb-font-select {
    width: 130px;
    min-width: 100px;
}

/* Font size group */
.etb-size-group {
    display: flex;
    align-items: center;
    border: 1px solid color-mix(in oklch, var(--foreground) 10%, transparent);
    border-radius: 6px;
    overflow: hidden;
    height: 30px;
    flex-shrink: 0;
}
.etb-size-btn {
    width: 26px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: all 0.12s;
    flex-shrink: 0;
}
.etb-size-btn:hover {
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
    color: var(--foreground);
}
.etb-size-input {
    width: 44px;
    height: 100%;
    text-align: center;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    border: 0;
    border-left: 1px solid color-mix(in oklch, var(--foreground) 8%, transparent);
    border-right: 1px solid color-mix(in oklch, var(--foreground) 8%, transparent);
    background: transparent;
    color: var(--foreground);
    outline: none;
    -moz-appearance: textfield;
}
.etb-size-input::-webkit-inner-spin-button,
.etb-size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Format buttons (bold, italic, underline, align) */
.etb-fmt-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--muted-foreground);
    transition: all 0.12s;
    flex-shrink: 0;
}
.etb-fmt-btn:hover {
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
    color: var(--foreground);
}
.etb-fmt-btn.active {
    background: color-mix(in oklch, var(--foreground) 10%, transparent);
    color: var(--foreground);
}

/* Color buttons */
.etb-color-btn {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
    gap: 1px;
}
.etb-color-btn:hover {
    background: color-mix(in oklch, var(--foreground) 6%, transparent);
}
.etb-color-indicator {
    display: block;
    width: 14px;
    height: 3px;
    border-radius: 1px;
}
.etb-color-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Range inputs */
.etb-range-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    color: var(--muted-foreground);
}

/* ================================================================
   HTML TEXT ENGINE — Canva-style text layer
   ================================================================ */

/* Text layer: sits above Fabric overlay (z-index 1) */
.editor-text-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none; /* enabled by JS only when text tool is active */
    overflow: visible;
}

/* ── Text object wrapper ── */
.pf-text-obj {
    position: absolute;
    box-sizing: content-box;
    outline: none;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    transform-origin: top left;
    pointer-events: auto;
    /* overflow visible so handles appear outside the box */
    overflow: visible;
}
/* Hover hint on content */
.pf-text-obj:hover .pf-text-content {
    outline: 1px dashed rgba(79, 142, 247, 0.45);
    outline-offset: 3px;
}
/* Selected: solid blue outline on content */
.pf-text-selected .pf-text-content {
    outline: 1.5px solid #4f8ef7 !important;
    outline-offset: 3px;
}

/* ── Editable text content — Canva-style ── */
.pf-text-content {
    display: inline-block;          /* auto-width: grows with text */
    white-space: nowrap;            /* single line until user sets fixed width */
    font-size: 1em;                 /* wrapper controls the px size */
    line-height: 1;
    outline: none;
    min-width: 4px;
    min-height: 1em;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    /* All font props inherited from .pf-text-obj */
    font-family: inherit;
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
    color: inherit;
    text-align: inherit;
    letter-spacing: inherit;
    background-color: inherit;
    vertical-align: top;
}
.pf-text-content:focus { caret-color: currentColor; }
/* When user manually sets a width: enable word-wrap */
.pf-text-fixed-width .pf-text-content {
    white-space: normal;
    word-break: break-word;
    display: block;
    width: 100%;
}

/* ── UI handles container (outside the text) ── */
.pf-text-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    overflow: visible;
}
.pf-text-selected .pf-text-ui { display: block; }

/* ─────────────────────────────────────
   FONT-SIZE handle — top-left corner, OUTSIDE box
   Drag down/right = bigger, up/left = smaller
───────────────────────────────────── */
.pf-handle-fontsize {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1.5px solid #4f8ef7;
    border-radius: 50%;
    cursor: nwse-resize;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, transform 0.1s;
}
.pf-handle-fontsize:hover { background: #eef3ff; transform: scale(1.15); }
/* "A" letter indicator */
.pf-handle-fontsize::after {
    content: 'A';
    font-size: 6px;
    font-family: Arial, sans-serif;
    font-weight: 700;
    color: #4f8ef7;
    line-height: 1;
    pointer-events: none;
}

/* ─────────────────────────────────────
   WIDTH handle — right-middle border (vertical bar)
───────────────────────────────────── */
.pf-handle-width {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 20px;
    background: #fff;
    border: 1.5px solid #4f8ef7;
    border-radius: 4px;
    cursor: ew-resize;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}
.pf-handle-width:hover { background: #eef3ff; }
/* grip line */
.pf-handle-width::before {
    content: '';
    display: block;
    width: 1px;
    height: 8px;
    border-left: 1px dotted #4f8ef7;
    pointer-events: none;
}

/* ─────────────────────────────────────
   BOTTOM row — ROTATE + MOVE circles
   Centered below the box, separated 18px gap
   They float independently (not attached to border)
───────────────────────────────────── */
.pf-handles-bottom {
    position: absolute;
    /* positioned via JS: left = center - 27px, top = bottom + 10px */
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: none;
    /* left / top set by updateBottomHandles() */
}

/* Both bottom handles share base style */
.pf-handle-rotate,
.pf-handle-move {
    width: 22px;
    height: 22px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    pointer-events: auto;
    box-shadow: 0 1px 5px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, box-shadow 0.12s;
    flex-shrink: 0;
}
.pf-handle-rotate:hover,
.pf-handle-move:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 7px rgba(0,0,0,0.2);
}
.pf-handle-rotate { cursor: grab; }
.pf-handle-rotate:active { cursor: grabbing; }
.pf-handle-move { cursor: move; }
.pf-handle-rotate svg,
.pf-handle-move svg { pointer-events: none; display: block; }

/* ── Layer panel: HTML text items ── */
.editor-layer-html-text {
    border-left: 2px solid #3b82f6;
}
.editor-layer-html-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #3b82f6;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}
.etb-range {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: color-mix(in oklch, var(--foreground) 12%, transparent);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.etb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--foreground);
    cursor: pointer;
}
.etb-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--foreground);
    cursor: pointer;
    border: 0;
}
