.viewer-toolbar {
    position: absolute;
    z-index: 10000;
    bottom: 12px;
    left: 50%;
    display: flex;
    gap: 4px;
    max-width: calc(100% - 20px);
    padding: 5px;
    overflow-x: auto;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(27, 48, 76, 0.94);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.viewer-toolbar-button {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.viewer-toolbar-button:hover:not(:disabled),
.viewer-toolbar-button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    outline: none;
}

.viewer-toolbar-button.active {
    background: #E6E9F0;
    color: #1B304C;
}

.viewer-toolbar-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.viewer:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #202932;
}

@media (max-width: 600px) {
    .viewer-toolbar {
        right: 8px;
        bottom: 8px;
        left: 8px;
        max-width: none;
        transform: none;
    }
}

.viewer-tree-modal {
    position: absolute;
    z-index: 9998;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100% - 20px));
    max-height: calc(100% - 80px);
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    color: #222;
    font: 13px/1.4 "Titillium Web", sans-serif;
}

.viewer-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    background: #f3f3f3;
}

.viewer-panel-drag-handle {
    cursor: grab;
    touch-action: none;
}

.viewer-panel-drag-handle.is-dragging {
    cursor: grabbing;
}

.viewer-panel-drag-handle button {
    cursor: pointer;
    touch-action: manipulation;
}

.viewer-tree-close {
    border: 0;
    background: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.viewer-tree-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.viewer-tree-tabs button {
    flex: 1;
    padding: 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
}

.viewer-tree-tabs button.active {
    border-bottom-color: #1B304C;
    font-weight: 600;
}

.viewer-tree-search {
    box-sizing: border-box;
    width: calc(100% - 20px);
    margin: 8px 10px;
    padding: 5px 8px;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
}

.viewer-tree-check {
    flex: 0 0 14px;
    box-sizing: border-box;
    width: 14px;
    min-width: 0;
    height: 14px;
    margin: 0;
    padding: 0;
}

.viewer-tree-label {
    flex: 1 1 auto;
    min-width: 0;
}

.viewer-tree-body {
    flex: 1;
    min-height: 120px;
    padding: 0 6px 8px;
    overflow: auto;
}

.viewer-tree-list {
    margin: 0;
    padding-left: 10px;
    list-style: none;
}

.viewer-tree-body > .viewer-tree-list {
    padding-left: 0;
}

.viewer-tree-row {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 2px;
    border-radius: 3px;
    cursor: pointer;
}

.viewer-tree-row:hover {
    background: #eef1f6;
}

.viewer-tree-row.selected {
    background: #ffe9a6;
}

.viewer-tree-toggle {
    flex: 0 0 12px;
    width: 12px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.viewer-tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-tree-note {
    padding: 4px 8px;
    color: #777;
    font-style: italic;
}
