/* css/behavior-timeline.css — 특수행동 전용 관찰 창
 *
 * ★왜 별도 파일인가★ `css/main.css` 는 이미 10,000줄이 넘는다. 화면 하나가 통째로 새로 생기는
 *   경우는 파일을 나눈다(CLAUDE.md 비대 파일 규칙). 이름공간은 `behtl-` 하나뿐이라
 *   기존 `behx-`(행동분석)와 섞이지 않는다 — 섞이면 한쪽을 고칠 때 다른 쪽이 따라 움직인다.
 *
 * ★색을 직접 쓰지 않는다★ 저장소 토큰(`--*`)을 쓰고, 없는 값만 이 파일에서 만든다.
 *   하드코딩한 색은 다크/고대비에서 반드시 어긋난다(실측: CSS 색의 43%가 하드코딩).
 */

/* ── 덮개 ─────────────────────────────────────────────────────────────── */
.behtl-ov{
  position:fixed; inset:0; z-index:1200;
  background:rgba(15,18,26,.55);
  display:flex; align-items:center; justify-content:center;
  padding:24px 16px;
  overflow-y:auto;
}
@media (max-width:640px){ .behtl-ov{ padding:0; align-items:stretch; } }

/* ★고정 크기 모달★ — 내용에 따라 창이 커졌다 작아지면 시연 중에 화면이 출렁인다
   (docs/UI_GUIDELINES.md §0). 안쪽이 넘치면 안쪽만 스크롤한다. */
/* ★가로·세로를 키운다 — «고정»은 그대로★
   > *"전체적으로 모달의 가로창, 세로창 더 키워서 보여주도록 하고"*
   ★`min()` 을 쓰는 것이 «내용에 따라 변한다»는 뜻이 아니다★ — 화면(뷰포트)에 맞추는 것이지
     안에 든 내용에 맞추는 것이 아니다. 같은 화면에서는 언제나 같은 크기다(고정 크기 모달 규칙).
   ★왜 1320×900 인가★ 이 저장소가 이미 쓰는 큰 모달과 같은 폭이다
     (`.rt-kgteam-overlay .rt-kgteam-modal` = 1320×780) — 새 숫자를 만들지 않는다.
     세로는 왼쪽 학생 목록이 8~9칸 서고 아래 곡선이 온전히 보여야 해서 조금 더 준다. */
.behtl-modal{
  position:relative;              /* 미리보기(.behtl-tip)의 기준 */
  /* ★세로도 «고정»한다★ — 종전엔 `max-height` 뿐이라 내용에 따라 창이
     자랐다 줄었다 했다(저장소 규칙은 가로·세로 «둘 다» 고정이다 ·
     `.claude/skills/fixed-size-modals`). 실측: 학생을 고를 때마다 점 수가 달라져 세로가
     출렁였고, 「세로창 더 키워서」 지시도 그 자리를 가리킨다.
     남는 자리는 아래 곡선 판(`.behtl-chartwrap{flex:1}`)이 가져가 곡선이 더 크게 보인다. */
  width:min(1320px, 100%); height:min(94vh, 900px);
  display:flex; flex-direction:column;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:14px;
  box-shadow:0 24px 60px -24px rgba(15,18,26,.45);
  overflow:hidden;
}
@media (max-width:640px){ .behtl-modal{ height:100vh; border-radius:0; border:0; } }

/* ── 머리 ─────────────────────────────────────────────────────────────── */
.behtl-head{
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; border-bottom:1px solid var(--border);
  background:var(--surface-2, #f4f6f9);
}
.behtl-head__tx{ display:flex; align-items:baseline; gap:10px; min-width:0; flex:1; }
.behtl-head__tx strong{ font-size:16px; font-weight:700; white-space:nowrap; }
.behtl-head__tx span{
  font-size:13px; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.behtl-x{
  flex:none; width:30px; height:30px; border-radius:8px;
  border:1px solid var(--border); background:transparent;
  color:var(--text-muted); font-size:14px; cursor:pointer;
}
.behtl-x:hover{ background:var(--surface); color:var(--text); }
.behtl-x:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }

/* ── 요약줄 ───────────────────────────────────────────────────────────── */
.behtl-sum{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:10px 16px 0;
}
.behtl-sum__n{ font-size:13px; color:var(--text-muted); }
.behtl-sum__n b{ font-size:17px; color:var(--text); font-variant-numeric:tabular-nums; }
.behtl-sum__lg{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  font-size:12px; color:var(--text-muted);
}
.behtl-lg{ display:inline-block; margin-right:5px; vertical-align:middle; }
/* ★두 곡선을 «색»만이 아니라 «모양»으로도 가른다★ (두 줄 유지 + 범례 구분)
   화면에서 소리는 **연한 면**(soundfill)이고 움직임은 **진한 실선**이다. 스와치가 그 둘을
   실제로 흉내 내야 범례가 «읽는 법»이 된다 — 같은 굵기 막대 두 개는 색만 다른 이름표였다. */
.behtl-lg--s{                       /* 소리 = 면 */
  width:16px; height:10px; border-radius:2px;
  background:var(--behtl-sound, #3d6ea8); opacity:.28;
  border-top:2px solid var(--behtl-sound, #3d6ea8);
}
.behtl-lg--m{                       /* 움직임 = 실선 */
  width:16px; height:0; border-top:3px solid var(--behtl-motion, #8a5aa8);
  border-radius:0; background:none;
}
.behtl-lg--e{ width:9px; height:9px; border-radius:50%; background:var(--danger); }
/* ⛔ `--g`(솟았는데 잡힌 행동 없음)·`--clip`(영상 있는 기록)·`--tie`(위로 민 점)
   세 스와치는 결정으로 화면에서 빠졌다 — 규칙도 함께 지운다(안 그리는 것의 규칙을
   남겨 두면 다음 사람이 「왜 안 보이지」를 여기서 찾는다). 되살리려면 이 커밋을 볼 것. */
.behtl-sum__lg em{ font-style:normal; }

/* ── 상단 무대 — 고른 순간을 크게 ─────────────────────────────────────── */
/* ★배치는 참고 화면 그대로★ 위가 «지금 보는 순간», 아래가 «수업 전체».
   시간표에서 고른 것이 위에서 커지는 흐름이라, 위아래가 바뀌면 눈이 거꾸로 움직인다. */
/* 좌: 지금 보는 순간 · 우: 그 순간의 앞뒤 사정. 참고 화면의 «큰 화면 + 옆 카드» 배치다. */
.behtl-top{
  display:grid; grid-template-columns:1.35fr 1fr; gap:14px;
  padding:12px 16px 6px; align-items:stretch;   /* 두 칸이 같은 높이 — 무대가 자리를 다 쓴다 */
  min-height:0; overflow:auto;      /* 넘치면 «이 칸 안에서»만 스크롤한다(창은 안 자란다) */
}
@media (max-width:840px){ .behtl-top{ grid-template-columns:1fr; } }
/* 아직 아무것도 안 골랐으면 왼쪽 안내 하나만 둔다(두 칸이 같은 말을 하면 잉크 낭비다). */
.behtl-top:not(.is-picked){ grid-template-columns:1fr; }
.behtl-top:not(.is-picked) .behtl-detailwrap{ display:none; }
/* 무대가 위 칸의 높이를 다 쓰게 — 사슬로 이어 내려간다(칸 → 무대 → 그림 자리). */
.behtl-stagewrap{ min-width:0; display:flex; min-height:0; }
.behtl-stage{ flex:1; display:flex; flex-direction:column; min-height:0; }

/* ★고르기 전/후의 «세로 높이»가 같아야 한다★
     *"사진 누르면 모달창 크기가 달라지는거 불편해. 누르기 전과 누르기 후의 세로 높이
       모달창 똑같이 해주고"*
   종전엔 빈 상태가 `min-height:96px` 짜리 «다른 상자»였고, 고르면 16:9 무대(200px)+재생바로
   바뀌어 창이 100px 넘게 널뛰었다. 이제 **빈 상태도 같은 무대 틀**을 쓰고(.behtl-stage__view),
   재생바도 잠긴 채로 늘 자리에 있다. 그래서 바뀌는 것은 «안의 그림»뿐이다.
   ⛔`aspect-ratio` 로만 두면 폭에 따라 높이가 달라져 또 널뛴다 — 높이를 값으로 못박는다.
   ★창 높이를 고정한 뒤, 200px 무대는 «남는 자리»를 못 채워 아래가 크게 비었다★
     (그 흰 공백은 이 저장소가 이미 겪은 「고장으로 읽힌다」와 같은 상태다). 무대가 남는 높이를
     가져가게 한다 — 사진이 커지는 것은 이 화면이 하려는 일 그 자체다.
     ★그래도 «고르기 전/후»가 같다★ 높이를 정하는 것은 창(고정)이지 내용이 아니다.
     ★바닥은 남긴다★ `min-height:200px` — 좁은 화면에서 무대가 찌부러지지 않게. */
.behtl-stage__view{
  position:relative; border-radius:10px; overflow:hidden;
  border:1px solid var(--border);
  background:#12151c;                 /* 사진 뒤 바탕 — 영상 무대의 관례 */
  flex:1; min-height:200px;
  display:flex; align-items:center; justify-content:center;
}
/* 빈 상태 — 무대 «안»에 안내문을 둔다(상자를 따로 만들지 않는다). */
.behtl-stage--empty .behtl-stage__view{
  background:var(--surface-2, #f4f6f9);
  border-style:dashed; border-color:var(--border-strong);
}
.behtl-stage__guide{
  margin:0; padding:0 18px; max-width:36em;
  font-size:14px; line-height:1.7; text-align:center;
  color:var(--text-muted); word-break:keep-all;
}
.behtl-stage__guide b{ color:var(--text); }
.behtl-stage__img{ width:100%; height:100%; object-fit:contain; display:block; }

/* ═══ [사진이 없으면 «동의를 안 한 학생»] ══════════════════════
   > *"그 사진이 없는 애들은 개인정보동의를 안한거입니다. 라는 데모로 그냥 회색 음영 처리"*
   ★비어 있는 칸은 «고장»으로 읽힌다★ 회색 면 + 한 줄로 «왜 없는지»를 말하면 그 자체가
     시연할 내용이 된다(실제 학교에서 늘 있는 일이다).
   ★사진 자리를 그대로 차지한다★ 크기가 다르면 카드 격자가 들쭉날쭉해진다. */
.behtl-noconsent{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  width:100%; height:100%; box-sizing:border-box; padding:8px;
  background:repeating-linear-gradient(45deg, #3a4152 0 6px, #333a49 6px 12px);
  color:#c8cfdd; text-align:center; word-break:keep-all;
}
.behtl-noconsent b{ font-size:12px; font-weight:700; color:#e7ecf6; line-height:1.4; }
.behtl-noconsent i{ font-style:normal; font-size:11px; opacity:.8; }
/* 무대(큰 칸)에서는 글자를 키운다 — 카드 크기 기준으로 맞추면 큰 화면에서 티끌처럼 보인다. */
.behtl-stage__img.behtl-noconsent b{ font-size:15px; }
.behtl-stage__img.behtl-noconsent i{ font-size:12px; }

/* ═══ [묶인 점 → 무대가 «그 순간의 목록»] ══════════════════════
   > *"클릭하면 그 시간대에 관련된 상호작용 리스트와 예시 이미지를 쭉 보여주고"*
   ★무대 틀을 그대로 쓴다★ 높이를 정하는 것은 창이지 내용이 아니다(규칙) —
     별도 상자를 만들면 「누르기 전과 후의 세로 높이가 같아야 한다」가 깨진다. */
.behtl-stage--pick .behtl-stage__view{
  background:var(--surface); align-items:stretch; justify-content:flex-start;
  flex-direction:column; padding:10px 12px; gap:8px; overflow-y:auto;
}
.behtl-pk__h{ font-size:13px; color:var(--text); display:flex;
  align-items:baseline; gap:8px; flex-wrap:wrap; }
.behtl-pk__h b{ font-size:15px; }
.behtl-pk__h em{ font-style:normal; font-size:12px; color:var(--text-muted);
  word-break:keep-all; }
/* ★칸 수를 못박지 않는다★ 한 점에 묶이는 건수는 회차마다 다르다(실측 개발환경: 2~6건).
   ★`auto-fit` 이지 `auto-fill` 이 아니다★ — `auto-fill` 은 «빈 칸»까지 만들어, 3건일 때
     카드가 132px 로 쪼그라든 채 오른쪽이 텅 빈다(실화면에서 그랬다). `auto-fit` 은 빈 칸을
     접어 남는 폭을 실제 카드가 나눠 갖는다 — 요청이 *"예시 이미지를 쭉 보여주고"* 라
     사진이 커지는 쪽이 맞다.
   ★그래도 상한을 둔다★ 1~2건일 때 카드가 화면 절반만큼 커지면 «사진 한 장»과 구분이 안 된다. */
.behtl-pk__g{ display:grid; gap:10px; align-content:start; justify-content:start;
  grid-template-columns:repeat(auto-fit, minmax(150px, 260px)); }
.behtl-pk__c{
  display:grid; grid-template-rows:auto auto auto; gap:2px; padding:0 0 7px;
  border:1px solid var(--border); border-radius:10px;
  background:var(--surface); color:var(--text);
  font:inherit; text-align:left; cursor:pointer; overflow:hidden;
}
.behtl-pk__c:hover{ border-color:var(--primary); }
.behtl-pk__c:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
/* 사진 칸 — 비율을 못박아 사진이 있든 없든 카드 높이가 같다. */
.behtl-pk__im{ display:block; aspect-ratio:4/3; background:#12151c; overflow:hidden; }
.behtl-pk__img{ width:100%; height:100%; object-fit:cover; display:block; }
.behtl-pk__nm{ font-size:13px; font-weight:700; padding:6px 8px 0; }
.behtl-pk__b{ font-size:12px; color:var(--text-muted); padding:0 8px;
  word-break:keep-all; }
.behtl-pk__t{ font-size:11px; color:var(--text-muted); padding:0 8px;
  font-variant-numeric:tabular-nums; }

/* ═══ [범례 줄 = 무대와 곡선 «사이»] ═══════════════════════════
   > *"영상과 그래프 사이에 줄 하나 만들어서 거기에 넣던가 해야할 것 같아."*
   ★왼쪽 정렬★ 곡선의 왼쪽 끝(축)과 눈이 같은 자리에서 출발한다. */
.behtl-lgrow{
  display:flex; align-items:center; padding:8px 16px 0;
  border-top:1px solid var(--border); margin-top:8px;
}
/* 곡선 판은 이제 범례 줄 바로 아래라 «또 하나의» 선을 긋지 않는다(줄이 두 번 그어진다). */
.behtl-lgrow + .behtl-chartwrap{ border-top:0; margin-top:0; padding-top:4px; }

/* 무대 위 글자는 «사진 위»라 토큰이 아니라 고정색이다(어느 테마에서도 사진은 어둡다). */
.behtl-stage__who, .behtl-stage__at, .behtl-stage__tmp, .behtl-stage__off{
  position:absolute; font-size:12px; color:#eef1f7;
  background:rgba(12,15,22,.62); border-radius:6px; padding:3px 9px;
  pointer-events:none; max-width:calc(100% - 20px);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.behtl-stage__who{ left:10px; top:10px; font-weight:600; }
.behtl-stage__at{ right:10px; top:10px; font-variant-numeric:tabular-nums; }
/* ★「아님」은 무대에서도 알 수 있어야 한다★ [실화면 발견]
   상세의 `.behtl-badge.is-off`(취소선)·`.behtl-offmark`(확인 문구)와 «같은 사실»을 말한다 —
   자리는 사진 위(어두운 배경)라 그 배경에 맞춰 색만 바꾼다. 모양(취소선 + 별도 확인 뱃지)은
   그대로다. */
.behtl-stage__who.is-off{ text-decoration:line-through; opacity:.8; }
.behtl-stage__off{ left:10px; bottom:10px; font-size:11px; font-weight:700;
  background:rgba(12,15,22,.72); }

/* 재생바 — 그림은 사진이지만 시간은 진짜로 흐른다. */
.behtl-play{ display:flex; align-items:center; gap:10px; margin-top:9px; flex-wrap:wrap; }
/* 아직 아무것도 안 골랐을 때 — 자리는 그대로 두고 «쓸 수 없음»만 보인다(높이 불변). */
.behtl-play.is-off .behtl-play__t{ color:var(--text-muted); }   /* 흐림 .45 는 걷었다(R222 · 글자 1.90) — 꺼진 단추 · 고르개는 꺼진 모양이 말한다 */
.behtl-play__lb{ font-size:11.5px; color:var(--text-muted); }
.behtl-play__rate, .behtl-play__vol{
  display:flex; align-items:center; gap:5px; flex:none;
}
.behtl-play__rate select{
  border:1px solid var(--border-input); border-radius:7px;   /* R223 ① */
  background:var(--surface); color:var(--text-2, #454c5c);
  font-size:12px; padding:3px 6px; cursor:pointer;
}
.behtl-play__rate select:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.behtl-play__rate select:disabled{ cursor:default; opacity:.6; }
/* ★음량은 «자리만» 잡고 잠근다★ — 이 데모 무대는 사진이라 조절할 소리가 없다.
   움직이는 손잡이를 달면 «조절되는 척»이 되어 사용자를 속인다. 실제 영상이 붙는 날
   `disabled` 만 떼면 된다(자리·크기는 그대로라 배치가 흔들리지 않는다). */
.behtl-play__vol input[type="range"]{ width:74px; cursor:default; }
.behtl-play__vol input[type="range"]:disabled{ opacity:.45; }
.behtl-play__btn{
  flex:none; width:32px; height:32px; border-radius:50%;
  border:1px solid var(--border-strong); background:var(--surface);
  color:var(--text); font-size:12px; cursor:pointer; line-height:1;
}
.behtl-play__btn:hover{ background:var(--surface-2, #f4f6f9); }
.behtl-play__btn:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.behtl-play__bar{
  position:relative; flex:1; height:8px; border-radius:999px;
  background:var(--surface-2, #f4f6f9); border:1px solid var(--border);
  cursor:pointer;
}
.behtl-play__bar:focus-visible{ outline:2px solid var(--primary); outline-offset:3px; }
.behtl-play__fill{
  position:absolute; left:0; top:0; bottom:0; border-radius:999px;
  background:var(--danger);
}
/* 사건이 시작하는 자리 — 앞 20초와 뒤 20초를 가르는 눈금. */
.behtl-play__mark{
  position:absolute; top:-4px; bottom:-4px; width:2px;
  background:var(--text); opacity:.45; border-radius:1px;
}
.behtl-play__t{
  flex:none; font-size:12px; color:var(--text-muted);
  font-variant-numeric:tabular-nums;
}

/* ── 마우스를 올렸을 때 나오는 미리보기 ───────────────────────────────── */
.behtl-tip{
  position:absolute; z-index:5; width:168px;
  border:1px solid var(--border-strong); border-radius:9px;
  background:var(--surface); box-shadow:0 10px 24px -12px rgba(15,18,26,.5);
  overflow:hidden; pointer-events:none;   /* ★가리키는 표시를 가로채지 않는다★ */
}
.behtl-tip[hidden]{ display:none; }
/* ★목록일 때만 «누를 수 있게»★ — 미리보기(사진)는 그대로 pointer-events:none.
   폭도 내용에 맞춘다(고정 168px 이라 「상동행동」 같은 이름이 잘렸다 · 개발환경 실측). */
.behtl-tip.is-pick{
  pointer-events:auto; width:auto; min-width:230px; max-width:320px; padding:4px;
}
.behtl-tip__h{
  font-size:11.5px; font-weight:600; padding:6px 9px;
  border-bottom:1px solid var(--border); background:var(--surface-2, #f4f6f9);
  font-variant-numeric:tabular-nums;
}
.behtl-tip__img{ width:100%; height:94px; object-fit:cover; display:block; }
.behtl-tip__none{
  height:94px; display:flex; align-items:center; justify-content:center;
  font-size:12px; color:var(--text-muted); background:var(--surface-2, #f4f6f9);
}
.behtl-tip__b{ font-size:12px; padding:6px 9px; }
.behtl-tip__b i{
  display:block; font-style:normal; font-size:11px;
  color:var(--text-muted); margin-top:2px;
}

/* ── 곡선 ─────────────────────────────────────────────────────────────── */
.behtl-chartwrap{
  padding:6px 16px 14px;
  border-top:1px solid var(--border);
  margin-top:8px;
  /* ★자기 높이대로★ — 종전 `flex:1` 은 남는 높이를 이 판이 다 먹었다는 뜻인데,
     그러면 SVG(`height:auto` · viewBox 비율)가 그 높이를 안 채워 아래가 휑하게 남는다.
     남는 높이는 이제 위쪽 `.behtl-main`(무대·기록)이 가져간다. */
  flex:0 0 auto; overflow-y:auto;
}
.behtl-chart{ width:100%; height:auto; display:block; overflow:visible; }

.behtl-ax{ stroke:var(--border-strong); stroke-width:1; }
.behtl-grid{ stroke:var(--border); stroke-width:1; stroke-dasharray:3 4; }
.behtl-axlab{ font-size:9px; fill:var(--text-muted); }

/* 소리는 «면», 행동은 «선» — 두 줄이 같은 모양이면 눈이 못 가른다.
   면이 아래에 깔려야 행동 선이 그 위에서 읽힌다(그리는 순서는 JS 가 지킨다). */
.behtl-soundfill{ fill:var(--behtl-sound, #3d6ea8); fill-opacity:.16; stroke:none; }
.behtl-sound{
  fill:none; stroke:var(--behtl-sound, #3d6ea8);
  stroke-width:1.8; stroke-linejoin:round; stroke-linecap:round;
}
/* ★점선을 «실선»으로★
   > *"지금 너무 점선그래프, 실선 그래프 지저분해."*
   두 곡선을 남기되 가르는 것은 **모양**이다 — 소리는 연한 «면», 움직임은
   진한 «실선». 점선은 굴곡이 잦은 구간에서 선이 끊겨 보여 «지저분함»의 주된 원인이었다.
   ★범례 스와치와 반드시 같아야 한다★(`.behtl-lg--m` 도 실선) — 다르면 범례가 거짓이 된다. */
.behtl-motion{
  fill:none; stroke:var(--behtl-motion, #8a5aa8);
  stroke-width:2; stroke-linejoin:round; stroke-linecap:round;
}

/* 이벤트 — 누를 수 있게 보인다(누를 수 있는 것은 누를 수 있게 보여야 한다). */
.behtl-ev{ cursor:pointer; }
.behtl-evdot{ fill:var(--danger); }
/* ⛔ `.behtl-evmk`(영상 있는 기록의 ▶)는 화면에서 빠졌다 — 지금은
   `.behtl-evn`(그 순간 몇 건인지 숫자)이 그 자리를 쓴다. */
.behtl-ev:hover .behtl-evdot{ r:11; }
.behtl-ev.is-sel .behtl-evdot{ r:12; stroke:var(--surface); stroke-width:2.5; }
.behtl-ev:focus-visible{ outline:none; }
.behtl-ev:focus-visible .behtl-evdot{ stroke:var(--primary); stroke-width:2.5; }

/* ⛔ 「놓쳤을 수 있는 순간」(.behtl-gap*) 규칙 묶음은 결정으로 화면에서
   빠졌다 — 규칙도 함께 지웠다(안 그리는 것의 규칙을 남기면 다음 사람이 여기서 찾는다). */

.behtl-ticks{
  display:flex; justify-content:space-between;
  font-size:10.5px; color:var(--text-muted);
  font-variant-numeric:tabular-nums; margin-top:2px;
  padding:0 14px 0 40px;   /* 곡선의 좌우 여백과 맞춘다 */
}

/* 재료가 없을 때 — 안내는 «곡선 자리»에 둔다(밑에 두면 안 읽는다). */
.behtl-nomat{
  margin:10px 0 0; padding:10px 12px;
  background:var(--surface-2, #f4f6f9); border:1px solid var(--border);
  border-radius:9px; font-size:13px; color:var(--text-muted);
  line-height:1.6; word-break:keep-all;
}
.behtl-nomat b{ color:var(--text); font-weight:600; }
.behtl-nomat span{ display:block; font-size:12px; opacity:.85; }

/* ── 상세 ─────────────────────────────────────────────────────────────── */
.behtl-detailwrap{
  min-width:0; align-self:stretch;
  border:1px solid var(--border); border-radius:10px;
  background:var(--surface-2, #f4f6f9);
  padding:10px 14px;
}
/* ★위쪽 좁은 칸에서는 두 칸을 세로로 쌓는다★ — 옆으로 2등분하면 한 칸이 글을 못 담는다.
   (아래 `max-height` 안에서 구르므로 쌓여도 무대 높이를 밀지 않는다.) */
.behtl-top .behtl-abc{ grid-template-columns:1fr; gap:8px; }
/* ★위 칸이 무한정 자라지 않게 막는다★ [실측] — 맥락이 길어지는 대로 두면 상단이
   449px 까지 자라 아래 시간표가 창 밖으로 156px 밀려났다. 넘치면 이 칸 «안»에서 구른다.
   ★값(221px)을 «없앴다» — 이제 «창»이 높이를 정한다★
     종전 값은 「무대 200px + 재생줄 43px」에서 뺄셈으로 나온 숫자였다. 창 높이를 고정하고
     무대가 남는 자리를 쓰게 되면서 그 뺄셈의 전제가 사라졌다 — 값을 그대로 두면 우측만
     221px 에 갇혀 **무대 378px vs 기록 243px** 로 어긋난다(실측 · 스펙이 잡았다).
     `align-items:stretch` 가 두 칸을 «정확히» 같게 만들고, 넘치는 글은 여기 안에서 구른다.
   ⛔이 자리에 숫자를 다시 못 박지 말 것 — 창 높이가 바뀔 때마다 어긋난다. */
.behtl-top .behtl-detailwrap{ min-height:0; overflow-y:auto; }
.behtl-detail--empty{
  display:flex; align-items:center; justify-content:center;
  min-height:120px; text-align:center;
  font-size:14px; color:var(--text-muted);
}
.behtl-detail__head{
  display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  font-size:14px; margin-bottom:8px;
}
.behtl-badge{
  font-size:12px; font-weight:600; border-radius:999px; padding:2px 10px;
  background:var(--danger-soft, #faebe6); color:var(--danger);
  border:1px solid var(--danger);
}
/* ★「특수행동 아님」 — 남기되 세지 않는다★
   ⛔숨기지 말 것 — 되돌릴 길이 없어지고, 교사가 「내가 지웠나」를 알 수 없다. */
.behtl-badge.is-off{
  background:var(--surface-2, #eef1f5); color:var(--text-muted);
  border-color:var(--border-strong); text-decoration:line-through;
}
.behtl-offmark{
  font-size:11.5px; font-weight:700; border-radius:999px; padding:2px 8px;
  background:var(--surface-2, #eef1f5); color:var(--text-2, #475569);
  border:1px solid var(--border-strong);
}
.behtl-ev.is-off .behtl-evdot{ fill:var(--surface-2, #eef1f5); stroke:var(--text-muted); }
.behtl-side__cut{
  margin:6px 4px 2px; font-size:11.5px; line-height:1.5; color:var(--text-muted);
}
.behtl-when{ font-size:12.5px; color:var(--text-muted); font-variant-numeric:tabular-nums; }

/* 교사가 쓰는 2칸 — 「행동 기록 · 대응」
   ★읽기 칸(앞선 일·행동·뒤에 온 것)은 뺐다★ — 셋 다 화면 다른 곳에 이미 있다
   (앞뒤 정황 = 위 무대의 앞뒤 20초 · 행동 = 상세 머리의 chip). */
.behtl-abc{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
@media (max-width:460px){ .behtl-abc{ grid-template-columns:1fr; } }

.behtl-cell{
  border:1px solid var(--border); border-radius:9px;
  padding:9px 11px; background:var(--surface);
  display:flex; flex-direction:column; min-width:0;
}
.behtl-cell__k{
  font-size:11.5px; font-weight:700; letter-spacing:.04em;
  color:var(--text-muted); margin-bottom:4px;
}
.behtl-cell__v{ font-size:13.5px; line-height:1.55; word-break:keep-all; }
/* ⛔ `.behtl-cell__src`(「선생님이 적음」)는 결정으로 화면에서 빠졌다 —
   대신 「AI생성」 chip 이 «AI 초안일 때만» 뜬다(.behtl-chip-ai). 규칙도 함께 지운다. */
/* ★비어 있음을 «비어 보이게» 둔다★ — 그럴듯한 문장으로 메우면 선생님이 하지 않은 일이
   기록으로 남는다. 빈칸은 빈칸으로 보여야 적을 마음이 든다. */
.behtl-cell.is-empty{ background:var(--surface-2, #f4f6f9); border-style:dashed; }
.behtl-cell__none{ font-size:12.5px; color:var(--text-muted); line-height:1.55; }

/* ── 「행동 기록」·「대응」 — 둘 다 «쓸 수 있는» 칸이다 ───────────────── */
/* ★쓸 수 있음이 «보여야» 한다★ — 버튼이 없으면 「적을 수 있어요」가 거짓말이 된다. */
.behtl-cell--note{ position:relative; }
/* 자동으로 잡은 말은 «힌트»다 — 본문과 눈에 띄게 갈라 둔다(저장된 글이 아니다). */
.behtl-cell__hint{
  display:block; margin-top:6px; padding:5px 8px;
  border-left:2px solid var(--border-strong);
  font-size:11px; line-height:1.5; color:var(--text-muted); word-break:keep-all;
}
/* ★「수정」은 상세 머리줄 오른쪽 하나다★ — 칸마다 있던 버튼을 합쳤다. */
.behtl-detail__edit{
  margin-left:auto;
  border:1px solid var(--border-strong); border-radius:7px;
  background:var(--surface); color:var(--text-2, #454c5c);
  font-size:12px; padding:4px 10px; cursor:pointer;
}
.behtl-detail__edit:hover{ background:var(--surface-2, #f4f6f9); color:var(--text); }
/* ★맥락이 오기 전에는 잠긴다★ — 잠긴 것이 «보여야» 선생님이 고장으로 읽지 않는다.
   (왜 잠그나: 빈 폼으로 저장하면 이미 있던 글이 지워진다 — js 의 `detailHtml` 주석 참조.) */
.behtl-detail__edit:disabled{ opacity:.5; cursor:default; }
.behtl-detail__edit:disabled:hover{ background:var(--surface); color:var(--text-2, #454c5c); }
.behtl-detail__edit:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }

/* ★칸 안 폼(`.behtl-resp__form`·`__btns`·`__save`·`__cancel`)은 지웠다★ —
   Task 8 이 상세 전체 단위 편집 모드로 다시 만들며, 저장·취소 버튼은 머리줄의
   `.behtl-detail__save`·`.behtl-detail__cancel` 하나로 옮겼다(아래 「분류 chip 줄」 참고).
   `.behtl-resp__ta`·`.behtl-resp__err` 는 편집 모드 textarea·에러줄로 그대로 재사용한다. */
.behtl-resp__ta{
  width:100%; box-sizing:border-box; resize:vertical; min-height:64px;
  border:1px solid var(--border-strong); border-radius:8px;
  padding:8px 10px; font:inherit; font-size:13px; line-height:1.55;
  background:var(--surface); color:var(--text);
}
.behtl-resp__ta:focus-visible{ outline:2px solid var(--primary); outline-offset:1px; }
/* 저장 실패는 «말한다» — 조용히 넘어가면 선생님은 적었다고 믿고 창을 닫는다. */
.behtl-resp__err{
  margin:7px 0 0; font-size:12px; line-height:1.5;
  color:var(--danger);
}

/* ── 분류 chip 줄 — 편집 모드에서만 뜬다 ──────────────────────────────── */
/* ★한 줄에 다섯 개★ 넷은 행동, 다섯째는 «취소»라 구분선 뒤에 둔다. */
.behtl-fix{ margin-bottom:8px; }
.behtl-fix__row{ display:flex; gap:5px; align-items:center; flex-wrap:wrap; margin-top:5px; }
.behtl-fix__gap{ display:none; }
.behtl-fix__gap:nth-of-type(4){
  display:block; width:1px; height:16px; background:var(--border-strong); margin:0 2px;
}
.behtl-fix__c{
  font-size:11.5px; font-weight:700; border-radius:999px; padding:4px 10px; cursor:pointer;
  border:1px solid var(--border-strong);
  background:var(--surface); color:var(--text-2, #5b6478);
}
.behtl-fix__c.on{ background:var(--danger); border-color:var(--danger); color:#fff; }
.behtl-fix__c--none{ border-style:dashed; }
.behtl-fix__c--none.on{ background:#475569; border-color:#475569; border-style:solid; }
.behtl-fix__c:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.behtl-detail__save,
.behtl-detail__cancel{
  border:1px solid var(--border-strong); border-radius:7px;
  font-size:12px; padding:4px 10px; cursor:pointer; background:var(--surface);
}
.behtl-detail__cancel{ margin-left:auto; }
.behtl-detail__save{ background:var(--primary); border-color:var(--primary); color:#fff; }

/* ── 다크를 «일부러» 넣지 않는다 ───────────────────────────────────────── */
/* 이 저장소는 라이트 일관이다 — 다크는 별도 프로젝트로 확정됐다(결정.
   제대로 하려면 하드코딩 색 6,157곳을 건드려야 한다).
   ★한 화면만 다크를 넣으면 그 화면이 깨진다★ — 본문 색·바탕은 «토큰»이 정하는데 토큰에는
   다크 재정의가 없다. 그래서 이 파일만 배경을 어둡게 바꾸면 글자는 라이트 색 그대로 남아
   실측 대비가 «1.09:1» 이 된다(#16202e 바탕 vs --text #0f172a — 사실상 같은 색).
   2026-08-26 첫 판이 그 블록을 넣었다가 2026-08-27 걷어냈다. 다시 넣지 말 것 —
   `tests/frontend/behavior_timeline_20260826.spec.js` 가 진입점에서 막는다. */

/* ── 모션 ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce){
  .behtl-ev, .behtl-x{ transition:none !important; }
}


/* ═══ 학생 목록 · 묶인 점 · AI생성 chip ═══════════════════════════════════
   결정으로 이 창의 뼈대가 바뀌었다 — 왼쪽 학생 목록에서 고르고, 겹친 점은 한 점에
   숫자로 묶인다. 관련 판단은 js/behavior-timeline.js 의 같은 날짜 주석에 있다. */

/* 왼쪽 목록 + 오른쪽 무대 */
/* ★높이 되먹임을 만들지 않는다★ [실측 — 화면이 «멎었다»]
   창 높이를 고정한 뒤 `.behtl-side{max-height:100%}` 를 그대로 두었더니 **브라우저가 굳었다.**
   `%` 높이는 부모 높이가 «정해져 있을 때»만 뜻이 있는데, `.behtl-main` 은 flex 배분을 안
   받아 높이가 내용에서 나왔다 — 자식이 부모를, 부모가 자식을 서로 참조하는 되먹임이다.
   → `.behtl-main` 이 **남는 높이를 받고**(flex:1 + min-height:0), 자식은 `%` 대신 `min-height:0`
     으로 «줄어들 수 있음»만 말한다. 곡선 판은 자기 높이대로 둔다(flex:0 0 auto).
   ★단위 시험은 이걸 못 잡는다★ — 레이아웃 계산에서만 일어난다. 개발환경 실화면이 잡았다. */
.behtl-main{
  display:grid; grid-template-columns:184px 1fr; gap:0;
  flex:1; min-height:0;
}
@media (max-width:840px){ .behtl-main{ grid-template-columns:1fr; } }

.behtl-side{
  border-right:1px solid var(--border);
  padding:10px 8px; overflow:auto; min-height:0;
  display:flex; flex-direction:column; gap:2px;
}
@media (max-width:840px){
  /* 좁은 화면에서는 가로 띠로 — 세로로 쌓으면 무대가 화면 밖으로 밀린다. */
  .behtl-side{ flex-direction:row; overflow-x:auto; border-right:0;
    border-bottom:1px solid var(--border); }
  .behtl-side__h{ display:none; }
}
.behtl-side__h{
  font-size:11px; font-weight:700; color:var(--text-muted);
  padding:2px 8px 6px; letter-spacing:.02em;
}
.behtl-side__i{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; padding:7px 9px; border:1px solid transparent; border-radius:8px;
  background:none; color:var(--text); font-size:13px; text-align:left;
  cursor:pointer; white-space:nowrap;
}
.behtl-side__i:hover{ background:var(--surface-2, #f4f6fa); }
.behtl-side__i.on{
  background:var(--surface-2, #f4f6fa); border-color:var(--border); font-weight:700;
}
.behtl-side__i:focus-visible{ outline:2px solid var(--brand, #2563eb); outline-offset:1px; }
.behtl-side__n{ overflow:hidden; text-overflow:ellipsis; }
.behtl-side__i em{
  font-style:normal; font-size:12px; color:var(--text-muted);
  font-variant-numeric:tabular-nums;
}
.behtl-side__i.on em{ color:var(--danger); }
.behtl-side__none{ font-size:12px; color:var(--text-muted); padding:6px 9px; margin:0; }

/* 「곡선은 수업 전체입니다」 — 학생을 고른 동안만 뜬다. */
.behtl-sum__scope{ font-size:12px; color:var(--text-muted); }
.behtl-sum__scope b{ color:var(--text); }

/* 묶인 점 — 한 점 + 숫자. */
.behtl-evn{ font-size:10px; font-weight:700; fill:#fff; pointer-events:none; }
.behtl-ev.is-many .behtl-evdot{ stroke:#fff; stroke-width:1.5; }

/* 「행동 기록」·「대응」 칸의 머리 — 라벨 왼쪽, AI생성 chip·수정 버튼 오른쪽. */
.behtl-cell--note{ position:relative; }
.behtl-cell__tools{
  position:absolute; top:8px; right:8px;
  display:flex; align-items:center; gap:6px;
}
.behtl-chip-ai{
  font-size:11px; font-weight:700; line-height:1; padding:4px 7px; border-radius:999px;
  background:var(--surface-2, #f4f6fa); color:var(--text-muted);
  border:1px solid var(--border); white-space:nowrap;
}

/* ═══ [다크 ④ 수업 리포트 2026-10-24] 다크에서만 — 행동 순간 점(흰 숫자가 얹힌다) ═══ */
@media screen {
  html.theme-dark:not(:has(body[data-contrast="high"])) .behtl-evdot { fill: var(--danger-fill); }
  html.theme-dark:not(:has(body[data-contrast="high"])) .behtl-ev.is-many .behtl-evdot { stroke: var(--surface); }
  html.theme-dark:not(:has(body[data-contrast="high"])) .behtl-ev.is-off .behtl-evdot { fill: var(--surface-2); }
}
