// Auto-generated by scripts/build-styles.js - DO NOT EDIT
export const inlineStyles = `.udoc-viewer-root {
    /* === Theme Variables (Light) === */
    --udoc-bg-viewport: #e0e0e0;
    --udoc-bg-surface: #fff;
    --udoc-bg-panel: #f5f5f5;
    --udoc-bg-panel-tabs: #e8e8e8;
    --udoc-bg-page-header: #f0f0f0;
    --udoc-bg-reply: #fafafa;
    --udoc-bg-input: #fff;
    --udoc-bg-overlay: rgba(0, 0, 0, 0.5);
    --udoc-bg-loading: rgba(224, 224, 224, 0.95);

    --udoc-text-primary: rgba(0, 0, 0, 0.8);
    --udoc-text-secondary: rgba(0, 0, 0, 0.7);
    --udoc-text-tertiary: rgba(0, 0, 0, 0.6);
    --udoc-text-muted: rgba(0, 0, 0, 0.58);
    --udoc-text-faint: rgba(0, 0, 0, 0.52);
    --udoc-text-disabled: rgba(0, 0, 0, 0.25);
    --udoc-text-heading: #333;
    --udoc-text-body: #555;
    --udoc-text-label: #666;
    --udoc-text-subtle: #767676;
    --udoc-text-placeholder: #999;
    --udoc-text-on-primary: #fff;

    --udoc-primary: #333;
    --udoc-primary-hover: #1a1a1a;
    --udoc-primary-active-bg: rgba(0, 0, 0, 0.1);
    --udoc-primary-active-bg-hover: rgba(0, 0, 0, 0.14);
    --udoc-primary-subtle-bg: rgba(0, 0, 0, 0.06);
    --udoc-primary-focus-ring: rgba(0, 0, 0, 0.15);
    --udoc-primary-muted: rgba(0, 0, 0, 0.25);
    --udoc-primary-disabled: #94a3b8;

    --udoc-border: #ddd;
    --udoc-border-input: #ccc;
    --udoc-border-light: #eee;
    --udoc-border-medium: #e0e0e0;

    --udoc-hover-overlay: rgba(0, 0, 0, 0.08);
    --udoc-active-overlay: rgba(0, 0, 0, 0.12);
    --udoc-pressed-overlay: rgba(0, 0, 0, 0.15);
    --udoc-subtle-hover: rgba(0, 0, 0, 0.05);
    --udoc-faint-hover: rgba(0, 0, 0, 0.04);

    --udoc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --udoc-shadow-page: 0 2px 8px rgba(0, 0, 0, 0.15);
    --udoc-shadow-toolbar: 0 2px 12px rgba(0, 0, 0, 0.15);
    --udoc-shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.2);
    --udoc-shadow-dialog: 0 8px 32px rgba(0, 0, 0, 0.3);
    --udoc-shadow-panel: 4px 0 20px rgba(0, 0, 0, 0.15);

    --udoc-search-highlight: rgba(255, 200, 0, 0.35);
    --udoc-search-highlight-active: rgba(255, 140, 0, 0.6);
    --udoc-search-highlight-active-outline: rgba(255, 140, 0, 0.8);
    --udoc-search-match-bg: rgba(255, 200, 0, 0.4);
    --udoc-search-match-text: #000;
    --udoc-search-result-active-bg: rgba(0, 0, 0, 0.06);

    --udoc-text-selection: rgba(0, 120, 215, 0.5);
    --udoc-selection-color: rgb(0, 120, 215);

    --udoc-annotation-bg: #ffffc0;
    --udoc-annotation-header-bg: #f0f0c0;
    --udoc-annotation-border: #d4d4a0;

    --udoc-status-accepted-bg: #d4edda;
    --udoc-status-accepted-text: #155724;
    --udoc-status-rejected-bg: #f8d7da;
    --udoc-status-rejected-text: #721c24;
    --udoc-status-completed-bg: #cce5ff;
    --udoc-status-completed-text: #004085;
    --udoc-status-cancelled-bg: #e2e3e5;
    --udoc-status-cancelled-text: #383d41;
    --udoc-status-marked-bg: #fff3cd;
    --udoc-status-marked-text: #856404;

    --udoc-error-bg: #fef2f2;
    --udoc-error-border: #fecaca;
    --udoc-error-text: #dc2626;

    --udoc-progress-track: #e5e7eb;
    --udoc-progress-fill: #333;

    --udoc-scrollbar-thumb: rgba(0, 0, 0, 0.3);
    --udoc-scrollbar-thumb-hover: rgba(0, 0, 0, 0.5);

    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    container-type: inline-size;
    container-name: udoc-viewer;
    isolation: isolate;
}

.udoc-viewer-root.udoc-viewer-dark {
    --udoc-bg-viewport: #1a1a1a;
    --udoc-bg-surface: #2d2d2d;
    --udoc-bg-panel: #252525;
    --udoc-bg-panel-tabs: #1e1e1e;
    --udoc-bg-page-header: #2a2a2a;
    --udoc-bg-reply: #333;
    --udoc-bg-input: #3a3a3a;
    --udoc-bg-overlay: rgba(0, 0, 0, 0.7);
    --udoc-bg-loading: rgba(30, 30, 30, 0.95);

    --udoc-text-primary: rgba(255, 255, 255, 0.87);
    --udoc-text-secondary: rgba(255, 255, 255, 0.7);
    --udoc-text-tertiary: rgba(255, 255, 255, 0.6);
    --udoc-text-muted: rgba(255, 255, 255, 0.64);
    --udoc-text-faint: rgba(255, 255, 255, 0.56);
    --udoc-text-disabled: rgba(255, 255, 255, 0.25);
    --udoc-text-heading: #e0e0e0;
    --udoc-text-body: #bbb;
    --udoc-text-label: #aaa;
    --udoc-text-subtle: #a0a0a0;
    --udoc-text-placeholder: #777;
    --udoc-text-on-primary: #fff;

    --udoc-primary: #e0e0e0;
    --udoc-primary-hover: #f0f0f0;
    --udoc-primary-active-bg: rgba(255, 255, 255, 0.12);
    --udoc-primary-active-bg-hover: rgba(255, 255, 255, 0.16);
    --udoc-primary-subtle-bg: rgba(255, 255, 255, 0.07);
    --udoc-primary-focus-ring: rgba(255, 255, 255, 0.2);
    --udoc-primary-muted: rgba(255, 255, 255, 0.3);
    --udoc-primary-disabled: #4a5568;

    --udoc-border: #444;
    --udoc-border-input: #555;
    --udoc-border-light: #3a3a3a;
    --udoc-border-medium: #404040;

    --udoc-hover-overlay: rgba(255, 255, 255, 0.08);
    --udoc-active-overlay: rgba(255, 255, 255, 0.12);
    --udoc-pressed-overlay: rgba(255, 255, 255, 0.15);
    --udoc-subtle-hover: rgba(255, 255, 255, 0.05);
    --udoc-faint-hover: rgba(255, 255, 255, 0.04);

    --udoc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --udoc-shadow-page: 0 2px 8px rgba(0, 0, 0, 0.4);
    --udoc-shadow-toolbar: 0 2px 12px rgba(0, 0, 0, 0.4);
    --udoc-shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.5);
    --udoc-shadow-dialog: 0 8px 32px rgba(0, 0, 0, 0.6);
    --udoc-shadow-panel: 4px 0 20px rgba(0, 0, 0, 0.4);

    --udoc-search-highlight: rgba(255, 200, 0, 0.4);
    --udoc-search-highlight-active: rgba(255, 140, 0, 0.65);
    --udoc-search-highlight-active-outline: rgba(255, 140, 0, 0.85);
    --udoc-search-match-bg: rgba(255, 200, 0, 0.3);
    --udoc-search-match-text: #fff;
    --udoc-search-result-active-bg: rgba(255, 255, 255, 0.08);

    --udoc-text-selection: rgba(77, 166, 255, 0.5);
    --udoc-selection-color: rgb(77, 166, 255);

    --udoc-annotation-bg: #4a4a20;
    --udoc-annotation-header-bg: #3a3a18;
    --udoc-annotation-border: #5a5a30;

    --udoc-status-accepted-bg: #1a3a1a;
    --udoc-status-accepted-text: #6fcf6f;
    --udoc-status-rejected-bg: #3a1a1a;
    --udoc-status-rejected-text: #f08080;
    --udoc-status-completed-bg: #1a2a3a;
    --udoc-status-completed-text: #80b8ff;
    --udoc-status-cancelled-bg: #2a2a2a;
    --udoc-status-cancelled-text: #aaa;
    --udoc-status-marked-bg: #3a3520;
    --udoc-status-marked-text: #d4b44a;

    --udoc-error-bg: #3a1c1c;
    --udoc-error-border: #6b2c2c;
    --udoc-error-text: #f87171;

    --udoc-progress-track: #404040;
    --udoc-progress-fill: #e0e0e0;

    --udoc-scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --udoc-scrollbar-thumb-hover: rgba(255, 255, 255, 0.5);
}

.udoc-viewer-root .udoc-toolbar-slot {
    flex: 0 0 auto;
    position: relative;
    z-index: 11;
}

.udoc-viewer-root .udoc-body-slot {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
}

.udoc-viewer-root .udoc-left-panel-slot {
    flex: 0 0 auto;
}

.udoc-viewer-root .udoc-right-panel-slot {
    flex: 0 0 auto;
}

.udoc-viewer-root .udoc-viewport-slot {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.udoc-viewer-root .udoc-viewport {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--udoc-bg-viewport);
}

.udoc-viewer-root .udoc-sheet-tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 2px;
    padding: 0 8px;
    background: var(--udoc-bg-viewport);
    border-bottom: 1px solid var(--udoc-border);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.udoc-viewer-root .udoc-sheet-tab {
    flex: 0 0 auto;
    padding: 4px 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-top: none;
    border-radius: 0 0 4px 4px;
    color: var(--udoc-text-body);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.udoc-viewer-root .udoc-sheet-tab:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-sheet-tab--active {
    background: var(--udoc-bg-surface);
    border-color: var(--udoc-border);
    color: var(--udoc-text-heading);
    font-weight: 600;
}

.udoc-viewer-root .udoc-viewport__content {
    position: relative;
    width: 100%;
    height: 100%;
}

.udoc-viewer-root .udoc-viewport__scroll {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    /* scrollbar visibility is managed dynamically by Viewport.ts */
}

.udoc-viewer-root .udoc-viewport__container {
    position: relative;
    min-height: 100%;
    box-sizing: border-box;
    /* height set dynamically for virtual scrolling */
}

/* Spread */
.udoc-viewer-root .udoc-spread {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-spread__wrapper {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    /* gap is set dynamically by Spread.ts based on pageSpacing */
}

.udoc-viewer-root .udoc-spread--hidden {
    display: none;
}

/* Page slot within spread */
.udoc-viewer-root .udoc-spread__slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: var(--udoc-shadow-page);
}

.udoc-viewer-root .udoc-viewport--seamless .udoc-spread__slot {
    box-shadow: none;
}

/* Continuous view mode: seamless stitching, no page chrome */
.udoc-viewer-root .udoc-viewport--continuous .udoc-spread__slot {
    box-shadow: none;
    background: transparent;
    --stitch-color: rgba(0, 0, 0, 0.15);
}

.udoc-viewer-dark .udoc-viewport--continuous .udoc-spread__slot {
    --stitch-color: rgba(255, 255, 255, 0.15);
}

.udoc-viewer-root .udoc-viewport--continuous .udoc-spread__slot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background-image:
        repeating-linear-gradient(
            to right,
            var(--stitch-color) 0,
            var(--stitch-color) 6px,
            transparent 6px,
            transparent 12px
        ),
        repeating-linear-gradient(
            to bottom,
            var(--stitch-color) 0,
            var(--stitch-color) 6px,
            transparent 6px,
            transparent 12px
        );
    background-size:
        100% 1px,
        1px 100%;
    background-position:
        bottom left,
        top right;
    background-repeat: repeat-x, repeat-y;
}

/* Hide bottom stitch line on last row */
.udoc-viewer-root .udoc-viewport--continuous .udoc-spread--last-row .udoc-spread__slot::after {
    background-image: repeating-linear-gradient(
        to bottom,
        var(--stitch-color) 0,
        var(--stitch-color) 6px,
        transparent 6px,
        transparent 12px
    );
    background-size: 1px 100%;
    background-position: top right;
    background-repeat: repeat-y;
}

/* Hide right stitch line on last column */
.udoc-viewer-root .udoc-viewport--continuous .udoc-spread--last-col .udoc-spread__slot::after {
    background-image: repeating-linear-gradient(
        to right,
        var(--stitch-color) 0,
        var(--stitch-color) 6px,
        transparent 6px,
        transparent 12px
    );
    background-size: 100% 1px;
    background-position: bottom left;
    background-repeat: repeat-x;
}

/* Hide both on last row + last column */
.udoc-viewer-root .udoc-viewport--continuous .udoc-spread--last-row.udoc-spread--last-col .udoc-spread__slot::after {
    background-image: none;
}

.udoc-viewer-root .udoc-spread__slot--empty {
    background: transparent;
    box-shadow: none;
}

.udoc-viewer-root .udoc-spread__preview-canvas {
    display: none;
    image-rendering: auto;
}

.udoc-viewer-root .udoc-spread__canvas {
    display: block;
}

/* Floating Toolbar */
.udoc-viewer-root .udoc-floating-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 6px;
    background: var(--udoc-bg-surface);
    border-radius: 8px;
    box-shadow: var(--udoc-shadow-toolbar);
    z-index: 30;
    transition: opacity 0.3s ease;
}

.udoc-viewer-root .udoc-floating-toolbar--idle {
    opacity: 0;
    pointer-events: none;
}

/* Zoom Dropdown */
.udoc-viewer-root .udoc-zoom-dropdown {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.udoc-viewer-root .udoc-zoom-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    border: 1px solid var(--udoc-pressed-overlay);
    border-radius: 4px;
    background: transparent;
}

.udoc-viewer-root .udoc-zoom-dropdown__toggle:focus-within {
    border-color: var(--udoc-scrollbar-thumb);
    background: var(--udoc-bg-input);
}

.udoc-viewer-root .udoc-zoom-dropdown__input {
    width: 44px;
    padding: 2px 4px;
    border: none;
    border-radius: 4px 0 0 4px;
    background: transparent;
    color: var(--udoc-text-primary);
    font-size: 13px;
    text-align: center;
}

.udoc-viewer-root .udoc-zoom-dropdown__input:focus {
    outline: none;
}

.udoc-viewer-root .udoc-zoom-dropdown__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 100%;
    padding: 2px 2px;
    border: none;
    border-left: 1px solid var(--udoc-subtle-hover);
    border-radius: 0 4px 4px 0;
    background: transparent;
    color: var(--udoc-text-muted);
    cursor: pointer;
}

.udoc-viewer-root .udoc-zoom-dropdown__chevron svg {
    width: 14px;
    height: 14px;
}

.udoc-viewer-root .udoc-zoom-dropdown__chevron:hover {
    background: var(--udoc-hover-overlay);
    color: var(--udoc-text-secondary);
}

.udoc-viewer-root .udoc-zoom-dropdown__chevron--active {
    background: var(--udoc-active-overlay);
}

.udoc-viewer-root .udoc-zoom-dropdown__chevron svg {
    width: 14px;
    height: 14px;
}

.udoc-viewer-root .udoc-zoom-dropdown__menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px;
    background: var(--udoc-bg-surface);
    border-radius: 8px;
    box-shadow: var(--udoc-shadow-dropdown);
    min-width: 100px;
}

.udoc-viewer-root .udoc-zoom-dropdown__section {
    display: flex;
    flex-direction: column;
}

.udoc-viewer-root .udoc-zoom-dropdown__divider {
    height: 1px;
    background: var(--udoc-subtle-hover);
    margin: 6px 0;
}

.udoc-viewer-root .udoc-zoom-dropdown__item {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-text-primary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.udoc-viewer-root .udoc-zoom-dropdown__item:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-zoom-dropdown__item--active {
    background: var(--udoc-primary-active-bg);
    color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-zoom-dropdown__item--active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

/* View Mode Menu */
.udoc-viewer-root .udoc-view-mode-menu {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.udoc-viewer-root .udoc-view-mode-menu__dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    padding: 8px;
    background: var(--udoc-bg-surface);
    border-radius: 8px;
    box-shadow: var(--udoc-shadow-dropdown);
    min-width: 160px;
}

.udoc-viewer-root .udoc-view-mode-menu__section {
    margin-bottom: 8px;
}

.udoc-viewer-root .udoc-view-mode-menu__section:last-child {
    margin-bottom: 0;
}

.udoc-viewer-root .udoc-view-mode-menu__title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--udoc-text-muted);
    margin-bottom: 4px;
    padding: 0 4px;
}

.udoc-viewer-root .udoc-view-mode-menu__options {
    display: flex;
    gap: 2px;
}

.udoc-viewer-root .udoc-view-mode-menu__option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-text-tertiary);
    cursor: pointer;
}

.udoc-viewer-root .udoc-view-mode-menu__option:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-view-mode-menu__option--active {
    background: var(--udoc-primary-active-bg);
    color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-view-mode-menu__option--active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

.udoc-viewer-root .udoc-view-mode-menu__option--disabled {
    color: var(--udoc-text-disabled);
    cursor: default;
}

.udoc-viewer-root .udoc-view-mode-menu__option--disabled:hover {
    background: transparent;
}

.udoc-viewer-root .udoc-view-mode-menu__option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.udoc-viewer-root .udoc-view-mode-menu__option-icon svg {
    width: 20px;
    height: 20px;
}

/* Left Panel */
.udoc-viewer-root .udoc-left-panel {
    position: relative;
    display: flex;
    width: 240px;
    height: 100%;
    background: var(--udoc-bg-panel);
    border-right: 1px solid var(--udoc-border);
    overflow: hidden;
    transition: width 0.2s ease;
}

.udoc-viewer-root .udoc-left-panel--closed {
    width: 0;
    border-right: none;
}

.udoc-viewer-root .udoc-left-panel__tabs {
    display: flex;
    flex-direction: column;
    width: 40px;
    background: var(--udoc-bg-panel-tabs);
    border-right: 1px solid var(--udoc-border);
}

.udoc-viewer-root .udoc-left-panel__tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--udoc-text-label);
    cursor: pointer;
}

.udoc-viewer-root .udoc-left-panel__tab:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-left-panel__tab--active {
    background: var(--udoc-bg-panel);
    color: var(--udoc-text-heading);
    border-right: 2px solid var(--udoc-primary);
}

.udoc-viewer-root .udoc-left-panel__tab svg {
    width: 20px;
    height: 20px;
}

.udoc-viewer-root .udoc-left-panel__content {
    flex: 1;
    overflow: hidden;
}

.udoc-viewer-root .udoc-left-panel__resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
}

.udoc-viewer-root .udoc-left-panel__resize-handle:hover,
.udoc-viewer-root .udoc-left-panel--resizing .udoc-left-panel__resize-handle {
    background: var(--udoc-primary-muted);
}

.udoc-viewer-root .udoc-left-panel--resizing {
    transition: none;
}

/* Thumbnail Panel */
.udoc-viewer-root .udoc-thumbnail-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.udoc-viewer-root .udoc-thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.udoc-viewer-root .udoc-thumbnail-item:hover {
    background: var(--udoc-subtle-hover);
}

.udoc-viewer-root .udoc-thumbnail-item--active {
    background: var(--udoc-primary-subtle-bg);
    outline: 2px solid var(--udoc-primary);
    outline-offset: -2px;
}

.udoc-viewer-root .udoc-thumbnail-item__canvas {
    display: block;
    max-width: calc(100% - 16px);
    background: white;
    box-shadow: var(--udoc-shadow-sm);
}

.udoc-viewer-root .udoc-thumbnail-item__label {
    font-size: 11px;
    color: var(--udoc-text-label);
    text-align: center;
}

.udoc-viewer-root .udoc-thumbnail-item--active .udoc-thumbnail-item__label {
    color: var(--udoc-primary);
    font-weight: 500;
}

/* Outline Panel */
.udoc-viewer-root .udoc-outline-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.udoc-viewer-root .udoc-outline-panel__loading,
.udoc-viewer-root .udoc-panel-empty {
    padding: 16px;
    color: var(--udoc-text-subtle);
    font-size: 13px;
    text-align: center;
}

.udoc-viewer-root .udoc-outline-item {
    display: flex;
    flex-direction: column;
}

.udoc-viewer-root .udoc-outline-item__header {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 8px;
    gap: 4px;
    min-height: 28px;
}

.udoc-viewer-root .udoc-outline-item__header--clickable {
    cursor: pointer;
}

.udoc-viewer-root .udoc-outline-item__header--clickable:hover {
    background: var(--udoc-subtle-hover);
}

.udoc-viewer-root .udoc-outline-item__header--active {
    background: var(--udoc-primary-subtle-bg);
}

.udoc-viewer-root .udoc-outline-item__header--active .udoc-outline-item__title {
    color: var(--udoc-primary);
    font-weight: 500;
}

.udoc-viewer-root .udoc-outline-item__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--udoc-text-label);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.udoc-viewer-root .udoc-outline-item__toggle:hover {
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-outline-item__toggle--expanded {
    transform: rotate(90deg);
}

.udoc-viewer-root .udoc-outline-item__spacer {
    width: 16px;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-outline-item__title {
    font-size: 13px;
    color: var(--udoc-text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* .udoc-outline-item__children: Indentation is handled via padding-left on header */

/* Layers panel */
.udoc-viewer-root .udoc-layers-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.udoc-viewer-root .udoc-layers-panel__loading,
.udoc-viewer-root .udoc-layers-panel__item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    min-height: 32px;
    cursor: pointer;
}

.udoc-viewer-root .udoc-layers-panel__item:hover {
    background: var(--udoc-subtle-hover);
}

.udoc-viewer-root .udoc-layers-panel__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--udoc-text-heading);
    cursor: pointer;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-layers-panel__toggle svg {
    width: 18px;
    height: 18px;
}

.udoc-viewer-root .udoc-layers-panel__toggle:hover {
    color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-layers-panel__toggle--hidden {
    color: var(--udoc-text-subtle);
}

.udoc-viewer-root .udoc-layers-panel__label {
    font-size: 13px;
    color: var(--udoc-text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    cursor: pointer;
}

.udoc-viewer-root .udoc-layers-panel__label--hidden {
    color: var(--udoc-text-subtle);
}

.udoc-viewer-root .udoc-layers-panel__item--locked {
    cursor: default;
}

.udoc-viewer-root .udoc-layers-panel__item--locked .udoc-layers-panel__toggle {
    cursor: default;
    opacity: 0.5;
}

.udoc-viewer-root .udoc-layers-panel__item--locked .udoc-layers-panel__label {
    cursor: default;
}

.udoc-viewer-root .udoc-layers-panel__lock {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--udoc-text-subtle);
}

.udoc-viewer-root .udoc-layers-panel__lock svg {
    width: 14px;
    height: 14px;
}

/* Fonts panel */
.udoc-viewer-root .udoc-fonts-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.udoc-viewer-root .udoc-fonts-panel__loading {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    min-height: 32px;
    color: var(--udoc-text-subtle);
    font-size: 13px;
}

.udoc-viewer-root .udoc-fonts-panel__item {
    display: flex;
    flex-direction: column;
    padding: 6px 12px;
    gap: 2px;
}

.udoc-viewer-root .udoc-fonts-panel__item:hover {
    background: var(--udoc-subtle-hover);
}

.udoc-viewer-root .udoc-fonts-panel__spec {
    font-size: 13px;
    font-weight: 500;
    color: var(--udoc-text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.udoc-viewer-root .udoc-fonts-panel__tree {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-left: 4px;
}

.udoc-viewer-root .udoc-fonts-panel__font-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}

.udoc-viewer-root .udoc-fonts-panel__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--udoc-text-subtle);
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-fonts-panel__dot--primary {
    background: var(--udoc-text-heading);
    border-color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-fonts-panel__font-name {
    font-size: 12px;
    color: var(--udoc-text-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.udoc-viewer-root .udoc-fonts-panel__font-row--fallback .udoc-fonts-panel__font-name {
    color: var(--udoc-text-label);
}

.udoc-viewer-root .udoc-fonts-panel__source {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--udoc-hover-overlay);
    color: var(--udoc-text-label);
    white-space: nowrap;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 4px;
    background: var(--udoc-bg-panel);
    border-bottom: 1px solid var(--udoc-border);
}

.udoc-viewer-root .udoc-toolbar__left,
.udoc-viewer-root .udoc-toolbar__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.udoc-viewer-root .udoc-toolbar__right {
    margin-left: auto;
}

.udoc-viewer-root .udoc-toolbar__spacer {
    flex: 1;
}

.udoc-viewer-root .udoc-toolbar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-text-body);
    cursor: pointer;
}

.udoc-viewer-root .udoc-toolbar__btn:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-toolbar__btn:active {
    background: var(--udoc-active-overlay);
}

.udoc-viewer-root .udoc-toolbar__btn svg {
    width: 20px;
    height: 20px;
}

/* Toolbar center section (inline controls when floating toolbar is hidden) */
.udoc-viewer-root .udoc-toolbar__center {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-start;
}

/* Overflow menu (hidden on desktop, shown on mobile) */
.udoc-viewer-root .udoc-overflow-menu {
    display: none;
    position: relative;
}

.udoc-viewer-root .udoc-overflow-menu__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    background: var(--udoc-bg-surface);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: var(--udoc-shadow-dialog);
    padding: 4px 0;
    z-index: 80;
}

.udoc-viewer-root .udoc-overflow-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--udoc-text-body);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

.udoc-viewer-root .udoc-overflow-menu__item:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-overflow-menu__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-overflow-menu__item-icon svg {
    width: 18px;
    height: 18px;
}

.udoc-viewer-root .udoc-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0;
}

.udoc-viewer-root .udoc-toolbar__divider {
    width: 1px;
    height: 20px;
    background: var(--udoc-border);
    margin: 0 2px;
}

.udoc-viewer-root .udoc-toolbar__btn--nav {
    width: 32px;
    height: 32px;
}

.udoc-viewer-root .udoc-toolbar__btn--nav svg {
    width: 18px;
    height: 18px;
}

.udoc-viewer-root .udoc-toolbar__page-info {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--udoc-text-body);
}

.udoc-viewer-root .udoc-toolbar__page-input {
    width: 36px;
    height: 24px;
    border: 1px solid var(--udoc-border-input);
    border-radius: 3px;
    text-align: center;
    font-size: 13px;
    padding: 0 2px;
    background: var(--udoc-bg-input);
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-toolbar__page-input:focus {
    outline: none;
    border-color: var(--udoc-text-placeholder);
}

.udoc-viewer-root .udoc-toolbar__page-total {
    font-size: 13px;
    color: var(--udoc-text-muted);
    white-space: nowrap;
}

/* Zoom dropdown in toolbar: drops down instead of up */
.udoc-viewer-root .udoc-zoom-dropdown--toolbar .udoc-zoom-dropdown__menu {
    bottom: auto;
    top: calc(100% + 8px);
}

/* View mode menu in toolbar: drops down instead of up */
.udoc-viewer-root .udoc-toolbar__center .udoc-view-mode-menu__dropdown {
    bottom: auto;
    top: calc(100% + 8px);
}

/* ===== Tool buttons (pointer split button & tool set buttons) ===== */

/* Split button container */
.udoc-viewer-root .udoc-toolbar__split-btn {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

.udoc-viewer-root .udoc-toolbar__split-btn--active {
    background: var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-toolbar__split-btn--active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

.udoc-viewer-root .udoc-toolbar__split-btn-main {
    width: 26px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.udoc-viewer-root .udoc-toolbar__split-btn-drop {
    width: 16px;
    padding: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.udoc-viewer-root .udoc-toolbar__split-btn-drop svg {
    width: 12px;
    height: 12px;
}

/* Split button dropdown */
.udoc-viewer-root .udoc-toolbar__split-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 140px;
    background: var(--udoc-bg-surface);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: var(--udoc-shadow-dialog);
    padding: 4px 0;
    z-index: 80;
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--udoc-text-body);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-item:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-item--active {
    background: var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-item--active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-toolbar__split-dropdown-icon svg {
    width: 18px;
    height: 18px;
}

/* Tool set buttons active state */
.udoc-viewer-root .udoc-toolbar__btn--tool-active {
    background: var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-toolbar__btn--tool-active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

/* ===== Sub-toolbar (tool options bar) ===== */

.udoc-viewer-root .udoc-subtoolbar-slot {
    flex: 0 0 auto;
    position: relative;
    z-index: 10;
}

.udoc-viewer-root .udoc-subtoolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 8px;
    background: var(--udoc-bg-panel);
    border-bottom: 1px solid var(--udoc-border);
}

.udoc-viewer-root .udoc-subtoolbar__tools {
    display: flex;
    align-items: center;
    gap: 2px;
}

.udoc-viewer-root .udoc-subtoolbar__undo {
    display: flex;
    align-items: center;
    gap: 2px;
}

.udoc-viewer-root .udoc-subtoolbar__divider {
    width: 1px;
    height: 20px;
    background: var(--udoc-border);
    margin: 0 4px;
}

.udoc-viewer-root .udoc-subtoolbar__options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
}

.udoc-viewer-root .udoc-subtoolbar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-text-body);
    cursor: pointer;
}

.udoc-viewer-root .udoc-subtoolbar__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.udoc-viewer-root .udoc-subtoolbar__btn:hover:not(:disabled) {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-subtoolbar__btn--active {
    background: var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-subtoolbar__btn--active:hover {
    background: var(--udoc-primary-active-bg-hover);
}

.udoc-viewer-root .udoc-subtoolbar__btn svg {
    width: 20px;
    height: 20px;
}

/* ---- Dropdown trigger (shared) ---- */
.udoc-viewer-root .udoc-subtoolbar__dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--udoc-border);
    border-radius: 4px;
    background: var(--udoc-bg-panel);
    cursor: pointer;
    color: var(--udoc-text-body);
    box-sizing: border-box;
}

.udoc-viewer-root .udoc-subtoolbar__dropdown-trigger:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-subtoolbar__dropdown-trigger--icon svg {
    width: 20px;
    height: 20px;
}

.udoc-viewer-root .udoc-subtoolbar__dropdown-arrow {
    font-size: 10px;
    line-height: 1;
    color: var(--udoc-text-muted);
}

/* ---- Color swatch in trigger ---- */
.udoc-viewer-root .udoc-subtoolbar__color-swatch {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    padding: 0;
    box-sizing: border-box;
    pointer-events: none;
}

/* Stroke swatch: outlined ring */
.udoc-viewer-root .udoc-subtoolbar__color-swatch--stroke {
    background: transparent;
    border: 3px solid var(--swatch-color);
}

/* Stroke none: dashed ring */
.udoc-viewer-root .udoc-subtoolbar__color-swatch--stroke-none {
    border-color: var(--udoc-text-muted);
    border-style: dashed;
    border-width: 2px;
}

/* Fill swatch: solid disc */
.udoc-viewer-root .udoc-subtoolbar__color-swatch--fill {
    background: var(--swatch-color);
    border: 2px solid var(--udoc-border);
}

/* Fill none: diagonal strike */
.udoc-viewer-root .udoc-subtoolbar__color-swatch--fill-none {
    background: transparent;
    position: relative;
    overflow: hidden;
}

.udoc-viewer-root .udoc-subtoolbar__color-swatch--fill-none::after {
    content: "";
    position: absolute;
    width: 140%;
    height: 2px;
    background: var(--udoc-text-muted);
    top: 50%;
    left: -20%;
    transform: rotate(-45deg);
}

/* ---- NumberInput trigger ---- */
.udoc-viewer-root .udoc-number-input__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 68px;
    height: 28px;
    padding: 0 4px;
    border: 1px solid var(--udoc-border);
    border-radius: 4px;
    background: var(--udoc-bg-panel);
    cursor: pointer;
    color: var(--udoc-text-body);
    box-sizing: border-box;
}

.udoc-viewer-root .udoc-number-input__trigger:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-number-input__icon {
    display: flex;
    align-items: center;
    width: 14px;
    height: 14px;
    color: var(--udoc-text-muted);
}

.udoc-viewer-root .udoc-number-input__icon svg {
    width: 14px;
    height: 14px;
}

.udoc-viewer-root .udoc-number-input__value {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ---- NumberInput floating panel ---- */
.udoc-viewer-root .udoc-number-input-panel {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 2px;
    padding: 8px 10px;
    background: var(--udoc-bg-panel);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.udoc-viewer-root .udoc-number-input-panel--open {
    display: flex;
    align-items: center;
    gap: 8px;
}

.udoc-viewer-root .udoc-number-input-panel__slider {
    width: 100px;
    height: 4px;
    cursor: pointer;
    accent-color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-number-input-panel__text {
    width: 48px;
    text-align: center;
    border: 1px solid var(--udoc-border);
    border-radius: 4px;
    padding: 3px 4px;
    font-size: 11px;
    font-family: inherit;
    color: var(--udoc-text-body);
    background: var(--udoc-bg-panel);
    box-sizing: border-box;
}

.udoc-viewer-root .udoc-number-input-panel__text:focus {
    outline: 2px solid var(--udoc-primary);
    outline-offset: -1px;
}

/* ---- Color panel (floating) ---- */
.udoc-viewer-root .udoc-color-panel {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 2px;
    padding: 8px;
    background: var(--udoc-bg-panel);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.udoc-viewer-root .udoc-color-panel--open {
    display: block;
}

.udoc-viewer-root .udoc-color-panel__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    justify-items: center;
}

/* Base swatch (shared) */
.udoc-viewer-root .udoc-color-panel__swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
}

/* Fill panel: solid discs with subtle border */
.udoc-viewer-root .udoc-color-panel__grid--fill .udoc-color-panel__swatch:not(.udoc-color-panel__swatch--none) {
    background: var(--swatch-color);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Stroke panel: outlined rings */
.udoc-viewer-root .udoc-color-panel__grid--stroke .udoc-color-panel__swatch:not(.udoc-color-panel__swatch--none) {
    background: transparent;
    border: 3px solid var(--swatch-color);
}

/* Hover: both use outline */
.udoc-viewer-root .udoc-color-panel__swatch:hover:not(.udoc-color-panel__swatch--active) {
    outline: 2px solid var(--udoc-text-muted);
    outline-offset: 1px;
}

/* Active: both use outline */
.udoc-viewer-root .udoc-color-panel__swatch--active:not(.udoc-color-panel__swatch--none) {
    outline: 2px solid var(--udoc-primary);
    outline-offset: 2px;
}

/* None swatch — shared base */
.udoc-viewer-root .udoc-color-panel__swatch--none {
    background: transparent;
    cursor: pointer;
}

.udoc-viewer-root .udoc-color-panel__swatch--none.udoc-color-panel__swatch--active {
    outline: 2px solid var(--udoc-primary);
    outline-offset: 2px;
}

/* None stroke: dashed ring (matches toolbar trigger) */
.udoc-viewer-root .udoc-color-panel__swatch--none-stroke {
    border: 2px dashed var(--udoc-text-muted);
}

/* None fill: diagonal strike (matches toolbar trigger) */
.udoc-viewer-root .udoc-color-panel__swatch--none-fill {
    border: 2px solid var(--udoc-border);
    position: relative;
    overflow: hidden;
}

.udoc-viewer-root .udoc-color-panel__swatch--none-fill::after {
    content: "";
    position: absolute;
    width: 140%;
    height: 2px;
    background: var(--udoc-text-muted);
    top: 50%;
    left: -20%;
    transform: rotate(-45deg);
}

.udoc-viewer-root .udoc-color-panel__swatch--none:hover {
    border-color: var(--udoc-text-muted);
}

/* ---- Line style panel (floating) ---- */
.udoc-viewer-root .udoc-linestyle-panel {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 2px;
    padding: 4px;
    background: var(--udoc-bg-panel);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.udoc-viewer-root .udoc-linestyle-panel--open {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.udoc-viewer-root .udoc-linestyle-panel__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    color: var(--udoc-text-body);
}

.udoc-viewer-root .udoc-linestyle-panel__item:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-linestyle-panel__item--active {
    background: var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-linestyle-panel__icon {
    display: flex;
    width: 24px;
    height: 24px;
}

.udoc-viewer-root .udoc-linestyle-panel__icon svg {
    width: 24px;
    height: 24px;
}

.udoc-viewer-root .udoc-linestyle-panel__label {
    font-size: 11px;
}

/* ---- Arrow head panel (floating) ---- */
.udoc-viewer-root .udoc-arrowhead-panel {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 2px;
    padding: 8px;
    background: var(--udoc-bg-panel);
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.udoc-viewer-root .udoc-arrowhead-panel--open {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.udoc-viewer-root .udoc-arrowhead-panel__row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.udoc-viewer-root .udoc-arrowhead-panel__row-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--udoc-text-muted);
    letter-spacing: 0.05em;
    width: 36px;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-arrowhead-panel__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--udoc-text-body);
}

.udoc-viewer-root .udoc-arrowhead-panel__btn svg {
    width: 20px;
    height: 20px;
}

.udoc-viewer-root .udoc-arrowhead-panel__btn:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-arrowhead-panel__btn--active {
    background: var(--udoc-primary-active-bg);
}

/* Right Panel */
.udoc-viewer-root .udoc-right-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 300px;
    height: 100%;
    background: var(--udoc-bg-panel);
    border-left: 1px solid var(--udoc-border);
    overflow: hidden;
    transition: width 0.2s ease;
}

.udoc-viewer-root .udoc-right-panel--closed {
    width: 0;
    border-left: none;
}

.udoc-viewer-root .udoc-right-panel__resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
}

.udoc-viewer-root .udoc-right-panel__resize-handle:hover,
.udoc-viewer-root .udoc-right-panel--resizing .udoc-right-panel__resize-handle {
    background: var(--udoc-primary-muted);
}

.udoc-viewer-root .udoc-right-panel--resizing {
    transition: none;
}

.udoc-viewer-root .udoc-right-panel__content {
    flex: 1;
    overflow: auto;
}

/* Text Layer (for text selection) */
.udoc-viewer-root .udoc-spread__text-layer {
    position: absolute;
    overflow: hidden;
    /* user-select: none prevents selection from starting/extending in gaps */
    user-select: none;
    pointer-events: auto;
    z-index: 1;
    /* Isolate compositing so overlapping run ::selection backgrounds
       don't double-darken.  Selection is painted opaque inside the group,
       then the whole layer is rendered at reduced opacity onto the page. */
    isolation: isolate;
    opacity: 0.6;
}

/* Layout structure containers — each positioned relative to its parent */
.udoc-viewer-root .udoc-text-frame,
.udoc-viewer-root .udoc-text-parcel,
.udoc-viewer-root .udoc-text-line,
.udoc-viewer-root .udoc-text-table,
.udoc-viewer-root .udoc-text-row,
.udoc-viewer-root .udoc-text-cell,
.udoc-viewer-root .udoc-text-grid {
    position: absolute;
}

.udoc-viewer-root .udoc-text-run {
    position: absolute;
    color: transparent;
    white-space: pre;
    line-height: 1;
    font-family: sans-serif;
    overflow: hidden;
    /* Allow selection on actual text runs */
    user-select: text;
}

.udoc-viewer-root .udoc-text-run::selection {
    background: var(--udoc-text-selection);
}

/* Text selection disabled */
.udoc-viewer--no-text-select .udoc-spread__text-layer {
    pointer-events: none;
}

.udoc-viewer--no-text-select .udoc-text-run {
    user-select: none;
}

/* View tool cursors */
.udoc-viewer--tool-hand .udoc-viewport__scroll {
    cursor: grab;
}

.udoc-viewer--tool-hand-grabbing .udoc-viewport__scroll {
    cursor: grabbing;
}

.udoc-viewer--tool-hand .udoc-spread__text-layer,
.udoc-viewer--tool-hand-grabbing .udoc-spread__text-layer {
    pointer-events: none;
}

.udoc-viewer--tool-hand .udoc-text-run,
.udoc-viewer--tool-hand-grabbing .udoc-text-run {
    user-select: none;
}

.udoc-viewer--tool-zoom .udoc-viewport__scroll {
    cursor: zoom-in;
}

.udoc-viewer--tool-zoom-out .udoc-viewport__scroll {
    cursor: zoom-out;
}

.udoc-viewer--tool-zoom .udoc-spread__text-layer {
    pointer-events: none;
}

.udoc-viewer--tool-zoom .udoc-text-run {
    user-select: none;
}

/* Annotation draw tool cursor */
.udoc-viewer--tool-draw .udoc-viewport__scroll {
    cursor: crosshair;
    touch-action: none;
}

.udoc-viewer--tool-draw .udoc-spread__text-layer {
    pointer-events: none;
}

.udoc-viewer--tool-draw .udoc-text-run {
    user-select: none;
}

/* Annotation Layer */
.udoc-viewer-root .udoc-spread__annotation-layer {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

/* Base annotation */
.udoc-viewer-root .udoc-annotation {
    position: absolute;
    box-sizing: border-box;
}

/* Link annotation */
.udoc-viewer-root .udoc-annotation--link {
    pointer-events: auto;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.udoc-viewer-root .udoc-annotation--link:hover {
    background-color: var(--udoc-primary-active-bg);
}

/* Highlight annotation */
.udoc-viewer-root .udoc-annotation--highlight {
    pointer-events: none;
}

.udoc-viewer-root .udoc-annotation__quad {
    mix-blend-mode: multiply;
}

/* Underline annotation */
.udoc-viewer-root .udoc-annotation--underline {
    pointer-events: none;
}

/* StrikeOut annotation */
.udoc-viewer-root .udoc-annotation--strikeout {
    pointer-events: none;
}

/* Squiggly annotation */
.udoc-viewer-root .udoc-annotation--squiggly {
    pointer-events: none;
}

/* Text (sticky note) annotation */
.udoc-viewer-root .udoc-annotation--text {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s ease;
}

.udoc-viewer-root .udoc-annotation--text:hover {
    filter: brightness(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.udoc-viewer-root .udoc-annotation--text svg {
    width: 100%;
    height: 100%;
}

/* Annotation popup */
.udoc-viewer-root .udoc-annotation-popup {
    position: absolute;
    z-index: 30;
    min-width: 200px;
    max-width: 300px;
    background: var(--udoc-annotation-bg);
    border: 1px solid var(--udoc-annotation-border);
    border-radius: 4px;
    box-shadow: var(--udoc-shadow-page);
    font-size: 12px;
    color: var(--udoc-text-heading);
    pointer-events: auto;
}

.udoc-viewer-root .udoc-annotation-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--udoc-annotation-header-bg);
    border-bottom: 1px solid var(--udoc-annotation-border);
    border-radius: 4px 4px 0 0;
}

.udoc-viewer-root .udoc-annotation-popup__author {
    font-weight: 600;
    color: var(--udoc-text-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.udoc-viewer-root .udoc-annotation-popup__close {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    flex-shrink: 0;
    margin-left: 8px;
}

.udoc-viewer-root .udoc-annotation-popup__close:hover {
    opacity: 1;
}

.udoc-viewer-root .udoc-annotation-popup__close svg {
    width: 12px;
    height: 12px;
}

.udoc-viewer-root .udoc-annotation-popup__content {
    padding: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* FreeText annotation */
.udoc-viewer-root .udoc-annotation--freetext {
    pointer-events: auto;
    overflow: hidden;
    font-size: 12px;
    padding: 2px;
}

/* Stamp annotation */
.udoc-viewer-root .udoc-annotation--stamp {
    pointer-events: none;
}

/* Caret annotation - rendered via SVG, minimal styling needed */
.udoc-viewer-root .udoc-annotation--caret {
    pointer-events: none;
}

/* Shape annotations - rendered via SVG overlay */
.udoc-viewer-root .udoc-annotation--line,
.udoc-viewer-root .udoc-annotation--square,
.udoc-viewer-root .udoc-annotation--circle,
.udoc-viewer-root .udoc-annotation--polygon,
.udoc-viewer-root .udoc-annotation--polyLine,
.udoc-viewer-root .udoc-annotation--ink {
    pointer-events: none;
}

/* Redact annotation */
.udoc-viewer-root .udoc-annotation--redact {
    pointer-events: none;
}

/* Annotation Panel */
.udoc-viewer-root .udoc-annotation-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.udoc-viewer-root .udoc-annotation-panel__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--udoc-text-subtle);
    font-size: 13px;
}

/* Comments List */
.udoc-viewer-root .udoc-comments-list {
    display: flex;
    flex-direction: column;
}

/* Page Group */
.udoc-viewer-root .udoc-comments-page-group {
    border-bottom: 1px solid var(--udoc-border-medium);
}

.udoc-viewer-root .udoc-comments-page-group:last-child {
    border-bottom: none;
}

.udoc-viewer-root .udoc-comments-page-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    background: var(--udoc-bg-page-header);
    transition: background 0.15s;
}

.udoc-viewer-root .udoc-comments-page-header:hover {
    background: var(--udoc-bg-panel-tabs);
}

.udoc-viewer-root .udoc-comments-page-header svg {
    width: 16px;
    height: 16px;
    color: var(--udoc-text-label);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.udoc-viewer-root .udoc-comments-page-header span {
    font-size: 13px;
    font-weight: 500;
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-comments-page-count {
    margin-left: auto;
    padding: 2px 6px;
    background: var(--udoc-border);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--udoc-text-label);
}

/* Collapsed state */
.udoc-viewer-root .udoc-comments-page-group--collapsed .udoc-comments-page-header svg {
    transform: rotate(-90deg);
}

.udoc-viewer-root .udoc-comments-page-group--collapsed .udoc-comments-page-content {
    display: none;
}

/* Page Content */
.udoc-viewer-root .udoc-comments-page-content {
    display: flex;
    flex-direction: column;
}

/* Comment Item */
.udoc-viewer-root .udoc-comment-item {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--udoc-border-light);
}

.udoc-viewer-root .udoc-comment-item:last-child {
    border-bottom: none;
}

.udoc-viewer-root .udoc-comment-item:hover {
    background: var(--udoc-subtle-hover);
}

/* Reply indentation */
.udoc-viewer-root .udoc-comment-reply {
    background: var(--udoc-bg-reply);
}

.udoc-viewer-root .udoc-comment-depth-1 {
    padding-left: 28px;
}

.udoc-viewer-root .udoc-comment-depth-2 {
    padding-left: 44px;
}

.udoc-viewer-root .udoc-comment-depth-3 {
    padding-left: 60px;
}

/* Comment Icon */
.udoc-viewer-root .udoc-comment-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--udoc-text-subtle);
}

.udoc-viewer-root .udoc-comment-icon svg {
    width: 16px;
    height: 16px;
}

/* Comment Body */
.udoc-viewer-root .udoc-comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Comment Header */
.udoc-viewer-root .udoc-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.udoc-viewer-root .udoc-comment-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--udoc-text-heading);
}

/* Status Badge */
.udoc-viewer-root .udoc-comment-status {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: capitalize;
}

.udoc-viewer-root .udoc-comment-status--accepted {
    background: var(--udoc-status-accepted-bg);
    color: var(--udoc-status-accepted-text);
}

.udoc-viewer-root .udoc-comment-status--rejected {
    background: var(--udoc-status-rejected-bg);
    color: var(--udoc-status-rejected-text);
}

.udoc-viewer-root .udoc-comment-status--completed {
    background: var(--udoc-status-completed-bg);
    color: var(--udoc-status-completed-text);
}

.udoc-viewer-root .udoc-comment-status--cancelled {
    background: var(--udoc-status-cancelled-bg);
    color: var(--udoc-status-cancelled-text);
}

.udoc-viewer-root .udoc-comment-status--marked {
    background: var(--udoc-status-marked-bg);
    color: var(--udoc-status-marked-text);
}

.udoc-viewer-root .udoc-comment-status--unmarked {
    background: var(--udoc-status-cancelled-bg);
    color: var(--udoc-status-cancelled-text);
}

/* Comment Contents */
.udoc-viewer-root .udoc-comment-contents {
    font-size: 12px;
    color: var(--udoc-text-body);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Reply Toggle */
.udoc-viewer-root .udoc-comment-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    margin-top: 4px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-primary);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
}

.udoc-viewer-root .udoc-comment-toggle:hover {
    background: var(--udoc-primary-subtle-bg);
}

.udoc-viewer-root .udoc-comment-toggle svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.udoc-viewer-root .udoc-comment-toggle--expanded svg {
    transform: rotate(90deg);
}

/* Replies Container */
.udoc-viewer-root .udoc-comment-replies {
    display: flex;
    flex-direction: column;
}

.udoc-viewer-root .udoc-comment-replies--collapsed {
    display: none;
}

/* Annotation Highlight Animation */
@keyframes udoc-annotation-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 102, 204, 0.3);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(0, 102, 204, 0);
    }
}

.udoc-viewer-root .udoc-annotation--highlighted {
    animation: udoc-annotation-pulse 1.5s ease-out;
    outline: 2px solid var(--udoc-primary);
    outline-offset: 2px;
    border-radius: 2px;
    z-index: 20;
}

/* Highlight indicator for full-layer markup annotations */
.udoc-viewer-root .udoc-annotation-highlight-indicator {
    position: absolute;
    box-sizing: border-box;
    pointer-events: none;
    animation: udoc-annotation-pulse 1.5s ease-out;
    outline: 2px solid var(--udoc-primary);
    outline-offset: 2px;
    border-radius: 2px;
    z-index: 20;
}

/* Annotation select tool */
.udoc-viewer--tool-select .udoc-viewport__scroll {
    touch-action: none;
}

.udoc-viewer--tool-select .udoc-spread__text-layer {
    pointer-events: none;
}

.udoc-viewer--tool-select .udoc-text-run {
    user-select: none;
}

/* SVG shape annotations: hit-testing is owned by \`pointer-events: painted\` set
   inline on each \`<svg>\` overlay (see createSvgOverlay), so empty SVG space
   stays transparent to PDF text underneath and painted geometry fires
   \`annotation:hover\`/\`annotation:click\` in all tool modes. Cursor affordance
   stays scoped to the select tool — clicking a painted shape only does
   something user-visible (selection) in that mode. */
.udoc-viewer--tool-select .udoc-spread__annotation-layer svg[data-annotation-index] * {
    cursor: pointer;
}

/* HTML-based annotations (markup quads, text icons, etc.): make children
   clickable only in the select tool. The parent container keeps
   \`pointer-events: none\` inline so the highlight/underline/etc. fill stays
   transparent to text selection during normal reading; the \`!important\`
   override here re-enables hits on the children for the select tool only. */
.udoc-viewer--tool-select .udoc-spread__annotation-layer div[data-annotation-index] > * {
    pointer-events: auto !important;
    cursor: pointer;
}

/* Selected annotation bounding box */
.udoc-viewer-root .udoc-annotation-select-bbox {
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.udoc-viewer-root .udoc-annotation-select-bbox__inner {
    box-sizing: border-box;
    border: 2px solid var(--udoc-selection-color);
    cursor: grab;
    pointer-events: auto;
}

/* Resize handles */
.udoc-viewer-root .udoc-annotation-select-bbox__handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--udoc-selection-color);
    border-radius: 2px;
    pointer-events: auto;
    box-sizing: border-box;
}

/* Corner handles */
.udoc-annotation-select-bbox__handle--nw {
    top: -5px;
    left: -5px;
}
.udoc-annotation-select-bbox__handle--ne {
    top: -5px;
    right: -5px;
}
.udoc-annotation-select-bbox__handle--se {
    bottom: -5px;
    right: -5px;
}
.udoc-annotation-select-bbox__handle--sw {
    bottom: -5px;
    left: -5px;
}

/* Edge midpoint handles */
.udoc-annotation-select-bbox__handle--n {
    top: -5px;
    left: 50%;
    margin-left: -5px;
}
.udoc-annotation-select-bbox__handle--e {
    top: 50%;
    right: -5px;
    margin-top: -5px;
}
.udoc-annotation-select-bbox__handle--s {
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
}
.udoc-annotation-select-bbox__handle--w {
    top: 50%;
    left: -5px;
    margin-top: -5px;
}

/* Moving annotation cursor */
.udoc-viewer--annotation-moving .udoc-viewport__scroll {
    cursor: grabbing !important;
}

.udoc-viewer--annotation-moving .udoc-annotation-select-bbox__inner {
    cursor: grabbing;
}

/* Resizing annotation — lock cursor globally */
.udoc-viewer--annotation-resizing .udoc-viewport__scroll {
    cursor: inherit !important;
}

/* Delete button in sub-toolbar */
.udoc-viewer-root .udoc-subtoolbar__btn--delete {
    transition:
        color 0.15s ease,
        opacity 0.15s ease;
}

.udoc-viewer-root .udoc-subtoolbar__btn--delete:disabled {
    opacity: 0.35;
    cursor: default;
}

.udoc-viewer-root .udoc-subtoolbar__btn--delete:not(:disabled):hover {
    color: var(--udoc-error-text);
}

/* Mobile Panel Overlay */
.udoc-viewer-root .udoc-panel-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--udoc-bg-overlay);
    z-index: 40;
}

/* ===== Responsive: Small Mobile (≤480px) ===== */
@container udoc-viewer (max-width: 480px) {
    /* Make body-slot a positioning context */
    .udoc-viewer-root .udoc-body-slot {
        position: relative;
    }

    /* Collapse panels to slide-out drawers */
    .udoc-viewer-root .udoc-left-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .udoc-viewer-root .udoc-left-panel:not(.udoc-left-panel--closed) {
        transform: translateX(0);
        box-shadow: var(--udoc-shadow-panel);
    }

    .udoc-viewer-root .udoc-left-panel--closed {
        width: 280px !important;
        transform: translateX(-100%);
    }

    .udoc-viewer-root .udoc-right-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 50;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }

    .udoc-viewer-root .udoc-right-panel:not(.udoc-right-panel--closed) {
        transform: translateX(0);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .udoc-viewer-root .udoc-right-panel--closed {
        width: 280px !important;
        transform: translateX(100%);
    }

    /* Show overlay when panel is open */
    .udoc-viewer-root.udoc-panel-open .udoc-panel-overlay {
        display: block;
    }

    /* Viewport becomes flex column so floating toolbar is a footer */
    .udoc-viewer-root .udoc-viewport {
        display: flex;
        flex-direction: column;
    }

    .udoc-viewer-root .udoc-viewport__content {
        flex: 1 1 auto;
        overflow: hidden;
    }

    /* Convert floating bar to full-width footer toolbar */
    .udoc-viewer-root .udoc-floating-toolbar {
        position: relative;
        bottom: auto;
        left: auto;
        flex: 0 0 auto;
        transform: none;
        border-radius: 0;
        box-sizing: border-box;
        background: var(--udoc-bg-panel);
        border-top: 1px solid var(--udoc-border);
        box-shadow: none;
        height: 40px;
        padding: 0 4px;
        gap: 4px;
        max-width: none;
        justify-content: center;
    }

    /* Raise toolbar above slide-out panels so overflow dropdown is not hidden */
    .udoc-viewer-root .udoc-toolbar-slot {
        z-index: 60;
    }

    /* Hide individual right-section buttons on mobile; show overflow menu */
    .udoc-viewer-root .udoc-toolbar__btn--search,
    .udoc-viewer-root .udoc-toolbar__btn--comments,
    .udoc-viewer-root .udoc-toolbar__btn--print,
    .udoc-viewer-root .udoc-toolbar__btn--download,
    .udoc-viewer-root .udoc-toolbar__btn--theme,
    .udoc-viewer-root .udoc-toolbar__btn--fullscreen {
        display: none !important;
    }

    .udoc-viewer-root .udoc-overflow-menu {
        display: block;
    }

    /* Panel tab buttons for touch */
    .udoc-viewer-root .udoc-left-panel__tabs {
        width: 32px;
        padding: 8px 0;
    }

    .udoc-viewer-root .udoc-left-panel__tab {
        width: 32px;
        height: 32px;
    }

    .udoc-viewer-root .udoc-left-panel__tab svg {
        width: 18px;
        height: 18px;
    }

    /* Toolbar adjustments */
    .udoc-viewer-root .udoc-toolbar {
        padding: 0 4px;
    }

    .udoc-viewer-root .udoc-toolbar__btn {
        box-sizing: border-box;
        padding: 6px;
    }

    /* View mode menu - right align */
    .udoc-viewer-root .udoc-view-mode-menu__dropdown {
        left: auto;
        right: 0;
    }

    .udoc-viewer-root .udoc-zoom-dropdown__item {
        padding: 12px 16px;
    }

    .udoc-viewer-root .udoc-view-mode-menu__option {
        width: 36px;
        height: 36px;
    }
}

/* ===== Password Dialog ===== */
.udoc-viewer-root .udoc-password-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--udoc-bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
}

.udoc-viewer-root .udoc-password-dialog {
    background: var(--udoc-bg-surface);
    border-radius: 12px;
    box-shadow: var(--udoc-shadow-dialog);
    padding: 24px;
    max-width: 360px;
    width: 90%;
}

.udoc-viewer-root .udoc-password-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.udoc-viewer-root .udoc-password-icon {
    width: 32px;
    height: 32px;
    color: var(--udoc-text-label);
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-password-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-password-message {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--udoc-text-label);
    line-height: 1.5;
}

.udoc-viewer-root .udoc-password-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.udoc-viewer-root .udoc-password-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    background: var(--udoc-bg-input);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.udoc-viewer-root .udoc-password-input-wrapper:focus-within {
    border-color: var(--udoc-primary);
    box-shadow: 0 0 0 3px var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-password-input {
    flex: 1;
    padding: 12px 14px;
    border: none;
    border-radius: 8px 0 0 8px;
    background: transparent;
    font-size: 15px;
    color: var(--udoc-text-heading);
    outline: none;
}

.udoc-viewer-root .udoc-password-input::placeholder {
    color: var(--udoc-text-placeholder);
}

.udoc-viewer-root .udoc-password-input:disabled {
    background: var(--udoc-bg-panel);
    color: var(--udoc-text-placeholder);
}

.udoc-viewer-root .udoc-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--udoc-text-subtle);
    cursor: pointer;
    transition: color 0.15s;
}

.udoc-viewer-root .udoc-password-toggle:hover {
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-password-toggle svg {
    width: 20px;
    height: 20px;
}

.udoc-viewer-root .udoc-password-error {
    margin: 0;
    padding: 8px 12px;
    background: var(--udoc-error-bg);
    border: 1px solid var(--udoc-error-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--udoc-error-text);
}

.udoc-viewer-root .udoc-password-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--udoc-primary);
    color: var(--udoc-text-on-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.udoc-viewer-root .udoc-password-submit:hover:not(:disabled) {
    background: var(--udoc-primary-hover);
}

.udoc-viewer-root .udoc-password-submit:disabled {
    background: var(--udoc-primary-disabled);
    cursor: not-allowed;
}

.udoc-viewer-root .udoc-password-submit-spinner svg {
    width: 20px;
    height: 20px;
}

/* ===== Print Dialog ===== */
.udoc-viewer-root .udoc-print-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--udoc-bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

.udoc-viewer-root .udoc-print-dialog {
    background: var(--udoc-bg-surface);
    border-radius: 12px;
    box-shadow: var(--udoc-shadow-dialog);
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.udoc-viewer-root .udoc-print-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--udoc-text-heading);
}

.udoc-viewer-root .udoc-print-section {
    margin-bottom: 16px;
}

.udoc-viewer-root .udoc-print-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--udoc-text-label);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.udoc-viewer-root .udoc-print-radios {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.udoc-viewer-root .udoc-print-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--udoc-text-heading);
    cursor: pointer;
    padding: 4px 0;
}

.udoc-viewer-root .udoc-print-radio input[type="radio"] {
    accent-color: var(--udoc-primary);
    margin: 0;
    cursor: pointer;
}

.udoc-viewer-root .udoc-print-input {
    padding: 4px 8px;
    border: 1px solid var(--udoc-border);
    border-radius: 6px;
    background: var(--udoc-bg-input);
    color: var(--udoc-text-heading);
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.udoc-viewer-root .udoc-print-input:focus {
    border-color: var(--udoc-primary);
    box-shadow: 0 0 0 3px var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-print-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.udoc-viewer-root .udoc-print-input[type="number"] {
    width: 64px;
}

.udoc-viewer-root .udoc-print-input[type="text"] {
    flex: 1;
    min-width: 0;
}

.udoc-viewer-root .udoc-print-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--udoc-border);
    border-radius: 8px;
    background: var(--udoc-bg-input);
    color: var(--udoc-text-heading);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.udoc-viewer-root .udoc-print-select:focus {
    border-color: var(--udoc-primary);
    box-shadow: 0 0 0 3px var(--udoc-primary-active-bg);
}

.udoc-viewer-root .udoc-print-error {
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: var(--udoc-error-bg);
    border: 1px solid var(--udoc-error-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--udoc-error-text);
    display: none;
}

.udoc-viewer-root .udoc-print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.udoc-viewer-root .udoc-print-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.udoc-viewer-root .udoc-print-btn--cancel {
    background: transparent;
    color: var(--udoc-text-label);
}

.udoc-viewer-root .udoc-print-btn--cancel:hover {
    background: var(--udoc-bg-hover);
}

.udoc-viewer-root .udoc-print-btn--print {
    background: var(--udoc-primary);
    color: var(--udoc-text-on-primary);
}

.udoc-viewer-root .udoc-print-btn--print:hover {
    background: var(--udoc-primary-hover);
}

/* ===== Loading Overlay ===== */
.udoc-viewer-root .udoc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--udoc-bg-loading);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 70;
    backdrop-filter: blur(2px);
}

.udoc-viewer-root .udoc-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.udoc-viewer-root .udoc-loading-spinner {
    width: 40px;
    height: 40px;
    color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-loading-spinner svg {
    width: 100%;
    height: 100%;
}

.udoc-viewer-root .udoc-loading-progress-container {
    width: 240px;
}

.udoc-viewer-root .udoc-loading-progress-track {
    width: 100%;
    height: 6px;
    background: var(--udoc-progress-track);
    border-radius: 3px;
    overflow: hidden;
}

.udoc-viewer-root .udoc-loading-progress-fill {
    height: 100%;
    background: var(--udoc-progress-fill);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s ease-out;
}

.udoc-viewer-root .udoc-loading-progress-fill--indeterminate {
    animation: udoc-loading-indeterminate 1.5s ease-in-out infinite;
}

@keyframes udoc-loading-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(233%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.udoc-viewer-root .udoc-loading-progress-text {
    font-size: 13px;
    color: var(--udoc-text-label);
    text-align: center;
}

/* Logo path colors live inside the Branding component's shadow root (see
   components/Branding.ts) so external CSS cannot select them. */

/* =============================================================================
   Search Panel
   ============================================================================= */

.udoc-viewer-root .udoc-search-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-size: 13px;
}

.udoc-viewer-root .udoc-search-panel__header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 12px 8px;
}

.udoc-viewer-root .udoc-search-panel__input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--udoc-border-input);
    border-radius: 4px;
    background: var(--udoc-bg-input);
    overflow: hidden;
}

.udoc-viewer-root .udoc-search-panel__input-wrapper:focus-within {
    border-color: var(--udoc-primary);
    box-shadow: 0 0 0 2px var(--udoc-primary-focus-ring);
}

.udoc-viewer-root .udoc-search-panel__input-icon {
    display: flex;
    align-items: center;
    padding: 0 6px 0 8px;
    color: var(--udoc-text-placeholder);
}

.udoc-viewer-root .udoc-search-panel__input-icon svg {
    width: 14px;
    height: 14px;
}

.udoc-viewer-root .udoc-search-panel__input {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 8px 6px 0;
    font-size: 13px;
    min-width: 0;
    background: transparent;
}

/* Suppress focus ring on the inner input — the wrapper handles :focus-within */
.udoc-viewer-root .udoc-search-panel__input:focus-visible {
    outline: none;
}

.udoc-viewer-root .udoc-search-panel__clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 4px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--udoc-text-placeholder);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-search-panel__clear:hover {
    background: var(--udoc-hover-overlay);
    color: var(--udoc-text-body);
}

.udoc-viewer-root .udoc-search-panel__clear svg {
    width: 14px;
    height: 14px;
}

.udoc-viewer-root .udoc-search-panel__clear:focus-visible {
    outline: none;
}

.udoc-viewer-root .udoc-search-panel__case {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--udoc-border-input);
    border-radius: 4px;
    background: var(--udoc-bg-input);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--udoc-text-label);
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-search-panel__case:hover {
    background: var(--udoc-bg-page-header);
}

.udoc-viewer-root .udoc-search-panel__case--active {
    background: var(--udoc-primary);
    color: var(--udoc-text-on-primary);
    border-color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-search-panel__case--active:hover {
    background: var(--udoc-primary-hover);
}

.udoc-viewer-root .udoc-search-panel__fuzzy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--udoc-border-input);
    border-radius: 4px;
    background: var(--udoc-bg-input);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--udoc-text-label);
    flex-shrink: 0;
}

.udoc-viewer-root .udoc-search-panel__fuzzy:hover {
    background: var(--udoc-bg-page-header);
}

.udoc-viewer-root .udoc-search-panel__fuzzy--active {
    background: var(--udoc-primary);
    color: var(--udoc-text-on-primary);
    border-color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-search-panel__fuzzy--active:hover {
    background: var(--udoc-primary-hover);
}

.udoc-viewer-root .udoc-search-panel__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--udoc-border-light);
    min-height: 32px;
}

.udoc-viewer-root .udoc-search-panel__status {
    color: var(--udoc-text-label);
    font-size: 12px;
}

.udoc-viewer-root .udoc-search-panel__nav-buttons {
    display: flex;
    gap: 2px;
}

.udoc-viewer-root .udoc-search-panel__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--udoc-text-heading);
    padding: 0;
}

.udoc-viewer-root .udoc-search-panel__nav-btn svg {
    width: 16px;
    height: 16px;
}

.udoc-viewer-root .udoc-search-panel__nav-btn:hover {
    background: var(--udoc-hover-overlay);
}

.udoc-viewer-root .udoc-search-panel__nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.udoc-viewer-root .udoc-search-panel__nav-btn:disabled:hover {
    background: transparent;
}

.udoc-viewer-root .udoc-search-panel__results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.udoc-viewer-root .udoc-search-result__page-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--udoc-text-placeholder);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    background: var(--udoc-bg-surface);
    z-index: 1;
}

.udoc-viewer-root .udoc-search-result {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    color: var(--udoc-text-heading);
    border-left: 3px solid transparent;
}

.udoc-viewer-root .udoc-search-result:hover {
    background: var(--udoc-faint-hover);
}

.udoc-viewer-root .udoc-search-result--active {
    background: var(--udoc-search-result-active-bg);
    border-left-color: var(--udoc-primary);
}

.udoc-viewer-root .udoc-search-result__context {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    color: var(--udoc-text-body);
}

.udoc-viewer-root .udoc-search-result__match {
    background: var(--udoc-search-match-bg);
    color: var(--udoc-search-match-text);
    border-radius: 2px;
    padding: 0 1px;
}

/* =============================================================================
   Search Highlights on Pages
   ============================================================================= */

.udoc-viewer-root .udoc-spread__search-highlight-layer {
    position: absolute;
    pointer-events: none;
}

.udoc-viewer-root .udoc-spread__custom-page-overlay-layer {
    position: absolute;
    pointer-events: none;
    /* Above annotation layer (z-index: 2) so host overlays sit on top of every built-in layer. */
    z-index: 3;
}

.udoc-viewer-root .udoc-search-highlight {
    background-color: var(--udoc-search-highlight);
    mix-blend-mode: multiply;
    border-radius: 1px;
}

.udoc-viewer-root .udoc-search-highlight--active {
    background-color: var(--udoc-search-highlight-active);
    outline: 2px solid var(--udoc-search-highlight-active-outline);
    outline-offset: 1px;
}

/* Dark mode blend mode overrides */
.udoc-viewer-root.udoc-viewer-dark .udoc-annotation__quad {
    mix-blend-mode: screen;
}

.udoc-viewer-root.udoc-viewer-dark .udoc-search-highlight {
    mix-blend-mode: screen;
}

/* === Accessibility === */

/* Screen-reader-only utility (visually hidden but accessible) */
.udoc-viewer-root .udoc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip navigation link */
.udoc-viewer-root .udoc-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 100;
    padding: 8px 16px;
    background: var(--udoc-bg-surface);
    color: var(--udoc-text-heading);
    text-decoration: none;
    font-size: 14px;
    border-radius: 0 0 4px 0;
    box-shadow: var(--udoc-shadow-sm);
}

.udoc-viewer-root .udoc-skip-link:focus {
    top: 0;
}

/* Keyboard focus indicators */
.udoc-viewer-root :focus-visible {
    outline: 2px solid var(--udoc-primary);
    outline-offset: 2px;
}

.udoc-viewer-root :focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .udoc-viewer-root,
    .udoc-viewer-root * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast preference */
@media (prefers-contrast: more) {
    .udoc-viewer-root {
        --udoc-border: #000;
        --udoc-border-input: #000;
        --udoc-text-muted: rgba(0, 0, 0, 0.7);
        --udoc-text-faint: rgba(0, 0, 0, 0.6);
        --udoc-primary-focus-ring: rgba(0, 0, 0, 0.4);
    }

    .udoc-viewer-root.udoc-viewer-dark {
        --udoc-border: #aaa;
        --udoc-border-input: #aaa;
        --udoc-text-muted: rgba(255, 255, 255, 0.7);
        --udoc-text-faint: rgba(255, 255, 255, 0.6);
        --udoc-primary-focus-ring: rgba(255, 255, 255, 0.45);
    }

    .udoc-viewer-root :focus-visible {
        outline-width: 3px;
    }
}

/* Forced colors (Windows High Contrast) */
@media (forced-colors: active) {
    .udoc-viewer-root .udoc-thumbnail-item--active {
        outline: 3px solid Highlight;
    }

    .udoc-viewer-root .udoc-toolbar__btn,
    .udoc-viewer-root .udoc-left-panel__tab {
        border: 1px solid ButtonText;
    }

    .udoc-viewer-root .udoc-left-panel__tab--active {
        background: Highlight;
        color: HighlightText;
    }

    .udoc-viewer-root .udoc-search-highlight {
        outline: 2px solid Highlight;
    }
}

/* Resize handle focus styles */
.udoc-viewer-root .udoc-left-panel__resize-handle:focus-visible,
.udoc-viewer-root .udoc-right-panel__resize-handle:focus-visible {
    background: var(--udoc-primary-muted);
    outline: 2px solid var(--udoc-primary);
    outline-offset: -2px;
}

/* Touch target sizes for coarse pointers (panels and side UI only — toolbars handle their own sizing) */
@media (pointer: coarse) {
    .udoc-viewer-root .udoc-left-panel__tab {
        width: 32px;
        height: 32px;
    }

    .udoc-viewer-root .udoc-left-panel__tabs {
        width: 32px;
    }

    .udoc-viewer-root .udoc-outline-item__toggle {
        min-width: 32px;
        min-height: 32px;
    }
}
`;
//# sourceMappingURL=styles-inline.js.map