/* 엑셀 리본 뚝딱 — 줄인 화면(2026-11-12 운영자: 시안 2판 「아홉 줄 모두 이대로」 · 3판 왼쪽 요소 그림 「가 선 · 진한 초록」 「가 · 조금 줄임」)
 * 도구 원본(tools/xl-ribbon-editor.php 의 <style>) 위에 얹는다 — 템플릿이 body 에 erbs 를 붙였을 때만 먹는다.
 * 짝 = js/erb-simple.js(부품을 옮기고 접는다 · [파일 받기] = 매크로가 든 파일).
 * 값은 정본 그대로: 단추 6 · 칸 8 · 회색 면 · 채운 초록 단추는 [파일 받기] 하나 · 글자 13–14.
 * 규칙 예외(.claude/rules/css.md 「엑셀 리본 뚝딱」 줄): 왼쪽 요소 그림 = Lucide 가 아닌 한 벌 그림(GPT image 로 뽑아 자른 것) · 진한 초록(--primary).
 */
body.erbs {
	--erbs-font: 'Pretendard Variable', Pretendard, 'Malgun Gothic', sans-serif;
	--excel: var(--brand-action);
	--excel-l: var(--brand-hover);
	--excel-d: var(--primary);
	--accent: var(--brand-action);
	--accent-bg: color-mix(in srgb, var(--brand-action) 6%, transparent);
	--border: var(--gray-200);
	--bg: var(--gray-50);
}

.erbs-ic { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 스크립트가 부품을 옮기기 전 모습이 잠깐 비치지 않게 — 스크립트가 못 실려도 2.5초 뒤엔 보인다 */
body.erbs:not(.erbs-on) .file-info-bar,
body.erbs:not(.erbs-on) .main { visibility: hidden; animation: erbs-late 0s linear 2.5s forwards; }
@keyframes erbs-late { to { visibility: visible; } }

/* ── 1. 위 줄 — 파일 이름 · [다른 파일 불러오기] · [파일 받기] ── */
body.erbs .file-info-bar { gap: 10px; height: 52px; padding: 0 14px; border-bottom: 1px solid var(--gray-200); background: var(--surface-white); font-family: var(--erbs-font); font-size: 14px; }
body.erbs .file-info-bar .fi-section:nth-of-type(2),
body.erbs .file-info-bar .fi-section:nth-of-type(3) { display: none; }
body.erbs .file-info-bar .fi-section:first-child { gap: 6px; min-width: 0; height: 34px; padding: 0 12px 0 10px; border-radius: 6px; background: var(--gray-100); color: var(--gray-900); }
body.erbs .file-info-bar .fi-section:first-child strong { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
body.erbs .file-info-bar .fi-section.fi-vba { font-size: 13px; font-weight: 400; color: var(--gray-500); white-space: nowrap; }
body.erbs .fi-icon { display: none; }
body.erbs .erbs-fic { width: 16px; height: 16px; color: var(--gray-700); }
body.erbs .file-info-bar .fi-btn { display: inline-flex; align-items: center; flex: none; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--gray-100); font-family: var(--erbs-font); font-size: 14px; font-weight: 600; color: var(--gray-900); white-space: nowrap; transition: none; }
body.erbs .file-info-bar .fi-btn:hover { background: var(--gray-200); color: var(--gray-900); }
body.erbs .file-info-bar .fi-btn.erbs-save { background: var(--brand-action); color: var(--surface-white); transition: background-color .2s ease, color .2s ease; } /* 받을 것이 준비되면 회색 → 초록으로 부드럽게(아래 [disabled]) */
body.erbs .file-info-bar .fi-btn.erbs-save:hover { background: var(--brand-hover); color: var(--surface-white); }
/* 잠긴 단추 — [파일 받기]는 받을 것이 준비되기 전 · 만드는 동안 잠긴다(js ready · 11/16 밤 대표). 둘째 선택자 = 위 초록 :hover 줄을 이긴다(잠긴 채 마우스를 올려도 회색) */
body.erbs .file-info-bar .fi-btn[disabled],
body.erbs .file-info-bar .fi-btn.erbs-save[disabled] { background: var(--gray-200); color: var(--gray-500); cursor: default; }
@media (prefers-reduced-motion: reduce) { body.erbs .file-info-bar .fi-btn.erbs-save { transition: none; } }
body.erbs .fi-btn svg { width: 16px; height: 16px; }
body.erbs .fi-btn:focus-visible,
.erbs-codebtn:focus-visible,
.erbs-adv > summary:focus-visible,
.erbs-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── 2. 왼쪽 — 요소 열 개를 늘 다 보인다(2026-11-12 운영자 「더보기는 뺍니다. 항상 다 표시합니다」) ──
   제목 · 안내 글은 두지 않는다(같은 날 운영자 「'리본에 넣기 / 끌어서 그룹에 놓으세요' 이런 문구는 넣지 맙시다」 — 정본 v4 「먼저 읽기 — 자잘한 안내 글」).
   위 여백 13 = 첫 요소 줄의 가운데가 가운데 판 리본 탭 줄의 가운데(위 줄 아래 37)와 같은 높이에 온다 — 가운데 판 위 여백(16)을 바꾸면 같이 맞춘다(재는 도구 = 랩탑 스튜디오 C:/tmp/ribbon-ai/impl/test/t-align.cjs). */
body.erbs .palette { width: 200px; padding-top: 13px; border-right: 1px solid var(--gray-200); font-family: var(--erbs-font); }
body.erbs .palette-header,
body.erbs .psec { display: none; }
body.erbs .palette-item { gap: 10px; margin: 1px 8px; padding: 7px 8px; border-radius: 6px; font-size: 14px; color: var(--gray-900); transition: none; }
body.erbs .palette-item:hover { background: var(--gray-100); color: var(--gray-900); }

/* 요소 그림 — 테두리 칸 없이 진한 초록 한 색. 묶음 그림(열 칸 × 72 · 차례 = 도구의 data-type)을 가림막으로 쓰고 색은 토큰으로 칠한다.
   이니셜 칸이 있던 자리(26) 안에 24 — 그림마다 칸에 맞춘 크기에서 체크박스 · 구분선 .82 · 메뉴 · 드롭다운 · 레이블 .9 만 줄였다(C:\tmp\ribbon-ai\icons\slice.cjs =a) */
body.erbs .pi {
	width: 24px;
	height: 24px;
	margin: 1px;
	border: 0;
	border-radius: 0;
	background: var(--primary);
	font-size: 0;
	-webkit-mask: url(../img/pal-icons.png?v=1) no-repeat 0 0 / 240px 24px;
	mask: url(../img/pal-icons.png?v=1) no-repeat 0 0 / 240px 24px;
}
body.erbs .palette-item[data-type="toggleButton"] .pi { -webkit-mask-position: -24px 0; mask-position: -24px 0; }
body.erbs .palette-item[data-type="checkBox"] .pi { -webkit-mask-position: -48px 0; mask-position: -48px 0; }
body.erbs .palette-item[data-type="editBox"] .pi { -webkit-mask-position: -72px 0; mask-position: -72px 0; }
body.erbs .palette-item[data-type="comboBox"] .pi { -webkit-mask-position: -96px 0; mask-position: -96px 0; }
body.erbs .palette-item[data-type="dropDown"] .pi { -webkit-mask-position: -120px 0; mask-position: -120px 0; }
body.erbs .palette-item[data-type="menu"] .pi { -webkit-mask-position: -144px 0; mask-position: -144px 0; }
body.erbs .palette-item[data-type="splitButton"] .pi { -webkit-mask-position: -168px 0; mask-position: -168px 0; }
body.erbs .palette-item[data-type="labelControl"] .pi { -webkit-mask-position: -192px 0; mask-position: -192px 0; }
body.erbs .palette-item[data-type="separator"] .pi { -webkit-mask-position: -216px 0; mask-position: -216px 0; }


/* ── 3. 가운데 — 범례 줄을 빼고 리본을 키운다 ── */
body.erbs .canvas-toolbar { display: none; }
/* 가운데 판 여백 = 사방 16 으로 확정 — 11/12 하루에 54 · 20 → 16 → 54 · 20 → 16 으로 오갔고(운영자 「여백이 달라서 어색」 → 「꽉 껴있고 답답」 → 「여백을 다시 빼봅시다」),
   짜임이 다른 시안 넷(한 바탕 · 가운데 띄운 판 · 떠 있는 칸 · 좁은 아이콘 줄)을 보신 뒤 「그냥 지금으로 갑시다」. ⛔ 여백 · 짜임을 다시 바꾸지 않는다(바꾸려면 운영자에게 먼저) */
body.erbs .canvas { padding: 16px; background: var(--gray-50); }
body.erbs .ribbon-preview { zoom: 1.2; border-color: var(--gray-200); box-shadow: none; }
body.erbs .add-tab-btn { border-color: transparent; background: var(--gray-100); color: var(--gray-900); }
body.erbs .add-tab-btn:hover { border-color: transparent; background: var(--gray-200); }

/* ── 4. 아래 — 코드 칸은 접어 두고 한 줄만 ── */
.erbs-codebar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 40px; padding: 0 14px 0 6px; border-top: 1px solid var(--gray-200); background: var(--surface-white); font-family: var(--erbs-font); font-size: 13px; color: var(--gray-500); }
.erbs-codebtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-weight: 600; color: var(--gray-900); cursor: pointer; }
.erbs-codebtn:hover { background: var(--gray-100); }
.erbs-codebtn svg { width: 16px; height: 16px; transform: rotate(180deg); }
body.erbs:not(.erbs-code-closed) .erbs-codebtn svg { transform: none; }
body.erbs.erbs-code-closed #xmlPanel,
body.erbs.erbs-code-closed #xmlResizer { display: none; }
.erbs-codebar-r { display: inline-flex; align-items: center; gap: 14px; }
body.erbs .erbs-codebar .fi-link { margin: 0; font-family: var(--erbs-font); font-size: 13px; color: var(--gray-500); }
body.erbs .erbs-codebar .fi-link:hover { color: var(--gray-900); }
body.erbs .xml-header { background: var(--surface-white); font-family: var(--erbs-font); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--gray-500); }

/* ── 5. 작은 단추(코드 칸 · 속성 · 창) — 회색 면 6 ── */
body.erbs .btn { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--gray-100); font-family: var(--erbs-font); font-size: 13px; font-weight: 500; line-height: 1; color: var(--gray-900); transition: none; }
body.erbs .btn:hover,
body.erbs .btn:focus,
body.erbs .btn:active { background: var(--gray-200); color: var(--gray-900); }
body.erbs .btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }
body.erbs .btn-primary { background: var(--brand-action); color: var(--surface-white); }
body.erbs .btn-primary:hover,
body.erbs .btn-primary:focus,
body.erbs .btn-primary:active { background: var(--brand-hover); color: var(--surface-white); }
body.erbs .btn-danger,
body.erbs .btn-danger:hover { color: var(--color-danger-text); }
body.erbs .btn.is-copied { color: var(--color-success-text); }
body.erbs .btn .erbs-ic { width: 14px; height: 14px; }

/* ── 6. 속성 — 기본 칸만 보이고 나머지는 「자세히」 ── */
body.erbs .props-panel { width: 300px; border-left: 1px solid var(--gray-200); font-family: var(--erbs-font); }
body.erbs .props-header { justify-content: flex-end; min-height: 44px; padding: 8px 12px 0 16px; border: 0; background: none; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--gray-500); }
body.erbs .props-header > span { display: none; }
body.erbs .props-body { padding: 8px 16px 16px; font-family: var(--erbs-font); }
body.erbs .props-empty { padding: 40px 8px; font-family: var(--erbs-font); font-size: 14px; line-height: 1.6; color: var(--gray-500); word-break: keep-all; }
body.erbs .prop-group { margin: 0 0 14px; padding: 0; border: 0; background: none; }
body.erbs .prop-group-title { margin: 0 0 8px; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--gray-500); }
body.erbs .prop-row { margin-bottom: 10px; }
body.erbs .prop-label { margin-bottom: 4px; font-size: 13px; color: var(--gray-500); }
body.erbs .prop-input,
body.erbs .prop-select { height: 38px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--gray-100); font-family: var(--erbs-font); font-size: 14px; color: var(--gray-900); }
body.erbs .prop-input:focus,
body.erbs .prop-select:focus { background: var(--surface-white); outline: 2px solid var(--primary); }
body.erbs .prop-id-wrap .prop-input { padding-right: 56px; font-family: Consolas, 'D2Coding', monospace; font-size: 13px; }
body.erbs .prop-id-wrap .prop-input[readonly] { background: var(--gray-100); color: var(--gray-500); }
body.erbs .prop-id-wrap .prop-input[readonly]:focus { outline: 0; }
body.erbs .prop-id-wrap .prop-input.id-error { background: var(--color-danger-bg); color: var(--color-danger-text); }
body.erbs .id-edit-btn { right: 4px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--surface-white); font-family: var(--erbs-font); font-size: 12px; font-weight: 500; color: var(--gray-900); }
body.erbs .id-edit-btn:hover { background: var(--gray-200); color: var(--gray-900); }
body.erbs .icon-picker-btn { gap: 8px; height: 38px; padding: 0 12px 0 8px; border: 0; border-radius: 6px; background: var(--gray-100); font-family: var(--erbs-font); font-size: 14px; color: var(--gray-900); }
body.erbs .icon-picker-btn:hover { background: var(--gray-200); }
body.erbs .icon-picker-btn .picked-icon { width: 24px; height: 24px; border: 0; border-radius: 4px; background: var(--surface-white); }
body.erbs .cb-desc,
body.erbs .cb-sig-hint { font-size: 12px; color: var(--gray-500); }
body.erbs .erbs-note { margin-top: -4px; font-size: 12px; line-height: 1.5; color: var(--gray-500); word-break: keep-all; }
body.erbs .item-card { margin-bottom: 6px; padding: 8px; border: 0; border-radius: 8px; background: var(--gray-100); }
body.erbs .item-card .prop-row { margin-bottom: 6px; }
body.erbs .item-card .prop-label { font-size: 12px; }
body.erbs .item-card .prop-input { background: var(--surface-white); }
body.erbs .item-card .prop-id-wrap .prop-input[readonly] { background: var(--surface-white); }
body.erbs .item-card .id-edit-btn { background: var(--gray-100); }
body.erbs .item-card .btn { background: var(--surface-white); }
body.erbs .item-card .btn:hover { background: var(--gray-200); }
/* 항목의 id 는 「자세히」를 펼쳤을 때만 */
body.erbs #propsBody:not(.erbs-adv-open) .item-card .prop-row:first-child { display: none; }
body.erbs .erbs-child { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; padding: 4px 4px 4px 12px; border-radius: 6px; background: var(--gray-100); font-size: 14px; color: var(--gray-900); }
body.erbs .erbs-child > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.erbs .erbs-child .btn { background: var(--surface-white); }
body.erbs .erbs-child .btn:hover { background: var(--gray-200); }
.erbs-adv { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--gray-200); }
.erbs-adv > summary { display: flex; align-items: center; gap: 6px; padding: 10px 0; font-size: 13px; color: var(--gray-500); cursor: pointer; list-style: none; }
.erbs-adv > summary::-webkit-details-marker { display: none; }
.erbs-adv > summary svg { width: 14px; height: 14px; }
.erbs-adv[open] > summary svg { transform: rotate(180deg); }
.erbs-adv[open] > summary { margin-bottom: 6px; }

/* ── 7. 창(아이콘 고르기 · 새 매크로 · 매크로 관리) · 오른쪽 단추 메뉴 — 색과 단추만 맞춘다 ── */
body.erbs .icon-modal,
body.erbs .small-modal,
body.erbs .manage-modal { border: 0; font-family: var(--erbs-font); }
body.erbs .icon-modal-header,
body.erbs .small-modal-header,
body.erbs .manage-modal-header,
body.erbs .small-modal-footer,
body.erbs .manage-modal-footer { border-color: var(--gray-200); background: var(--surface-white); }
body.erbs .small-modal-header,
body.erbs .manage-modal-header { padding: 14px 16px; font-size: 16px; font-weight: 600; color: var(--gray-900); }
body.erbs .manage-modal-footer { justify-content: flex-end; }
body.erbs .manage-modal-footer .legend { display: none; }
body.erbs .small-modal-body label { font-size: 13px; font-weight: 400; color: var(--gray-500); }
body.erbs .small-modal-body input[type=text],
body.erbs .icon-modal-header input { height: 38px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--gray-100); font-family: var(--erbs-font); font-size: 14px; color: var(--gray-900); }
body.erbs .small-modal-body input[type=text]:focus,
body.erbs .icon-modal-header input:focus { background: var(--surface-white); outline: 2px solid var(--primary); }
body.erbs .sig-label { font-weight: 400; color: var(--gray-900); }
body.erbs .macro-table { font-family: var(--erbs-font); font-size: 13px; }
body.erbs .macro-table th { background: var(--surface-white); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--gray-500); }
body.erbs .macro-table tr:hover td { background: var(--gray-50); }
body.erbs .icon-modal-tab { font-family: var(--erbs-font); font-size: 13px; }
body.erbs .icon-modal-tab.active { border-bottom-color: var(--gray-900); color: var(--gray-900); }
body.erbs .ctx-menu { padding: 6px; border: 0; border-radius: 8px; box-shadow: var(--shadow-lg); font-family: var(--erbs-font); }
body.erbs .ctx-item { padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--gray-900); }
body.erbs .ctx-item:hover { background: var(--gray-100); color: var(--gray-900); }
body.erbs .ctx-item.danger { color: var(--color-danger-text); }
body.erbs .ctx-sep { background: var(--gray-200); }

/* ── 8. 받은 뒤 안내(위 줄 아래 작은 판) · 채팅 완성 칸이 같이 쓰는 부품 ── */
.erbs-pop { position: fixed; z-index: 450; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 28px); padding: 16px; border-radius: 8px; background: var(--surface-white); box-shadow: var(--shadow-lg); font-family: var(--erbs-font); font-size: 14px; line-height: 1.5; color: var(--gray-900); word-break: keep-all; }
.erbs-pop[hidden] { display: none; }
.erbs-file { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--gray-100); }
.erbs-file svg { width: 22px; height: 22px; color: var(--gray-700); }
.erbs-file b { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.erbs-file span { display: block; font-size: 13px; line-height: 1.45; color: var(--gray-500); }
.erbs-guide-h { margin: 6px 0 -3px 14px; font-size: 13px; line-height: 1.4; color: var(--gray-500); }
.erbs-guide { margin: 0; padding: 0; border-radius: 8px; background: var(--gray-100); list-style: none; }
.erbs-guide li { display: flex; gap: 8px; margin: 0 14px; padding: 11px 0; font-size: 14px; line-height: 1.5; }
.erbs-guide li + li { border-top: 1px solid var(--gray-200); }
.erbs-guide i { flex: none; width: 14px; font-style: normal; font-weight: 600; color: var(--gray-500); }
.erbs-warn { display: flex; gap: 8px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--gray-700); }
.erbs-warn svg { width: 16px; height: 16px; margin-top: 2px; color: var(--color-warning); }
.erbs-pop-foot { display: flex; justify-content: flex-end; gap: 6px; }
.erbs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--gray-100); font: inherit; font-family: var(--erbs-font); font-size: 14px; font-weight: 600; line-height: 1; color: var(--gray-900); white-space: nowrap; cursor: pointer; }
.erbs-btn:hover { background: var(--gray-200); }

/* ── 9. 처음 화면 — [새 파일에서 시작] · [기존 파일 불러오기](js 9절 · 2026-11-16 밤 대표 「나 · 편집 화면 안 가운데 칸으로 합니다」 — 시안 아티팩트 GkwUhKZe24FJBvrhzDgK1U) ──
   body: erbst-on = 처음 화면 · erbst-go = 고른 뒤 가운데 칸이 물러나는 중(on 과 함께) · erbst-in = 리본이 차오르는 중(1.7초)
   편집 화면은 처음부터 보인다 — 가운데 판 위에 끌어다 놓는 칸 + [새 파일에서 시작]을 놓고, 리본 판 · 파일 이름 · [다른 파일 불러오기]는 감추고, 왼쪽 요소 · 아래 코드 줄은 흐리게 잠근다.
   규칙 예외(.claude/rules/css.md 는 상한을 넘어 여기에 적는다):
   · 움직임 — 대표 「고급스러운 애니메이션, 부드럽게」: 들어올 때 · 고른 뒤 한 번씩만 돈다(되풀이 없음 · 움직임 줄이기면 바로 — 이 절 끝).
   · 끌어다 놓는 칸의 마우스 올림 = 테두리 + 옅은 그림자(고른 시안의 모습 그대로 — 평소엔 테두리만). */
body.erbs { --erbst-out: cubic-bezier(.2, .8, .2, 1); --erbst-pop: cubic-bezier(.34, 1.56, .64, 1); }
body.erbst-on .canvas-area { position: relative; } /* 처음 화면이 놓여 있는 동안만(평소 짜임은 건드리지 않는다) */
.erbst { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px 24px 9vh; background: var(--gray-50); font-family: var(--erbs-font); color: var(--gray-900); overflow: auto; }
.erbst-col { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); }
.erbst button { font-family: inherit; cursor: pointer; }
.erbst button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.erbst-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 248px; padding: 0 20px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--surface-white); color: var(--gray-900); text-align: center;
	transition: border-color .2s ease, background-color .2s ease, box-shadow .3s var(--erbst-out), transform .3s var(--erbst-out); }
.erbst-dic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 8px; background: var(--gray-100); color: var(--gray-700); transition: transform .4s var(--erbst-pop), background-color .2s ease, color .2s ease; }
.erbst-dic svg { width: 26px; height: 26px; stroke-width: 1.75; }
.erbst-t { font-size: 16px; font-weight: 600; line-height: 1.4; }
.erbst-s { font-size: 13px; line-height: 1.5; color: var(--gray-500); }
.erbst-new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 0; border-radius: 6px; background: var(--brand-action); color: var(--surface-white); font-size: 15px; font-weight: 600; transition: background-color .15s ease, transform .12s ease, opacity .2s ease; }
.erbst-new svg { width: 18px; height: 18px; transition: transform .4s var(--erbst-out); }
@media (hover: hover) {
	.erbst-drop:hover { border-color: var(--gray-400); box-shadow: 0 12px 28px -18px color-mix(in srgb, var(--gray-900) 40%, transparent); }
	.erbst-drop:hover .erbst-dic { transform: translateY(-4px); background: var(--primary-50); color: var(--primary-700); }
	.erbst-new:hover { background: var(--brand-hover); }
	.erbst-new:hover svg { transform: rotate(90deg); }
}
.erbst-new:active { transform: scale(.985); }
/* 파일을 화면 위로 끌어왔다 */
.erbst-drop.is-drop { border-color: var(--brand-action); background: var(--primary-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-action) 18%, transparent); transform: scale(1.012); }
.erbst-drop.is-drop .erbst-dic { transform: translateY(-6px) scale(1.1); background: var(--surface-white); color: var(--primary-700); }
/* 고른 파일을 읽는 동안(0.3초 넘게 걸릴 때만 보인다) — 두 칸은 눌리지 않는다(js startRead) */
.erbst.is-reading .erbst-drop,
.erbst.is-reading .erbst-new { cursor: progress; }
.erbst.is-reading .erbst-new { opacity: .5; }
/* 처음 화면 동안 — 감추는 것 · 흐리게 잠그는 것 */
body.erbst-on .canvas .ribbon-preview,
body.erbst-on .file-info-bar .fi-section:first-child,
body.erbst-on .file-info-bar .fi-vba,
body.erbst-on #fileActionBtn { visibility: hidden; }
body.erbst-on .palette,
body.erbst-on .erbs-codebar > * { pointer-events: none; }
body.erbst-on .palette .palette-item,
body.erbst-on .erbs-codebar > * { opacity: .32; }
/* 들어올 때 — 칸 · 단추가 아래에서 차례로 */
@keyframes erbst-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes erbst-fade { from { opacity: 0; } }
@keyframes erbst-left { from { opacity: 0; transform: translateX(-18px); } }
@keyframes erbst-wake { from { opacity: .32; transform: translateX(-6px); } }
body.erbst-on .erbst-drop { animation: erbst-up .6s var(--erbst-out) backwards .05s; }
body.erbst-on .erbst-new { animation: erbst-up .6s var(--erbst-out) backwards .14s; }
/* 고르면 — 그 자리에서 리본이 차오른다: 판 → 탭이 왼쪽부터 → 그룹이 왼쪽부터 · 흐리던 왼쪽 요소가 위에서부터 또렷해진다 · 파일 이름이 위 줄에 들어온다.
   --erbst-i = 줄 차례(아래 nth-child) · --erbst-t = 걷은 뒤 지난 시간(다시 그려진 탭 · 그룹이 움직임을 처음부터 되풀이하지 않고 그 자리에서 잇게 — js startTick 이 #canvas 에 적는다) */
body.erbst-in .canvas .ribbon-preview { animation: erbst-up .55s var(--erbst-out) backwards; animation-delay: calc(0s - var(--erbst-t, 0s)); }
body.erbst-in .ribbon-tab,
body.erbst-in .add-tab-btn { animation: erbst-up .45s var(--erbst-out) backwards; animation-delay: calc(.14s + var(--erbst-i, 9) * 32ms - var(--erbst-t, 0s)); }
body.erbst-in .ribbon-groups > * { animation: erbst-up .5s var(--erbst-out) backwards; animation-delay: calc(.3s + var(--erbst-i, 9) * 42ms - var(--erbst-t, 0s)); }
body.erbst-in .palette .palette-item { animation: erbst-wake .5s var(--erbst-out) backwards; animation-delay: calc(.1s + var(--erbst-i, 9) * 34ms); }
body.erbst-in .file-info-bar .fi-section:first-child { animation: erbst-left .5s var(--erbst-out) backwards .12s; }
body.erbst-in #fileActionBtn { animation: erbst-fade .5s ease backwards .2s; }
body.erbst-in .erbs-codebar > * { animation: erbst-fade .5s ease backwards .3s; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(1) { --erbst-i: 0; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(2) { --erbst-i: 1; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(3) { --erbst-i: 2; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(4) { --erbst-i: 3; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(5) { --erbst-i: 4; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(6) { --erbst-i: 5; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(7) { --erbst-i: 6; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(8) { --erbst-i: 7; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(9) { --erbst-i: 8; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(10) { --erbst-i: 9; }
body.erbst-in :is(.ribbon-tab, .ribbon-groups > *, .palette-item):nth-child(n + 11) { --erbst-i: 10; }
/* 움직임 줄이기 — 모두 바로(js 도 걷을 때 움직임 없이 바꾼다) */
@media (prefers-reduced-motion: reduce) {
	.erbst-drop, .erbst-dic, .erbst-new, .erbst-new svg { transition: none; }
	body.erbst-on .erbst-drop, body.erbst-on .erbst-new,
	body.erbst-in .canvas .ribbon-preview, body.erbst-in .ribbon-tab, body.erbst-in .add-tab-btn, body.erbst-in .ribbon-groups > *, body.erbst-in .palette .palette-item,
	body.erbst-in .file-info-bar .fi-section:first-child, body.erbst-in #fileActionBtn, body.erbst-in .erbs-codebar > * { animation: none; }
}

/* 그림이 없는 레이블 · 콤보 · 드롭다운 — 원본이 그리는 「?」 칸을 걷는다(js noIcon · 11/17) */
body.erbs #canvas .ribbon-ctrl > .ctrl-icon.erbs-noic { display: none; }
