:root {
    --printer-ink: #0f172a;
    --printer-muted: #64748b;
    --printer-line: #e2e8f0;
    --printer-bg: #f8fafc;
    --printer-surface: #ffffff;
    --printer-accent: #7c3aed;
    --printer-accent-hover: #6d28d9;
    --printer-accent-glow: rgba(124, 58, 237, 0.15);
    --printer-success: #10b981;
    --printer-warning: #f59e0b;
    --printer-danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --printer-ink: #0f172a;
    --printer-muted: #64748b;
    --printer-line: #e2e8f0;
    --printer-bg: #f8fafc;
    --printer-surface: #ffffff;
}

/* ─── Global Viewport Setup for Single-View Layout ─── */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f1f5f9;
    color: var(--printer-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* The shared site navbar is fixed on most pages. This workspace keeps it in
   document flow so it cannot cover the first toolbar or an ad slot. */
.id-printer-page #global-navbar-container {
    min-height: 70px;
}

.id-printer-page .global-navbar {
    position: sticky !important;
    top: 0;
}

@media (max-width: 700px) {
    .id-printer-page #global-navbar-container {
        min-height: 60px;
    }

    .id-printer-page .global-navbar {
        height: 60px;
    }
}

/* ─── Main Workspace Shell with Top & Right Gap ─── */
.printer-shell {
    width: 100%;
    max-width: 1540px;
    min-height: calc(100vh - 100px);
    height: auto;
    max-height: none;
    margin: 18px auto 24px;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.workspace-layout-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    align-items: stretch;
}

.workspace-main-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    width: 100%;
}

/* Keep the responsive ad after the complete editor so its size never changes
   the editor's available width or height. */
.workspace-ad-rail {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
    padding: 0.75rem;
    align-self: stretch;
}

.workspace-ad-heading {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 0 0.25rem 0.5rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid var(--printer-line);
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--printer-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.workspace-ad-slot {
    width: 100%;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #fafbfc;
    border-radius: 6px;
}

.workspace-ad-slot .adsbygoogle {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 250px;
    box-sizing: border-box;
}

/* ─── Unified Compact Header Bar (Single-View App Bar) ─── */
.printer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    min-height: 56px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.app-logo-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--printer-accent-glow);
    color: var(--printer-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.printer-header h1 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--printer-ink);
    white-space: nowrap;
}

.header-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #6d28d9;
    background: #ede9fe;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* ─── Integrated Quick Presets Bar in Header ─── */
.header-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
}

.preset-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.025);
}

.preset-toolbar-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.preset-toolbar-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f5f3ff;
    color: var(--printer-accent);
    font-size: 1.05rem;
}

.preset-toolbar-heading strong,
.preset-toolbar-heading small {
    display: block;
}

.preset-toolbar-heading strong {
    color: var(--printer-ink);
    font-size: 0.78rem;
}

.preset-toolbar-heading small {
    margin-top: 0.1rem;
    color: var(--printer-muted);
    font-size: 0.66rem;
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
}

.header-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.header-action-divider {
    width: 1px;
    height: 22px;
    background: var(--printer-line);
    margin: 0 0.1rem;
}

.preset-btn {
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    color: var(--printer-muted);
    border-radius: 8px;
    padding: 0.42rem 0.65rem;
    font-size: 0.73rem;
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--printer-accent);
    color: var(--printer-accent);
    background: #ffffff;
}

.preset-btn.active {
    background: var(--printer-accent-glow);
    border-color: var(--printer-accent);
    color: var(--printer-accent);
    font-weight: 700;
}

/* ─── Standard Buttons ─── */
.button {
    border: 0;
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button.primary {
    background: var(--printer-accent);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--printer-accent-glow);
}

.button.primary:hover:not(:disabled) {
    background: var(--printer-accent-hover);
}

.button.secondary {
    background: #ffffff;
    color: var(--printer-ink);
    border: 1px solid var(--printer-line);
}

.button.secondary:hover:not(:disabled) {
    border-color: var(--printer-accent);
    color: var(--printer-accent);
}

.button.small {
    padding: 0.3rem 0.55rem;
    font-size: 0.74rem;
    border-radius: 6px;
}

.button.large {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    border-radius: 8px;
}

.link-btn {
    background: transparent;
    border: 0;
    color: var(--printer-accent);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════════════
   CANVA-STYLE TOP CONTEXTUAL ACTION BAR
   ══════════════════════════════════════════════════════════════════════════ */
.contextual-top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid var(--printer-line);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    overflow: visible;
    flex-shrink: 0;
    min-height: 58px;
}

.contextual-left {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.1rem 0.65rem;
    border-left: 1px solid #edf0f5;
}

.toolbar-group:first-child {
    border-left: 0;
    padding-left: 0.15rem;
}

.toolbar-group-label {
    color: #64748b;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    line-height: 1;
    text-transform: uppercase;
}

.toolbar-group-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.toolbar-document-group .dim-display-group {
    margin-top: 0.1rem;
}

.contextual-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.35rem;
    border-left: 1px solid var(--printer-line);
    padding-left: 0.75rem;
    min-width: max-content;
}

/* ── Document Type Picker Dropdown in Contextual Bar ── */
.doc-type-picker-wrap {
    position: relative;
}

.doc-dropdown-trigger {
    background: #f5f3ff;
    border: 1.5px solid var(--printer-accent);
    color: var(--printer-accent);
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.doc-dropdown-trigger:hover {
    background: #ede9fe;
}

.badge-size-chip {
    background: var(--printer-accent);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 2px;
}

.doc-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 255px;
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18);
    z-index: 300;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-header {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--printer-line);
    margin-bottom: 0.2rem;
}

.doc-opt-btn {
    border: 0;
    background: transparent;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-align: left;
    transition: background 0.15s ease;
    width: 100%;
}

.doc-opt-btn:hover {
    background: #f8fafc;
}

.doc-opt-btn.active {
    background: var(--printer-accent-glow);
}

.doc-opt-icon {
    font-size: 1.15rem;
    color: var(--printer-accent);
    flex-shrink: 0;
}

.doc-opt-text strong {
    display: block;
    font-size: 0.78rem;
    color: #0f172a;
}

.doc-opt-text small {
    display: block;
    font-size: 0.68rem;
    color: #64748b;
}

/* ── Live Dimension Readout Chip ── */
.dim-display-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dim-chip {
    background: #f1f5f9;
    border: 1px solid var(--printer-line);
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.dim-label {
    color: #64748b;
    font-size: 0.68rem;
}

.topbar-btn {
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    color: #1e293b;
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.topbar-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.topbar-btn.active {
    background: var(--printer-accent);
    border-color: var(--printer-accent);
    color: #ffffff;
}

.topbar-btn.crown-btn i {
    color: #f59e0b;
}

.v-divider {
    width: 1px;
    height: 16px;
    background: var(--printer-line);
}

.color-swatches-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.color-swatch-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease;
}

.color-swatch-dot:hover {
    transform: scale(1.2);
}

.color-swatch-dot.active {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px #fff;
}

.color-white { background: #ffffff; border: 1px solid #cbd5e1; }
.color-transparent { background: repeating-conic-gradient(#808080 0% 25%, #fff 0% 50%) 50% / 8px 8px; border: 1px solid #94a3b8; }
.color-saffron { background: #ff9933; }
.color-green { background: #138808; }
.color-blue { background: #000080; }

.icon-tool-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--printer-line);
    border-radius: 6px;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.icon-tool-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.icon-tool-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.icon-tool-btn-light {
    width: 28px;
    height: 28px;
    border: 1px solid var(--printer-line);
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.icon-tool-btn-light:hover {
    background: #f1f5f9;
}

/* ══════════════════════════════════════════════════════════════════════════
   STUDIO LAYOUT & "EDIT IMAGE" SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */
.studio {
    flex: 1 1 auto;
    min-height: 680px;
    height: calc(100vh - 165px);
    max-height: 960px;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    grid-template-rows: 100%;
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    position: relative;
}

.studio.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.studio.sidebar-collapsed .edit-image-sidebar {
    display: none !important;
}

/* Dedicated Bottom Hub (Below Studio) */
.studio-bottom-hub {
    width: 100%;
    max-width: 1240px;
    margin: 28px auto 40px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Professional Features & Specifications Guide */
.hub-content-wrap {
    margin-top: 1rem;
}

.hub-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hub-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--printer-accent);
    background: #f5f3ff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
}

.hub-header h2 {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--printer-ink);
}

.hub-header p {
    margin: 0 auto;
    max-width: 680px;
    font-size: 0.88rem;
    color: var(--printer-muted);
    line-height: 1.5;
}

.hub-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.hub-feature-card {
    background: #ffffff;
    border: 1px solid var(--printer-line);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border-color: #cbd5e1;
}

.hub-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f5f3ff;
    color: var(--printer-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 0.85rem;
}

.hub-feature-card h3 {
    margin: 0 0 0.4rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--printer-ink);
}

.hub-feature-card p {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: var(--printer-muted);
    line-height: 1.45;
    flex-grow: 1;
}

.hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    align-self: flex-start;
}

.edit-image-sidebar {
    padding: 0.85rem;
    border-right: 1px solid var(--printer-line);
    background: #ffffff;
    color: #0f172a;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.sidebar-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--printer-line);
}

.sidebar-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-close-btn {
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sidebar-meta-link {
    font-size: 0.7rem;
    color: var(--printer-accent);
    font-weight: 700;
}

/* ── Document Preset 2-Column Grid in Sidebar ── */
.doc-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.doc-preset-card {
    background: #f8fafc;
    border: 1.5px solid var(--printer-line);
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
}

.doc-preset-card:hover {
    border-color: var(--printer-accent);
    background: #f5f3ff;
}

.doc-preset-card.active {
    border-color: var(--printer-accent);
    background: var(--printer-accent-glow);
}

.doc-preset-icon {
    font-size: 1.1rem;
    color: var(--printer-accent);
    margin-bottom: 0.1rem;
}

.doc-preset-name {
    font-size: 0.73rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.doc-preset-cm {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}

/* Segmented Control */
.segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 6px;
}

.segment-btn {
    border: 0;
    background: transparent;
    color: #475569;
    border-radius: 5px;
    padding: 0.35rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
}

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

/* Circular Tools Grid in Light Theme */
.tools-circle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem 0.4rem;
}

.circle-tool-card {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
    padding: 0;
}

.circle-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid var(--printer-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.circle-tool-card:hover .circle-icon-wrap {
    transform: translateY(-2px);
    border-color: var(--printer-accent);
    background: #f5f3ff;
    color: var(--printer-accent);
}

.circle-icon-wrap.ai-glow {
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
    border-color: #c4b5fd;
    color: #7c3aed;
}

.circle-tool-card span {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.card-badge-new {
    position: absolute;
    top: -3px;
    right: 8px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 999px;
    z-index: 2;
}

.card-badge-crown {
    position: absolute;
    top: -3px;
    right: 8px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 999px;
    z-index: 2;
}

/* Adjust Sliders Box */
.adjust-sliders-box {
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    border-radius: 8px;
    padding: 0.65rem;
}

.sliders-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.4rem;
}

.control-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.control-row output {
    color: var(--printer-accent);
    font-weight: 800;
}

.control-row input[type="range"] {
    width: 100%;
    accent-color: var(--printer-accent);
}

/* Document Profiles */
.style-match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}

.style-card {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
}

.style-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1.5px solid var(--printer-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #64748b;
    transition: all 0.15s ease;
}

.style-card.active .style-preview {
    border-color: var(--printer-accent);
    background: #f5f3ff;
    color: var(--printer-accent);
}

.style-card span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}

/* Filters Carousel */
.filters-carousel {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
}

.filter-card {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    flex: 0 0 46px;
}

.filter-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    border: 1.5px solid var(--printer-line);
    background-size: cover;
}

.normal-filter { background: #e2e8f0; }
.eco-filter { background: #dcfce7; }
.warm-filter { background: #fed7aa; }
.cool-filter { background: #bae6fd; }
.vivid-filter { background: linear-gradient(135deg, #c4b5fd, #f472b6); }
.mono-filter { background: #475569; }

.filter-card.active .filter-thumb {
    border-color: var(--printer-accent);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.filter-card span {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

/* Upload Dropzone (Compact in Sidebar) */
.upload-zone.compact {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 0.65rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.15s ease;
}

.upload-zone.compact:hover,
.upload-zone.compact.dragover {
    border-color: var(--printer-accent);
    background: #f5f3ff;
}

.upload-zone.compact i {
    font-size: 1.4rem;
    color: var(--printer-accent);
}

.upload-zone.compact strong {
    color: #0f172a;
    font-size: 0.78rem;
}

.upload-zone.compact span {
    font-size: 0.68rem;
}

.upload-zone input {
    display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   MAIN CANVAS & A4 PRINT AREA
   ══════════════════════════════════════════════════════════════════════════ */
.canvas-area {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.canvas-viewport {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 0.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

#pagesHost {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.a4-canvas {
    position: relative;
    width: 794px;
    height: 1123px;
    background: #ffffff;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.16);
    transform-origin: top center;
    overflow: hidden;
    user-select: none;
    flex-shrink: 0;
}

.a4-canvas:not(.current-page) {
    display: none;
}

.a4-canvas.show-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(124, 58, 237, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(124, 58, 237, 0.08) 1px, transparent 1px),
        linear-gradient(to right, rgba(124, 58, 237, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(124, 58, 237, 0.18) 1px, transparent 1px);
    background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px;
    pointer-events: none;
    z-index: 1;
}

.a4-canvas::after {
    content: "";
    position: absolute;
    inset: 19px;
    border: 1px dashed rgba(100, 116, 139, 0.22);
    pointer-events: none;
    z-index: 1;
}

/* ── Interactive Empty Sheet Dropzone ── */
.canvas-empty {
    position: absolute;
    inset: 40px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.5rem;
    box-sizing: border-box;
    color: #64748b;
    background: #ffffff;
    z-index: 5;
}

.empty-start-panel {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.75rem);
    box-sizing: border-box;
    border: 1px solid #e7e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
    box-shadow: 0 14px 42px rgba(39, 34, 68, 0.08);
}

.empty-start-heading {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 1.25rem;
}

.empty-start-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    border-radius: 14px;
    background: #f1eaff;
    color: var(--printer-accent);
    font-size: 1.5rem;
}

.empty-step-label {
    margin: 0 0 0.35rem;
    color: var(--printer-accent);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.empty-start-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.15rem, 2.5vw, 1.55rem);
    letter-spacing: -0.03em;
}

.empty-start-heading p {
    max-width: 430px;
    margin: 0.45rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.empty-doc-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.empty-doc-type-card {
    min-height: 96px;
    padding: 0.7rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.empty-doc-type-card > i {
    color: var(--printer-accent);
    font-size: 1.35rem;
}

.empty-doc-type-card > span {
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1.25;
}

.empty-doc-type-card > small {
    color: #64748b;
    font-size: 0.62rem;
    line-height: 1.25;
}

.empty-doc-type-card:hover {
    transform: translateY(-1px);
    border-color: #a78bfa;
    background: #fcfaff;
}

.empty-doc-type-card.active {
    border-color: var(--printer-accent);
    background: #f5f0ff;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.empty-start-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.empty-selected-format {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    color: #475569;
    font-size: 0.73rem;
}

.empty-selected-format > i {
    color: #059669;
    font-size: 1rem;
}

.empty-selected-format strong {
    color: #0f172a;
}

.empty-selected-format span {
    color: #64748b;
}

.empty-quick-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.empty-btn {
    border: 1px solid var(--printer-line);
    background: #ffffff;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--printer-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
}

.empty-btn.empty-start-upload {
    min-height: 42px;
    padding: 0.65rem 0.95rem;
    border-color: var(--printer-accent);
    background: var(--printer-accent);
    color: #ffffff;
}

.empty-btn.empty-start-upload:hover {
    background: var(--printer-accent-hover);
    color: #ffffff;
}

.empty-upload-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.8rem 0 0;
    color: #64748b;
    font-size: 0.66rem;
    text-align: center;
}

.empty-btn:hover {
    border-color: var(--printer-accent);
    color: var(--printer-accent);
    transform: translateY(-1px);
}

/* ── Canvas Drag & Drop Overlay ── */
.canvas-drop-overlay {
    position: absolute;
    inset: 12px;
    background: rgba(245, 243, 255, 0.94);
    border: 3px dashed var(--printer-accent);
    border-radius: 14px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.15);
}

.canvas-drop-message {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.drop-pulse-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--printer-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 0 0 12px rgba(124, 58, 237, 0.15);
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.canvas-drop-message h3 {
    margin: 0.4rem 0 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.canvas-drop-message p {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}

/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM CANVAS BAR
   ══════════════════════════════════════════════════════════════════════════ */
.bottom-canvas-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.85rem;
    background: #ffffff;
    color: #0f172a;
    border-top: 1px solid var(--printer-line);
    z-index: 50;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    min-height: 36px;
}

.bottom-left-group, .bottom-right-group, .bottom-center-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.bottom-action-btn {
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    color: #0f172a;
    border-radius: 6px;
    padding: 0.28rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.bottom-action-btn:hover {
    background: var(--printer-accent);
    border-color: var(--printer-accent);
    color: #ffffff;
}

.footer-badge {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.zoom-control-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
}

.zoom-control-inline input[type="range"] {
    width: 80px;
    accent-color: var(--printer-accent);
}

/* ══════════════════════════════════════════════════════════════════════════
   BOUNDING BOX, HOVER CM TOOLTIP & FLOATING ACTIONS ON CARD
   ══════════════════════════════════════════════════════════════════════════ */
.canvas-item {
    position: absolute;
    box-sizing: border-box;
    cursor: move;
    user-select: none;
    touch-action: none;
    transform-origin: center center;
    z-index: 2;
}

.canvas-item.has-cut-border {
    border: 1px solid #000000;
}

.canvas-item.has-rounded-corners img {
    border-radius: 8px;
}

.canvas-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    pointer-events: none;
}

.canvas-crop-overlay {
    position: absolute;
    inset: 0;
    z-index: 300;
    display: none;
    touch-action: none;
}

.canvas-item.crop-mode {
    cursor: default;
}

.canvas-item.crop-mode .card-dim-tooltip,
.canvas-item.crop-mode .item-top-toolbar,
.canvas-item.crop-mode > .box-handle,
.canvas-item.crop-mode > .rotate-stalk-container {
    visibility: hidden;
}

.canvas-item.crop-mode .canvas-crop-overlay {
    display: block;
}

.canvas-item.crop-processing .canvas-crop-overlay {
    pointer-events: none;
    opacity: 0.65;
}

.canvas-crop-toolbar {
    position: absolute;
    left: 50%;
    top: calc(-18px * var(--crop-ui-scale, 1));
    transform: translateX(-50%) scale(var(--crop-ui-scale, 1));
    transform-origin: center bottom;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: #171329;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
    color: #ffffff;
    white-space: nowrap;
    z-index: 3;
}

.canvas-crop-toolbar > span {
    padding: 0 5px;
    font-size: 0.72rem;
    font-weight: 750;
}

.canvas-crop-toolbar button {
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.canvas-crop-toolbar button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.canvas-crop-toolbar .canvas-crop-apply {
    background: #7c3aed;
}

.canvas-crop-toolbar .canvas-crop-apply:hover {
    background: #6d28d9;
}

.canvas-crop-window {
    position: absolute;
    min-width: 5%;
    min-height: 5%;
    box-sizing: border-box;
    border: 2px dashed #ffffff;
    z-index: 1;
    cursor: move;
    touch-action: none;
}

.canvas-crop-shade {
    position: absolute;
    display: block;
    background: rgba(15, 23, 42, 0.58);
    pointer-events: none;
}

.canvas-crop-handle {
    position: absolute;
    z-index: 2;
    display: block;
    width: var(--crop-handle-size, 12px);
    height: var(--crop-handle-size, 12px);
    box-sizing: border-box;
    border: var(--crop-handle-border, 2px) solid #7c3aed;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.45);
    touch-action: none;
}

.canvas-crop-handle.nw { left: var(--crop-handle-offset-negative, -7px); top: var(--crop-handle-offset-negative, -7px); cursor: nwse-resize; }
.canvas-crop-handle.ne { right: var(--crop-handle-offset-negative, -7px); top: var(--crop-handle-offset-negative, -7px); cursor: nesw-resize; }
.canvas-crop-handle.se { right: var(--crop-handle-offset-negative, -7px); bottom: var(--crop-handle-offset-negative, -7px); cursor: nwse-resize; }
.canvas-crop-handle.sw { left: var(--crop-handle-offset-negative, -7px); bottom: var(--crop-handle-offset-negative, -7px); cursor: nesw-resize; }
.canvas-crop-handle.n,
.canvas-crop-handle.s {
    left: 50%;
    margin-left: var(--crop-handle-half-negative, -6px);
    width: var(--crop-handle-size, 12px);
    height: var(--crop-edge-size, 8px);
    border-radius: 5px;
    cursor: ns-resize;
}
.canvas-crop-handle.n { top: var(--crop-edge-offset-negative, -5px); }
.canvas-crop-handle.s { bottom: var(--crop-edge-offset-negative, -5px); }
.canvas-crop-handle.e,
.canvas-crop-handle.w {
    top: 50%;
    margin-top: var(--crop-handle-half-negative, -6px);
    width: var(--crop-edge-size, 8px);
    height: var(--crop-handle-size, 12px);
    border-radius: 5px;
    cursor: ew-resize;
}
.canvas-crop-handle.e { right: var(--crop-edge-offset-negative, -5px); }
.canvas-crop-handle.w { left: var(--crop-edge-offset-negative, -5px); }

.canvas-item.selected {
    border: 2px solid #7c3aed !important;
    z-index: 100;
}

/* ── Live CM Tooltip on Hover ── */
.card-dim-tooltip {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 250;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: none;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.01em;
}

.card-dim-tooltip .dim-cm-badge {
    background: #7c3aed;
    color: #ffffff;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}

/* Tooltip is shown on hover only when item is NOT selected */
.canvas-item:not(.selected):hover .card-dim-tooltip,
.canvas-item.is-resizing:not(.selected) .card-dim-tooltip {
    display: flex;
}

.canvas-item.selected .card-dim-tooltip {
    display: none !important;
}

/* Floating top toolbar directly above card */
.item-top-toolbar {
    position: absolute;
    left: 50%;
    top: -50px;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 3px 6px 3px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    z-index: 250;
    pointer-events: auto;
    white-space: nowrap;
    user-select: none;
    animation: floatToolbarIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatToolbarIn {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.canvas-item.near-top .item-top-toolbar {
    top: auto;
    bottom: -50px;
}

.canvas-item:not(.selected) .item-top-toolbar,
.canvas-item:not(.selected) .box-handle,
.canvas-item:not(.selected) .rotate-stalk-container {
    display: none !important;
}

/* Document & Size Info inside Floating Bar */
.tb-doc-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-right: 2px;
    cursor: default;
}

.tb-doc-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tb-doc-size {
    font-size: 0.68rem;
    font-weight: 800;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Snap PVC Button */
.tb-snap-btn {
    background: rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tb-snap-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #8b5cf6;
    transform: scale(1.04);
}

.tb-snap-btn.needs-snap {
    background: rgba(234, 88, 12, 0.32);
    border-color: #fb923c;
    color: #fed7aa;
    animation: pulseSnap 1.8s infinite;
}

@keyframes pulseSnap {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); box-shadow: 0 0 10px rgba(251, 146, 60, 0.5); }
}

.tb-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 2px;
}

/* Action Icon Buttons */
.item-top-toolbar .tb-btn {
    background: transparent;
    border: 0;
    color: #f1f5f9;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    opacity: 0.88;
}

.item-top-toolbar .tb-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    color: #a78bfa;
}

.item-top-toolbar .tb-btn.tb-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* Dropdown Menu in Toolbar */
.tb-dropdown {
    position: relative;
    display: inline-flex;
}

.tb-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
}

.tb-dropdown-menu.hidden {
    display: none;
}

.tb-dropdown-header {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 4px 8px 2px;
}

.tb-dropdown-menu button {
    background: transparent;
    border: 0;
    color: #f1f5f9;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 9px;
    border-radius: 6px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.tb-dropdown-menu button:hover {
    background: rgba(124, 58, 237, 0.25);
    color: #c4b5fd;
}

/* 4 Corner Circular Handles */
.box-handle.corner-tl,
.box-handle.corner-tr,
.box-handle.corner-br,
.box-handle.corner-bl {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #7c3aed;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 120;
}

.box-handle.corner-tl { left: -7px; top: -7px; cursor: nwse-resize; }
.box-handle.corner-tr { right: -7px; top: -7px; cursor: nesw-resize; }
.box-handle.corner-br { right: -7px; bottom: -7px; cursor: nwse-resize; }
.box-handle.corner-bl { left: -7px; bottom: -7px; cursor: nesw-resize; }

/* 4 Edge Pill Handles */
.box-handle.edge-top,
.box-handle.edge-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 7px;
    background: #ffffff;
    border: 2px solid #7c3aed;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 120;
    cursor: ns-resize;
}

.box-handle.edge-top { top: -5px; }
.box-handle.edge-bottom { bottom: -5px; }

.box-handle.edge-left,
.box-handle.edge-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 22px;
    background: #ffffff;
    border: 2px solid #7c3aed;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 120;
    cursor: ew-resize;
}

.box-handle.edge-left { left: -5px; }
.box-handle.edge-right { right: -5px; }

/* Bottom Rotation Handle */
.rotate-stalk-container {
    position: absolute;
    left: 50%;
    bottom: -38px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 150;
    cursor: grab;
}

.rotate-circle-btn {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.rotate-circle-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    transform: scale(1.08);
}

/* ══════════════════════════════════════════════════════════════════════════
   SMART DETECTION NOTIFICATION BANNER / TOAST
   ══════════════════════════════════════════════════════════════════════════ */
.smart-detect-toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    z-index: 1000;
    animation: toastPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes toastPop {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-icon-wrap {
    color: #f59e0b;
    font-size: 1.15rem;
    display: flex;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-content strong {
    font-size: 0.78rem;
    color: #ffffff;
}

.toast-content span {
    font-size: 0.68rem;
    color: #94a3b8;
}

.toast-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toast-action-btn {
    border: 0;
    background: var(--printer-accent);
    color: #ffffff;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.toast-action-btn:hover {
    background: var(--printer-accent-hover);
}

.toast-close-btn {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
}

.toast-close-btn:hover {
    color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   DOCUMENT SELECTOR MODAL ("What do you want to print?")
   ══════════════════════════════════════════════════════════════════════════ */
.doc-select-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.doc-select-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 3rem);
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--printer-line);
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.doc-select-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.3rem 1.6rem;
    border-bottom: 1px solid var(--printer-line);
}

.doc-select-header h2 {
    margin: 0.2rem 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.doc-select-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.doc-select-body {
    padding: 1.2rem 1.6rem;
    overflow-y: auto;
}

.doc-choice-cards {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.doc-modal-choice-card {
    border: 1.5px solid var(--printer-line);
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.doc-modal-choice-card:hover {
    border-color: var(--printer-accent);
    background: #f5f3ff;
    transform: translateY(-1px);
}

.choice-icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--printer-accent-glow);
    color: var(--printer-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.choice-info {
    flex: 1;
}

.choice-info strong {
    display: block;
    font-size: 0.9rem;
    color: #0f172a;
}

.choice-info span {
    display: block;
    font-size: 0.76rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.choice-size-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6d28d9;
    background: #ede9fe;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.choice-arrow {
    font-size: 1.1rem;
    color: #94a3b8;
}

.doc-modal-choice-card:hover .choice-arrow {
    color: var(--printer-accent);
    transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════════════════════
   SMART DOCUMENT INTAKE ENGINE
   ══════════════════════════════════════════════════════════════════════════ */
.intake-dialog-v2 {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100vh - 2.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 30px 100px rgba(15, 23, 42, 0.28);
    border: 1px solid var(--printer-line);
}

.intake-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--printer-line);
    background: #ffffff;
}

.intake-eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.intake-header-info h2 {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.intake-header-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.intake-close-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--printer-line);
    border-radius: 50%;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s ease;
}

.intake-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.intake-body-v2 {
    padding: 1.2rem 1.6rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.intake-hero-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #166534;
}

.intake-hero-banner i {
    font-size: 1.8rem;
    color: #16a34a;
    flex-shrink: 0;
}

.intake-hero-banner strong {
    display: block;
    font-size: 0.9rem;
    color: #14532d;
}

.intake-hero-banner span {
    font-size: 0.78rem;
    color: #15803d;
}

.audit-section-title, .workflow-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.review-list-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.review-card-v2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
}

.review-card-thumb-v2 {
    width: 68px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--printer-line);
}

.review-card-info-v2 {
    flex: 1;
}

.review-card-info-v2 h4 {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    color: #0f172a;
}

.review-meta-v2 {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tag-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.doc-verified { background: #dcfce7; color: #166534; }
.doc-neutral { background: #f1f5f9; color: #475569; }
.issue-amber { background: #fef3c7; color: #92400e; }

.review-score-v2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--printer-accent);
    text-align: right;
}

.review-score-v2 small {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

.workflow-cards-v2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.wf-card-v2 {
    border-radius: 14px;
    border: 1.5px solid var(--printer-line);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.wf-card-v2.auto-highlight {
    border-color: var(--printer-accent);
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 8px 25px var(--printer-accent-glow);
}

.wf-pill-badge {
    font-size: 0.66rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.wf-pill-badge.primary { background: var(--printer-accent); color: #ffffff; }
.wf-pill-badge.secondary { background: #f1f5f9; color: #475569; }

.wf-card-header h3 {
    margin: 0.15rem 0 0.3rem;
    font-size: 1.05rem;
    color: #0f172a;
}

.wf-card-header p {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

.wf-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wf-checklist li {
    font-size: 0.76rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wf-checklist i {
    color: var(--printer-accent);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.wf-main-btn {
    margin-top: auto;
    width: 100%;
}

.intake-privacy-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--printer-line);
    font-size: 0.74rem;
    color: #64748b;
}

.intake-privacy-banner i {
    font-size: 1.3rem;
    color: #10b981;
}

/* ══════════════════════════════════════════════════════════════════════════
   MODAL BACKDROPS & STAGES (CROP, ERASER, PRINT)
   ══════════════════════════════════════════════════════════════════════════ */
.crop-backdrop, .intake-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.crop-modal, .eraser-modal, .intake-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.crop-dialog, .eraser-dialog {
    position: relative;
    width: min(840px, 100%);
    max-height: calc(100vh - 2rem);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--printer-line);
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--printer-line);
}

.crop-header h2 {
    margin: 0.15rem 0 0.2rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.crop-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
}

.editor-close {
    border: 1px solid var(--printer-line);
    background: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-stage, .eraser-stage {
    flex: 1;
    min-height: 340px;
    max-height: 480px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-stage canvas, .eraser-stage canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.crop-overlay {
    position: absolute;
    inset: 0;
    pointer-events: auto;
}

.crop-overlay svg {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-overlay polygon {
    fill: rgba(124, 58, 237, 0.18);
    stroke: #7c3aed;
    stroke-width: 2;
    cursor: move;
    pointer-events: auto;
}

.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7c3aed;
    border: 2px solid #ffffff;
    transform: translate(-50%, -50%);
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.crop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.4rem;
    border-top: 1px solid var(--printer-line);
    background: #f8fafc;
}

.crop-tools, .crop-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.brush-size-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #1e293b;
}

.brush-size-control input {
    width: 80px;
    accent-color: var(--printer-accent);
}

.editor-reset {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   PRINT MODAL (SPECIFIC PAGE SELECTOR)
   ══════════════════════════════════════════════════════════════════════════ */
.print-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.print-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 2.5rem);
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--printer-line);
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.print-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--printer-line);
}

.print-modal-header h2 {
    margin: 0.15rem 0 0.2rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.print-modal-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
}

.print-modal-body {
    padding: 1.1rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.print-option-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.print-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.page-select-radios, .ink-mode-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.print-radio-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid var(--printer-line);
    cursor: pointer;
    transition: all 0.15s ease;
    background: #f8fafc;
}

.print-radio-card input[type="radio"] {
    accent-color: var(--printer-accent);
}

.print-radio-card div strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.print-radio-card div small {
    font-size: 0.72rem;
    color: #64748b;
}

.print-radio-card.active, .print-radio-card:has(input:checked) {
    border-color: var(--printer-accent);
    background: #f5f3ff;
}

.ink-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid var(--printer-line);
    cursor: pointer;
    transition: all 0.15s ease;
    background: #f8fafc;
}

.ink-mode-card input[type="radio"] {
    accent-color: var(--printer-accent);
    margin-top: 0.2rem;
}

.ink-mode-content strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.ink-mode-content p {
    font-size: 0.72rem;
    color: #64748b;
    margin: 0.15rem 0 0;
    line-height: 1.35;
}

.ink-mode-card.active, .ink-mode-card:has(input:checked) {
    border-color: var(--printer-accent);
    background: #f5f3ff;
}

.ink-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-bottom: 0.15rem;
}

.ink-pill-tag.eco { background: #dcfce7; color: #166534; }
.ink-pill-tag.xerox { background: #e2e8f0; color: #334155; }
.ink-pill-tag.color { background: #fef3c7; color: #92400e; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--printer-accent);
}

.print-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1.5rem 1.1rem;
    border-top: 1px solid var(--printer-line);
}

/* ── Topbar Snap PVC Pill ── */
.snap-pvc-pill-btn {
    background: rgba(124, 58, 237, 0.12) !important;
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    color: #6d28d9 !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.15s ease !important;
}

.snap-pvc-pill-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
    transform: scale(1.03) !important;
}

/* ── Keyboard Shortcuts Modal ── */
.shortcuts-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.shortcuts-dialog {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shortcuts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--printer-line);
    background: #f8fafc;
}

.shortcuts-modal-header h2 {
    margin: 0.15rem 0 0.2rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.shortcuts-modal-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
}

.shortcuts-modal-body {
    padding: 1.2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.shortcut-category {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.shortcut-category h3 {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcut-category h3 i {
    color: #7c3aed;
    font-size: 1rem;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
}

.shortcut-keys {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #64748b;
}

.shortcut-row kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: 2px solid #94a3b8;
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shortcut-desc {
    color: #334155;
    text-align: right;
    font-size: 0.75rem;
}

.shortcuts-pro-tip {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #5b21b6;
    font-size: 0.8rem;
    line-height: 1.45;
}

.shortcuts-pro-tip i {
    font-size: 1.4rem;
    color: #7c3aed;
    flex-shrink: 0;
    margin-top: 2px;
}

.shortcuts-pro-tip strong {
    color: #4c1d95;
    display: block;
    margin-bottom: 2px;
}

.shortcuts-pro-tip code {
    background: rgba(124, 58, 237, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    color: #6d28d9;
}

.shortcuts-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--printer-line);
    background: #f8fafc;
}

/* ── Desktop-Grade Right-Click Card Context Menu ── */
.card-context-menu {
    position: fixed;
    z-index: 1200;
    background: #0f172ae8;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 6px;
    min-width: 220px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: ctxPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-context-menu.hidden {
    display: none !important;
}

@keyframes ctxPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.card-context-menu button {
    background: transparent;
    border: 0;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
    width: 100%;
}

.card-context-menu button span.ctx-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-context-menu button i {
    font-size: 1rem;
    color: #a78bfa;
}

.card-context-menu button kbd {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.card-context-menu button:hover {
    background: rgba(124, 58, 237, 0.35);
    color: #ffffff;
}

.card-context-menu button.ctx-danger {
    color: #fca5a5;
}

.card-context-menu button.ctx-danger i {
    color: #f87171;
}

.card-context-menu button.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

.ctx-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 4px 0;
}

.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    html, body {
        overflow: auto;
        height: auto;
    }
    .printer-shell {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-top: 8px;
    }
    .printer-header {
        align-items: flex-start;
    }
    .header-actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
    .preset-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .header-presets {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    .contextual-top-bar {
        grid-template-columns: minmax(0, 1fr);
    }
    .contextual-right {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        border-left: 0;
        border-top: 1px solid var(--printer-line);
        padding: 0.55rem 0 0;
    }
    .studio {
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(560px, 72vh) auto;
    }
    .edit-image-sidebar {
        grid-row: 2;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--printer-line);
    }
    .canvas-area {
        grid-row: 1;
        min-height: 560px;
    }
    .canvas-viewport {
        align-items: flex-start;
    }
    #pagesHost {
        margin: 0 auto;
    }
    .a4-canvas {
        transform-origin: top center;
    }
    .canvas-empty {
        justify-content: flex-start;
    }
    .empty-start-panel {
        margin: 0 auto;
    }
    .workflow-cards-v2 {
        grid-template-columns: 1fr;
    }
    .hub-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1259px) {
    .printer-shell {
        padding: 0 16px 20px;
    }
}

@media (max-width: 700px) {
    .contextual-top-bar {
        display: none;
    }
    .printer-header {
        padding: 0.6rem;
    }
    .header-title-wrap {
        flex-wrap: wrap;
        gap: 0.2rem 0.4rem;
    }
    .printer-header h1 {
        font-size: 0.9rem;
    }
    .header-sub-badge {
        font-size: 0.6rem;
    }
    .header-actions {
        justify-content: flex-end;
        gap: 0.3rem;
    }
    .header-actions .button.small {
        padding: 0.35rem 0.45rem;
        font-size: 0.68rem;
    }
    .preset-toolbar {
        gap: 0.55rem;
        padding: 0.6rem;
    }
    .preset-toolbar-heading {
        width: 100%;
    }
    .header-presets {
        gap: 0.3rem;
    }
    .preset-btn {
        padding: 0.38rem 0.5rem;
        font-size: 0.68rem;
    }
    .contextual-top-bar {
        padding: 0.45rem;
        gap: 0.4rem;
    }
    .contextual-left {
        gap: 0.35rem;
    }
    .toolbar-group {
        flex: 1 1 auto;
        padding: 0.35rem 0.4rem;
        border: 1px solid #edf0f5;
        border-radius: 8px;
    }
    .toolbar-document-group {
        flex-basis: 100%;
    }
    .toolbar-group-controls {
        gap: 0.3rem;
    }
    .toolbar-document-group .dim-display-group {
        flex-wrap: wrap;
    }
    .contextual-right {
        justify-content: space-between;
    }
    .printer-shell {
        padding-left: 6px;
        padding-right: 6px;
    }
    .hub-features-grid {
        grid-template-columns: 1fr;
    }
    .canvas-empty {
        inset: 22px;
        padding: 0.5rem;
    }
    .empty-start-panel {
        padding: 0.9rem;
        border-radius: 14px;
    }
    .empty-doc-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }
    .empty-doc-type-card {
        min-height: 76px;
        padding: 0.45rem 0.3rem;
    }
    .empty-doc-type-card > span {
        font-size: 0.7rem;
    }
    .empty-doc-type-card > small {
        font-size: 0.58rem;
    }
    .empty-start-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .empty-selected-format {
        justify-content: center;
    }
    .empty-start-upload {
        justify-content: center;
    }
    .hub-header h2 {
        font-size: 1.25rem;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   PRECISION PRINT STYLES (AIRTIGHT HEADER REMOVAL & 1:1 A4 OUTPUT)
   ══════════════════════════════════════════════════════════════════════════ */
@media print {
    /* ── Hide ALL site navigation, headers, tools, chrome, modals, toasts ── */
    #global-navbar-container,
    #global-navbar,
    .global-navbar,
    .global-ad-container,
    .top-nav-gap-zone,
    .workspace-ad-rail,

    .studio-bottom-hub,
    .adsbygoogle,
    .google-auto-placed,
    .whatsapp-float,
    header,
    nav,
    .printer-header,
    .header-presets,
    .preset-toolbar,
    .preset-bar,
    .contextual-top-bar,
    .bottom-canvas-bar,
    .edit-image-sidebar,
    .studio > aside,
    .item-top-toolbar,
    .box-handle,
    .rotate-stalk-container,
    .canvas-empty,
    .intake-modal,
    .eraser-modal,
    .crop-modal,
    .print-modal,
    .doc-select-modal,
    .shortcuts-modal,
    .card-context-menu,
    .smart-detect-toast,
    .canvas-drop-overlay,
    .card-dim-tooltip,
    #dropZone {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        position: absolute !important;
        top: -99999px !important;
        left: -99999px !important;
        pointer-events: none !important;
    }

    body.is-printing #global-navbar-container,
    body.is-printing .global-navbar,
    body.is-printing .printer-header,
    body.is-printing .preset-bar,
    body.is-printing .preset-toolbar,
    body.is-printing .contextual-top-bar,
    body.is-printing .bottom-canvas-bar,
    body.is-printing .edit-image-sidebar {
        display: none !important;
    }

    /* ── Reset root layout so only canvases print ── */
    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .printer-shell,
    .studio,
    .canvas-area,
    .canvas-viewport,
    #pagesHost {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        grid-template-columns: unset !important;
        min-height: unset !important;
    }

    /* ── Exact physical A4 page (210mm x 297mm) ── */
    .a4-canvas {
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        min-width: unset !important;
        max-width: unset !important;
        margin: 0 auto !important;
        transform: none !important;
        box-shadow: none !important;
        page-break-after: always !important;
        break-after: page !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    .a4-canvas::before,
    .a4-canvas::after {
        display: none !important;
    }

    /* Exclude pages marked hidden */
    .a4-canvas.print-hidden {
        display: none !important;
    }

    /* Canvas items: preserve absolute mm/px positioning */
    .canvas-item {
        position: absolute !important;
        overflow: hidden !important;
    }

    .canvas-item img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: fill !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: A4 portrait;
        margin: 0mm;
    }
}
