/* Canvas 에디터 확장 기능 스타일 (서식 툴바 / 콘솔 / 선택 팝업 / 편집 바 / 수락 바) */

/* ── 문서 서식 툴바 ──────────────────────────────────────── */
.canvas-format-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.fmt-btn {
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.fmt-btn:hover   { background: #e8eaed; border-color: #dadce0; }
.fmt-btn:active  { background: #d2e3fc; border-color: #4b90ff; }
.fmt-btn svg     { width: 14px; height: 14px; }

.fmt-divider {
    width: 1px;
    height: 20px;
    background: #dadce0;
    margin: 0 4px;
    flex-shrink: 0;
}

/* ── 헤더 텍스트 버튼 (최근 변경사항) ─────────────────────── */
.canvas-text-btn {
    background: transparent;
    border: none;
    color: #4b90ff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.15s;
}
.canvas-text-btn:hover  { background: rgba(75, 144, 255, 0.12); }
.canvas-text-btn.active { background: rgba(75, 144, 255, 0.2); color: #2563eb; }

/* ── 콘솔 패널 ───────────────────────────────────────────── */
.canvas-console {
    flex-shrink: 0;
    height: 160px;
    min-height: 80px;
    max-height: 60%;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.console-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    cursor: ns-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s;
}

.console-resize-handle:hover,
.console-resize-handle.dragging {
    background: rgba(75, 144, 255, 0.35);
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: #242424;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.console-title {
    font-size: 12px;
    color: #9e9e9e;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.console-title svg { width: 13px; height: 13px; }

.console-clear-btn {
    background: transparent;
    border: none;
    color: #757575;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.15s;
}
.console-clear-btn:hover { color: #e0e0e0; }

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 6px 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.console-line  { padding: 1px 0; }
.console-log   { color: #d4d4d4; }
.console-error { color: #f48771; }

/* ══════════════════════════════════════════════════════════
   선택 텍스트 AI 팝업 — Gemini 다크 pill 스타일
   ══════════════════════════════════════════════════════════ */
.canvas-selection-popup {
    position: fixed;
    z-index: 10100;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    background: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.25);
    transform: translate(-50%, calc(-100% - 10px));
    pointer-events: auto;
    user-select: none;
    animation: popup-in 0.12s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes popup-in {
    from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, calc(-100% - 10px)) scale(1); }
}

.sel-popup-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: 18px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}
.sel-popup-btn:hover { background: rgba(255,255,255,0.1); }

/* 어조 변경 (서브메뉴 화살표 포함) */
.sel-popup-submenu { gap: 2px; }
.sel-submenu-arrow {
    font-size: 9px;
    opacity: 0.55;
    margin-left: 1px;
    line-height: 1;
}

/* 세로 구분선 */
.sel-popup-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.14);
    flex-shrink: 0;
    margin: 0 3px;
}

/* "Gemini에게 물어보기" 강조 버튼 */
.sel-popup-ask { color: #c8b9f5; }
.sel-popup-ask:hover { background: rgba(200,185,245,0.14); }
.sel-ask-star {
    font-size: 11px;
    background: linear-gradient(135deg, #4285f4 0%, #9c59d1 50%, #ea4335 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════
   Selection 팝업용 슬라이더 (다크 테마)
   ══════════════════════════════════════════════════════════ */
@keyframes sel-slider-popup-in {
    from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, calc(-100% - 8px)) scale(1); }
}

.sel-slider-popup {
    position: fixed;
    z-index: 10101;
    width: 260px;
    background: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.25);
    padding: 14px 16px 10px;
    transform: translate(-50%, calc(-100% - 8px));
    animation: sel-slider-popup-in 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.sel-slider-popup .tone-slider-label { color: rgba(255,255,255,0.5); }

.sel-slider-popup input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.sel-slider-popup input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7c9cff;
    border: 2px solid #2d2d2d;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.1s;
}

.sel-slider-popup input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

.sel-slider-popup .tone-slider-ticks span { background: rgba(255,255,255,0.2); }

.sel-slider-desc {
    text-align: center;
    font-size: 12px;
    color: #7c9cff;
    font-weight: 500;
    margin: 8px 0 0;
    letter-spacing: 0.01em;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

/* ══════════════════════════════════════════════════════════
   어조 변경 서브메뉴 + 툴바 드롭다운 (공용 스타일)
   ══════════════════════════════════════════════════════════ */
.canvas-tone-menu {
    position: fixed;
    z-index: 10101;
    background: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.25);
    padding: 5px;
    min-width: 128px;
    pointer-events: auto;
    animation: popup-in-fade 0.12s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes popup-in-fade {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.tone-option {
    display: block;
    width: 100%;
    padding: 7px 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}
.tone-option:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* 툴바 드롭다운: 문서 모드 라이트 배경 위에 표시 */
.canvas-tone-dropdown {
    background: #ffffff;
    border: 1px solid #dadce0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.08);
}
.canvas-tone-dropdown .tone-option { color: #3c4043; }
.canvas-tone-dropdown .tone-option:hover { background: #f1f3f4; color: #202124; }

/* ══════════════════════════════════════════════════════════
   Gemini에게 물어보기 — 인라인 입력창
   ══════════════════════════════════════════════════════════ */
.canvas-ask-input {
    position: fixed;
    z-index: 10102;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 7px 7px 14px;
    background: #ffffff;
    border: 1.5px solid #dadce0;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
    width: 308px;
    transform: translate(-50%, calc(-100% - 10px));
    animation: popup-in-fade 0.14s cubic-bezier(0.2, 0, 0, 1);
}
.canvas-ask-input:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 4px 20px rgba(26,115,232,0.18), 0 0 0 3px rgba(26,115,232,0.08);
}

.ask-star-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
    background: linear-gradient(135deg, #4285f4 0%, #9c59d1 50%, #ea4335 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ask-input-field {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 14px;
    color: #202124;
    background: transparent;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    line-height: 1.4;
}
.ask-input-field::placeholder { color: #80868b; }

.ask-send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.ask-send-btn:hover:not(:disabled) { background: #1557b0; }
.ask-send-btn:active:not(:disabled) { transform: scale(0.93); }
.ask-send-btn:disabled { background: #e8eaed; color: #bdc1c6; cursor: not-allowed; }

.ask-cancel-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}
.ask-cancel-btn:hover { background: #f1f3f4; color: #202124; }

/* ══════════════════════════════════════════════════════════
   Pending 편집 영역 — 스트리밍 중 하이라이트 + 커서
   ══════════════════════════════════════════════════════════ */
.canvas-edit-pending {
    background: rgba(26, 115, 232, 0.07);
    border-radius: 3px;
    outline: 1px solid rgba(26, 115, 232, 0.18);
    transition: background 0.3s;
}

.canvas-edit-full {
    display: block;
    min-height: 2em;
}

/* 스트리밍 중 커서 애니메이션 */
.canvas-edit-pending.streaming::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #1a73e8;
    margin-left: 2px;
    vertical-align: text-bottom;
    border-radius: 1px;
    animation: canvas-cursor-blink 0.85s step-end infinite;
}

@keyframes canvas-cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.canvas-edit-error { color: #d32f2f; font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   스트리밍 진행 바 — 편집 중 상태 표시 + 취소 버튼
   ══════════════════════════════════════════════════════════ */
.canvas-edit-bar {
    position: fixed;
    z-index: 10200;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.16), 0 1px 3px rgba(0,0,0,0.08);
    pointer-events: auto;
    user-select: none;
    animation: bar-slide-in 0.18s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes bar-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.edit-bar-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #5f6368;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    white-space: nowrap;
}

.edit-bar-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: edit-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes edit-spin {
    to { transform: rotate(360deg); }
}

.edit-bar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    line-height: 1;
}
.edit-bar-btn:active { transform: scale(0.96); }

.edit-bar-cancel { background: transparent; color: #3c4043; border: 1px solid #dadce0; }
.edit-bar-cancel:hover { background: #f1f3f4; border-color: #bdc1c6; }

/* 문서 모드 되돌리기 버튼 비활성 상태 */
#canvas-doc-undo-btn.disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ══════════════════════════════════════════════════════════
   제안 사이드 패널 — Gemini Suggestion Panel
   ══════════════════════════════════════════════════════════ */
.canvas-suggestion-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
}

.canvas-suggestion-panel.active {
    transform: translateX(0);
}

.suggestion-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8eaed;
    flex-shrink: 0;
}

.suggestion-panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.suggestion-star {
    font-size: 13px;
    background: linear-gradient(135deg, #4285f4 0%, #9c59d1 50%, #ea4335 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.suggestion-count-badge {
    font-size: 11px;
    font-weight: 500;
    color: #5f6368;
    background: #f1f3f4;
    padding: 2px 7px;
    border-radius: 10px;
}

.suggestion-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggestion-apply-all-btn {
    padding: 5px 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.suggestion-apply-all-btn:hover:not(:disabled) { background: #1557b0; }
.suggestion-apply-all-btn:active:not(:disabled) { transform: scale(0.96); }
.suggestion-apply-all-btn:disabled { background: #e8eaed; color: #bdc1c6; cursor: not-allowed; }

.suggestion-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ── 제안 카드 ──────────────────────────────────────────── */
.suggestion-card {
    margin: 4px 10px;
    padding: 12px 14px;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.3s, transform 0.3s;
    display: flex;
    gap: 10px;
}
.suggestion-card:hover { border-color: #c5cae9; box-shadow: 0 1px 6px rgba(0,0,0,0.07); }

.suggestion-card-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    font-family: 'Google Sans', sans-serif;
}

.suggestion-card-body { flex: 1; min-width: 0; }

.suggestion-original {
    font-size: 12px;
    color: #9e9e9e;
    text-decoration: line-through;
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 5px;
}

.suggestion-arrow {
    font-size: 12px;
    color: #1a73e8;
    margin: 2px 0;
    line-height: 1;
}

.suggestion-replacement {
    font-size: 12px;
    color: #137333;
    background: #e6f4ea;
    border-radius: 6px;
    padding: 5px 8px;
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 6px;
}

.suggestion-reason {
    font-size: 11px;
    color: #5f6368;
    line-height: 1.45;
    margin-bottom: 9px;
}

.suggestion-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.suggestion-apply-btn {
    padding: 4px 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.suggestion-apply-btn:hover { background: #1557b0; }
.suggestion-apply-btn:active { transform: scale(0.95); }

.suggestion-dismiss-btn {
    padding: 4px 8px;
    background: transparent;
    color: #5f6368;
    border: none;
    border-radius: 14px;
    font-size: 12px;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.suggestion-dismiss-btn:hover { background: #f1f3f4; color: #202124; }

/* ── 카드 상태 애니메이션 ────────────────────────────────── */
.suggestion-card--applied {
    border-color: #34a853;
    background: #f0fff4;
    opacity: 0;
    transform: translateX(12px);
}

.suggestion-card--dismissed {
    opacity: 0;
    transform: translateX(-12px);
}

.suggestion-card--not-found {
    border-color: #ea4335;
    background: #fff8f7;
}

/* ── 로딩 시머 ──────────────────────────────────────────── */
.suggestion-card--loading {
    border: 1px solid #e8eaed;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.suggestion-shimmer {
    background: linear-gradient(90deg, #f1f3f4 25%, #e8eaed 50%, #f1f3f4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: 4px;
    height: 12px;
}
.suggestion-shimmer--short  { width: 55%; }
.suggestion-shimmer--medium { width: 75%; }
.suggestion-shimmer--long   { width: 90%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 빈 상태 / 오류 ─────────────────────────────────────── */
.suggestion-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 10px;
    color: #5f6368;
    font-size: 13px;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    text-align: center;
}
.suggestion-empty-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e6f4ea;
    color: #34a853;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-error {
    padding: 24px 16px;
    color: #d32f2f;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}
.suggestion-error small { color: #9e9e9e; font-size: 11px; }

.monaco-changed-line  { background: rgba(255, 214, 0, 0.08) !important; }
.monaco-changed-glyph { background: #ffd600; width: 3px !important; }

/* ══════════════════════════════════════════════════════════
   버전 기록 패널 — 좌측 슬라이드인 (gemini.google.com 복제)
   ══════════════════════════════════════════════════════════ */
.canvas-version-panel {
    position: absolute;
    top: 64px; /* canvas-header 높이 */
    left: 0;
    width: 240px;
    height: calc(100% - 64px);
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

#canvas-panel.document-mode .canvas-version-panel {
    top: 64px;
}

.canvas-version-panel.active {
    transform: translateX(0);
}

.version-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8eaed;
    flex-shrink: 0;
}

.version-panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}
.version-panel-title svg { width: 15px; height: 15px; color: #5f6368; }

.version-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ── 버전 항목 ──────────────────────────────────────────── */
.version-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.version-item:hover { background: #f1f3f4; }
.version-item--current { cursor: default; }
.version-item--current:hover { background: transparent; }
.version-item--previewing { background: #e8f0fe; }
.version-item--previewing:hover { background: #d2e3fc; }

.version-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dadce0;
    flex-shrink: 0;
    margin-top: 1px;
}
.version-item--current .version-item-dot {
    background: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}
.version-item--previewing .version-item-dot { background: #4b90ff; }

.version-item-body { flex: 1; min-width: 0; }

.version-item-label {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}
.version-item--current .version-item-label { color: #1a73e8; }

.version-item-time {
    font-size: 11px;
    color: #5f6368;
    margin-top: 2px;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.version-item-arrow {
    font-size: 16px;
    color: #bdc1c6;
    flex-shrink: 0;
    line-height: 1;
}
.version-item:hover .version-item-arrow { color: #5f6368; }

.version-empty {
    padding: 32px 16px;
    font-size: 13px;
    color: #9e9e9e;
    text-align: center;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

/* ══════════════════════════════════════════════════════════
   버전 미리보기 배너 — 에디터 상단 고정
   ══════════════════════════════════════════════════════════ */
.canvas-version-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #e8f0fe;
    border-bottom: 1px solid #c5cae9;
    flex-shrink: 0;
    z-index: 50;
    animation: bar-slide-in 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.version-preview-info {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.version-preview-icon {
    color: #1a73e8;
    flex-shrink: 0;
}
.version-preview-icon svg { width: 15px; height: 15px; }

.version-preview-label {
    font-size: 13px;
    color: #1a73e8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
}

.version-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.version-restore-btn {
    padding: 5px 14px;
    background: #1a73e8;
    color: #ffffff;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.version-restore-btn:hover  { background: #1557b0; }
.version-restore-btn:active { transform: scale(0.96); }

.version-current-btn {
    padding: 5px 10px;
    background: transparent;
    color: #5f6368;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.version-current-btn:hover { background: rgba(0,0,0,0.06); color: #202124; }

/* 버전 기록 버튼 활성 상태 */
#canvas-version-btn.active {
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.1);
}

/* ── 코드 모드 AI 도구 드롭다운 ─────────────────────────── */
.canvas-ai-tools-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.canvas-ai-tools-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.25);
    padding: 5px;
    min-width: 148px;
    z-index: 500;
    animation: popup-in-fade 0.12s cubic-bezier(0.2, 0, 0, 1);
}

.ai-tool-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Google Sans', 'Noto Sans KR', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.ai-tool-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.ai-tool-item svg   { width: 14px; height: 14px; opacity: 0.8; flex-shrink: 0; }
