/* 고객 전용 라이브 페이지 - 다크+골드 테마, 모바일 우선 반응형 */
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-1Thin.woff2") format("woff2");
  font-weight: 100; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-2ExtraLight.woff2") format("woff2");
  font-weight: 200; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-3Light.woff2") format("woff2");
  font-weight: 300; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2") format("woff2");
  font-weight: 800; font-display: swap;
}
@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-9Black.woff2") format("woff2");
  font-weight: 900; font-display: swap;
}

:root {
  --bg: #08090d;
  --gold: #d8b16a;
  --gold-bright: #f1d08e;
  --gold-soft: rgba(216, 177, 106, 0.22);
  --gold-faint: rgba(216, 177, 106, 0.08);
  --ink: #f4ead4;
  --ink-dim: #d6ccba;
  --ink-muted: #918b80;
  --panel: rgba(17, 19, 26, 0.92);
  --panel-line: rgba(255, 255, 255, 0.1);
  --field-bg: rgba(10, 12, 17, 0.92);
  --radius: 8px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  --fs-chat-width: clamp(200px, 30vw, 360px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  min-height: 100vh;
  background: #08090d;
  color: var(--ink);
  font-family: "Paperozi", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 110%;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background: #08090d;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(circle at 82% 10%, rgba(216,177,106,0.08), transparent 34rem),
    rgba(7,8,12,0.88);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

/* 부팅 스피너 */
.live-booting { min-height: 100vh; display: grid; place-items: center; }
.boot-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgba(216,177,106,0.2);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 레이아웃 셸 */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-topbar-host { z-index: 60; }
.live-main {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding:
    clamp(16px, 2vw, 28px)
    var(--page-gutter)
    56px;
}

/* ===== 게이트(로그인/가입) ===== */
.gate {
  width: 100%;
  max-width: none;
  min-height: min(720px, calc(100svh - 120px));
  margin: clamp(10px, 3vw, 38px) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) 430px;
  gap: 0;
  align-content: stretch;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(15,18,26,0.80);
  box-shadow: 0 36px 120px rgba(0,0,0,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.gate-hero {
  position: relative;
  min-height: 100%;
  display: grid;
  align-content: space-between;
  gap: 36px;
  padding: clamp(30px, 4.6vw, 52px);
  background:
    radial-gradient(440px 340px at 82% 88%, rgba(216,177,106,0.20), transparent 62%),
    linear-gradient(145deg, rgba(216,177,106,0.18), rgba(255,255,255,0.03) 44%, rgba(35,116,255,0.10));
  overflow: hidden;
}
.gate-hero::before {
  content: "";
  position: absolute;
  right: -130px;
  bottom: -170px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(216,177,106,0.16);
  filter: blur(10px);
}
.gate-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gate-brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 18px;
  padding: 5px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 14px 40px rgba(0,0,0,0.28);
}
.gate-brand strong {
  display: block;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.05;
  font-weight: 900;
}
.gate-brand small {
  display: block;
  margin-top: 5px;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gate-copy { position: relative; max-width: 560px; }
.gate-hero .eyebrow {
  display: inline-flex;
  border-left: 2px solid var(--gold);
  background: rgba(8,9,13,0.48);
  padding: 9px 14px;
  color: #eed7a1;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.16em; text-transform: uppercase;
  backdrop-filter: blur(10px);
}
.gate-hero h1 {
  margin: 18px 0 0;
  color: #fff;
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.055em;
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  text-shadow: none;
}
.gate-hero p { margin: 16px 0 0; max-width: 560px; color: #d8deea; line-height: 1.8; font-size: clamp(0.96rem, 2.2vw, 1.06rem); }
.gate-points {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gate-points div {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.06);
}
.gate-points b { display: block; color: #fff; font-weight: 900; }
.gate-points span { display: block; margin-top: 4px; color: #c6cfdb; font-size: 0.78rem; }

.card {
  position: relative; overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  color: #222831;
  padding: clamp(34px, 4vw, 48px) clamp(26px, 3.2vw, 42px);
  box-shadow: none;
  backdrop-filter: none;
  align-content: center;
}
.card::before {
  content: none;
}
.gate-card-head { margin-bottom: 22px; }
.gate-card-head .eyebrow {
  display: inline-flex;
  margin: 0 0 10px;
  color: #2374ff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}
.gate-card-head h2 {
  margin: 0;
  color: #111827;
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.gate-card-head p {
  margin: 9px 0 0;
  color: #677083;
  font-size: 0.94rem;
  line-height: 1.65;
}
form { display: grid; gap: 14px; }
.field-stack { display: grid; gap: 8px; }
.field-stack label { color: #3d4656; font-weight: 900; font-size: 0.88rem; }
.inline-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inline-check button { min-width: 104px; }

.gate input, .gate select, .gate textarea, .gate .btn, .gate button {
  min-height: 50px;
  border: 1px solid #d9e0ea;
  background: #fff;
  color: #111827;
  padding: 0 15px;
  outline: none;
  border-radius: 13px;
}
.gate textarea { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.6; }
.gate input { width: 100%; font-weight: 600; }
.gate input::placeholder, .gate textarea::placeholder { color: #8a94a6; }
.gate input:focus, .gate select:focus, .gate textarea:focus { border-color: #2374ff; box-shadow: 0 0 0 4px rgba(35,116,255,0.14); }
.gate button, .gate .btn {
  background: #2374ff; border-color: #2374ff; color: #fff;
  font-weight: 800; cursor: pointer; transition: 160ms ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 12px 28px rgba(35,116,255,0.22);
}
/* button:hover → 파일 하단 통일 규칙 */
.gate button:disabled { cursor: wait; opacity: 0.6; }

.prefs { display: flex; flex-wrap: wrap; gap: 10px 18px; border-top: 1px solid #e2e8f0; padding-top: 14px; margin-top: 2px; }
.pref { display: inline-flex; align-items: center; gap: 8px; color: #5b6473; font-weight: 800; }
.pref input { min-height: auto; flex: none; width: 17px; height: 17px; accent-color: #2374ff; padding: 0; }
.account-links { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 4px; }
.link-button { min-height: auto; border: 0; background: transparent; color: #5b6473; padding: 0; font-weight: 900; box-shadow: none; }
.link-button:hover { background: transparent; color: #2374ff; text-decoration: underline; box-shadow: none; }
.hint { color: #7a828d; font-size: 0.85rem; line-height: 1.6; }

#register-card { display: none; }
#register-card.is-open { display: grid; }
.card.is-hidden, .is-hidden { display: none !important; }
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; min-height: 0; }
  .gate-hero { padding: 30px; }
  .gate-hero h1 { font-size: 2.35rem; }
  .gate-points { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .live-main { padding: 0; }
  .gate { width: 100%; min-height: 100svh; margin: 0; border: 0; border-radius: 0; }
  .gate-hero { display: none; }
  .card { min-height: 100svh; padding: 28px 22px; }
}

/* ===== 모달 ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(3,4,9,0.76); backdrop-filter: blur(8px); padding: 18px;
}
.modal-backdrop[hidden] { display: none; }
.site-modal {
  width: min(420px, 100%); border: 1px solid rgba(216,177,106,0.38);
  background: #12141d;
  box-shadow: 0 26px 90px rgba(0,0,0,0.65); padding: 22px; border-radius: var(--radius);
}
.site-modal h2 { margin: 0; color: #fff4d9; font-size: 1.3rem; }
.site-modal p { margin: 12px 0 0; color: var(--ink-dim); line-height: 1.7; }
.site-modal button { width: 100%; margin-top: 18px; }

/* ===== 뷰어 ===== */
.viewer { display: none; }
body.is-viewing .viewer { display: block; }
body.is-viewing .gate { display: none; }

.viewer-grid { display: grid; gap: clamp(14px, 2vw, 20px); }
.viewer-main,
.viewer-side {
  min-width: 0;
}
/* 채팅창은 라이브(방송) 탭에서만 노출 */
.viewer[data-active-tab="stats"] .viewer-side { display: none; }
.viewer-broadcast {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.viewer-broadcast,
.card.chat-card {
  --head-pad-y: 6px;
  --head-row-h: 36px;
}
.viewer-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: nowrap;
  padding: var(--head-pad-y) 10px;
  min-height: calc(var(--head-pad-y) * 2 + var(--head-row-h));
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}
.viewer-tabs .spacer { flex: 1; }
.icon-btn {
  min-height: 42px; aspect-ratio: 1/1; width: auto; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-btn.viewer-text-btn {
  aspect-ratio: auto;
  min-width: 0;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.icon-btn.viewer-text-btn svg {
  flex-shrink: 0;
}
#live-panel, #stats-panel { display: block; }

/* 영상 영역 */
.video-shell {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 0; overflow: hidden;
  border: 0; box-shadow: none;
  contain: layout paint;
  isolation: isolate;
}
.video-shell.is-soft-fullscreen {
  position: fixed; inset: 0; z-index: 9000; width: 100vw; height: 100vh;
  aspect-ratio: auto; border-radius: 0; border: 0;
}
#player { display: none; }
body.is-viewing #player { display: block; }

.stream-layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity 0.12s linear; backface-visibility: hidden; }
#remote, #remote-mjpeg, #remote-canvas { object-fit: contain; background: #000; }
#remote { transform: translate3d(0,0,0); will-change: transform; }
#remote-rustdesk { border: 0; background: #000; }
.video-shell .plyr { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; --plyr-color-main: var(--gold); }
.video-shell .plyr video { width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 1; }

/* mode-video: Plyr 래퍼(.plyr)와 그 안의 실제 video(#remote)를 모두 불투명 처리.
   Plyr가 #remote를 .plyr로 감싸도 #remote는 .stream-layer(opacity:0)를 유지하므로
   여기서 opacity:1을 명시해야 화면에 보임(이게 없으면 PIP에서만 보임). */
.video-shell.mode-video .plyr,
.video-shell.mode-video #remote { opacity: 1; pointer-events: auto; }
.video-shell.mode-mjpeg #remote-mjpeg { opacity: 1; pointer-events: auto; }
.video-shell.mode-canvas #remote-canvas { opacity: 1; pointer-events: auto; }
.video-shell.mode-rustdesk #remote-rustdesk { opacity: 1; pointer-events: auto; }

.viewer-frame-hud {
  position: absolute; top: 10px; left: 10px; z-index: 6;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 28px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(4,6,10,0.72); color: #fff;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  pointer-events: none;
}
.viewer-frame-hud[hidden] { display: none; }
.viewer-frame-hud::before {
  content: ''; width: 7px; height: 7px; border-radius: 999px;
  background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
}
.viewer-frame-hud.is-stale::before {
  background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,0.18);
}

/* 커스텀 오버레이 컨트롤(영상=Plyr가 담당하므로 mjpeg/rustdesk에서만 표시) */
.viewer-test-log {
  position: static;
  width: 100%;
  max-height: none;
  overflow: visible;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(216,177,106,0.32);
  border-radius: 10px;
  background: rgba(5,7,12,0.88);
  color: #f8fafc;
  box-shadow: 0 6px 18px rgba(0,0,0,0.24);
  backdrop-filter: none;
  contain: content;
  font-size: 12px;
  pointer-events: auto;
}
.viewer-test-log[hidden] { display: none; }
.viewer-test-log.is-warn { border-color: rgba(245,158,11,0.72); box-shadow: 0 0 0 1px rgba(245,158,11,0.16), 0 6px 18px rgba(0,0,0,0.24); }
.viewer-test-log-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.viewer-test-log-head strong {
  color: #ffe3a3;
  font-size: 13px;
  white-space: nowrap;
}
#viewer-test-log-summary {
  display: inline-block;
  max-width: 420px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.82);
  color: #dbeafe;
  text-align: right;
  line-height: 1.45;
}
.viewer-test-log-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.viewer-test-log-tools button {
  border: 1px solid rgba(216,177,106,0.42);
  border-radius: 999px;
  background: rgba(216,177,106,0.14);
  color: #ffe3a3;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  cursor: pointer;
}
.viewer-test-log:not(.is-expanded) {
  overflow: visible;
}
.viewer-test-log:not(.is-expanded) .viewer-test-log-grid,
.viewer-test-log:not(.is-expanded) #viewer-test-log-lines {
  display: none;
}
.viewer-test-log-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
}
.viewer-test-log-metric {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 6px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.055);
}
.viewer-test-log-metric span { color: #94a3b8; }
.viewer-test-log-metric strong { color: #f8fafc; font-weight: 800; word-break: keep-all; overflow-wrap: anywhere; }
.viewer-test-log-metric.is-warn { background: rgba(245,158,11,0.16); }
.viewer-test-log-metric.is-warn strong { color: #fde68a; }
#viewer-test-log-lines {
  margin: 8px 0 0;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  color: #cbd5e1;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.45;
}
@media (max-width: 760px) {
  .viewer-test-log { max-height: 58%; font-size: 11px; }
  .viewer-test-log-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-test-log-metric { grid-template-columns: 86px minmax(0, 1fr); }
  #viewer-test-log-summary { max-width: 280px; }
}

.vs-controls {
  position: absolute; top: 10px; right: 10px; z-index: 9; display: none; gap: 8px;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.18s ease, visibility 0.18s ease;
}
.video-shell.mode-video .vs-controls, .video-shell.mode-mjpeg .vs-controls, .video-shell.mode-canvas .vs-controls, .video-shell.mode-rustdesk .vs-controls,
.video-shell.is-soft-fullscreen .vs-controls { display: flex; }
.video-shell:hover .vs-controls,
.video-shell:focus-within .vs-controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.vs-controls button {
  min-height: 38px; width: 38px; padding: 0; border: 1px solid rgba(255,255,255,0.22); border-radius: 6px;
  background: rgba(4,6,10,0.58); color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.22); backdrop-filter: blur(6px);
}
.vs-controls button:hover {
  background: rgba(20,22,30,0.78); border-color: rgba(216,177,106,0.7); color: #fff;
  transform: scale(1.08); opacity: 1;
}
.vs-controls svg { width: 18px; height: 18px; }

/* 버퍼링 오버레이(기본 숨김) */
.viewer-buffering {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: rgba(6,7,11,0.45); pointer-events: none;
}
.viewer-buffering[hidden] { display: none; }
.viewer-buffering-inner {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(8,10,16,0.82); border: 1px solid rgba(216,177,106,0.28);
  color: #fff4d9; font-size: 0.88rem; font-weight: 700;
}
.viewer-buffering-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,244,217,0.25); border-top-color: var(--gold);
  animation: viewer-buffering-spin 0.8s linear infinite;
}
@keyframes viewer-buffering-spin { to { transform: rotate(360deg); } }

/* 시청 불가 오버레이(기본 숨김) */
.viewer-unavailable {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center;
  background: rgba(6,7,11,0.92); padding: 24px; text-align: center;
}
.viewer-unavailable[hidden] { display: none; }
.viewer-unavailable strong { display: block; color: #fff4d9; font-size: clamp(1.1rem, 3vw, 1.5rem); margin-bottom: 10px; }
.viewer-unavailable p { margin: 0; color: var(--ink-dim); line-height: 1.7; max-width: 460px; }

/* 상태/타이머 — 시청 중에는 방송 박스 아래 문구(버퍼링 등) 숨김(영상 위 오버레이만 사용) */
body.is-viewing .status-row { display: none; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; color: var(--ink-dim); }
#status { font-size: 0.85rem; color: var(--ink-muted); flex: 1; min-width: 140px; }
.viewer-tabs-timer { font-size: 0.9rem; font-weight: 700; color: var(--gold); align-self: center; white-space: nowrap; }
.viewer-tabs-apm { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 700; color: var(--gold); white-space: nowrap; box-sizing: border-box; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: default; }
.viewer-tabs-apm .js-apm-live { color: var(--gold-bright); }
html.theme-dark body.school-customer-page .viewer-tabs-apm,
body.school-customer-page.theme-dark .viewer-tabs-apm { border: 1px solid rgba(255, 255, 255, 0.12); background: #0206174d; }

/* 채팅 */
.card.chat-card {
  --chat-pad-y: var(--head-pad-y);
  --chat-inset-x: 10px;
  --chat-gap: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 200px;
  max-height: 420px;
  padding: 0;
  box-sizing: border-box;
}
.chat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: calc(var(--head-pad-y) * 2 + var(--head-row-h));
  margin: 0;
  padding: var(--head-pad-y) var(--chat-inset-x);
  width: auto;
  box-sizing: border-box;
}
.chat-card-head h2 {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.chat-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.chat-card-actions .icon-btn {
  min-height: 36px;
  width: 36px;
  border-radius: 8px;
}
.chat-card-actions .icon-btn.viewer-text-btn {
  width: auto;
  min-height: 36px;
  padding: 0 10px;
  gap: 5px;
  font-size: 0.78rem;
}
#chat-log {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px var(--chat-inset-x);
  margin: 0;
  width: 100%;
  max-height: min(320px, 46vh);
  border: 1px solid rgba(216,177,106,0.28);
  border-radius: 0;
  background: rgba(7,9,16,0.5);
  box-sizing: border-box;
}
body.is-viewing #chat-log {
  flex: 1 1 0;
  min-height: 120px;
  max-height: none;
}
.chat-row { display: flex; flex-wrap: nowrap; gap: 4px 8px; align-items: baseline; font-size: 0.88rem; line-height: 1.4; width: 100%; }
.chat-sender { color: var(--gold); font-weight: 700; flex-shrink: 0; }
.chat-text { color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chat-time { color: #6a6253; font-size: 0.72rem; flex-shrink: 0; margin-left: auto; }
.chat-cleared-notice { color: var(--ink-muted); font-size: 0.82rem; line-height: 1.6; padding: 10px; border: 1px dashed var(--gold-faint); border-radius: 8px; }
.chat-cleared-notice strong { display: block; color: var(--gold); margin-bottom: 4px; }
#chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: var(--chat-gap) 0 0;
  padding: var(--head-pad-y) var(--chat-inset-x);
  min-height: calc(var(--head-pad-y) * 2 + var(--head-row-h));
  width: auto;
  box-sizing: border-box;
  align-items: center;
}
#chat-form input {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  border-radius: 10px;
}
#chat-form button {
  min-height: 36px;
  min-width: 56px;
  padding: 0 12px;
  font-size: 0.8rem;
}

/* 채팅 헤더 피드백 버튼 */
.chat-card-actions #feedback-up,
.chat-card-actions #feedback-down {
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chat-card-actions #feedback-up { color: #6fcf97; background: rgba(111,207,151,0.08); border-color: rgba(111,207,151,0.3); }
.chat-card-actions #feedback-down { color: #e07a7a; background: rgba(224,122,122,0.08); border-color: rgba(224,122,122,0.3); }
.topbar-feedback-status { color: var(--ink-muted); font-size: 0.78rem; white-space: nowrap; align-self: center; }
.topbar-divider { width: 1px; height: 28px; background: rgba(216,177,106,0.25); margin: 0 4px; align-self: center; flex-shrink: 0; }
#feedback-status { color: var(--ink-muted); font-size: 0.8rem; }

/* ===== 캐릭터 정보 ===== */
#character-info-content { color: #e8d9b5; font-size: 0.9rem; line-height: 1.7; }
.char-scroll-x { overflow-x: auto; }

/* 인벤토리(.wh-scroll) 전용 커스텀 스크롤바 */
.wh-scroll::-webkit-scrollbar { width: 20px; background: transparent; }
.wh-scroll::-webkit-scrollbar-track { background-color: transparent; background-image: url(/ui-scrollbar-track.webp); background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.wh-scroll::-webkit-scrollbar-thumb { background: url(/ui-scrollbar-thumb.webp) center / 100% 100% no-repeat; min-height: 30px; }
.wh-scroll::-webkit-scrollbar-button { width: 20px; height: 17px; background-color: transparent; background-position: center; background-repeat: no-repeat; background-size: contain; }
.wh-scroll::-webkit-scrollbar-button:vertical:decrement { background-image: url(/ui-scrollbar-track-top.webp); }
.wh-scroll::-webkit-scrollbar-button:vertical:increment { background-image: url(/ui-scrollbar-track-bottom.webp); }
.wh-scroll::-webkit-scrollbar-button:vertical:start:increment,
.wh-scroll::-webkit-scrollbar-button:vertical:end:decrement { display: none; }

/* 창고(.st-wh-scroll) 전용 커스텀 스크롤바 */
.st-wh-scroll::-webkit-scrollbar { width: 20px; background: transparent; }
.st-wh-scroll::-webkit-scrollbar-track { background-color: transparent; background-image: url(/ui-scrollbar-track.webp); background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.st-wh-scroll::-webkit-scrollbar-thumb { background: url(/ui-scrollbar-thumb.webp) center / 100% 100% no-repeat; min-height: 30px; }
.st-wh-scroll::-webkit-scrollbar-button { width: 20px; height: 17px; background-color: transparent; background-position: center; background-repeat: no-repeat; background-size: contain; }
.st-wh-scroll::-webkit-scrollbar-button:vertical:decrement { background-image: url(/ui-scrollbar-track-top.webp); }
.st-wh-scroll::-webkit-scrollbar-button:vertical:increment { background-image: url(/ui-scrollbar-track-bottom.webp); }
.st-wh-scroll::-webkit-scrollbar-button:vertical:start:increment,
.st-wh-scroll::-webkit-scrollbar-button:vertical:end:decrement { display: none; }

/* 창고 아이템 툴팁(이름+수량) */
#wh-tip {
  position: fixed; z-index: 9500; pointer-events: none; transform: translate(-50%, -100%);
  background: rgba(10,12,18,0.97); border: 1px solid var(--gold-soft); color: #f0e0b0;
  font-size: 0.78rem; font-weight: 700; padding: 5px 11px; border-radius: 7px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.55); white-space: nowrap; max-width: 70vw;
  overflow: hidden; text-overflow: ellipsis;
}
#wh-tip[hidden] { display: none; }
#wh-tip[data-pos="below"] { transform: translate(-50%, 0); }

/* 캐릭터 성향/PK 배지 */
.char-align-group { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.char-align-row { width: 100%; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.char-align-row .char-align-group { margin-left: 0; }
.char-align-badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 5px; border: 1px solid rgba(168,150,96,.35); background: rgba(168,150,96,.1); color: #c0b080; white-space: nowrap; font-weight: 600; }
.char-radar-wrap { display: flex; justify-content: center; width: 100%; margin-top: 7%; }

/* 하나의 카드 안에서 좌(스탯·아이템 340px)/우(차트 나머지) 영역을 구분선으로 나눈다 */
.char-main-row { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) {
  .char-main-row { flex-direction: row; align-items: stretch; gap: 18px; }
  .char-main-row > .char-left { flex: 0 0 340px; }
  .char-main-row > .char-right { flex: 1 1 0; min-width: 0; }
}

/* 캐릭터 좌/우 영역 세로 구분선 — PC 가로 배치에서만 표시 */
.char-divider-v { display: none; }
@media (min-width: 1024px) {
  .char-divider-v {
    display: block;
    width: 1px;
    background: rgba(216, 177, 106, 0.18);
    align-self: stretch;
    flex-shrink: 0;
  }
}

/* 캐릭터 패널 탭(인벤/장비/창고) */
.char-panel-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 300px;
  gap: 5px;
  padding: 8px 8px 0;
  box-sizing: border-box;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}
.char-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  padding: 7px 4px 6px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  cursor: pointer;
  background: var(--panel);
  box-shadow: none;
  transform: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* 캐릭터 패널 뷰 - 인벤토리 패널 비율로 높이 고정(탭 전환 시 점프 방지) */
.char-panel-views {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 998 / 1676;
  position: relative;
}
.cpt-view { position: absolute; inset: 0; }
.cpt-img { display: block; width: 100%; height: 100%; object-fit: fill; }

/* ===== 전체화면 채팅 ===== */
/* 전체화면 컨테이너(#video-shell)에 append. 닫힘 상태에서는 숨기고, 열림 상태에서만 우측 열로 배치 */
#viewer-fullscreen-chat {
  position: absolute; right: 0; top: 0; bottom: 0; width: var(--fs-chat-width); z-index: 9300;
  background: rgba(8,9,13,0.94); backdrop-filter: blur(10px); border-left: 1px solid var(--gold-soft);
  display: flex; flex-direction: column; padding: 14px;
}
#viewer-fullscreen-chat[hidden] { display: none; }
#viewer-fullscreen-chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.viewer-fullscreen-chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.viewer-fullscreen-chat-input button { min-width: 64px; }

/* 전체화면 전용 '채팅창 표시' 토글 버튼 (전체화면에서만 노출, 좌상단 → vs-controls/Plyr 컨트롤과 미충돌) */
.fs-chat-toggle {
  position: absolute; top: 14px; left: 14px; z-index: 9301; display: none;
  align-items: center; gap: 7px; min-height: 40px; width: auto; padding: 0 16px; border-radius: 999px;
  background: rgba(8,10,16,0.85); border: 1px solid var(--gold-soft); color: var(--gold);
  font-weight: 800; font-size: 0.9rem; backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.fs-chat-toggle:hover { background: rgba(216,177,106,0.24); color: #fff4d9; }
.fs-chat-toggle svg { width: 18px; height: 18px; }
.fs-chat-toggle-label { line-height: 1; }
.video-shell.is-fullscreen .fs-chat-toggle { display: inline-flex; }

/* 채팅 열림: 컨테이너를 2열로 만들어 방송 영역과 채팅 영역이 서로 밀어내며 맞대도록 배치 */
.video-shell.chat-open {
  display: grid;
  grid-template-columns: minmax(0, calc(100% - var(--fs-chat-width))) var(--fs-chat-width);
  grid-template-rows: minmax(0, 1fr);
}
.video-shell.chat-open > .stream-layer,
.video-shell.chat-open > .plyr {
  position: relative !important;
  inset: auto !important;
  grid-column: 1;
  grid-row: 1;
  width: 100% !important;
  max-width: none;
  height: 100% !important;
  min-width: 0;
}
.video-shell.chat-open > #viewer-fullscreen-chat {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.video-shell.chat-open .vs-controls {
  right: calc(var(--fs-chat-width) + 10px);
}

/* ===== 반응형: 태블릿 ===== */
@media (min-width: 640px) {
  .card.chat-card { min-height: 240px; }
}

/* ===== 반응형: PC (영상+캐릭터 좌, 채팅 우) ===== */
@media (min-width: 1024px) {
  .viewer-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto auto;
    grid-template-areas: "main side" "stats stats";
    align-items: stretch;
  }
  .viewer-main { grid-area: main; }
  .viewer-side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    align-self: start;
    min-height: 0;
  }
  .viewer-stats { grid-area: stats; }
  body.is-viewing .card.chat-card {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
  }
  body.is-viewing #chat-log {
    flex: 1 1 0;
    min-height: 160px;
    max-height: none;
  }
  .viewer[data-active-tab="stats"] .viewer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Plyr: 영상 위 컨트롤(재생·PIP·전체화면) 배경/테두리 제거 */
.video-shell .plyr__controls {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.video-shell .plyr__control {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.video-shell .plyr__control:hover,
.video-shell .plyr__control[aria-expanded="true"] {
  background: transparent !important;
}
.plyr--full-ui input[type=range] { color: var(--gold); }
.plyr__control--overlaid { background: rgba(216,177,106,0.9); }
.plyr__control.plyr__tab-focus { box-shadow: 0 0 0 3px rgba(216,177,106,0.4); }

/* 토픽바 보정 */
[data-site-topbar="customer"] {
  display: block;
}

/* 메인 페이지(home.css)와 동일한 라이트/다크 컬러 토큰 */
body.school-customer-page {
  --page-max: 1180px;
  --page-gutter: max(20px, calc((100vw - var(--page-max)) / 2));
  --customer-page-max: var(--page-max);
  --customer-page-gutter: var(--page-gutter);
  --paper: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --ink: #1a1d24;
  --muted: #5f6675;
  --line: rgba(26, 29, 36, 0.12);
  --gold: #b78436;
  --gold-2: #c8954a;
  --bg: var(--paper);
  --gold-bright: var(--gold-2);
  --gold-soft: rgba(183, 132, 54, 0.22);
  --gold-faint: rgba(183, 132, 54, 0.08);
  --ink-dim: var(--muted);
  --ink-muted: var(--muted);
  --panel-line: var(--line);
  --field-bg: var(--panel);
  --radius: 10px;
  --shadow: 0 20px 50px rgba(20, 26, 40, 0.12);
  background: var(--paper);
  color: var(--ink);
}

@media (min-width: 1440px) {
  body.school-customer-page {
    --page-max: 1280px;
  }
}

@media (min-width: 1920px) {
  body.school-customer-page {
    --page-max: 1420px;
  }
}

@media (min-width: 2560px) {
  body.school-customer-page {
    --page-max: 1560px;
  }
}

body.school-customer-page::before {
  display: none;
}

body.school-customer-page::after {
  background: #eef1f5;
  opacity: 1;
}

body.school-customer-page .site-topbar-customer {
  min-height: 76px;
  height: auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

body.school-customer-page .site-topbar-customer .site-topbar-logo {
  width: 48px;
  height: 48px;
}

body.school-customer-page .site-topbar-customer .site-topbar-logo img {
  transform: none;
}

.gate-hero .eyebrow {
  border-left: 0;
  background: transparent;
  padding: 0;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  backdrop-filter: none;
}

.gate-hero h1 {
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  line-height: 0.98;
  font-weight: 800;
}

.gate-hero p {
  margin-top: 22px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.card,
.site-modal,
.chat-card {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gate .card {
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  color: #222831;
  box-shadow: none;
  backdrop-filter: none;
}

.field-stack label,
.pref,
.hint,
.account-links,
.site-modal p,
.status-row,
#status,
#feedback-status,
.topbar-feedback-status {
  color: var(--muted);
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #9aa1ae;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(183, 132, 54, 0.72);
  box-shadow: 0 0 0 4px rgba(183, 132, 54, 0.12);
}

/* 라이트 모드 기본(주요) 버튼: 골드 채움 — 다크 모드와 통일 */
button:not(.icon-btn):not(.customer-theme-toggle):not(.site-topbar-theme):not(.site-topbar-logout):not(.link-button):not(.viewer-test-log-copy):not(.viewer-test-log-toggle):not(.vs-controls button):not(.fs-chat-toggle):not(.plyr__control):not(.char-tab),
.btn {
  border-radius: 999px;
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
  box-shadow: none;
}

.gate button:not(.link-button),
.gate .btn {
  border-color: #2374ff;
  background: #2374ff;
  color: #fff;
  border-radius: 13px;
  box-shadow: 0 12px 28px rgba(35,116,255,0.22);
}

.link-button {
  color: var(--muted);
}

.prefs {
  border-top-color: var(--line);
}

.viewer-grid {
  gap: 18px;
}

.viewer-tabs {
  gap: 8px;
}

/* 라이트: 채팅 전송·인벤/창고/장착 — 테두리·배경·글자색 동일 (크기·폰트 제외) */
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .icon-btn,
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) #chat-form button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .icon-btn,
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) #chat-form button {
  border-radius: 8px;
}

.viewer-broadcast {
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.22);
}

body.is-viewing .site-topbar-host,
body.is-viewing .card,
body.is-viewing .viewer-broadcast,
body.is-viewing .viewer-tabs,
body.is-viewing .chat-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.live-check-page.is-viewing {
  overflow: auto;
  background: var(--paper, var(--bg));
}

body.live-check-page.is-viewing::before {
  display: block !important;
}

body.live-check-page.is-viewing::after {
  display: block !important;
}

body.live-check-page.is-viewing .site-topbar-host {
  display: block !important;
}

body.live-check-page.is-viewing .viewer-tabs {
  display: flex !important;
}

body.live-check-page.is-viewing .viewer-side,
body.live-check-page.is-viewing .viewer-stats {
  display: block !important;
}

body.live-check-page.is-viewing .live-main {
  width: 100%;
  max-width: none;
  min-height: auto;
  margin: 0;
  padding:
    clamp(12px, 1.8vw, 24px)
    var(--page-gutter)
    56px;
}

body.live-check-page.is-viewing .viewer-grid {
  display: grid;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.live-check-page.is-viewing .viewer-main,
body.live-check-page.is-viewing .viewer-broadcast {
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--panel);
}

body.live-check-page.is-viewing .video-shell {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

body.live-check-page.is-viewing .viewer-test-log {
  display: none !important;
}

.chat-card-head h2 {
  color: var(--muted);
}

#chat-log {
  border-color: var(--line);
  border-radius: 0;
  background: var(--panel);
}

.chat-text {
  color: var(--ink);
}

.chat-time {
  color: var(--muted);
}

.chat-sender,
.viewer-tabs-timer {
  color: var(--gold);
}

html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-up {
  border-color: rgba(30, 143, 92, 0.24);
  background: rgba(30, 143, 92, 0.08);
  color: #166c45;
}

html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-down {
  border-color: rgba(190, 60, 60, 0.24);
  background: rgba(190, 60, 60, 0.08);
  color: #9d2b2b;
}

#character-info-content {
  color: var(--ink);
}

.char-divider-v {
  background: var(--line);
}

.modal-backdrop {
  background: rgba(17, 17, 17, 0.34);
  backdrop-filter: blur(10px);
}

.site-modal h2 {
  color: var(--ink);
}

.viewer-unavailable {
  background: rgba(238, 241, 245, 0.92);
}

.viewer-unavailable strong {
  color: var(--ink);
}

.viewer-unavailable p {
  color: var(--muted);
}

@media (min-width: 1024px) {
  .viewer-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 1023px) {
  .gate {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .gate-hero h1 {
    font-size: clamp(2.3rem, 13vw, 4.1rem);
  }

}

.viewer-tabs-trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.viewer-tabs .icon-btn {
  min-height: 36px;
  width: 36px;
}

@media (min-width: 1024px) {
  .viewer-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
}

/* ===== 다크 모드 (메인 페이지와 동일 토큰) ===== */
html.theme-dark body.school-customer-page,
body.school-customer-page.theme-dark {
  --paper: #14161c;
  --panel: #1e212a;
  --panel-2: #262a35;
  --ink: #f4ead4;
  --muted: #b6ab92;
  --line: #353b48;
  --gold: #d8b16a;
  --gold-2: #efd08f;
  --bg: var(--paper);
  --gold-bright: var(--gold-2);
  --gold-soft: rgba(216, 177, 106, 0.22);
  --gold-faint: rgba(216, 177, 106, 0.08);
  --ink-dim: var(--muted);
  --ink-muted: var(--muted);
  --panel-line: var(--line);
  --field-bg: #171a21;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  background: var(--paper);
  color: var(--ink);
}

html.theme-dark body.school-customer-page::after,
body.school-customer-page.theme-dark::after {
  background: #14161c;
}

/* 다크 텍스트/카드 색은 토큰(--gold/--ink/--muted/--panel/--line) 재정의로 자동 전환되므로 개별 재지정 제거 */

/* 다크: 채팅 카드/로그 배경 지정 */
html.theme-dark body.school-customer-page .card.chat-card,
body.school-customer-page.theme-dark .card.chat-card {
  background: #1e212a;
}

/* 다크: 상단 컨트롤 바 + 내부 버튼 */
html.theme-dark body.school-customer-page .viewer-broadcast,
body.school-customer-page.theme-dark .viewer-broadcast {
  border-color: rgba(255, 255, 255, 0.12);
  background: #1e212a;
  box-shadow: var(--shadow);
}

html.theme-dark body.school-customer-page .viewer-tabs,
body.school-customer-page.theme-dark .viewer-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: #1e212a;
}

html.theme-dark body.school-customer-page .viewer-tabs .icon-btn,
body.school-customer-page.theme-dark .viewer-tabs .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0206174d;
  color: #fff;
}

html.theme-dark body.school-customer-page .viewer-tabs .icon-btn:hover,
body.school-customer-page.theme-dark .viewer-tabs .icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f4ead4;
}

html.theme-dark body.school-customer-page #chat-log,
body.school-customer-page.theme-dark #chat-log {
  background: #0206174d;
}

body.school-customer-page.theme-dark input::placeholder,
body.school-customer-page.theme-dark textarea::placeholder {
  color: #6b6454;
}

body.school-customer-page.theme-dark input:focus,
body.school-customer-page.theme-dark select:focus,
body.school-customer-page.theme-dark textarea:focus {
  border-color: rgba(216, 177, 106, 0.72);
  box-shadow: 0 0 0 4px rgba(216, 177, 106, 0.14);
}

html.theme-dark body.school-customer-page button:not(.link-button):not(.vs-controls button):not(.fs-chat-toggle):not(.plyr__control):not(.char-tab),
html.theme-dark body.school-customer-page .btn,
body.school-customer-page.theme-dark button:not(.link-button):not(.vs-controls button):not(.fs-chat-toggle):not(.plyr__control):not(.char-tab),
body.school-customer-page.theme-dark .btn {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(8, 9, 13, 0.72);
  color: #fff;
}

body.school-customer-page.theme-dark .link-button {
  color: #9a917f;
}

html.theme-dark body.school-customer-page .gate input:focus,
html.theme-dark body.school-customer-page .gate select:focus,
html.theme-dark body.school-customer-page .gate textarea:focus,
body.school-customer-page.theme-dark .gate input:focus,
body.school-customer-page.theme-dark .gate select:focus,
body.school-customer-page.theme-dark .gate textarea:focus {
  border-color: #2374ff;
  box-shadow: 0 0 0 4px rgba(35,116,255,0.14);
}

html.theme-dark body.school-customer-page .gate button:not(.link-button),
html.theme-dark body.school-customer-page .gate .btn,
body.school-customer-page.theme-dark .gate button:not(.link-button),
body.school-customer-page.theme-dark .gate .btn {
  border-color: #2374ff;
  background: #2374ff;
  color: #fff;
  border-radius: 13px;
  box-shadow: 0 12px 28px rgba(35,116,255,0.22);
}

/* 다크: 채팅 전송·인벤/창고/장착 — 테두리·배경·글자색 동일 (크기·폰트 제외) */
html.theme-dark body.school-customer-page .icon-btn,
html.theme-dark body.school-customer-page #chat-form button,
body.school-customer-page.theme-dark .icon-btn,
body.school-customer-page.theme-dark #chat-form button {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(8, 9, 13, 0.72);
  color: #fff;
}

html.theme-dark body.school-customer-page .icon-btn,
html.theme-dark body.school-customer-page #chat-form button,
body.school-customer-page.theme-dark .icon-btn,
body.school-customer-page.theme-dark #chat-form button {
  border-radius: 8px;
}

body.school-customer-page.theme-dark .chat-time {
  color: #6b6454;
}

body.school-customer-page.theme-dark #character-info-content {
  color: #e7dccb;
}

body.school-customer-page.theme-dark .modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

body.school-customer-page.theme-dark .viewer-unavailable {
  background: rgba(20, 22, 28, 0.92);
}

body.school-customer-page.theme-dark .viewer-unavailable strong {
  color: #f4ead4;
}

body.school-customer-page.theme-dark .viewer-unavailable p {
  color: #cfc4ad;
}

/* ===== 호버: 채팅 전송·인벤/창고/장착 동일 (테두리·배경·글자색) ===== */
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .icon-btn:hover,
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) #chat-form button:hover,
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .site-topbar-customer .site-topbar-theme:hover,
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .site-topbar-customer .site-topbar-logout:hover {
  border: 1px solid rgba(26, 29, 36, 0.12);
  background: #81818157;
  color: #1a1d24;
}

html.theme-dark body.school-customer-page .icon-btn:hover,
html.theme-dark body.school-customer-page #chat-form button:hover,
html.theme-dark body.school-customer-page .site-topbar-customer .site-topbar-theme:hover,
html.theme-dark body.school-customer-page .site-topbar-customer .site-topbar-logout:hover,
body.school-customer-page.theme-dark .icon-btn:hover,
body.school-customer-page.theme-dark #chat-form button:hover,
body.school-customer-page.theme-dark .site-topbar-customer .site-topbar-theme:hover,
body.school-customer-page.theme-dark .site-topbar-customer .site-topbar-logout:hover {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f4ead4;
}

/* 좋아요/별로예요 호버 — 공통 icon-btn:hover(회색)보다 우선, 색상 유지 */
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-up:hover,
body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-up:hover {
  border-color: rgba(30, 143, 92, 0.5);
  background: rgba(30, 143, 92, 0.2);
  color: #0f5c3a;
}

html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-down:hover,
body.school-customer-page:not(.theme-dark) .chat-card-actions #feedback-down:hover {
  border-color: rgba(190, 60, 60, 0.5);
  background: rgba(190, 60, 60, 0.2);
  color: #7a1f1f;
}

html.theme-dark body.school-customer-page .chat-card-actions #feedback-up:hover,
body.school-customer-page.theme-dark .chat-card-actions #feedback-up:hover {
  border-color: rgba(111, 207, 151, 0.5);
  background: rgba(111, 207, 151, 0.2);
  color: #8ee4b0;
}

html.theme-dark body.school-customer-page .chat-card-actions #feedback-down:hover,
body.school-customer-page.theme-dark .chat-card-actions #feedback-down:hover {
  border-color: rgba(224, 122, 122, 0.5);
  background: rgba(224, 122, 122, 0.2);
  color: #f0a0a0;
}

/* 인벤·창고·장착 탭 — 라이트 모드 (그라데이션 없이 솔리드 단색으로 구분) */
html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab,
body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab {
  background: #e7ebf1;
  border-color: #cfd5df;
  color: var(--muted);
}

html:not(.theme-dark) body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab:hover,
body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab:hover {
  background: #d6dde7;
  border-color: #b9c1cd;
  color: var(--ink);
}

html:not(.theme-dark) body.school-customer-page .char-panel-tabs button.char-tab.is-active,
html:not(.theme-dark) body.school-customer-page .char-panel-tabs button.char-tab.is-active:hover,
body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab.is-active,
body.school-customer-page:not(.theme-dark) .char-panel-tabs button.char-tab.is-active:hover {
  background: #fff;
  border-color: var(--gold);
  border-bottom-color: #fff;
  color: #6b4f1f;
  z-index: 2;
}

/* 인벤·창고·장착 탭 — 다크 모드 (그라데이션 없이 솔리드 단색으로 구분) */
html.theme-dark body.school-customer-page .char-panel-tabs button.char-tab,
body.school-customer-page.theme-dark .char-panel-tabs button.char-tab {
  background: #161922;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

html.theme-dark body.school-customer-page .char-panel-tabs button.char-tab:hover,
body.school-customer-page.theme-dark .char-panel-tabs button.char-tab:hover {
  background: #222633;
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--ink);
}

html.theme-dark body.school-customer-page .char-panel-tabs button.char-tab.is-active,
html.theme-dark body.school-customer-page .char-panel-tabs button.char-tab.is-active:hover,
body.school-customer-page.theme-dark .char-panel-tabs button.char-tab.is-active,
body.school-customer-page.theme-dark .char-panel-tabs button.char-tab.is-active:hover {
  background: #4a3a1d;
  border-color: var(--gold);
  border-bottom-color: #4a3a1d;
  color: var(--gold-bright);
  z-index: 2;
}

body.school-customer-page .char-panel-tabs button.char-tab img {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.82;
  filter: none;
  transition: opacity .15s ease;
}

body.school-customer-page .char-panel-tabs button.char-tab:hover img,
body.school-customer-page .char-panel-tabs button.char-tab.is-active img {
  opacity: 1;
}

/* ===== Customer UI rebuild: keep character panel internals untouched ===== */
body.school-customer-page {
  --customer-bg: #f4f6fb;
  --customer-surface: #ffffff;
  --customer-surface-2: #f8fafc;
  --customer-ink: #151923;
  --customer-muted: #687386;
  --customer-line: rgba(22, 28, 40, 0.12);
  --customer-gold: #b98232;
  --customer-blue: #2563eb;
  --customer-good: #15803d;
  --customer-bad: #b42318;
  --customer-shadow: 0 22px 70px rgba(25, 33, 48, 0.12);
  --customer-radius: 22px;
  --paper: var(--customer-bg);
  --panel: var(--customer-surface);
  --panel-2: var(--customer-surface-2);
  --ink: var(--customer-ink);
  --muted: var(--customer-muted);
  --line: var(--customer-line);
  --gold: var(--customer-gold);
  --gold-2: #d49b4c;
  --bg: var(--customer-bg);
  --gold-bright: var(--gold-2);
  --gold-soft: rgba(185, 130, 50, 0.18);
  --gold-faint: rgba(185, 130, 50, 0.08);
  --ink-dim: var(--customer-muted);
  --ink-muted: var(--customer-muted);
  --panel-line: var(--customer-line);
  --field-bg: #ffffff;
  --shadow: var(--customer-shadow);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(185, 130, 50, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 0%, rgba(37, 99, 235, 0.11), transparent 32rem),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  color: var(--customer-ink);
}

html.theme-dark body.school-customer-page,
body.school-customer-page.theme-dark {
  --customer-bg: #10131a;
  --customer-surface: #181c25;
  --customer-surface-2: #202633;
  --customer-ink: #f4ead4;
  --customer-muted: #b6ad9d;
  --customer-line: rgba(255, 255, 255, 0.13);
  --customer-gold: #d8b16a;
  --customer-blue: #5d8cff;
  --customer-good: #6fcf97;
  --customer-bad: #e07a7a;
  --customer-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 177, 106, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 0%, rgba(93, 140, 255, 0.12), transparent 32rem),
    linear-gradient(180deg, #11141b 0%, #0d1016 100%);
  color: var(--customer-ink);
}

body.school-customer-page::before,
body.school-customer-page::after {
  display: none;
}

body.school-customer-page .shell {
  min-height: 100vh;
  background: transparent;
}

body.school-customer-page .customer-topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  min-height: 76px;
  height: 76px;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--customer-line);
  background: color-mix(in srgb, var(--customer-bg) 84%, transparent);
  color: var(--customer-ink);
  box-sizing: border-box;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.school-customer-page .customer-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--customer-ink);
  text-decoration: none;
}

body.school-customer-page .customer-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}

body.school-customer-page .customer-brand small {
  display: block;
  color: var(--customer-gold);
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.school-customer-page .customer-brand strong {
  display: block;
  margin-top: 4px;
  color: var(--customer-ink);
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
}

body.school-customer-page .customer-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.school-customer-page .customer-theme-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--customer-line);
  border-radius: 12px;
  background: var(--customer-surface);
  color: var(--customer-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

body.school-customer-page .customer-theme-toggle svg {
  width: 18px;
  height: 18px;
}

body.school-customer-page .customer-theme-toggle:hover {
  border-color: rgba(185, 130, 50, 0.42);
  background: color-mix(in srgb, var(--customer-gold) 12%, var(--customer-surface));
  color: var(--customer-ink);
}

body.school-customer-page .site-topbar-host {
  height: 76px;
  flex: 0 0 76px;
}

body.school-customer-page .site-topbar-customer {
  min-height: 76px;
  padding: 0;
  border-bottom: 1px solid var(--customer-line);
  background: color-mix(in srgb, var(--customer-bg) 84%, transparent);
  box-shadow: none;
  color: var(--customer-ink);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.school-customer-page .site-topbar-customer .site-topbar-brand {
  height: 76px;
  padding: 0 clamp(18px, 3vw, 36px);
}

body.school-customer-page .site-topbar-customer .site-topbar-logo {
  width: 50px;
  height: 50px;
}

body.school-customer-page .site-topbar-customer .site-topbar-logo img {
  transform: none;
}

body.school-customer-page .site-topbar-customer .site-topbar-title {
  color: var(--customer-ink);
}

body.school-customer-page .site-topbar-customer .site-topbar-nav {
  height: 76px;
  padding: 0 clamp(18px, 3vw, 36px) 0 0;
}

body.school-customer-page .site-topbar-theme,
body.school-customer-page .site-topbar-logout,
body.school-customer-page .icon-btn,
body.school-customer-page #chat-form button,
body.school-customer-page .viewer-test-log-copy,
body.school-customer-page .viewer-test-log-toggle {
  border: 1px solid var(--customer-line);
  background: var(--customer-surface);
  color: var(--customer-ink);
  box-shadow: none;
}

body.school-customer-page .site-topbar-theme:hover,
body.school-customer-page .site-topbar-logout:hover,
body.school-customer-page .icon-btn:hover,
body.school-customer-page #chat-form button:hover {
  border-color: rgba(185, 130, 50, 0.42);
  background: color-mix(in srgb, var(--customer-gold) 12%, var(--customer-surface));
  color: var(--customer-ink);
}

body.school-customer-page .live-main {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 76px);
  margin: 0;
  padding: 0;
}

body.school-customer-page .gate {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 76px);
  margin: 0;
  padding: clamp(18px, 3vw, 42px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.school-customer-page .gate-hero,
body.school-customer-page .gate .card {
  border: 1px solid var(--customer-line);
  border-radius: var(--customer-radius);
  box-shadow: var(--customer-shadow);
}

body.school-customer-page .gate-hero {
  min-height: 620px;
  padding: clamp(32px, 5vw, 70px);
  background:
    linear-gradient(90deg, rgba(8, 11, 18, 0.72), rgba(8, 11, 18, 0.36)),
    radial-gradient(circle at 82% 82%, rgba(216, 177, 106, 0.25), transparent 26rem),
    url("/login_bg.png") center / cover no-repeat,
    linear-gradient(135deg, #262b36, #485260);
  overflow: hidden;
}

body.school-customer-page .gate-hero::before {
  display: none;
}

body.school-customer-page .gate-brand img {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

body.school-customer-page .gate-brand strong {
  color: #ffffff;
}

body.school-customer-page .gate-brand small,
body.school-customer-page .gate-hero .eyebrow {
  color: #f0bd61;
}

body.school-customer-page .gate-hero h1 {
  max-width: 700px;
  margin-top: 20px;
  color: #ffffff;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

body.school-customer-page .gate-hero p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.76);
}

body.school-customer-page .gate-points {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.school-customer-page .gate-points div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.school-customer-page .gate-points b {
  color: #ffffff;
}

body.school-customer-page .gate-points span {
  color: rgba(255, 255, 255, 0.68);
}

body.school-customer-page .gate .card {
  display: grid;
  align-content: center;
  min-height: 620px;
  padding: clamp(28px, 4vw, 54px);
  background: var(--customer-surface);
  color: var(--customer-ink);
  overflow: hidden;
}

body.school-customer-page .gate-card-head .eyebrow {
  color: var(--customer-blue);
}

body.school-customer-page .gate-card-head h2 {
  color: var(--customer-ink);
}

body.school-customer-page .gate-card-head p,
body.school-customer-page .hint,
body.school-customer-page .pref,
body.school-customer-page .link-button,
body.school-customer-page #status,
body.school-customer-page #feedback-status,
body.school-customer-page .topbar-feedback-status {
  color: var(--customer-muted);
}

body.school-customer-page .gate input,
body.school-customer-page .gate select,
body.school-customer-page .gate textarea {
  border: 1px solid var(--customer-line);
  border-radius: 14px;
  background: var(--field-bg);
  color: var(--customer-ink);
  box-shadow: none;
}

body.school-customer-page .gate input:focus,
body.school-customer-page .gate select:focus,
body.school-customer-page .gate textarea:focus,
body.school-customer-page #chat-form input:focus {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

body.school-customer-page .gate button:not(.link-button),
body.school-customer-page .gate .btn {
  border: 0;
  border-radius: 13px;
  background: var(--customer-blue);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

body.school-customer-page .gate .account-links .link-button {
  min-height: 50px;
  border: 0;
  border-radius: 13px;
  background: var(--customer-blue);
  color: #ffffff;
  padding: 0 15px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
  text-decoration: none;
}

body.school-customer-page .gate .account-links .link-button:hover {
  background: var(--customer-blue);
  color: #ffffff;
  text-decoration: none;
  filter: brightness(1.04);
}

body.school-customer-page .gate #access-form button[type="submit"] {
  border-radius: 13px;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
  border-bottom-right-radius: 13px;
  border-bottom-left-radius: 13px;
}

body.school-customer-page .viewer {
  width: 100%;
}

body.school-customer-page.is-viewing .live-main,
body.live-check-page.school-customer-page.is-viewing .live-main {
  min-height: calc(100vh - 76px);
  padding: clamp(14px, 2vw, 28px);
}

body.school-customer-page .viewer-grid {
  width: 100%;
  display: grid;
  gap: clamp(14px, 1.8vw, 24px);
  align-items: start;
}

body.school-customer-page .viewer-main,
body.school-customer-page .viewer-side,
body.school-customer-page .viewer-stats {
  min-width: 0;
}

body.school-customer-page .viewer-broadcast,
body.school-customer-page .card.chat-card {
  border: 1px solid var(--customer-line);
  border-radius: 22px;
  background: var(--customer-surface);
  box-shadow: var(--customer-shadow);
  overflow: hidden;
}

body.school-customer-page .viewer-tabs {
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--customer-line);
  background: var(--customer-surface);
}

body.school-customer-page .viewer-tabs-timer,
body.school-customer-page .chat-sender {
  color: var(--customer-gold);
}

body.school-customer-page .viewer-tabs-apm {
  min-height: 38px;
  border: 1px solid var(--customer-line);
  border-radius: 999px;
  background: var(--customer-surface-2);
  color: var(--customer-gold);
}

body.school-customer-page .viewer-test-log {
  display: none !important;
}

body.school-customer-page .video-shell {
  border-radius: 0;
  background: #000;
}

body.school-customer-page .chat-card-head {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--customer-line);
}

body.school-customer-page .chat-card-head h2,
body.school-customer-page .chat-text {
  color: var(--customer-ink);
}

body.school-customer-page #chat-log {
  border: 0;
  background: var(--customer-surface);
  color: var(--customer-ink);
}

body.school-customer-page .chat-time {
  color: var(--customer-muted);
}

body.school-customer-page #chat-form {
  border-top: 1px solid var(--customer-line);
}

body.school-customer-page #chat-form input {
  border: 1px solid var(--customer-line);
  border-radius: 14px;
  background: var(--field-bg);
  color: var(--customer-ink);
}

body.school-customer-page #chat-form button {
  aspect-ratio: auto;
  border-radius: 14px;
  background: var(--customer-surface-2);
  font-weight: 800;
}

body.school-customer-page .chat-card-actions #feedback-up {
  border-color: rgba(21, 128, 61, 0.24);
  background: color-mix(in srgb, var(--customer-good) 10%, var(--customer-surface));
  color: var(--customer-good);
}

body.school-customer-page .chat-card-actions #feedback-down {
  border-color: rgba(180, 35, 24, 0.24);
  background: color-mix(in srgb, var(--customer-bad) 10%, var(--customer-surface));
  color: var(--customer-bad);
}

body.school-customer-page .modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.school-customer-page .site-modal {
  border: 1px solid var(--customer-line);
  border-radius: 22px;
  background: var(--customer-surface);
  color: var(--customer-ink);
  box-shadow: var(--customer-shadow);
}

body.school-customer-page .site-modal h2 {
  color: var(--customer-ink);
}

body.school-customer-page .site-modal p {
  color: var(--customer-muted);
}

body.school-customer-page .viewer-unavailable {
  background: color-mix(in srgb, var(--customer-bg) 92%, transparent);
}

body.school-customer-page .viewer-unavailable strong {
  color: var(--customer-ink);
}

body.school-customer-page .viewer-unavailable p {
  color: var(--customer-muted);
}

@media (min-width: 1024px) {
  body.school-customer-page .viewer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    grid-template-rows: auto auto;
    grid-template-areas:
      "main side"
      "stats stats";
  }

  body.school-customer-page .viewer-main {
    grid-area: main;
  }

  body.school-customer-page .viewer-side {
    grid-area: side;
  }

  body.school-customer-page .viewer-stats {
    grid-area: stats;
  }
}

@media (max-width: 1023px) {
  body.school-customer-page .gate {
    grid-template-columns: 1fr;
  }

  body.school-customer-page .gate-hero,
  body.school-customer-page .gate .card {
    min-height: auto;
  }

  body.school-customer-page .viewer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.school-customer-page .customer-topbar {
    min-height: 68px;
    height: 68px;
    padding: 0 var(--page-gutter);
  }

  body.school-customer-page .customer-brand img {
    width: 44px;
    height: 44px;
  }

  body.school-customer-page .customer-brand small {
    display: none;
  }

  body.school-customer-page .site-topbar-host {
    height: 68px;
    flex-basis: 68px;
  }

  body.school-customer-page .site-topbar-customer,
  body.school-customer-page .site-topbar-customer .site-topbar-brand,
  body.school-customer-page .site-topbar-customer .site-topbar-nav {
    height: 68px;
    min-height: 68px;
  }

  body.school-customer-page .site-topbar-customer .site-topbar-brand {
    padding-left: 14px;
    padding-right: 10px;
  }

  body.school-customer-page .site-topbar-customer .site-topbar-nav {
    padding-right: 14px;
  }

  body.school-customer-page .site-topbar-customer .site-topbar-kicker {
    display: none;
  }

  body.school-customer-page .gate {
    min-height: calc(100vh - 68px);
    padding: 12px;
  }

  body.school-customer-page .gate-hero {
    display: none;
  }

  body.school-customer-page .gate .card {
    min-height: calc(100vh - 92px);
    border-radius: 20px;
    padding: 24px 18px;
  }

  body.school-customer-page.is-viewing .live-main,
  body.live-check-page.school-customer-page.is-viewing .live-main {
    padding: 10px;
  }

  body.school-customer-page .viewer-broadcast,
  body.school-customer-page .card.chat-card {
    border-radius: 18px;
  }
}

/* ===== Customer visual alignment: main page metrics only ===== */
body.school-customer-page .site-topbar-customer {
  height: 76px;
  min-height: 76px;
  box-sizing: border-box;
}

body.school-customer-page .site-topbar-customer .site-topbar-brand {
  padding-left: var(--page-gutter);
  padding-right: 0;
}

body.school-customer-page .site-topbar-customer .site-topbar-nav {
  padding-left: 0;
  padding-right: var(--page-gutter);
}

body.school-customer-page .site-topbar-customer .site-topbar-logo {
  width: 48px;
  height: 48px;
}

body.school-customer-page .gate {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}

body.school-customer-page.is-viewing .gate,
body.live-check-page.school-customer-page.is-viewing .gate {
  display: none;
}

body.school-customer-page.is-viewing .live-main,
body.live-check-page.school-customer-page.is-viewing .live-main {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
