/* ============================================ */
/* EDIT PDF TOOL STYLES                         */
/* ============================================ */

/* TinyWow-like focused editor view after upload */
body.editor-focus-mode > section,
body.editor-focus-mode .internal-links {
    display: none !important;
}

body.editor-focus-mode .tool-page {
    padding: 0 0 24px;
    margin: 0;
    min-height: auto;
}

body.editor-focus-mode .tool-layout-container.container {
    max-width: none !important;
    width: 100%;
    padding: 0 !important;
}

body.editor-focus-mode .main-tool-area,
body.editor-focus-mode .tool-section,
body.editor-focus-mode .tool-card-specific {
    margin: 0;
    border-radius: 0;
}

body.editor-focus-mode .tool-header {
    display: none;
}

body.editor-focus-mode #editorSection {
    display: flex !important;
    flex-direction: column;
    min-height: 75vh;
}

body.editor-focus-mode .editor-top-bar {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

body.editor-focus-mode .editor-workspace {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
}

/* Upload intro */
#uploadSection {
    padding: 12px 0 10px;
}

#uploadSection > p {
    max-width: 760px;
    margin: 0 auto 22px;
    padding: 0 18px;
    text-align: center;
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.92);
}

.light-mode #uploadSection > p {
    color: rgba(51, 65, 85, 0.88);
}

#uploadSection .upload-area {
    padding: 52px 24px;
}

/* Editor Top Bar */
.editor-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--tool-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.pdf-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--dark-text);
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    min-width: 200px;
    flex: 1;
    transition: all 0.2s ease;
}

.pdf-name-input:hover,
.pdf-name-input:focus {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.editor-top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Editor Workspace Layout */
.editor-workspace {
    display: flex;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--tool-card-bg);
    min-height: 600px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Page Thumbnails Sidebar */
.thumbnails-sidebar {
    width: 140px;
    min-width: 140px;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 85vh;
}

.thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.thumbnail-item:hover {
    border-color: rgba(58, 90, 254, 0.5);
    transform: scale(1.03);
}

.thumbnail-item.active {
    border-color: #3A5AFE;
    box-shadow: 0 0 0 2px rgba(58, 90, 254, 0.3);
}

.thumbnail-item canvas {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-label {
    text-align: center;
    font-size: 0.7rem;
    padding: 3px 0;
    color: var(--dark-text);
    opacity: 0.7;
    font-weight: 600;
}

/* Main Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.canvas-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dark .canvas-topbar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.canvas-topbar-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.canvas-topbar-group-pages {
    margin-left: auto;
}

.canvas-topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dark .canvas-topbar-btn {
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.16);
}

.canvas-topbar-btn:hover {
    border-color: rgba(58, 90, 254, 0.45);
    color: #3A5AFE;
    background: rgba(58, 90, 254, 0.08);
}

.canvas-topbar-label {
    min-width: 72px;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark-text);
}

.page-indicator-label {
    min-width: 92px;
}

/* Toolbar */
.edit-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

.dark .edit-toolbar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: #334155;
    font-size: 0.95rem;
    width: auto;
    min-width: 50px;
    height: 52px;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    gap: 4px;
}

.dark .toolbar-btn {
    color: #f1f5f9;
}

.toolbar-btn:hover {
    background: rgba(58, 90, 254, 0.1);
    color: #3A5AFE;
}

.toolbar-btn.active {
    background: rgba(58, 90, 254, 0.15);
    color: #3A5AFE;
    box-shadow: inset 0 -2px 0 #3A5AFE;
}

.toolbar-btn.is-active-toggle {
    background: rgba(58, 90, 254, 0.15);
    color: #3A5AFE;
}

.toolbar-btn .btn-label {
    display: block;
    font-size: 0.74rem;
    line-height: 1;
    font-weight: 600;
    color: inherit;
}

.toolbar-dropdown {
    position: relative;
    display: flex;
    align-items: stretch;
}

.shape-tool-group,
.check-tool-group {
    border-radius: 10px;
}

.shape-tool-group > .toolbar-btn,
.check-tool-group > .toolbar-btn {
    min-width: 0;
}

.shape-tool-group > #shapeToolBtn,
.check-tool-group > #checkToolBtn {
    padding-inline: 10px 8px;
    border-radius: 8px 0 0 8px;
}

.shape-tool-group > .toolbar-btn-caret,
.check-tool-group > .toolbar-btn-caret {
    width: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 0 8px 8px 0;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
    gap: 0;
}

.shape-tool-group > .toolbar-btn.active + .toolbar-btn-caret,
.shape-tool-group > .toolbar-btn-caret[aria-expanded="true"],
.check-tool-group > .toolbar-btn.active + .toolbar-btn-caret,
.check-tool-group > .toolbar-btn-caret[aria-expanded="true"] {
    background: rgba(58, 90, 254, 0.15);
    color: #3A5AFE;
}

.shape-menu,
.check-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 178px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 60;
}

.dark .shape-menu,
.dark .check-menu {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.45);
}

.shape-menu.open,
.check-menu.open {
    display: flex;
}

.shape-menu-item,
.check-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #334155;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dark .shape-menu-item,
.dark .check-menu-item {
    color: #e2e8f0;
}

.shape-menu-item i,
.check-menu-item i {
    width: 16px;
    text-align: center;
    color: #64748b;
}

.dark .shape-menu-item i,
.dark .check-menu-item i {
    color: #94a3b8;
}

.shape-menu-item:hover,
.check-menu-item:hover {
    background: rgba(58, 90, 254, 0.1);
    color: #3A5AFE;
    transform: translateX(1px);
}

.shape-menu-item.active,
.check-menu-item.active {
    background: rgba(58, 90, 254, 0.14);
    color: #3A5AFE;
}

.shape-menu-item.active i,
.shape-menu-item:hover i,
.check-menu-item.active i,
.check-menu-item:hover i {
    color: inherit;
}

.toolbar-sep {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 4px;
}

.dark .toolbar-sep {
    background: rgba(255, 255, 255, 0.2);
}

/* Context Controls (shown when overlay selected) */
.context-controls {
    display: none;
    align-items: center;
    gap: 4px;
}

.context-controls.visible {
    display: flex;
}

.context-controls .toolbar-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.context-controls .toolbar-btn .btn-label {
    display: none;
}

.color-swatch-bar {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 4px;
}

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

.color-swatch-btn:hover,
.color-swatch-btn.active {
    border-color: #3A5AFE;
    transform: scale(1.15);
}

/* Canvas Container */
.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    position: relative;
    background: rgba(0, 0, 0, 0.08);
}

.pdf-canvas-wrapper {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: white;
}

.pdf-canvas-wrapper canvas {
    display: block;
}

#pdfCanvas {
    position: relative;
    z-index: 1;
}

.pdf-text-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    text-align: initial;
    line-height: 1;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    user-select: text;
    pointer-events: auto;
    z-index: 2;
    transform-origin: 0 0;
}

.pdf-text-layer span,
.pdf-text-layer br {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
    pointer-events: auto;
    user-select: text;
}

.pdf-text-layer.debug-text-layer span {
    outline: 1px solid rgba(239, 68, 68, 0.7);
    background: rgba(239, 68, 68, 0.08);
}

body.debug-edit-pdf #pdfTextLayer span {
    outline: 1px solid red !important;
    background: rgba(255, 0, 0, 0.12) !important;
}

.pdf-text-layer span:hover,
.pdf-text-layer .pdf-text-span:hover {
    background: rgba(58, 90, 254, 0.16);
    outline: 1px solid rgba(58, 90, 254, 0.35);
}

.pdf-text-layer ::selection {
    background: rgba(0, 120, 215, 0.35);
}

.pdf-text-layer .endOfContent {
    display: block;
    position: absolute;
    inset: 100% 0 0;
    z-index: -1;
    cursor: default;
    user-select: none;
}

.ocr-text-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.ocr-word-box {
    position: absolute;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: text;
    pointer-events: auto;
    color: transparent;
    font-size: 0;
}

body.debug-edit-pdf .ocr-word-box {
    outline: 1px solid rgba(34, 197, 94, 0.9);
    background: rgba(34, 197, 94, 0.12);
}

/* Overlays */
.edit-overlay {
    position: absolute;
    z-index: 5;
    cursor: move;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.edit-overlay:hover {
    border-color: rgba(58, 90, 254, 0.28);
}

.edit-overlay.inline-editing:hover,
.edit-overlay.committed-text:hover {
    border-color: transparent;
}

.edit-overlay.selected {
    border-color: rgba(58, 90, 254, 0.75);
    box-shadow: 0 2px 7px rgba(58, 90, 254, 0.14);
    border-radius: 2px;
}

.edit-overlay.inline-editing,
.edit-overlay.inline-editing.selected {
    z-index: 10;
    border: none;
    outline: none;
    background: transparent;
    padding: var(--inline-pad-y, 0) var(--inline-pad-x, 0);
    margin: 0;
    resize: none;
    box-shadow: none;
    min-height: var(--inline-line-height, 1em);
    height: auto !important;
    width: fit-content !important;
    min-width: 4px;
    cursor: text;
    user-select: text;
    vertical-align: baseline;
}

.edit-overlay.text-overlay {
    min-width: 20px;
    padding: 2px 4px;
    font-family: Helvetica, Arial, sans-serif;
    outline: none;
    white-space: pre-wrap;
    color: #000;
    background: transparent;
    line-height: 1.3;
}

.edit-overlay.text-overlay.committed-text:not(.selected),
.edit-overlay.text-overlay.inline-editing {
    min-width: 0;
    padding: var(--inline-pad-y, 0) var(--inline-pad-x, 0);
    border: none;
    box-shadow: none;
    background: transparent;
    line-height: inherit;
    overflow: visible;
    white-space: pre;
    width: fit-content !important;
    height: auto !important;
}

.edit-overlay.text-overlay.committed-text {
    cursor: text;
    user-select: none;
}

.edit-overlay.text-overlay.committed-text.selected {
    padding: var(--inline-pad-y, 0) var(--inline-pad-x, 0);
    border-color: rgba(58, 90, 254, 0.65);
    box-shadow: 0 2px 7px rgba(58, 90, 254, 0.12);
}

.edit-overlay.text-overlay.inline-editing:focus {
    outline: none;
}

.edit-overlay.text-overlay[contenteditable="true"] {
    cursor: text;
}

.edit-overlay.highlight-overlay {
    background: rgba(255, 255, 0, 0.35);
    cursor: default;
    min-width: 20px;
    min-height: 14px;
}

.edit-overlay.whiteout-overlay {
    background: #fff;
    cursor: default;
    min-width: 20px;
    min-height: 14px;
}

.edit-overlay.blackout-overlay {
    background: #000;
    cursor: default;
    min-width: 20px;
    min-height: 14px;
}

.pdf-text-selection-toolbar,
.selection-toolbar {
    position: absolute;
    z-index: 30;
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.16);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
    color: #0f172a;
    max-width: min(760px, calc(100vw - 32px));
    flex-wrap: wrap;
    font-family: Inter, Arial, sans-serif;
}

.pdf-text-selection-toolbar.visible {
    display: flex;
}

.pdf-text-selection-toolbar button {
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.pdf-text-selection-toolbar button:hover {
    background: #e2e8f0;
}

.dark .pdf-text-selection-toolbar {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
}

.dark .pdf-text-selection-toolbar button,
.dark .toolbar-font-select,
.dark .toolbar-font-size-input,
.dark .toolbar-size-chip,
.dark .toolbar-color-trigger,
.dark .toolbar-color-popover,
.dark .toolbar-color-hex {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

.toolbar-font-select,
.toolbar-font-size-input,
.toolbar-color-trigger,
.toolbar-color-hex {
    height: 28px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 700;
}

.toolbar-font-select {
    max-width: 150px;
    padding: 0 6px;
}

.toolbar-font-size-input {
    width: 52px;
    padding: 0 5px;
}

.toolbar-stroke-width-input {
    width: 60px;
}

.toolbar-size-chip {
    height: 28px;
    min-width: 58px;
    padding: 0 8px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar-color-picker {
    position: relative;
}

.toolbar-color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    min-width: 44px;
    justify-content: center;
}

.toolbar-color-trigger.active {
    background: rgba(58, 90, 254, 0.16);
    color: #3A5AFE;
}

.toolbar-color-label {
    font-size: 0.74rem;
    font-weight: 800;
}

.toolbar-color-preview {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.toolbar-color-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 35;
    display: none;
    width: 222px;
    padding: 12px;
    border-radius: 16px;
    background: #111a33;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.28);
    color: #f8fafc;
}

.toolbar-color-popover.visible {
    display: block;
}

.toolbar-color-picker-surface {
    display: flex;
    justify-content: center;
}

.toolbar-color-wheel {
    position: relative;
    width: 148px;
    height: 148px;
    border-radius: 999px;
    background: conic-gradient(
        #ff004c,
        #ff7a00,
        #ffee00,
        #66ff00,
        #00ffd5,
        #0066ff,
        #7a00ff,
        #ff00c8,
        #ff004c
    );
}

.toolbar-color-wheel::before {
    content: "";
    position: absolute;
    inset: 19px;
    border-radius: 999px;
    background: #111a33;
}

.toolbar-color-wheel.is-transparent {
    opacity: 0.9;
}

.toolbar-color-wheel-thumb,
.toolbar-color-square-thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.toolbar-color-wheel-thumb {
    background: transparent;
}

.toolbar-color-square {
    position: absolute;
    inset: 37px;
    border-radius: 4px;
    overflow: hidden;
    background:
        linear-gradient(to top, #000 0%, transparent 100%),
        linear-gradient(to right, #fff 0%, var(--picker-hue, #ff0000) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.toolbar-color-square-thumb {
    background: transparent;
}

.toolbar-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-color-recents.visible {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.toolbar-color-recents {
    display: none;
}

.toolbar-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--swatch-color);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.toolbar-color-swatch:hover,
.toolbar-color-swatch.active {
    border-color: #3A5AFE;
    box-shadow: 0 0 0 2px rgba(58, 90, 254, 0.2);
}

.toolbar-color-none {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.toolbar-color-none.active {
    background: rgba(58, 90, 254, 0.16);
    color: #3A5AFE;
}

.toolbar-color-hex-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-color-hex-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: inherit;
}

.toolbar-color-hex {
    flex: 1;
    padding: 0 8px;
    text-transform: uppercase;
}

.toolbar-color-trigger.is-transparent .toolbar-color-preview {
    background: linear-gradient(135deg, transparent 0 45%, #ef4444 45% 55%, transparent 55% 100%), #ffffff;
}

.pdf-text-selection-toolbar button.active {
    background: rgba(58, 90, 254, 0.16);
    color: #3A5AFE;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(15, 23, 42, 0.18);
}

.dark .toolbar-divider {
    background: rgba(255, 255, 255, 0.2);
}

.dark .toolbar-color-preview {
    border-color: rgba(255, 255, 255, 0.18);
}

.dark .toolbar-color-swatch {
    border-color: rgba(255, 255, 255, 0.12);
}

.pdf-text-selection-toolbar button.disabled,
.pdf-text-selection-toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.pdf-text-selection-toolbar [hidden] {
    display: none !important;
}

.edit-overlay-resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: #3A5AFE;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    cursor: nwse-resize;
    z-index: 2;
    display: none;
}

.edit-overlay.selected .edit-overlay-resize-handle {
    display: block;
}

.edit-overlay.inline-editing .edit-overlay-resize-handle,
.edit-overlay.committed-text:not(.selected) .edit-overlay-resize-handle {
    display: none;
}

.pdf-layout-warning {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    z-index: 30;
    display: none;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.pdf-layout-warning.visible {
    display: block;
}

.edit-overlay.shape-overlay {
    border: none;
    background: transparent;
    cursor: default;
    min-width: 20px;
    min-height: 14px;
    padding: 0;
    overflow: visible;
}

.edit-overlay.shape-overlay.selected {
    box-shadow: 0 0 0 1px rgba(58, 90, 254, 0.18), 0 2px 8px rgba(58, 90, 254, 0.14);
}

.shape-overlay-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.edit-overlay.image-overlay img,
.edit-overlay.sign-overlay img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.zoom-level {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-text);
    min-width: 50px;
    text-align: center;
}

/* Signature Modal */
.sig-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.sig-modal.open {
    display: flex;
}

.sig-modal-inner {
    background: #ffffff;
    padding: 34px 36px;
    border-radius: 22px;
    width: min(92vw, 680px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
}

body:not(.light-mode) .sig-modal-inner {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.52);
}

.sig-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sig-header h3 {
    color: #0f172a;
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

body:not(.light-mode) .sig-header h3 {
    color: #f8fafc;
}

.sig-header p {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

body:not(.light-mode) .sig-header p {
    color: #94a3b8;
}

.sig-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}

body:not(.light-mode) .sig-tabs {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.sig-tab {
    flex: 1;
    padding: 10px 8px 12px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}

body:not(.light-mode) .sig-tab {
    color: #94a3b8;
}

.sig-tab.active {
    color: #2490ea;
    border-bottom-color: #2490ea;
}

body:not(.light-mode) .sig-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.sig-panels {
    min-height: 230px;
}

.sig-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.sig-panel.active {
    display: flex;
}

.sig-type-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    outline: none;
}

body:not(.light-mode) .sig-type-input {
    background: #0f172a;
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.28);
}

body:not(.light-mode) .sig-type-input::placeholder {
    color: #94a3b8;
}

.sig-type-input:focus {
    border-color: rgba(36, 144, 234, 0.55);
    box-shadow: 0 0 0 3px rgba(36, 144, 234, 0.12);
}

.sig-type-preview-wrap,
.sig-image-preview-wrap {
    min-height: 150px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sig-type-preview {
    color: #0f172a;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
}

.sig-type-preview.is-placeholder {
    color: #94a3b8;
}

.sig-upload-btn {
    align-self: flex-start;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(36, 144, 234, 0.22);
    background: rgba(36, 144, 234, 0.08);
    color: #2490ea;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

body:not(.light-mode) .sig-upload-btn {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

.sig-upload-btn:hover {
    background: rgba(36, 144, 234, 0.14);
}

body:not(.light-mode) .sig-upload-btn:hover {
    background: rgba(96, 165, 250, 0.2);
}

.sig-image-preview-wrap {
    position: relative;
    overflow: hidden;
}

.sig-image-preview-wrap img {
    max-width: 100%;
    max-height: 180px;
    display: none;
    object-fit: contain;
}

.sig-image-preview-wrap.has-image img {
    display: block;
}

.sig-image-placeholder {
    color: #94a3b8;
    font-size: 0.95rem;
    text-align: center;
}

.sig-image-preview-wrap.has-image .sig-image-placeholder {
    display: none;
}

.sig-color-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sig-color-controls.hidden {
    display: none;
}

.sig-color-label {
    color: #475569;
    font-size: 0.92rem;
    font-weight: 700;
}

body:not(.light-mode) .sig-color-label {
    color: #cbd5e1;
}

.sig-color-swatches {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sig-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--sig-swatch);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.sig-color-swatch.active {
    border-color: #2490ea;
    transform: scale(1.08);
}

body:not(.light-mode) .sig-color-swatch.active {
    border-color: #60a5fa;
}

.sig-canvas {
    border: 2px dashed rgba(148, 163, 184, 0.7);
    border-radius: 16px;
    width: 100%;
    height: 250px;
    background: #fff;
}

.sig-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.sig-actions .btn-primary {
    min-width: 180px;
    border-radius: 14px;
}

body:not(.light-mode) .sig-actions .btn-secondary {
    background: #374151;
    border-color: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
}

body:not(.light-mode) .sig-actions .btn-secondary:hover {
    background: #4b5563;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .editor-workspace {
        flex-direction: column;
        min-height: auto;
    }

    .thumbnails-sidebar {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        max-height: 100px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 8px;
    }

    .thumbnail-item {
        min-width: 60px;
        max-width: 80px;
    }

    .edit-toolbar {
        gap: 2px;
        padding: 8px 10px;
    }

    .toolbar-btn {
        min-width: 44px;
        height: 48px;
        font-size: 0.88rem;
    }

    .toolbar-sep {
        display: none;
    }

    .pdf-canvas-container {
        padding: 15px;
    }

    .editor-top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pdf-name-input {
        min-width: unset;
        width: 100%;
    }

    .editor-top-actions {
        justify-content: center;
    }

    .context-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .thumbnails-sidebar {
        max-height: 80px;
    }

    .thumbnail-item {
        min-width: 50px;
    }

    .toolbar-btn {
        min-width: 38px;
        height: 42px;
        font-size: 0.82rem;
    }

    .toolbar-btn .btn-label {
        font-size: 0.68rem;
    }
}

/* ============================================ */
/* PREMIUM EDITOR POLISH                        */
/* ============================================ */

body.editor-focus-mode {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 18%),
        linear-gradient(180deg, #08101f 0%, #0a1224 100%);
}

body.editor-focus-mode .navbar {
    background: rgba(7, 14, 30, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: 0 12px 36px rgba(2, 6, 23, 0.38);
    backdrop-filter: blur(14px);
}

body.editor-focus-mode .tool-card-specific {
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.editor-focus-mode #editorSection {
    gap: 14px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 17, 32, 0.98) 100%);
}

body.editor-focus-mode .editor-top-bar {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin: 0;
}

.editor-top-bar {
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(20, 32, 58, 0.98), rgba(14, 23, 41, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    margin-bottom: 0;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.26);
}

.editor-top-meta {
    display: flex;
    flex: 1;
    min-width: 260px;
    flex-direction: column;
    gap: 10px;
}

.editor-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #8da0c1;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.editor-breadcrumb i {
    font-size: 0.72rem;
    color: #5c6f91;
}

.editor-breadcrumb-current {
    color: #dbe7ff;
}

.editor-breadcrumb-file {
    color: #93c5fd;
    text-transform: none;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(52vw, 560px);
}

.editor-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.editor-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.16);
    flex: 0 0 auto;
}

.pdf-name-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #f8fbff;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 14px;
    min-width: 0;
}

.pdf-name-input:hover,
.pdf-name-input:focus {
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(255, 255, 255, 0.05);
}

.editor-top-actions {
    gap: 12px;
}

.editor-top-actions .btn {
    height: 44px;
    border-radius: 14px;
    padding: 0 16px;
    font-weight: 700;
    box-shadow: none;
}

.editor-top-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #dbe5f6;
}

.editor-top-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
}

.editor-top-actions .btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid rgba(96, 165, 250, 0.34);
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.editor-top-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.34);
}

.edit-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(15, 24, 42, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24);
    scrollbar-width: none;
    margin-bottom: 0;
}

.edit-toolbar::-webkit-scrollbar {
    display: none;
}

.edit-toolbar .toolbar-btn,
.edit-toolbar .toolbar-dropdown,
.edit-toolbar .toolbar-sep,
.edit-toolbar .context-controls {
    flex: 0 0 auto;
}

.dark .edit-toolbar {
    background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(15, 24, 42, 0.98));
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.toolbar-btn {
    min-width: 64px;
    height: 58px;
    padding: 6px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: #d5e3fb;
    gap: 6px;
}

.toolbar-btn i {
    font-size: 1rem;
}

.toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.18);
    color: #9ec5ff;
}

.toolbar-btn.active {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(96, 165, 250, 0.26);
    color: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.14);
}

.toolbar-btn .btn-label {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.shape-tool-group > #shapeToolBtn,
.check-tool-group > #checkToolBtn {
    padding-inline: 12px 10px;
    border-radius: 14px 0 0 14px;
    min-width: 84px;
    justify-content: center;
    gap: 5px;
}

.shape-tool-group,
.check-tool-group {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.shape-tool-group > .toolbar-btn,
.check-tool-group > .toolbar-btn {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.shape-tool-group > .toolbar-btn:hover,
.check-tool-group > .toolbar-btn:hover {
    border-color: transparent;
}

.shape-tool-group.is-active-group,
.check-tool-group.is-active-group {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(96, 165, 250, 0.26);
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.14);
}

.shape-tool-group.is-active-group > .toolbar-btn,
.check-tool-group.is-active-group > .toolbar-btn {
    color: #dbeafe;
}

.shape-tool-group:has(> #shapeToolBtn.active),
.shape-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]),
.check-tool-group:has(> #checkToolBtn.active),
.check-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(96, 165, 250, 0.26);
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.14);
}

.shape-tool-group:has(> #shapeToolBtn.active) > .toolbar-btn,
.shape-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) > .toolbar-btn,
.check-tool-group:has(> #checkToolBtn.active) > .toolbar-btn,
.check-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) > .toolbar-btn {
    color: #dbeafe;
}

.shape-tool-group > #shapeToolBtn.active,
.check-tool-group > #checkToolBtn.active,
.shape-tool-group > .toolbar-btn-caret[aria-expanded="true"],
.check-tool-group > .toolbar-btn-caret[aria-expanded="true"] {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.shape-tool-group > .toolbar-btn-caret,
.check-tool-group > .toolbar-btn-caret {
    width: 32px;
    min-width: 32px;
    border-left: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0 14px 14px 0;
    justify-content: center;
}

.shape-menu,
.check-menu {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 16px;
    background: rgba(11, 18, 33, 0.98);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
    min-width: 188px;
    max-width: min(240px, calc(100vw - 24px));
    z-index: 140;
}

.shape-menu-item,
.check-menu-item {
    color: #d6e3ff;
    border-radius: 12px;
}

.toolbar-sep {
    height: 30px;
    margin: 0 6px;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.22), transparent);
}

.editor-workspace {
    gap: 18px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    background: linear-gradient(180deg, rgba(13, 21, 39, 0.96), rgba(9, 16, 30, 0.98));
    box-shadow: 0 24px 54px rgba(2, 6, 23, 0.34);
    overflow: visible;
}

body.editor-focus-mode .editor-workspace {
    min-height: 680px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: 0 24px 54px rgba(2, 6, 23, 0.34);
}

.thumbnails-panel {
    width: 214px;
    min-width: 214px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(16, 25, 45, 0.96), rgba(10, 18, 33, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.thumbnails-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 0;
}

.thumbnails-panel-title {
    color: #e8f1ff;
    font-size: 0.96rem;
    font-weight: 800;
}

.thumbnails-panel-count {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.74rem;
    font-weight: 700;
}

.thumbnails-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 78vh;
    padding: 2px;
    background: transparent;
    border-right: 0;
    gap: 14px;
}

.thumbnail-item {
    border-radius: 18px;
    padding: 10px 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255, 255, 255, 0.03);
    transform: none;
}

.thumbnail-item:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
}

.thumbnail-item.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), 0 18px 32px rgba(30, 64, 175, 0.22);
}

.thumbnail-item canvas {
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.thumbnail-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    margin: 10px auto 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #c9d6ec;
    font-size: 0.72rem;
    font-weight: 700;
}

.thumbnail-item.active .thumbnail-label {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

.workspace-main {
    flex: 1;
    min-width: 0;
    display: flex;
}

.canvas-area {
    background: linear-gradient(180deg, rgba(14, 23, 40, 0.96), rgba(9, 16, 30, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.canvas-topbar {
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(14, 23, 41, 0.98));
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.canvas-topbar-group {
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.canvas-topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #dbeafe;
}

.canvas-topbar-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
}

.canvas-topbar-label {
    min-width: 74px;
    color: #dce7fb;
    font-size: 0.9rem;
    font-weight: 700;
}

.page-indicator-label {
    min-width: 108px;
}

.pdf-canvas-container {
    padding: 32px;
    background:
        radial-gradient(circle at top center, rgba(59, 130, 246, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(9, 16, 30, 1) 0%, rgba(8, 13, 25, 1) 100%);
}

.pdf-canvas-wrapper {
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 26px 60px rgba(2, 6, 23, 0.46),
        0 0 0 1px rgba(15, 23, 42, 0.06);
}

.pdf-layout-warning {
    left: 50%;
    right: auto;
    top: 18px;
    width: min(92%, 860px);
    transform: translateX(-50%);
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.28);
}

.pdf-text-selection-toolbar,
.selection-toolbar {
    gap: 6px;
    padding: 8px 9px;
    border-radius: 14px;
    background: rgba(13, 21, 39, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.4);
    color: #f8fbff;
    backdrop-filter: blur(12px);
}

.pdf-text-selection-toolbar button,
.toolbar-font-select,
.toolbar-font-size-input,
.toolbar-size-chip,
.toolbar-color-trigger,
.toolbar-color-hex {
    height: 30px;
    border-radius: 9px;
}

.pdf-text-selection-toolbar button {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e7eefb;
}

.pdf-text-selection-toolbar button:hover {
    background: rgba(59, 130, 246, 0.12);
}

.toolbar-font-select,
.toolbar-font-size-input,
.toolbar-size-chip,
.toolbar-color-trigger,
.toolbar-color-hex {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #f8fbff;
}

.toolbar-color-popover {
    border-radius: 18px;
    box-shadow: 0 24px 44px rgba(2, 6, 23, 0.48);
}

.edit-overlay.selected {
    border: 1px dashed rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.14), 0 10px 24px rgba(30, 64, 175, 0.12);
}

.edit-overlay-resize-handle {
    right: -6px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #3b82f6;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.34);
}

@media (max-width: 1120px) {
    .editor-workspace {
        flex-direction: column;
    }

    .thumbnails-panel {
        width: 100%;
        min-width: 0;
    }

    .thumbnails-sidebar {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        padding-bottom: 8px;
    }

    .thumbnail-item {
        min-width: 118px;
        max-width: 132px;
    }
}

@media (max-width: 768px) {
    body.editor-focus-mode #editorSection {
        padding: 0 0 114px !important;
    }

    body.editor-focus-mode .tool-page {
        padding-bottom: 0;
    }

    .mobile-editor-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px 0;
    }

    .mobile-editor-action {
        flex: 1 1 0;
        height: 42px;
        border-radius: 14px !important;
        justify-content: center;
        gap: 8px;
        font-size: 0.86rem;
        font-weight: 700;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
    }

    .editor-top-bar,
    .edit-toolbar,
    .canvas-area {
        border-radius: 0 !important;
    }

    body.editor-focus-mode .editor-workspace {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px 12px 0 !important;
        min-height: auto !important;
        background: #eef4ff !important;
    }

    body.editor-focus-mode:not(.light-mode) .editor-workspace {
        background: #0d1523 !important;
    }

    body.editor-focus-mode .thumbnails-panel {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px !important;
        border-radius: 18px !important;
        border: 1px solid rgba(148, 163, 184, 0.12) !important;
        background: rgba(255, 255, 255, 0.92) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
    }

    body.editor-focus-mode:not(.light-mode) .thumbnails-panel {
        background: #121d31 !important;
        box-shadow: 0 12px 28px rgba(2, 6, 23, 0.28) !important;
    }

    body.editor-focus-mode .thumbnails-panel-header {
        padding: 0 2px 6px !important;
    }

    body.editor-focus-mode .thumbnails-sidebar {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        gap: 12px !important;
        padding: 2px 2px 4px !important;
    }

    body.editor-focus-mode .thumbnail-item {
        min-width: 116px !important;
        max-width: 128px !important;
    }

    .editor-top-bar {
        padding: 14px;
    }

    .editor-breadcrumb {
        font-size: 0.76rem;
        gap: 8px;
    }

    .editor-breadcrumb-file {
        max-width: 100%;
    }

    .editor-top-actions {
        width: 100%;
        justify-content: stretch;
    }

    .editor-top-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .editor-command-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 140;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        pointer-events: none;
    }

    .edit-toolbar {
        display: block !important;
        padding: 10px 10px 8px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid rgba(226, 232, 240, 0.92) !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -14px 34px rgba(15, 23, 42, 0.18) !important;
        overflow: visible !important;
        pointer-events: auto;
    }

    .toolbar-left-cluster {
        position: static;
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
        background: transparent;
        border-top: 0;
        backdrop-filter: none;
        scrollbar-width: none;
    }

    .toolbar-left-cluster::-webkit-scrollbar {
        display: none;
    }

    .toolbar-right-cluster {
        display: none !important;
    }

    .toolbar-btn {
        min-width: 62px;
        height: 58px;
        padding: 8px 10px;
        border-radius: 16px;
        background: transparent !important;
        border: 1px solid transparent !important;
        color: #64748b !important;
        box-shadow: none !important;
    }

    .toolbar-btn i,
    .toolbar-btn .btn-label {
        color: currentColor !important;
    }

    .toolbar-btn .btn-label {
        font-size: 0.74rem !important;
        line-height: 1.05 !important;
    }

    .toolbar-btn.active {
        background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
        border-color: rgba(37, 99, 235, 0.95) !important;
        color: #ffffff !important;
        box-shadow: 0 12px 22px rgba(37, 99, 235, 0.26) !important;
    }

    .shape-tool-group,
    .check-tool-group {
        border-radius: 16px;
        border: 1px solid rgba(203, 213, 225, 0.88);
        background: #ffffff;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
        overflow: hidden;
    }

    .shape-tool-group > .toolbar-btn,
    .check-tool-group > .toolbar-btn,
    .shape-tool-group > .toolbar-btn-caret,
    .check-tool-group > .toolbar-btn-caret {
        background: transparent !important;
        border-color: transparent !important;
        color: #64748b !important;
    }

    .shape-tool-group.is-active-group,
    .check-tool-group.is-active-group {
        background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
        border-color: #93c5fd !important;
    }

    .workspace-main,
    .canvas-area {
        width: 100%;
    }

    body.editor-focus-mode .canvas-area {
        border-radius: 18px !important;
        overflow: hidden !important;
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1) !important;
        background: #ffffff !important;
    }

    body.editor-focus-mode:not(.light-mode) .canvas-area {
        background: #0f1828 !important;
        box-shadow: 0 16px 32px rgba(2, 6, 23, 0.26) !important;
    }

    .pdf-canvas-container {
        padding: 6px !important;
        overflow-x: auto;
        overflow-y: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: none;
        touch-action: pan-x pan-y;
    }

    .pdf-canvas-wrapper {
        flex-shrink: 0;
        margin-right: 6px;
    }

    .canvas-topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px !important;
    }

    .canvas-inline-controls .canvas-topbar-group {
        padding: 6px 8px;
    }

    .canvas-topbar-label {
        min-width: 58px;
        font-size: 0.84rem;
    }

    #pageIndicator.canvas-topbar-label {
        min-width: 72px;
    }

    .pdf-text-selection-toolbar,
    .selection-toolbar {
        max-width: calc(100vw - 28px);
    }

    .pdf-layout-warning {
        top: 6px;
        width: calc(100% - 12px);
        padding: 8px 10px;
        font-size: 0.84rem;
        line-height: 1.35;
        border-radius: 10px;
    }

    .mobile-sticky-dock {
        display: none !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    body.editor-focus-mode #editorSection {
        padding-bottom: 114px !important;
    }

    .mobile-editor-actions {
        display: flex;
    }

    .editor-command-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 140;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        pointer-events: none;
    }

    .edit-toolbar {
        display: block !important;
        padding: 10px 10px 8px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 1px solid rgba(226, 232, 240, 0.92) !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -14px 34px rgba(15, 23, 42, 0.18) !important;
        overflow: visible !important;
        pointer-events: auto;
    }

    .toolbar-left-cluster {
        position: static;
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
        background: transparent;
        border-top: 0;
        backdrop-filter: none;
        scrollbar-width: none;
    }

    .toolbar-left-cluster::-webkit-scrollbar {
        display: none;
    }

    .toolbar-right-cluster {
        display: none !important;
    }

    .mobile-sticky-dock {
        display: none !important;
    }
}

/* ============================================ */
/* RIGHT PROPERTIES PANEL                       */
/* ============================================ */

.properties-panel {
    width: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 22px;
    border: 1px solid transparent;
    background: transparent;
    transition: width 0.22s ease, min-width 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
    opacity: 0;
    pointer-events: none;
    flex-shrink: 0;
}

.properties-panel.active {
    width: 268px;
    min-width: 268px;
    opacity: 1;
    pointer-events: auto;
    border-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(16, 25, 45, 0.96), rgba(10, 18, 33, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Tabs */
.props-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 0 6px;
    flex-shrink: 0;
}

.props-tab {
    flex: 1;
    height: 48px;
    border: 0;
    background: transparent;
    color: #6a80a8;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.props-tab.active {
    color: #dbeafe;
    border-bottom-color: #3b82f6;
}

.props-tab:hover:not(.active) {
    color: #a8c0e8;
}

/* Body */
.props-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.15) transparent;
}

.props-body::-webkit-scrollbar {
    width: 4px;
}

.props-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
}

/* Sections */
.props-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.props-label {
    font-size: 0.76rem;
    font-weight: 800;
    color: #6a80a8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Edit Text area */
.props-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #e8f0ff;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.props-textarea:focus {
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(255, 255, 255, 0.06);
}

.props-char-count {
    font-size: 0.72rem;
    color: #4e6188;
    text-align: right;
    font-weight: 600;
}

/* Font + style controls inside panel */
.props-font-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.props-font-select {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e8f0ff;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.props-size-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.props-size-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #8da0c1;
    min-width: 30px;
}

/* Context controls inside panel (bold, italic, color, delete) */
#contextControls {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

#contextControls.visible {
    display: flex;
}

/* Override old toolbar styles since controls now live in panel */
.properties-panel #contextControls .toolbar-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #d5e3fb;
}

.properties-panel #contextControls .toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.22);
    color: #93c5fd;
}

.properties-panel #contextControls .toolbar-btn.is-active-toggle {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(96, 165, 250, 0.3);
    color: #dbeafe;
}

.properties-panel #contextControls .btn-label {
    display: none;
}

/* Style controls row inside panel */
.props-style-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Color swatches in panel */
.properties-panel .color-swatch-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.properties-panel .color-swatch-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.properties-panel .color-swatch-btn:hover,
.properties-panel .color-swatch-btn.active {
    border-color: #3b82f6;
    transform: scale(1.18);
}

/* Delete button inside panel */
.properties-panel #deleteOverlayBtn {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.properties-panel #deleteOverlayBtn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

/* Quick Actions grid */
.props-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.props-quick-btn {
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #c4d6f6;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.props-quick-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.26);
    color: #dbeafe;
}

.props-quick-btn i {
    font-size: 0.82rem;
}

/* Separator between sections */
.props-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.14), transparent);
    margin: 2px 0;
}

/* Quick actions section is always present in the panel (outside contextControls) */
.props-section-permanent {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
}

/* Responsive: hide panel on narrow screens where workspace stacks */
@media (max-width: 1120px) {
    .properties-panel,
    .properties-panel.active {
        display: none !important;
    }
}

/* ============================================ */
/* FLAT UNIFIED LAYOUT OVERRIDES                */
/* Matches the mockup: one dark workspace,      */
/* no individual raised cards.                  */
/* ============================================ */

/* Editor section becomes the single dark surface */
body.editor-focus-mode #editorSection {
    gap: 0 !important;
    padding: 0 !important;
    background: #0d1523 !important;
}

/* Top bar: flush row, no card */
body.editor-focus-mode .editor-top-bar {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    box-shadow: none !important;
    background: #0d1523 !important;
    margin: 0 !important;
    padding: 10px 20px !important;
}

/* Toolbar: flush row, subtle bottom border */
body.editor-focus-mode .edit-toolbar {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    box-shadow: none !important;
    background: #0f1b2e !important;
    margin: 0 !important;
    padding: 6px 16px !important;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Workspace: flush, no card, fills remaining height */
body.editor-focus-mode .editor-workspace {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #0d1523 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    flex: 1;
    min-height: 600px;
}

/* Thumbnails panel: flush left column */
body.editor-focus-mode .thumbnails-panel {
    border-radius: 0 !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: 1px solid rgba(148, 163, 184, 0.08) !important;
    box-shadow: none !important;
    background: #0a1220 !important;
    width: 170px !important;
    min-width: 170px !important;
}

/* Canvas area: flush center */
body.editor-focus-mode .canvas-area {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #0d1523 !important;
}

/* Canvas topbar (zoom/page row inside canvas): flush */
body.editor-focus-mode .canvas-topbar {
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
    background: #0f1b2e !important;
    padding: 8px 16px !important;
}

/* Properties panel: flush right column */
body.editor-focus-mode .properties-panel,
body.editor-focus-mode .properties-panel.active {
    border-radius: 0 !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
    border-left: 1px solid rgba(148, 163, 184, 0.08) !important;
    box-shadow: none !important;
    background: #0a1220 !important;
}

/* Toolbar buttons: very minimal in flat mode */
body.editor-focus-mode .toolbar-btn {
    border-radius: 8px !important;
    min-width: 54px !important;
    height: 50px !important;
    border: none !important;
    background: transparent !important;
    color: #8ba8d8 !important;
}

body.editor-focus-mode .toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #bcd4ff !important;
}

body.editor-focus-mode .toolbar-btn.active {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #dbeafe !important;
    box-shadow: none !important;
    border: none !important;
}

/* Separator: very subtle */

/* ============================================ */
/* LIGHT MODE EDITOR SHELL                      */
/* ============================================ */

body.light-mode.editor-focus-mode {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 24%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 18%),
        linear-gradient(180deg, #f3f7ff 0%, #eaf0fb 100%);
}

body.light-mode.editor-focus-mode .navbar {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

body.light-mode.editor-focus-mode #editorSection {
    background: #f4f8ff !important;
}

body.light-mode.editor-focus-mode .editor-top-bar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98)) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode.editor-focus-mode .editor-breadcrumb {
    color: #64748b;
}

body.light-mode.editor-focus-mode .editor-breadcrumb i {
    color: #94a3b8;
}

body.light-mode.editor-focus-mode .editor-breadcrumb-current {
    color: #0f172a;
}

body.light-mode.editor-focus-mode .editor-breadcrumb-file {
    color: #2563eb;
}

body.light-mode.editor-focus-mode .editor-file-icon {
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.16);
}

body.light-mode.editor-focus-mode .pdf-name-input {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.24);
}

body.light-mode.editor-focus-mode .pdf-name-input:hover,
body.light-mode.editor-focus-mode .pdf-name-input:focus {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.38);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

body.light-mode.editor-focus-mode .editor-top-actions .btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: rgba(148, 163, 184, 0.24);
}

body.light-mode.editor-focus-mode .editor-top-actions .btn-secondary:hover {
    background: #f8fbff;
    border-color: rgba(59, 130, 246, 0.22);
}

body.light-mode.editor-focus-mode .edit-toolbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98)) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode.editor-focus-mode .toolbar-btn {
    color: #5b6f91 !important;
    background: transparent !important;
}

body.light-mode.editor-focus-mode .toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #1d4ed8 !important;
}

body.light-mode.editor-focus-mode .toolbar-btn.active {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #1d4ed8 !important;
}

body.light-mode.editor-focus-mode .shape-tool-group > .toolbar-btn-caret,
body.light-mode.editor-focus-mode .check-tool-group > .toolbar-btn-caret {
    border-left-color: rgba(148, 163, 184, 0.18);
}

body.light-mode.editor-focus-mode .shape-menu,
body.light-mode.editor-focus-mode .check-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

body.light-mode.editor-focus-mode .shape-menu-item,
body.light-mode.editor-focus-mode .check-menu-item {
    color: #334155;
}

body.light-mode.editor-focus-mode .shape-menu-item:hover,
body.light-mode.editor-focus-mode .check-menu-item:hover,
body.light-mode.editor-focus-mode .shape-menu-item.active,
body.light-mode.editor-focus-mode .check-menu-item.active {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .editor-workspace {
    background: #eef4ff !important;
}

body.light-mode.editor-focus-mode .thumbnails-panel {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.16) !important;
}

body.light-mode.editor-focus-mode .thumbnails-panel-title {
    color: #0f172a;
}

body.light-mode.editor-focus-mode .thumbnails-panel-count {
    background: rgba(59, 130, 246, 0.10);
    color: #2563eb;
}

body.light-mode.editor-focus-mode .thumbnail-item {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.16);
}

body.light-mode.editor-focus-mode .thumbnail-item:hover {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

body.light-mode.editor-focus-mode .thumbnail-label {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}

body.light-mode.editor-focus-mode .thumbnail-item.active .thumbnail-label {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .canvas-area {
    background: #ffffff !important;
}

body.light-mode.editor-focus-mode .canvas-topbar {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}

body.light-mode.editor-focus-mode .canvas-topbar-group {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(148, 163, 184, 0.16);
}

body.light-mode.editor-focus-mode .canvas-topbar-btn {
    background: #ffffff;
    color: #334155;
    border-color: rgba(148, 163, 184, 0.18);
}

body.light-mode.editor-focus-mode .canvas-topbar-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.26);
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .canvas-topbar-label {
    color: #334155;
}

body.light-mode.editor-focus-mode .pdf-canvas-container {
    background:
        radial-gradient(circle at top center, rgba(59, 130, 246, 0.06), transparent 32%),
        linear-gradient(180deg, #eef4ff 0%, #e8eef8 100%);
}

body.light-mode.editor-focus-mode .pdf-canvas-wrapper {
    box-shadow:
        0 24px 54px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(148, 163, 184, 0.14);
}

body.light-mode.editor-focus-mode .properties-panel,
body.light-mode.editor-focus-mode .properties-panel.active {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
    border-left: 1px solid rgba(148, 163, 184, 0.16) !important;
}

body.light-mode.editor-focus-mode .props-tabs {
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

body.light-mode.editor-focus-mode .props-tab {
    color: #64748b;
}

body.light-mode.editor-focus-mode .props-tab.active {
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .props-tab:hover:not(.active) {
    color: #334155;
}

body.light-mode.editor-focus-mode .props-label,
body.light-mode.editor-focus-mode .props-char-count,
body.light-mode.editor-focus-mode .props-size-label {
    color: #64748b;
}

body.light-mode.editor-focus-mode .props-textarea,
body.light-mode.editor-focus-mode .props-font-select,
body.light-mode.editor-focus-mode .props-quick-btn,
body.light-mode.editor-focus-mode .properties-panel #contextControls .toolbar-btn {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.20);
}

body.light-mode.editor-focus-mode .props-quick-btn:hover,
body.light-mode.editor-focus-mode .properties-panel #contextControls .toolbar-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.24);
}

body.light-mode.editor-focus-mode .properties-panel #contextControls .toolbar-btn.is-active-toggle {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.26);
}

body.light-mode.editor-focus-mode .props-divider {
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.18), transparent);
}

body.light-mode.editor-focus-mode .pdf-text-selection-toolbar,
body.light-mode.editor-focus-mode .selection-toolbar {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.20);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

body.light-mode.editor-focus-mode .pdf-text-selection-toolbar button,
body.light-mode.editor-focus-mode .toolbar-font-select,
body.light-mode.editor-focus-mode .toolbar-font-size-input,
body.light-mode.editor-focus-mode .toolbar-size-chip,
body.light-mode.editor-focus-mode .toolbar-color-trigger,
body.light-mode.editor-focus-mode .toolbar-color-hex {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

body.light-mode.editor-focus-mode .pdf-text-selection-toolbar button:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .toolbar-color-popover {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.14);
}

body.light-mode.editor-focus-mode .pdf-layout-warning {
    background: rgba(15, 23, 42, 0.82);
    color: #f8fbff;
}
body.editor-focus-mode .toolbar-sep {
    background: rgba(148, 163, 184, 0.14) !important;
}

/* Thumbnail items: subtle borders */
body.editor-focus-mode:not(.light-mode) .thumbnail-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(148, 163, 184, 0.08) !important;
    border-radius: 10px !important;
}

body.editor-focus-mode:not(.light-mode) .thumbnail-item.active {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25) !important;
}

/* PDF canvas: white page on dark bg with shadow */
body.editor-focus-mode:not(.light-mode) .pdf-canvas-container {
    background: #0d1523 !important;
}

body.editor-focus-mode:not(.light-mode) .pdf-canvas-wrapper {
    border-radius: 4px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04) !important;
}

/* ============================================ */
/* TOOLBAR VISUAL GROUP DIVIDERS                */
/* ============================================ */

/* Group: Select / Text / Highlight / Blackout */
.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

/* Toolbar zoom group (inline in toolbar) */
.toolbar-zoom-group,
.toolbar-page-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.toolbar-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #8ba8d8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.toolbar-zoom-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.28);
    color: #bcd4ff;
}

.toolbar-zoom-label {
    min-width: 52px;
    text-align: center;
    font-size: 0.86rem;
    font-weight: 700;
    color: #8ba8d8;
    user-select: none;
}

.toolbar-page-group .toolbar-zoom-label {
    min-width: 80px;
}

body.light-mode.editor-focus-mode .toolbar-group {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(148, 163, 184, 0.16);
}

body.light-mode.editor-focus-mode .shape-tool-group,
body.light-mode.editor-focus-mode .check-tool-group {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(148, 163, 184, 0.16);
}

body.light-mode.editor-focus-mode .shape-tool-group.is-active-group,
body.light-mode.editor-focus-mode .check-tool-group.is-active-group {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.10);
}

body.light-mode.editor-focus-mode .shape-tool-group.is-active-group > .toolbar-btn,
body.light-mode.editor-focus-mode .check-tool-group.is-active-group > .toolbar-btn {
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .shape-tool-group:has(> #shapeToolBtn.active),
body.light-mode.editor-focus-mode .shape-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]),
body.light-mode.editor-focus-mode .check-tool-group:has(> #checkToolBtn.active),
body.light-mode.editor-focus-mode .check-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.10);
}

body.light-mode.editor-focus-mode .shape-tool-group:has(> #shapeToolBtn.active) > .toolbar-btn,
body.light-mode.editor-focus-mode .shape-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) > .toolbar-btn,
body.light-mode.editor-focus-mode .check-tool-group:has(> #checkToolBtn.active) > .toolbar-btn,
body.light-mode.editor-focus-mode .check-tool-group:has(> .toolbar-btn-caret[aria-expanded="true"]) > .toolbar-btn {
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .toolbar-zoom-btn {
    background: #ffffff;
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.20);
}

body.light-mode.editor-focus-mode .toolbar-zoom-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.24);
    color: #1d4ed8;
}

body.light-mode.editor-focus-mode .toolbar-zoom-label {
    color: #6b7d99;
}

/* "Start Over" button — ghost/outline style matching screenshot's Save button */
#startOverBtn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    color: #c8d8f0 !important;
    box-shadow: none !important;
}

#startOverBtn:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #dbeafe !important;
}

body.light-mode.editor-focus-mode #startOverBtn {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    color: #64748b !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode.editor-focus-mode #startOverBtn:hover {
    background: #f8fbff !important;
    border-color: rgba(59, 130, 246, 0.22) !important;
    color: #1d4ed8 !important;
}

/* Download button — stronger blue emphasis */
#downloadPdfBtn {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.35) !important;
}

#downloadPdfBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(29, 78, 216, 0.44) !important;
}

/* Toolbar: make undo/redo visually distinct */
#undoBtn,
#redoBtn {
    min-width: 48px;
    color: #7a9ac8;
}

#undoBtn:disabled,
#redoBtn:disabled {
    opacity: 0.32;
    pointer-events: none;
}

/* Detect Text button slight accent */
#detectTextBtn {
    color: #81b4f5;
}

#detectTextBtn:hover {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.22);
    color: #dbeafe;
}

body.light-mode.editor-focus-mode #undoBtn,
body.light-mode.editor-focus-mode #redoBtn,
body.light-mode.editor-focus-mode #detectTextBtn {
    color: #6b7d99;
}

body.light-mode.editor-focus-mode #detectTextBtn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.22);
    color: #1d4ed8;
}

/* Canvas area: smooth scrolling */
.pdf-canvas-container {
    scroll-behavior: smooth;
}

/* Canvas topbar: tighten dark border */
.canvas-topbar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

/* Ensure workspace flex row is correct */
.editor-workspace {
    align-items: stretch;
}

/* Breadcrumb file name update — ensure it truncates cleanly */
.editor-breadcrumb-file {
    max-width: min(40vw, 420px);
}

/* ============================================ */
/* UNIFIED COMMAND HEADER                       */
/* ============================================ */

.editor-command-bar {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.editor-command-bar .edit-toolbar {
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

.toolbar-left-cluster,
.toolbar-right-cluster {
    display: flex;
    align-items: center;
    min-width: 0;
}

.toolbar-left-cluster {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.toolbar-left-cluster::-webkit-scrollbar {
    display: none;
}

.toolbar-right-cluster {
    flex: 0 0 auto;
    gap: 8px;
    margin-left: 12px;
}

.editor-hidden-meta[hidden] {
    display: none !important;
}

.toolbar-spacer {
    flex: 1 1 40px;
    min-width: 24px;
}

.toolbar-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.toolbar-action-btn {
    height: 40px !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: none !important;
}

.toolbar-action-btn i {
    margin-right: 8px;
}

.toolbar-action-label {
    display: inline-flex;
    align-items: center;
}

.toolbar-action-btn.is-compact-label {
    min-width: 34px;
    padding-inline: 10px !important;
}

.toolbar-action-btn.is-compact-label .toolbar-action-label {
    display: none;
}

.toolbar-action-btn.is-compact-label i {
    margin-right: 0;
}

.canvas-inline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 0;
    background: transparent;
    border-bottom: 0;
    gap: 12px;
}

.canvas-inline-controls .canvas-topbar-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(10px);
}

.canvas-inline-controls-left {
    justify-content: flex-start;
}

.canvas-inline-controls-right {
    justify-content: flex-end;
}

body.light-mode.editor-focus-mode .canvas-inline-controls .canvas-topbar-group {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(148, 163, 184, 0.18);
}

.mobile-sticky-dock {
    display: none;
}

.mobile-editor-actions {
    display: none;
}

body.editor-focus-mode .editor-command-bar .edit-toolbar {
    border-radius: 16px !important;
    border: 1px solid rgba(148, 163, 184, 0.10) !important;
    background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(15, 24, 42, 0.98)) !important;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24) !important;
    padding: 10px 14px !important;
}

body.light-mode.editor-focus-mode .editor-command-bar .edit-toolbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98)) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode.editor-focus-mode .toolbar-action-btn.btn-secondary {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
}

body.light-mode.editor-focus-mode .toolbar-action-btn.btn-secondary:hover {
    background: #f8fbff !important;
    color: #1d4ed8 !important;
    border-color: rgba(59, 130, 246, 0.24) !important;
}

@media (max-width: 980px) {
    .toolbar-header-actions {
        gap: 8px;
    }

    .toolbar-action-btn {
        padding: 0 12px !important;
    }
}

@media (max-width: 1500px) {
    .editor-command-bar .edit-toolbar {
        flex-wrap: nowrap;
        overflow: hidden;
        row-gap: 0;
        gap: 4px;
        padding: 8px 10px !important;
    }

    .editor-command-bar .toolbar-left-cluster {
        gap: 4px;
    }

    .editor-command-bar .toolbar-btn {
        min-width: 52px;
        height: 46px;
        padding: 4px 6px;
        gap: 3px;
    }

    .editor-command-bar .toolbar-btn .btn-label {
        display: block;
        font-size: 0.62rem;
        line-height: 1.05;
    }

    .editor-command-bar .toolbar-zoom-group,
    .editor-command-bar .toolbar-page-group {
        gap: 2px;
    }

    .editor-command-bar .toolbar-zoom-label {
        min-width: 44px;
        font-size: 0.8rem;
    }

    .editor-command-bar .toolbar-page-group .toolbar-zoom-label {
        min-width: 58px;
    }

    .editor-command-bar .toolbar-page-group {
        order: 0;
        margin-left: 0;
    }

    .editor-command-bar .toolbar-header-actions {
        width: auto;
        margin-left: 0;
        justify-content: flex-end;
        padding-top: 0;
        border-top: 0;
        gap: 5px;
    }

    .editor-command-bar .toolbar-right-cluster {
        gap: 4px;
        margin-left: 6px;
    }

    .editor-command-bar .toolbar-sep,
    .editor-command-bar .toolbar-zoom-group,
    .editor-command-bar .toolbar-page-group {
        display: none;
    }

    .editor-command-bar .toolbar-action-btn {
        height: 34px !important;
        padding: 0 9px !important;
        font-size: 0.76rem;
        border-radius: 10px !important;
    }

    .editor-command-bar .toolbar-action-btn i {
        margin-right: 5px;
    }

    .editor-command-bar .toolbar-action-btn.is-compact-label {
        min-width: 34px;
        width: 34px;
        padding-inline: 0 !important;
        justify-content: center;
    }

    .editor-command-bar .toolbar-page-group .toolbar-zoom-label {
        min-width: 42px;
    }

    .editor-command-bar .toolbar-sep {
        margin: 0 1px;
    }

    .editor-command-bar .shape-tool-group > #shapeToolBtn,
    .editor-command-bar .check-tool-group > #checkToolBtn {
        min-width: 82px;
        padding-inline: 10px 7px;
        gap: 4px;
    }

    .editor-command-bar .shape-tool-group > .toolbar-btn-caret,
    .editor-command-bar .check-tool-group > .toolbar-btn-caret {
        width: 30px;
        min-width: 30px;
    }
}

@media (max-width: 1180px) {
    .editor-command-bar .toolbar-btn[data-tool="text"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="highlight"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="blackout"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="date"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="time"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="image"] .btn-label,
    .editor-command-bar .toolbar-btn[data-tool="sign"] .btn-label,
    .editor-command-bar #detectTextBtn .btn-label {
        display: none;
    }

    .editor-command-bar .toolbar-btn[data-tool="text"],
    .editor-command-bar .toolbar-btn[data-tool="highlight"],
    .editor-command-bar .toolbar-btn[data-tool="blackout"],
    .editor-command-bar .toolbar-btn[data-tool="date"],
    .editor-command-bar .toolbar-btn[data-tool="time"],
    .editor-command-bar .toolbar-btn[data-tool="image"],
    .editor-command-bar .toolbar-btn[data-tool="sign"],
    .editor-command-bar #detectTextBtn {
        min-width: 34px;
        width: 34px;
        padding: 4px;
        gap: 0;
    }

    .editor-command-bar .toolbar-btn[data-tool="text"] i,
    .editor-command-bar .toolbar-btn[data-tool="highlight"] i,
    .editor-command-bar .toolbar-btn[data-tool="blackout"] i,
    .editor-command-bar .toolbar-btn[data-tool="date"] i,
    .editor-command-bar .toolbar-btn[data-tool="time"] i,
    .editor-command-bar .toolbar-btn[data-tool="image"] i,
    .editor-command-bar .toolbar-btn[data-tool="sign"] i,
    .editor-command-bar #detectTextBtn i {
        font-size: 0.92rem;
    }
}

@media (max-width: 1180px) {
    .editor-command-bar .toolbar-left-cluster {
        overflow-x: auto;
    }

    .editor-command-bar .toolbar-right-cluster {
        position: sticky;
        right: 0;
        padding-left: 10px;
        background: linear-gradient(90deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.92) 18%, rgba(17, 24, 39, 0.98) 100%);
    }

    body.light-mode.editor-focus-mode .editor-command-bar .toolbar-right-cluster {
        background: linear-gradient(90deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.92) 18%, rgba(248, 250, 252, 0.98) 100%);
    }
}

@media (max-width: 768px) {
    body.editor-focus-mode .mobile-sticky-dock {
        position: sticky;
        bottom: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(15, 24, 42, 0.78), rgba(11, 18, 33, 0.96));
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(148, 163, 184, 0.12);
        overflow-x: auto;
        scrollbar-width: none;
    }

    body.editor-focus-mode .mobile-sticky-dock::-webkit-scrollbar {
        display: none;
    }

    body.editor-focus-mode .mobile-dock-group,
    body.editor-focus-mode .mobile-date-btn {
        flex: 0 0 auto;
    }

    body.editor-focus-mode .mobile-dock-group {
        display: inline-flex;
        align-items: stretch;
        min-width: 122px;
    }

    body.editor-focus-mode .mobile-dock-btn {
        min-width: 0;
        height: 52px;
        padding: 6px 14px;
        border-radius: 14px;
    }

    body.editor-focus-mode .mobile-dock-group .mobile-dock-btn {
        flex: 1 1 auto;
        border-radius: 14px 0 0 14px;
    }

    body.editor-focus-mode .mobile-dock-caret {
        width: 40px;
        min-width: 40px;
        border-radius: 0 14px 14px 0;
    }

    body.editor-focus-mode .mobile-date-btn {
        min-width: 92px;
        padding-inline: 14px;
    }

    body.editor-focus-mode #shapeToolGroup,
    body.editor-focus-mode #checkToolGroup,
    body.editor-focus-mode .edit-toolbar > .toolbar-btn[data-tool="date"] {
        display: none;
    }

    body.light-mode.editor-focus-mode .mobile-sticky-dock {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 250, 255, 0.96));
        border-top: 1px solid rgba(148, 163, 184, 0.18);
    }
}
