/* 사용자 위젯 (2026-10-20, CTO '사용자 위젯은 전 화면에 같아야') — 지큐(관리·학생·메일·파일)와 포털(설명회·관리)이 이 파일 하나를 쓴다.
   다른 화면 CSS 에 지지 않게 details.uw 로 시작. 포털에는 같은 내용 사본(video-portal/app/static/userwidget.css)이 있고, 포털 테스트가 두 파일이 같은지 본다. 색은 여기 안의 토큰만. */
.uw {
  --uw-ink: #16181d; --uw-sub: #596170; --uw-line: #e5e7eb; --uw-bg: #ffffff; --uw-soft: #f5f5f4; --uw-on: #ffffff;
  --uw-acc: #ff6a00; --uw-acc-soft: #fff1e8; --uw-acc-ink: #a33d00; --uw-focus: #1859b8; --uw-shadow: 0 12px 32px #10182833;
  --uw-r-super: #16181d; --uw-r-admin: #c2410c; --uw-r-counselor: #0369a1; --uw-r-teacher: #15804d; --uw-r-student: #2e6be6;
  position: relative; flex: none; font-family: inherit; font-size: 14px; line-height: 1.4; color: var(--uw-ink); text-align: left;
}
details.uw > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; height: 40px; min-width: 40px;
  padding: 0 12px 0 4px; margin: 0; border-radius: 999px; background: var(--uw-bg); border: 1px solid var(--uw-line); color: var(--uw-ink);
  cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; }
.uw > summary::-webkit-details-marker { display: none; }
.uw > summary:hover, .uw[open] > summary { border-color: var(--uw-acc); }
.uw-av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--uw-r-teacher); color: var(--uw-on); font-weight: 800; font-size: 14px; line-height: 1; }
.uw-av.uw-big { width: 44px; height: 44px; font-size: 19px; }
.uw-r-super { background: var(--uw-r-super); } .uw-r-admin { background: var(--uw-r-admin); } .uw-r-counselor { background: var(--uw-r-counselor); }
.uw-r-teacher { background: var(--uw-r-teacher); } .uw-r-student { background: var(--uw-r-student); }
.uw-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.uw-caret { font-style: normal; font-size: 10px; color: var(--uw-sub); }
.uw-drop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1000; box-sizing: border-box; width: 300px; max-width: calc(100vw - 24px);
  display: grid; gap: 2px; padding: 10px; background: var(--uw-bg); color: var(--uw-ink); border: 1px solid var(--uw-line); border-radius: 16px;
  box-shadow: var(--uw-shadow); }
.uw-card { display: flex; align-items: center; gap: 12px; padding: 6px 6px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--uw-line); }
.uw-id { min-width: 0; overflow-wrap: anywhere; }
.uw-id b { display: block; font-size: 16px; color: var(--uw-ink); }
.uw-id span { display: block; font-size: 12.5px; color: var(--uw-sub); }
details.uw .uw-drop a, details.uw .uw-drop button { display: flex; align-items: center; box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 10px; margin: 0;
  border: 0; border-radius: 10px; background: none; color: var(--uw-ink); font: inherit; font-size: 14px; font-weight: 500; text-align: left;
  text-decoration: none; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
details.uw .uw-drop a:hover, details.uw .uw-drop button:hover { background: var(--uw-soft); }
details.uw .uw-drop a.uw-map { background: var(--uw-acc-soft); color: var(--uw-acc-ink); font-weight: 750; border: 1px solid var(--uw-acc); margin-bottom: 4px; }
details.uw .uw-drop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--uw-line); }
.uw :is(summary, a, button):focus-visible { outline: 3px solid var(--uw-focus); outline-offset: 2px; }
/* 휴대폰: 동그란 첫 글자만 (모든 화면 같은 크기·자리 = 머리줄 오른쪽) */
@media (max-width: 760px) {
  .uw > summary { padding: 3px; gap: 0; }
  .uw-name, .uw-caret { display: none; }
}
/* 메뉴가 열려 있으면 뒷페이지 스크롤 잠금 (2026-10-21 Oksam '메뉴 팝업 열려 있을 때 뒷페이지 같이 스크롤') — 지큐·포털·홈페이지 같이.
   메뉴 안은 화면 높이까지만, 끝까지 스크롤해도 뒤로 안 넘어감. 바깥 누름·Esc 로 닫기는 userwidget.js. */
html:has(details.uw[open]) { overflow: hidden; scrollbar-gutter: stable; }  /* html 만 — body 까지 잠그면 body 가 스크롤 상자가 되어 sticky 머리줄이 문서 맨 위로 튀어 메뉴가 화면 밖에 열림 (2026-10-21) */
html:has(details.uw[open]) body { overflow: visible; }  /* 서랍(body.nav-open 등)이 같이 열려 있어도 body 는 풀어 둠 — 잠금은 html 이 함 */
details.uw .uw-drop { max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain; }

/* Codex 2026-10-21 설명회 강조 */

details.uw {
  --uw-hot-open: #a33d00; --uw-hot-open-bg: #ffd9b8;
  --uw-hot-live: #b42318; --uw-hot-live-bg: #fbd5d2;
}
details.uw > summary { position: relative; }
details.uw .uw-hot-open { --uw-hot-color: var(--uw-hot-open); --uw-hot-bg: var(--uw-hot-open-bg); }
details.uw .uw-hot-live { --uw-hot-color: var(--uw-hot-live); --uw-hot-bg: var(--uw-hot-live-bg); }
details.uw > summary > .uw-dot {
  display: block; position: absolute; top: -1px; left: 25px; z-index: 1;
  box-sizing: border-box; width: 14px; height: 14px; border: 2px solid var(--uw-on);
  border-radius: 50%; background: var(--uw-hot-color); pointer-events: none;
}
details.uw .uw-drop a.uw-sem.uw-hot {
  gap: 8px; min-height: 48px; margin-bottom: 6px; border: 2px solid var(--uw-hot-color); border-left-width: 6px;
  background: var(--uw-hot-bg); color: var(--uw-hot-color); font-size: 15px; font-weight: 800;
}
details.uw .uw-drop a.uw-sem.uw-hot:hover { background: var(--uw-hot-bg); text-decoration: underline; text-underline-offset: 3px; }
details.uw .uw-sem.uw-hot .uw-pill {
  flex: none; margin-left: auto; padding: 3px 10px; border-radius: 999px;
  background: var(--uw-hot-color); color: var(--uw-on); font-size: 13px;
  font-style: normal; font-weight: 800; line-height: 1.5; white-space: nowrap;
}
/* 설명회가 열려 있으면 바로 아래 '내 메뉴 지도'는 평범하게 (2026-10-21 Oksam '이게 눈에띄어?') */
details.uw .uw-drop a.uw-sem.uw-hot + a.uw-map { background: none; border: 0; color: var(--uw-ink); font-weight: 500; margin-bottom: 0; }
details.uw .uw-drop a.uw-sem.uw-hot + a.uw-map:hover { background: var(--uw-soft); }
details.uw > summary > .uw-dot.uw-hot-live { animation: uw-seminar-pulse 2.4s ease-in-out infinite; }
@keyframes uw-seminar-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  details.uw > summary > .uw-dot.uw-hot-live { animation: none; }
}
