        .toolbar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: var(--toolbar-height);
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            background: #fff;
            border-bottom: 1px solid #d8dee7;
            z-index: 30;
            box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
            overflow: visible;
            touch-action: none;
        }

        .toolbar button {
            border: none;
            cursor: pointer;
            font-weight: 600;
            font: inherit;
        }

        .toolbar button:disabled,
        .context-menu button:disabled,
        .field-memo-actions button:disabled,
        .field-editor-actions button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            box-shadow: none;
        }

        .toolbar-edit-actions {
            position: relative;
            flex: 0 0 auto;
            display: flex;
            gap: 6px;
            margin-right: 8px;
        }

        .toolbar-edit-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            border: none;
            transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
            white-space: nowrap;
        }

        .toolbar-edit-btn:hover {
            transform: translateY(-1px);
        }

        .toolbar-request-edit-btn {
            background: #2563eb;
            color: #fff;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
        }

        .toolbar-request-edit-btn:hover {
            background: #1d4ed8;
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
        }

        .toolbar-request-edit-btn:disabled {
            opacity: 0.5;
            cursor: default;
            transform: none;
        }

        .toolbar-manage-edit-btn {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            color: #e2e8f0;
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
        }

        .toolbar-manage-edit-btn:hover {
            box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
        }

        .toolbar-edit-btn-icon {
            font-size: 14px;
        }

        .toolbar-edit-btn-copy {
            font-size: 12px;
        }

        /* ── 편집 권한 관리 패널 ── */
        .edit-management-panel {
            position: fixed;
            top: 56px;
            width: 340px;
            max-height: calc(100vh - 80px);
            background: rgba(15, 23, 42, 0.95);
            color: #e2e8f0;
            border-radius: 16px;
            z-index: 85;
            backdrop-filter: blur(12px);
            box-shadow: 0 12px 48px rgba(0,0,0,.4);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .edit-management-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 18px;
            border-bottom: 1px solid rgba(255,255,255,.08);
        }

        .edit-management-title {
            font-weight: 800;
            font-size: 14px;
            color: #fff;
        }

        .edit-management-close {
            background: none;
            border: none;
            color: #94a3b8;
            font-size: 18px;
            cursor: pointer;
            line-height: 1;
        }

        .edit-management-close:hover {
            color: #fff;
        }

        .edit-management-body {
            padding: 14px 18px;
            overflow-y: auto;
            max-height: calc(100vh - 140px);
        }

        .edit-management-info {
            font-size: 12px;
            color: #94a3b8;
            margin-bottom: 12px;
        }

        .edit-management-empty {
            font-size: 13px;
            color: #64748b;
            text-align: center;
            padding: 20px 0;
        }

        .edit-management-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .edit-management-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 10px;
            background: rgba(255,255,255,.04);
        }

        .em-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            color: #fff;
            flex-shrink: 0;
        }

        .em-info {
            flex: 1;
            min-width: 0;
        }

        .em-name {
            font-size: 13px;
            font-weight: 600;
            color: #e2e8f0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .em-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 6px;
            margin-top: 2px;
        }

        .em-badge-owner {
            background: rgba(234, 179, 8, .15);
            color: #fbbf24;
        }

        .em-badge-perm {
            background: rgba(34, 197, 94, .15);
            color: #4ade80;
        }

        .em-badge-temp {
            background: rgba(249, 115, 22, .15);
            color: #fb923c;
        }

        .em-badge-viewer {
            background: rgba(148, 163, 184, .15);
            color: #94a3b8;
        }

        .em-actions {
            flex-shrink: 0;
        }

        .em-action {
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            border: none;
            transition: background .15s;
        }

        .em-action:disabled {
            opacity: 0.5;
            cursor: default;
        }

        .em-action-grant {
            background: #2563eb;
            color: #fff;
        }

        .em-action-grant:hover {
            background: #1d4ed8;
        }

        .em-action-revoke {
            background: rgba(239, 68, 68, .15);
            color: #f87171;
        }

        .em-action-revoke:hover {
            background: rgba(239, 68, 68, .25);
        }

        /* ── 프로젝트 임시 편집 뱃지 ── */
        .project-grant-temp {
            font-size: 11px;
            color: #fb923c;
            font-weight: 600;
        }

        /* ── 초대 역할 선택 ── */
        .invite-role-select {
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid #d1d5db;
            font-size: 13px;
            background: #fff;
            cursor: pointer;
        }

        .toolbar-menu-shell {
            position: relative;
            flex: 0 0 auto;
            margin-left: auto;
        }

        .toolbar-menu-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border-radius: 12px;
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            color: #ffffff;
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
            transition: transform 180ms ease, box-shadow 180ms ease;
        }

        .toolbar-menu-toggle:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 26px rgba(15, 23, 42, 0.22);
        }

        .toolbar-menu-toggle-icon {
            width: 22px;
            height: 22px;
            display: grid;
            place-items: center;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.14);
            font-size: 13px;
            font-weight: 800;
            flex: 0 0 22px;
        }

        .toolbar-menu-toggle-copy {
            display: inline-flex;
            align-items: center;
            min-width: 0;
        }

        .toolbar-menu-toggle-title {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.04em;
        }

        .toolbar-actions {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            left: auto;
            width: min(248px, calc(100vw - 20px));
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 8px;
            border: 1px solid rgba(203, 213, 225, 0.9);
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.97);
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
            backdrop-filter: blur(12px);
            opacity: 0;
            pointer-events: none;
            transform: translateY(-10px) scale(0.98);
            transform-origin: top right;
            transition: opacity 180ms ease, transform 220ms ease;
            z-index: 85;
        }

        .toolbar.toolbar-menu-open .toolbar-actions {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0) scale(1);
        }

        .toolbar-action {
            width: 100%;
            opacity: 0;
            transform: translateY(-6px);
            transition: opacity 180ms ease, transform 220ms ease;
        }

        .toolbar.toolbar-menu-open .toolbar-action {
            opacity: 1;
            transform: translateY(0);
        }

        .toolbar-menu-item,
        .toolbar-copy-status {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 9px;
            border: 1px solid #dbe3ee;
            border-radius: 12px;
            background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
            color: #0f172a;
            text-align: left;
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
            transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
        }

        .toolbar-menu-item:hover,
        .toolbar-copy-status:hover {
            transform: translateY(-1px);
            border-color: #bfdbfe;
            box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
        }

        .toolbar-menu-item:focus-visible,
        .toolbar-copy-status:focus-visible,
        .toolbar-menu-toggle:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), 0 18px 32px rgba(15, 23, 42, 0.12);
        }

        .toolbar-action-icon {
            width: 24px;
            height: 24px;
            display: grid;
            place-items: center;
            border-radius: 8px;
            flex: 0 0 24px;
            font-size: 12px;
            font-weight: 800;
            color: #ffffff;
            background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
            box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
        }

        .toolbar-action-copy {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .toolbar-action-title {
            font-size: 12px;
            font-weight: 800;
            color: #0f172a;
        }

        .toolbar-action-subtitle {
            font-size: 10px;
            line-height: 1.2;
            color: #64748b;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .toolbar-action-subtitle:empty {
            display: none;
        }

        .toolbar .primary .toolbar-action-icon {
            background: linear-gradient(180deg, #1f6feb 0%, #2563eb 100%);
            box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
        }

        .toolbar .success .toolbar-action-icon {
            background: linear-gradient(180deg, #1d9b5f 0%, #15803d 100%);
            box-shadow: 0 12px 22px rgba(21, 128, 61, 0.22);
        }

        .toolbar .slate .toolbar-action-icon {
            background: linear-gradient(180deg, #475569 0%, #334155 100%);
            box-shadow: 0 12px 22px rgba(51, 65, 85, 0.22);
        }

        .toolbar .warning .toolbar-action-icon {
            background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
            box-shadow: 0 12px 22px rgba(217, 119, 6, 0.22);
        }

        #toggle-lines[data-active="false"] .toolbar-action-icon {
            background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
            box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
        }

        .toolbar-copy-status[data-enabled="true"] .toolbar-action-icon {
            background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
            box-shadow: 0 6px 12px rgba(34, 197, 94, 0.22);
        }

        .toolbar-copy-status[data-enabled="false"] .toolbar-action-icon {
            background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
            box-shadow: 0 6px 12px rgba(239, 68, 68, 0.22);
        }

        .viewport {
            position: fixed;
            top: var(--toolbar-height);
            left: 0;
            right: 0;
            bottom: 0;
            overflow: auto;
            cursor: default;
            background:
                linear-gradient(90deg, rgba(31, 111, 235, 0.04) 1px, transparent 1px),
                linear-gradient(rgba(31, 111, 235, 0.04) 1px, transparent 1px),
                var(--workspace-bg);
            background-size: 24px 24px, 24px 24px, auto;
        }

        .viewport.panning {
            cursor: grabbing;
            user-select: none;
        }

        #workspace {
            position: relative;
            min-width: 4000px;
            min-height: 3000px;
            transform-origin: top left;
        }

        #selection-box {
            position: absolute;
            display: none;
            z-index: 20;
            border: 1px solid rgba(31, 111, 235, 0.9);
            background: rgba(31, 111, 235, 0.14);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
            pointer-events: none;
            border-radius: 10px;
        }

        #workspace.selecting-tables {
            cursor: crosshair;
            user-select: none;
        }

        #relationship-lines {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 5;
        }

        .relationship-arrow {
            fill: none;
            stroke: #2563eb;
            stroke-width: 3;
            opacity: 1;
            filter: drop-shadow(0 0 2px rgba(37, 99, 235, 0.45));
            pointer-events: none;
        }

        .relationship-hitbox {
            fill: none;
            stroke: transparent;
            stroke-width: 14;
            pointer-events: stroke;
            cursor: pointer;
        }

        .relationship-label {
            font-size: 12px;
            font-weight: 700;
            fill: #1d4ed8;
            paint-order: stroke;
            stroke: #ffffff;
            stroke-width: 3px;
            pointer-events: none;
        }

        .relationship-info {
            position: absolute;
            z-index: 25;
            display: none;
            padding: 6px 10px;
            border-radius: 8px;
            background: rgba(17, 24, 39, 0.9);
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            pointer-events: none;
            transform: translate(-50%, -120%);
            white-space: nowrap;
        }

        .erd-table {
            position: absolute;
            width: var(--table-width);
            border: 1px solid var(--table-border);
            border-radius: 14px;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
            overflow: hidden;
            background: #fff;
            z-index: 2;
            transition: left 240ms ease, top 240ms ease, width 220ms ease, opacity 220ms ease, transform 220ms ease;
            transform-origin: center center;
        }

        .erd-table.table-selected {
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 10px 28px rgba(15, 23, 42, 0.12);
        }

        .erd-table.no-transition {
            transition: none !important;
        }

        .erd-table.table-enter {
            opacity: 0;
            transform: translateY(12px) scale(0.97);
        }

        .erd-table.table-exit {
            opacity: 0;
            transform: translateY(-8px) scale(0.94);
        }

        .erd-table.table-flash,
        .field-row.field-flash {
            animation: flash-highlight 1.1s ease;
        }

        @keyframes flash-highlight {
            0% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.65); background-color: #dbeafe; }
            100% { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12); background-color: inherit; }
        }

        .table-header {
            background: var(--table-header-bg);
            color: #fff;
            padding: 12px 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            cursor: move;
        }

        .erd-resize-handle {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 10px;
            cursor: ew-resize;
            z-index: 7;
        }

        .erd-resize-e { right: -5px; }
        .erd-resize-w { left:  -5px; }

        .table-title-wrap {
            min-width: 0;
        }

        .table-title-physical,
        .table-title-logical {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .table-title-physical {
            font-size: 16px;
            font-weight: 700;
        }

        .table-title-logical {
            font-size: 12px;
            opacity: 0.9;
            margin-top: 2px;
        }

        .table-header-buttons {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .icon-btn {
            border: 1px solid rgba(255, 255, 255, 0.4);
            background: rgba(255, 255, 255, 0.14);
            color: #fff;
            border-radius: 7px;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
        }

        .table-body {
            padding: 12px;
            background: inherit;
        }

        .table-config {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }

        .table-config input {
            flex: 1 1 180px;
            padding: 8px 10px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            min-width: 0;
        }

        .table-config button,
        .field-editor-actions button,
        .field-actions button,
        .search-modal-actions button,
        .context-menu button,
        .context-menu label {
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }

        .table-config .save-table-name {
            padding: 8px 12px;
            background: var(--accent);
            color: #fff;
            font-weight: 600;
        }

        .field-table-wrap {
            border: 1px solid #d5dce6;
            border-radius: 10px;
            overflow: hidden;
            background: rgba(255,255,255,0.82);
        }

        .field-table {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: 13px;
        }

        .field-table thead th {
            background: #eff4fb;
            border-bottom: 1px solid #d5dce6;
            padding: 8px 6px;
            text-align: center;
            font-size: 12px;
            color: #334155;
        }

        .field-table thead th:nth-child(1) { width: 24%; }
        .field-table thead th:nth-child(2) { width: 24%; }
        .field-table thead th:nth-child(3) { width: 16%; }
        .field-table thead th:nth-child(4) { width: 6%; }
        .field-table thead th:nth-child(5) { width: 27%; }
        .field-table thead th:nth-child(6) { width: 3%; }

        .field-row td {
            border-bottom: 1px solid #ebeff5;
            padding: 8px 6px;
            vertical-align: top;
            background: rgba(255,255,255,0.96);
        }

        .field-row:last-child td,
        .field-editor-row:last-child td {
            border-bottom: none;
        }

        .field-row.linked-row td {
            background: #f8fbff;
        }

        .field-row.drag-over td {
            background: #dbeafe;
        }

        .field-row.field-selected td {
            background: #dbeafe;
            box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.12), inset 0 -1px 0 rgba(59, 130, 246, 0.12);
        }

        .field-row .value,
        .field-row .remark-value {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-height: 18px;
        }

        .field-row .remark-value.expanded {
            white-space: pre-wrap;
            overflow: visible;
            word-break: break-word;
        }

        body.show-full-field-names .field-row .value {
            overflow: visible;
            text-overflow: clip;
            white-space: normal;
            word-break: break-word;
        }

        .remark-cell {
            display: flex;
            align-items: flex-start;
            width: 100%;
        }

        .remark-content {
            flex: 1 1 auto;
            min-width: 0;
        }

        .field-actions {
            min-height: 18px;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
        }

        .memo-icon-btn {
            flex: 0 0 auto;
            width: 24px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #cbd5e1;
            border-radius: 999px;
            background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
            color: #2563eb;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
            transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
        }

        .memo-icon-btn:hover {
            transform: translateY(-1px);
            border-color: #93c5fd;
            box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
        }

        .memo-icon-btn.memo-open {
            background: linear-gradient(180deg, #1f6feb 0%, #2563eb 100%);
            border-color: #1d4ed8;
            color: #ffffff;
        }

        .memo-icon-glyph {
            font-size: 14px;
            line-height: 1;
        }

        .field-memo-row td {
            padding: 0 8px 12px;
            background: #f8fbff;
            border-bottom: 1px solid #dbe7f5;
        }

        .field-memo-panel {
            margin-top: 4px;
            border: 1px solid #d7e6f7;
            border-radius: 14px;
            background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(239,246,255,0.96) 100%);
            box-shadow: 0 12px 26px rgba(59, 130, 246, 0.08);
            padding: 14px;
        }

        .field-memo-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
        }

        .field-memo-title {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 700;
            color: #1e3a8a;
        }

        .field-memo-title::before {
            content: '📝';
            font-size: 14px;
        }

        .field-memo-editor-wrap {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .field-memo-textarea {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            min-height: 120px;
            padding: 12px 14px;
            border: 1px solid #bfd3ea;
            border-radius: 12px;
            background: #ffffff;
            color: #0f172a;
            line-height: 1.55;
            resize: both;
            overflow: auto;
            box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .field-memo-textarea:focus {
            outline: none;
            border-color: #60a5fa;
            box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
        }

        .field-memo-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 10px;
        }

        .field-memo-actions button {
            border: none;
            border-radius: 10px;
            padding: 8px 12px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            transition: transform 160ms ease, box-shadow 160ms ease;
            box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
        }

        .field-memo-actions button:hover {
            transform: translateY(-1px);
        }

        .memo-save-btn {
            background: linear-gradient(180deg, #1d9b5f 0%, #15803d 100%);
            color: #fff;
        }

        .memo-cancel-btn {
            background: #e2e8f0;
            color: #334155;
        }

        .field-meta {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 2px 6px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
        }

        .badge-fk {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .badge-pk {
            background: #f59e0b;
            color: #fff;
            font-weight: 800;
            letter-spacing: 0.03em;
        }

        .badge-override {
            background: #fef3c7;
            color: #92400e;
        }

        .field-row.dragging {
            opacity: 0.55;
        }

        .field-editor-row td {
            background: #eef6ff;
            padding: 10px 6px;
            border-bottom: 1px solid #d8e5f7;
        }

        .field-editor-grid {
            display: grid;
            grid-template-columns: 24fr 24fr 16fr 6fr 27fr 3fr;
            gap: 0;
            align-items: start;
        }

        .field-editor-grid > div {
            padding: 0 3px;
        }

        .editor-col-type {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 0 3px;
        }

        .editor-col-type .editor-field-size {
            font-size: 12px;
            padding: 5px 8px;
        }

        .editor-col-action {
            /* empty spacer to align with 6th table column */
        }

        .field-editor-grid input,
        .field-editor-grid select,
        .field-editor-grid textarea {
            width: 100%;
            border: 1px solid #b7c7db;
            border-radius: 8px;
            padding: 8px 10px;
            background: #fff;
        }

        .field-editor-grid textarea {
            min-height: 48px;
            resize: vertical;
        }

        .field-editor-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 10px;
        }

        .field-editor-actions button {
            padding: 7px 12px;
            color: #fff;
            font-weight: 700;
        }

        .field-editor-actions .save-field-btn { background: var(--success); }
        .field-editor-actions .cancel-field-btn { background: #64748b; }
        .field-editor-actions .delete-field-btn { background: var(--danger); }

        .empty-fields {
            padding: 18px 10px;
            text-align: center;
            color: #64748b;
            font-size: 13px;
        }

        .search-modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.42);
            display: none;
            z-index: 100;
            align-items: center;
            justify-content: center;
        }

        .search-modal {
            width: min(720px, calc(100vw - 32px));
            max-height: min(80vh, 760px);
            background: #fff;
            border-radius: 14px;
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .search-modal-header {
            padding: 16px 18px;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .search-modal-title {
            font-size: 18px;
            font-weight: 700;
        }

        .search-modal-body {
            padding: 16px 18px;
            overflow: auto;
        }

        .search-controls {
            display: grid;
            grid-template-columns: 180px 1fr auto;
            gap: 10px;
        }

        .search-controls select,
        .search-controls input {
            width: 100%;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            padding: 10px 12px;
        }

        .search-modal-actions button {
            padding: 10px 14px;
            background: var(--accent);
            color: #fff;
            font-weight: 700;
        }

        .search-results {
            margin-top: 14px;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
        }

        .search-result-item {
            padding: 12px 14px;
            border-bottom: 1px solid #eef2f7;
            cursor: pointer;
            background: #fff;
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .search-result-item:hover {
            background: #eff6ff;
        }

        .search-result-title {
            font-weight: 700;
            margin-bottom: 4px;
        }

        .search-result-desc {
            color: #64748b;
            font-size: 12px;
            white-space: pre-wrap;
        }

        .script-modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.48);
            display: none;
            z-index: 130;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }

        .script-modal {
            width: min(760px, calc(100vw - 32px));
            max-height: min(84vh, 860px);
            background: #fff;
            border-radius: 16px;
            box-shadow: 0 24px 52px rgba(15, 23, 42, 0.32);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .script-modal-header {
            padding: 18px 20px;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .script-modal-title {
            font-size: 18px;
            font-weight: 800;
            color: #0f172a;
        }

        .script-modal-body {
            padding: 18px 20px 20px;
            overflow: auto;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .script-modal-help {
            color: #475569;
            font-size: 13px;
            line-height: 1.6;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 12px 14px;
        }

        .script-modal-grid {
            display: grid;
            grid-template-columns: 180px 1fr;
            gap: 12px;
            align-items: center;
        }

        .script-modal-grid label {
            font-size: 13px;
            font-weight: 700;
            color: #1e293b;
        }

        .script-modal-grid select,
        .script-export-output {
            width: 100%;
            border: 1px solid #cbd5e1;
            border-radius: 10px;
            padding: 11px 12px;
            background: #fff;
        }

        .script-export-output {
            min-height: 320px;
            resize: vertical;
            font-family: Consolas, Monaco, monospace;
            font-size: 12px;
            line-height: 1.55;
        }

        .script-file-trigger {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 16px;
            border: none;
            border-radius: 12px;
            background: linear-gradient(180deg, #1f6feb 0%, #2563eb 100%);
            color: #fff;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
        }

        .script-file-name {
            color: #64748b;
            font-size: 12px;
        }

        .script-modal-actions {
            display: flex;
            justify-content: flex-end;
            flex-wrap: wrap;
            gap: 8px;
        }

        .script-modal-actions button {
            border: none;
            border-radius: 10px;
            padding: 10px 14px;
            color: #fff;
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
        }

        .script-btn-primary { background: linear-gradient(180deg, #1f6feb 0%, #2563eb 100%); }
        .script-btn-success { background: linear-gradient(180deg, #169b5f 0%, #15803d 100%); }
        .script-btn-neutral { background: #64748b; }

        /* ── PDF 내보내기 모드 ── */
        #pdf-mode-panel {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 120;
            pointer-events: none;
        }
        .pdf-mode-bar {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 16px;
            background: rgba(15, 23, 42, 0.92);
            backdrop-filter: blur(6px);
            border-bottom: 1px solid rgba(59, 130, 246, 0.3);
            pointer-events: auto;
            flex-wrap: wrap;
        }
        .pdf-mode-title {
            font-size: 13px;
            font-weight: 600;
            color: #fff;
            margin-right: 8px;
            white-space: nowrap;
        }
        .pdf-mode-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .pdf-mode-controls label {
            font-size: 11px;
            color: #94a3b8;
            white-space: nowrap;
        }
        .pdf-mode-controls select {
            font-size: 12px;
            padding: 3px 8px;
            border-radius: 4px;
            border: 1px solid #475569;
            background: #1e293b;
            color: #e2e8f0;
            cursor: pointer;
        }
        .pdf-mode-count {
            font-size: 12px;
            font-weight: 600;
            color: #60a5fa;
            background: rgba(59, 130, 246, 0.15);
            padding: 2px 8px;
            border-radius: 10px;
            white-space: nowrap;
            min-width: 48px;
            text-align: center;
        }
        .pdf-zoom-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 90px;
            height: 4px;
            background: #475569;
            border-radius: 2px;
            outline: none;
            cursor: pointer;
        }
        .pdf-zoom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #60a5fa;
            border: 2px solid #fff;
            cursor: pointer;
        }
        .pdf-zoom-slider::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #60a5fa;
            border: 2px solid #fff;
            cursor: pointer;
        }
        .pdf-mode-actions {
            display: flex;
            gap: 6px;
            margin-left: auto;
        }
        .pdf-mode-btn {
            font-size: 12px;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            color: #fff;
        }
        .pdf-mode-btn-primary { background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%); }
        .pdf-mode-btn-primary:hover { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); }
        .pdf-mode-btn-neutral { background: #475569; }
        .pdf-mode-btn-neutral:hover { background: #64748b; }

        /* 점선 그리드 */
        .pdf-grid-line-v {
            border-left: 2px dashed rgba(59, 130, 246, 0.45);
            pointer-events: none;
        }
        .pdf-grid-line-h {
            border-top: 2px dashed rgba(59, 130, 246, 0.45);
            pointer-events: none;
        }
        .pdf-grid-label {
            font-size: 11px;
            font-weight: 600;
            color: rgba(59, 130, 246, 0.5);
            pointer-events: none;
            user-select: none;
            line-height: 1;
        }

        .script-progress-backdrop {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.44);
            z-index: 150;
        }

        .script-progress-card {
            width: min(320px, calc(100vw - 32px));
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(219, 234, 254, 0.95);
            border-radius: 22px;
            box-shadow: 0 24px 50px rgba(15, 23, 42, 0.24);
            padding: 24px 22px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            text-align: center;
            backdrop-filter: blur(10px);
        }

        .script-progress-ring {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            background: conic-gradient(#2563eb 0deg, #dbeafe 0deg);
            box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18), 0 14px 32px rgba(37, 99, 235, 0.16);
        }

        .script-progress-ring::before {
            content: '';
            width: 86px;
            height: 86px;
            border-radius: 50%;
            background: #fff;
            box-shadow: inset 0 0 0 1px #e2e8f0;
        }

        .script-progress-value {
            position: absolute;
            font-size: 22px;
            font-weight: 800;
            color: #1e3a8a;
        }

        .script-progress-title {
            font-size: 18px;
            font-weight: 800;
            color: #0f172a;
        }

        .script-progress-detail {
            font-size: 13px;
            color: #64748b;
            line-height: 1.6;
        }

        .context-menu {
            position: fixed;
            min-width: 220px;
            background: #fff;
            border: 1px solid #d6dde7;
            border-radius: 12px;
            box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
            padding: 8px;
            display: none;
            z-index: 120;
        }

        .context-menu .menu-section {
            padding: 4px 0;
        }

        .context-menu .menu-title {
            font-size: 11px;
            color: #64748b;
            padding: 4px 10px 6px;
            font-weight: 700;
        }

        .context-menu button,
        .context-menu label {
            display: flex;
            width: 100%;
            align-items: center;
            justify-content: space-between;
            padding: 9px 10px;
            background: transparent;
            color: #111827;
            text-align: left;
        }

        .context-menu button:hover,
        .context-menu label:hover {
            background: #eef4ff;
        }

        .context-menu hr {
            border: none;
            border-top: 1px solid #edf2f7;
            margin: 6px 0;
        }

        .color-swatches {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
            padding: 0 10px 6px;
        }

        .color-swatch {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 1px solid #cbd5e1;
            cursor: pointer;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }

        .minimap {
            position: fixed;
            top: calc(var(--toolbar-height) + 12px);
            left: 12px;
            width: 220px;
            height: 140px;
            background: rgba(255, 255, 255, 0.92);
            border: 1px solid #d8dee7;
            border-radius: 12px;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
            touch-action: none;
            z-index: 40;
            overflow: hidden;
            backdrop-filter: blur(6px);
            pointer-events: auto;
        }

        .minimap-header {
            padding: 8px 10px;
            font-size: 12px;
            font-weight: 700;
            color: #475569;
            border-bottom: 1px solid #e2e8f0;
            background: rgba(248, 250, 252, 0.95);
            cursor: pointer;
        }

        #minimap-canvas {
            display: block;
            width: 100%;
            height: calc(100% - 33px);
            background: #f8fafc;
            cursor: grab;
        }

        #minimap-canvas.is-dragging {
            cursor: grabbing;
        }

        .minimap.collapsed {
            height: 35px;
        }

        .minimap.collapsed #minimap-canvas {
            display: none;
        }

        .debug-panel {
            position: fixed;
            right: 12px;
            bottom: 12px;
            width: min(520px, calc(100vw - 24px));
            max-height: 42vh;
            background: rgba(15, 23, 42, 0.94);
            color: #e5eefc;
            border-radius: 12px;
            box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
            z-index: 60;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .debug-panel.collapsed {
            max-height: 40px;
        }

        .debug-panel-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: rgba(30, 41, 59, 0.95);
            border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        }

        .debug-panel-title {
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.02em;
        }

        .debug-panel-actions {
            margin-left: auto;
            display: flex;
            gap: 6px;
        }

        .debug-panel-actions button {
            border: none;
            border-radius: 8px;
            padding: 6px 10px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            color: #fff;
            background: #334155;
        }

        .debug-panel-body {
            padding: 10px 12px;
            overflow: auto;
            font-family: Consolas, Monaco, monospace;
            font-size: 11px;
            line-height: 1.45;
            white-space: pre-wrap;
            word-break: break-word;
            min-height: 120px;
        }

        .debug-panel.collapsed .debug-panel-body {
            display: none;
        }

        #debug-panel {
            display: none !important;
        }

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

            .toolbar.toolbar-menu-open .toolbar-actions {
                max-width: calc(100vw - 20px);
            }

            :root {
                --table-width: 520px;
            }

            .search-controls,
            .field-editor-grid {
                grid-template-columns: 1fr;
            }
        }

/* ── 협업 툴바 배지 ── */
        #collab-bar {
            position: relative;
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1 1 auto;
            min-width: 0;
            flex-shrink: 1;
        }
        .member-count {
            font-size: 11px;
            font-weight: 700;
            color: #475569;
            white-space: nowrap;
            padding: 5px 10px;
            border-radius: 999px;
            background: rgba(241, 245, 249, .95);
            border: 1px solid rgba(203, 213, 225, .9);
        }
        .collab-bar-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 8px;
            border: 1px solid #cbd5e1;
            border-radius: 7px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
        }
        .collab-bar-btn-neutral {
            background: #f1f5f9;
            color: #334155;
        }
        #ws-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            background: #e2e8f0;
            color: #475569;
            transition: background .3s, color .3s;
            white-space: nowrap;
        }
        #ws-status::before {
            content: '';
            width: 8px; height: 8px;
            border-radius: 50%;
            background: #94a3b8;
            flex-shrink: 0;
        }
        #ws-status.connected { background: #dcfce7; color: #166534; }
        #ws-status.connected::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
        #ws-status.reconnecting { background: #fef3c7; color: #92400e; }
        #ws-status.reconnecting::before { background: #f59e0b; animation: blink .8s infinite; }
        #ws-status.disconnected { background: #fee2e2; color: #991b1b; }
        #ws-status.disconnected::before { background: #ef4444; }
        @keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

        /* ── 접속자 아바타 목록 ── */
        #user-list {
            display: flex;
            align-items: center;
            gap: -4px;
        }
        .user-avatar {
            width: 24px; height: 24px;
            border-radius: 50%;
            border: 2px solid #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 800;
            color: #fff;
            cursor: pointer;
            margin-left: -6px;
            box-shadow: 0 2px 6px rgba(0,0,0,.15);
            transition: transform .15s;
            position: relative;
            z-index: 1;
        }
        .user-avatar.is-owner {
            box-shadow: 0 0 0 2px rgba(250, 204, 21, .35), 0 8px 18px rgba(15, 23, 42, .2);
            border-color: #fef3c7;
        }
        .user-avatar:first-child { margin-left: 0; }
        .user-avatar:hover { transform: translateY(-3px) scale(1.1); z-index: 10; }
        .user-avatar[title]:hover::after {
            content: attr(title);
            position: absolute;
            bottom: -28px;
            left: 50%;
            transform: translateX(-50%);
            background: #111;
            color: #fff;
            font-size: 11px;
            padding: 3px 7px;
            border-radius: 6px;
            white-space: nowrap;
            pointer-events: none;
            z-index: 60;
        }
        .participant-panel-float {
            position: fixed;
            min-width: 200px;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px solid rgba(226, 232, 240, .95);
            background: rgba(255, 255, 255, .98);
            box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
            z-index: 90;
            backdrop-filter: blur(12px);
        }

        .pp-role-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pp-kick-btn {
            padding: 2px 8px;
            border-radius: 6px;
            border: none;
            background: rgba(239, 68, 68, .1);
            color: #dc2626;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: background .15s;
        }

        .pp-kick-btn:hover {
            background: rgba(239, 68, 68, .2);
        }

        .pp-kick-btn:disabled {
            opacity: .4;
            cursor: default;
        }

        .user-tooltip {
            position: fixed;
            z-index: 90;
            background: rgba(15, 23, 42, .9);
            color: #e2e8f0;
            padding: 4px 10px;
            border-radius: 8px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            pointer-events: none;
            backdrop-filter: blur(6px);
        }
        .participant-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }
        .participant-name {
            font-size: 14px;
            font-weight: 800;
            color: #0f172a;
        }
        .participant-panel-close {
            width: 28px;
            height: 28px;
            border: 0;
            border-radius: 999px;
            background: #f1f5f9;
            color: #475569;
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
        }
        .participant-panel-body {
            display: grid;
            gap: 10px;
        }
        .participant-role-badge {
            display: inline-flex;
            align-items: center;
            width: fit-content;
            padding: 7px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 800;
        }
        .participant-role-badge.is-owner {
            background: #fef3c7;
            color: #92400e;
        }
        .participant-role-badge.is-editor {
            background: #dcfce7;
            color: #166534;
        }
        .participant-role-badge.is-viewer {
            background: #e0f2fe;
            color: #075985;
        }
        .participant-toggle-area {
            display: flex;
        }
        .participant-toggle-btn {
            border: 0;
            border-radius: 12px;
            padding: 10px 12px;
            font-size: 12px;
            font-weight: 800;
            color: #fff;
            background: linear-gradient(135deg, #0f172a, #334155);
            cursor: pointer;
            box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
        }
        .participant-toggle-btn:disabled {
            opacity: .6;
            cursor: wait;
        }

        /* ── 원격 커서 ── */
        .remote-cursor {
            position: absolute;
            pointer-events: none;
            z-index: 999999;
            transition: left .08s linear, top .08s linear;
        }
        .remote-cursor-dot {
            width: 12px; height: 12px;
            border-radius: 50%;
            border: 2px solid #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,.25);
        }
        .remote-cursor-label {
            margin-top: 2px;
            padding: 2px 7px;
            border-radius: 10px;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            white-space: nowrap;
            box-shadow: 0 2px 6px rgba(0,0,0,.2);
        }

        /* ── 원격 테이블 하이라이트 ── */
        .remote-focus-ring {
            position: absolute;
            inset: -3px;
            border-radius: 16px;
            pointer-events: none;
            z-index: 100;
            border: 2px solid currentColor;
            opacity: .7;
        }

        /* ── 동기화 토스트 ── */
        #collab-toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(80px);
            background: rgba(17,24,39,.92);
            color: #fff;
            padding: 10px 20px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            z-index: 999;
            pointer-events: none;
            transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
            opacity: 0;
            backdrop-filter: blur(8px);
            white-space: nowrap;
        }
        #collab-toast.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }

/* ── Version History Modal ── */
        .version-history-modal {
            max-width: 560px;
            width: 92vw;
            max-height: 80vh;
        }

        .version-history-modal .modal-panel-body {
            overflow-y: auto;
            max-height: calc(80vh - 80px);
        }

        .vh-owner-section {
            padding-bottom: 12px;
            border-bottom: 1px solid #e2e8f0;
            margin-bottom: 12px;
        }

        .vh-save-form {
            display: flex;
            gap: 8px;
            align-items: stretch;
        }

        .vh-save-input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            font-size: 13px;
            color: #1e293b;
            background: #fff;
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .vh-save-input:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .vh-save-btn {
            white-space: nowrap;
            padding: 8px 16px;
            font-size: 13px;
        }

        .vh-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .vh-item {
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 14px 16px;
            background: #fff;
            transition: box-shadow 0.15s;
        }

        .vh-item:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .vh-item-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 6px;
        }

        .vh-item-name {
            font-weight: 700;
            font-size: 14px;
            color: #1e293b;
            word-break: break-word;
        }

        .vh-item-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }

        .vh-item-action-btn {
            padding: 4px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: #fff;
            font-size: 12px;
            color: #475569;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }

        .vh-item-action-btn:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .vh-item-action-btn.vh-restore-btn {
            color: #2563eb;
            border-color: #bfdbfe;
        }

        .vh-item-action-btn.vh-restore-btn:hover {
            background: #eff6ff;
            border-color: #93c5fd;
        }

        .vh-item-action-btn.vh-delete-btn {
            color: #dc2626;
            border-color: #fecaca;
        }

        .vh-item-action-btn.vh-delete-btn:hover {
            background: #fef2f2;
            border-color: #fca5a5;
        }

        .vh-item-meta {
            display: flex;
            gap: 12px;
            font-size: 12px;
            color: #94a3b8;
            flex-wrap: wrap;
        }

        .vh-item-meta span {
            display: flex;
            align-items: center;
            gap: 3px;
        }

        .vh-empty {
            text-align: center;
            padding: 40px 20px;
            color: #94a3b8;
            font-size: 14px;
        }

        .vh-preview-panel {
            margin-top: 8px;
            padding: 10px 12px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            font-size: 12px;
            color: #64748b;
            max-height: 150px;
            overflow-y: auto;
        }

        .vh-preview-table-list {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 4px;
        }

        .vh-preview-table-tag {
            padding: 2px 8px;
            background: #eff6ff;
            border-radius: 4px;
            font-size: 11px;
            color: #2563eb;
        }

        /* ── 권한 요청 승인/거부 토스트 (방장 전용) ── */
        .edit-role-request-toast {
            position: fixed;
            bottom: 70px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(17, 24, 39, 0.95);
            color: #e2e8f0;
            padding: 16px 22px;
            border-radius: 16px;
            font-size: 13px;
            z-index: 1000;
            backdrop-filter: blur(8px);
            box-shadow: 0 12px 36px rgba(0,0,0,.3);
            animation: tipFadeIn .3s ease;
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 280px;
        }

        .edit-role-request-msg {
            line-height: 1.5;
        }

        .edit-role-request-msg strong {
            color: #93c5fd;
        }

        .edit-role-request-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }

        .edit-role-approve-btn,
        .edit-role-deny-btn {
            padding: 6px 16px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            border: none;
        }

        .edit-role-approve-btn {
            background: #2563eb;
            color: #fff;
        }

        .edit-role-approve-btn:hover {
            background: #1d4ed8;
        }

        .edit-role-deny-btn {
            background: rgba(255,255,255,.12);
            color: #e2e8f0;
        }

        .edit-role-deny-btn:hover {
            background: rgba(255,255,255,.2);
        }

        /* ── 참여자 패널 권한 요청 버튼 ── */
        .participant-request-btn {
            width: 100%;
            padding: 8px 12px;
            border-radius: 10px;
            border: 1px solid #2563eb;
            background: transparent;
            color: #2563eb;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: background .15s, color .15s;
        }

        .participant-request-btn:hover {
            background: #2563eb;
            color: #fff;
        }

        .participant-request-btn:disabled {
            opacity: .5;
            cursor: default;
        }

        /* ── 버전 배지 ── */
        #version-badge {
            font-size: 11px;
            color: #94a3b8;
            white-space: nowrap;
        }

        /* ── 에디터 진입 Tip 레이어 ── */
        .editor-tip {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 200;
            background: rgba(15, 23, 42, 0.92);
            color: #e2e8f0;
            padding: 14px 22px;
            border-radius: 14px;
            font-size: 13px;
            line-height: 1.7;
            display: none;
            backdrop-filter: blur(6px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }

        .editor-tip.show {
            display: block;
            animation: tipFadeIn .3s ease;
        }

        .editor-tip.hiding {
            animation: tipFadeOut .4s ease forwards;
        }

        @keyframes tipFadeIn {
            from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
            to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        }

        @keyframes tipFadeOut {
            from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            to { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
        }

        .editor-tip-title {
            font-weight: 800;
            font-size: 14px;
            color: #fff;
            margin-bottom: 6px;
        }

        .editor-tip-row {
            display: flex;
            align-items: baseline;
            gap: 10px;
        }

        .editor-tip-key {
            display: inline-block;
            min-width: 72px;
            font-weight: 700;
            color: #93c5fd;
        }

        .editor-tip-close {
            position: absolute;
            top: 6px;
            right: 10px;
            background: none;
            border: none;
            color: #94a3b8;
            font-size: 16px;
            cursor: pointer;
            line-height: 1;
        }

        .editor-tip-close:hover {
            color: #fff;
        }

/* ── Version Preview Banner ── */
.vh-preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f1f5f9;
    font-size: 13px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    gap: 12px;
}
.vh-preview-banner-content {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vh-preview-banner-icon {
    font-size: 16px;
}
.vh-preview-banner-hint {
    color: #94a3b8;
    font-size: 12px;
}
.vh-preview-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.vh-preview-banner-restore {
    padding: 6px 16px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.vh-preview-banner-restore:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
    padding: 6px 16px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: transparent;
    color: #f1f5f9;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.vh-preview-banner-close:hover {
    background: rgba(255,255,255,0.1);
    border-color: #e2e8f0;
}
