/* css/editor-side-drawers.css — 슬라이드 편집기 좁은 화면(600~1279) «양옆 서랍» (2026-10-14 · §0-B R191)
   ① 벽 가운데 손잡이 — 칸과 칸 사이에 폭 0 짜리 «벽»(.qm-edge)을 끼우고 손잡이를 그 위에 얹는다.
      손잡이는 칸을 따로 먹지 않는다(종전 「도구 / 도구 접기」 단추는 52px 칸을 따로 먹었다).
      화살표 = 서랍이 움직일 쪽. 열고 닫아도 손잡이 «높이»는 그대로다(벽을 따라 옆으로만 간다).
   ② 0.2초 열고 닫기 — 목록은 폭 전환, 도구 칸은 열기·닫기 애니메이션(js/editor-list-rail.js 가 class 를 건다).
      «움직임 줄이기»면 바로 바뀐다.
   ③ 접힌 도구 = 아이콘 띠(.qm-tool-strip · js/editor-tool-strip.js) — 기본 / 미디어 / 유형(문항 / 수업 도구)을
      구분선으로 나누고 아이콘만 세운다. 맨 위 「도구」 단추는 없다(손잡이가 그 일을 한다).
   ★폭 구간은 js/editor-list-rail.js · js/editor-tool-strip.js 의 DRAWER_MQ 와 같아야 한다(바꾸면 셋을 함께)★
   넓은 화면(≥1280)·폰(≤599)에서는 벽·띠가 그려지지 않는다 — 종전 그대로다. */
.qm-edge, .qm-tool-strip { display: none; }

@media (min-width: 600px) and (width < 1280px) {
  html.v2.quizn-editor .qm-layout { --qm-drawer-dur: 220ms; }

  /* ── ① 벽과 손잡이 ── */
  html.v2.quizn-editor .qm-edge { display: block; position: relative; flex: 0 0 0px; width: 0; z-index: 5; }
  /* 자기 칸 쪽으로는 6px 만 들어간다 — 접힌 목록의 번호 원·띠의 아이콘을 가리지 않는다. 나머지는 가운데 쪽으로 튀어나온다 */
  html.v2.quizn-editor .qm-drawer-handle {
    position: absolute; top: 50%; left: -6px; width: 20px; height: 56px; margin-top: -28px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
    color: var(--text-body); box-shadow: var(--shadow-sm); cursor: pointer;
  }
  html.v2.quizn-editor .qm-drawer-handle[data-side="tools"] { left: -14px; }
  /* 누르는 자리 — 마우스 24px(WCAG 2.5.8) · 손가락 44px. 넓히는 쪽은 언제나 가운데(칸 안의 단추를 덮지 않는다) */
  html.v2.quizn-editor .qm-drawer-handle::before { content: ''; position: absolute; top: -6px; bottom: -6px; left: -1px; right: -5px; }
  html.v2.quizn-editor .qm-drawer-handle[data-side="tools"]::before { left: -5px; right: -1px; }
  html.v2.quizn-editor .qm-drawer-handle:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
  html.v2.quizn-editor .qm-drawer-handle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  /* 아이콘은 #i-chevron-down 하나를 돌려 쓴다 — 왼쪽 서랍: 닫힘 › · 열림 ‹ / 오른쪽 서랍: 닫힘 ‹ · 열림 › */
  html.v2.quizn-editor .qm-drawer-handle .ui-ico { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform var(--qm-drawer-dur) var(--easing); }
  html.v2.quizn-editor .qm-drawer-handle[data-side="rail"][aria-expanded="true"] .ui-ico,
  html.v2.quizn-editor .qm-drawer-handle[data-side="tools"][aria-expanded="false"] .ui-ico { transform: rotate(90deg); }

  /* 종전 「도구 / 도구 접기」 단추는 이 폭에서 걷는다 — 손잡이가 그 일을 한다(폰은 그대로 쓴다) */
  html.v2.quizn-editor .qm-tools-toggle { display: none; }

  /* ── ③ 아이콘 띠 ── */
  html.v2.quizn-editor .qm-tool-strip { display: block; position: relative; flex: 0 0 56px; width: 56px; background: var(--surface); }
  html.v2.quizn-editor .qm-editor-panel.qm-tools-open ~ .qm-tool-strip { display: none; }
  /* [F-20261029-003 · 2026-10-30] 띠가 화면 오른쪽 끝에 서 있는 동안 ALC 도우미(.sup-launcher · 오른쪽 아래 고정)는 띠 왼쪽으로 비킨다 —
     낮은 창(1024×700)에서 도우미가 띠 아래 「더 보기」 화살표(.qm-ts-more)를 덮어 누를 수 없었다. 76 = 띠 56 + 숨통 20(평소 여백과 같다) */
  html.v2.quizn-editor:not(:has(.qm-editor-panel.qm-tools-open)):has(#tab-questions.active .qm-tool-strip) .sup-launcher { --sup-edge: 76px; }   /* 띠는 «편집» 탭에만 보인다(.tab-panel.active · 리뷰) */
  html.v2.quizn-editor .qm-ts-list {
    position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
    display: flex; flex-direction: column; align-items: center; padding: 6px 0;
  }
  html.v2.quizn-editor .qm-ts-list::-webkit-scrollbar { display: none; }
  html.v2.quizn-editor .qm-ts-grp { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  /* 구분선 — 실선 = 기본 · 미디어 사이 */
  html.v2.quizn-editor .qm-ts-dv { flex: 0 0 11px; width: 100%; display: flex; align-items: center; justify-content: center; }
  html.v2.quizn-editor .qm-ts-dv::before { content: ''; width: 34px; height: 1px; background: var(--border-strong); }
  html.v2.quizn-editor .qm-ts-btn {
    flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  }
  /* 아이콘 글자 = 펼친 칸 .nq-el-ico 와 같은 꼴(「T」 굵기까지) */
  html.v2.quizn-editor .qm-ts-ico { display: block; font-size: var(--text-lg); line-height: 1; font-weight: 800; pointer-events: none; }
  html.v2.quizn-editor .qm-ts-btn:hover { background: var(--primary-light); }
  html.v2.quizn-editor .qm-ts-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
  /* 지금 슬라이드에 못 넣는 도구 — 펼친 칸(.nq-el.is-off)과 같은 흐림 */
  html.v2.quizn-editor .qm-ts-btn.is-off { opacity: .4; cursor: not-allowed; }
  html.v2.quizn-editor .qm-ts-btn.is-off:hover { background: transparent; }
  /* 높이가 모자라면 띠 안에서 굴린다 — 아래가 흐려지고 아래 화살표가 «더 있음»을 알린다(§0-B R060) */
  html.v2.quizn-editor .qm-ts-more {
    position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 4px; color: var(--primary); cursor: pointer; opacity: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface) 70%);
    transition: opacity var(--dur-fast) var(--easing);
  }
  html.v2.quizn-editor .qm-ts-more .ui-ico { width: 16px; height: 16px; }
  html.v2.quizn-editor .qm-tool-strip.has-more .qm-ts-more { opacity: 1; pointer-events: auto; }
  /* 잠긴 회차 — 펼친 칸의 「구성」이 숨으므로(css/detail.css .qm-layout.locked) 띠의 아이콘도 숨긴다 */
  html.v2.quizn-editor .qm-layout.locked :is(.qm-ts-list, .qm-ts-more) { display: none; }

  /* ── ② 서랍 움직임 ── */
  /* 폭 전환은 손잡이·☰ 로 여닫는 0.2초에만 건다(창 크기를 바꿀 때는 움직이지 않는다 · js 가 qm-drawer-anim 을 붙였다 뗀다).
     여는 동안 목록 내용은 «펼친 폭»으로 미리 서고 서랍이 그것을 드러낸다(좁은 폭에 눌린 글이 스치지 않게) */
  html.v2.quizn-editor .qm-list-panel.qm-drawer-anim { overflow: hidden; transition: width var(--qm-drawer-dur) var(--easing); }
  html.v2.quizn-editor .qm-list-panel.qm-rail-open.qm-drawer-anim > * { min-width: 279px; }
  html.v2.quizn-editor .qm-editor-panel.qm-tools-open.qm-drawer-anim { animation: qmToolsIn var(--qm-drawer-dur) var(--easing-out) both; }
  html.v2.quizn-editor .qm-editor-panel.qm-tools-open.qm-drawer-closing { animation: qmToolsOut var(--qm-drawer-dur) var(--easing) both; }
  html.v2.quizn-editor .qm-editor-panel:is(.qm-drawer-anim, .qm-drawer-closing) > * { min-width: 300px; }
  html.v2.quizn-editor .qm-editor-panel.qm-drawer-anim > * { animation: qmDrawerFade var(--qm-drawer-dur) var(--easing-out) both; }
  html.v2.quizn-editor .qm-tool-strip { animation: qmDrawerFade var(--dur-fast) var(--easing-out); }
}
/* --qm-drawer-from = 닫히는 도중 다시 열 때 «지금 폭»(js/editor-list-rail.js) — 평소엔 띠 폭 56 에서 */
@keyframes qmToolsIn { from { flex-basis: var(--qm-drawer-from, 56px); max-width: var(--qm-drawer-from, 56px); } to { flex-basis: 300px; max-width: 300px; } }
@keyframes qmToolsOut { from { flex-basis: 300px; max-width: 300px; } to { flex-basis: 56px; max-width: 56px; } }
@keyframes qmDrawerFade { from { opacity: 0; } to { opacity: 1; } }
/* 움직임 줄이기 — 서랍을 여닫는 class 는 js 가 아예 안 붙인다(js/editor-list-rail.js moving()). 여기서는 늘 붙어 있는 것만 끈다 */
@media (min-width: 600px) and (width < 1280px) and (prefers-reduced-motion: reduce) {
  html.v2.quizn-editor :is(.qm-drawer-handle .ui-ico, .qm-ts-more) { transition: none; }
  html.v2.quizn-editor .qm-tool-strip { animation: none; }
}
/* 문제뱅킹 모드는 슬라이드 목록이 없다(css/bank-editor.css) — 목록 손잡이도 없다 */
html.bank-mode .qm-edge--rail { display: none !important; }

/* 이름 말풍선 — 띠 밖(문서 맨 끝)에 하나만 둔다. 띠는 굴러가는 칸이라 그 안에 두면 잘린다 */
.qm-ts-tip {
  position: fixed; z-index: 1000; max-width: 260px; padding: 4px 9px; border-radius: 4px;
  background: var(--text); color: var(--surface); font-size: var(--text-sm); font-weight: 600; line-height: 1.4;
  word-break: keep-all; pointer-events: none; transform: translate(-100%, -50%);
}
.qm-ts-tip[hidden] { display: none; }
.qm-ts-tip::after {
  content: ''; position: absolute; right: -5px; top: 50%; margin-top: -5px;
  border: 5px solid transparent; border-right: 0; border-left-color: var(--text);
}
/* [2026-10-27 · 10-26 수업 테스트 기능 2] 띠의 「도형」 옆 칸 — 다섯 모양을 이름과 함께 띄운다(js/editor-tool-strip.js openFly).
   띠 단추와 같은 꼴이되 이름이 보이도록 가로로 넓다. 펼친 칸의 「도형 ▾」과 같은 다섯 · 같은 차례. */
.qm-ts-fly {
  position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md);
}
.qm-ts-fly[hidden] { display: none; }
html.v2.quizn-editor .qm-ts-fly .qm-ts-btn { width: auto; flex-basis: auto; justify-content: flex-start; gap: 8px; padding: 0 12px 0 8px; }
.qm-ts-flylb { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; pointer-events: none; }
/* 손가락 기기 — 누르는 칸 44px(교사 화면 손가락 규칙). 칸끼리 붙여 띠 길이를 아낀다 */
@media (min-width: 600px) and (width < 1280px) and (pointer: coarse) {
  html.v2.quizn-editor .qm-ts-grp { gap: 0; }
  html.v2.quizn-editor .qm-ts-btn { flex-basis: 44px; width: 44px; height: 44px; }
  html.v2.quizn-editor .qm-ts-more { height: 44px; }
  html.v2.quizn-editor .qm-drawer-handle::before { left: -1px; right: -23px; }
  html.v2.quizn-editor .qm-drawer-handle[data-side="tools"]::before { left: -23px; right: -1px; }
}
