:root {
  /* Seoltab-inspired Modern Violet + Crisp Ink + Pure White Aesthetic */
  --violet: #6342F5;
  --violet-hover: #5030DF;
  --violet-light: #8B6BFF;
  --violet-soft: #F4F1FF;
  --violet-tint: #EAE4FF;
  --violet-grad: linear-gradient(135deg, #6342F5 0%, #8B6BFF 100%);

  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --ink: #161822;
  --ink-2: #43475D;
  --muted: #7A7E96;
  --line: #ECECF4;
  --line-strong: #DCDCE8;

  /* Unified Editorial Typography Scale (Enhanced Legibility for 32" Monitor & Tablets) */
  --fs-xs: 13px;
  --fs-sm: 14.5px;
  --fs-base: 15.5px;
  --fs-md: 17px;
  --fs-lg: 26px;
  --fs-xl: 34px;

  --red: #E11D48;
  --red-soft: #FFF1F4;
  --blue: #2563EB;
  --blue-soft: #EFF6FF;
  --green: #059669;
  --green-soft: #ECFDF5;
  --amber: #D97706;
  --amber-soft: #FFFBEB;

  --radius: 16px;
  --radius-pill: 999px;
  --page-max: 980px;
  --shadow-sm: 0 2px 10px rgba(22, 24, 34, 0.04);
  --shadow-md: 0 8px 24px rgba(34, 24, 96, 0.075);
  --shadow-float: 0 12px 32px rgba(22, 24, 34, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.58;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  overflow-x: clip;
  max-width: 100%;
  font-feature-settings: "tnum" 1;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; letter-spacing: inherit; }
button { cursor: pointer; }

/* Boot */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 12px;
}
.boot-spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--violet-tint);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Clean Airy Top Bar (Aligned to --page-max for Visual Harmony & iPad Readiness) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 6px max(20px, env(safe-area-inset-right)) 6px max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-inner {
  width: 100%;
  max-width: calc(var(--page-max) - 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
body.in-studio .topbar-inner {
  max-width: 100%;
}
body.in-studio #mc-chat-fab,
body.in-studio #mc-chat-drawer,
body.in-studio #mc-class-alarm {
  display: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.role-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.role-pill.coach { background: var(--violet-soft); color: var(--violet); }
.role-pill.student { background: var(--blue-soft); color: var(--blue); }

.nav-simple {
  display: flex;
  gap: 4px;
  background: #F3F2FA;
  padding: 4px;
  border-radius: var(--radius-pill);
}
.nav-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--muted);
  transition: all 0.16s;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.active {
  background: var(--surface);
  color: var(--violet);
  box-shadow: 0 2px 8px rgba(99, 66, 245, 0.12);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Container & Page Headings */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  min-width: 0;
}
.container > *,
.container .card,
.container .cal-wrap,
.container .live-home-banner,
.container .mic-check-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.head-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.3;
}
.head-title .accent { color: var(--violet); }
.head-sub {
  margin: 5px 0 0;
  font-size: var(--fs-base);
  color: var(--muted);
  font-weight: 450;
}

.sec-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
  margin: 26px 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-count {
  background: var(--violet-soft);
  color: var(--violet);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

/* Course Roadmap Progress Card (Minimal 8-Lecture Strip) */
.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.course-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.course-kicker {
  display: inline-block;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  margin-right: 7px;
}
.course-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.course-stat {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 500;
}
.course-stat b { color: var(--violet); font-weight: 700; }
.course-track {
  width: 100%;
  height: 7px;
  background: #EFEFF7;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 12px;
}
.course-fill {
  height: 100%;
  background: var(--violet-grad);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}
.course-pills {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.course-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #FAF9FE;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.14s;
}
.course-pill:hover { border-color: var(--violet); transform: translateY(-1px); }
.course-pill.st-PASSED { background: var(--green-soft); border-color: #A7F3D0; color: var(--green); }
.course-pill.st-RESUBMIT_NEEDED { background: var(--red-soft); border-color: #FECDD3; color: var(--red); }
.course-pill.st-SUBMITTED { background: var(--violet); border-color: var(--violet); color: #FFFFFF; box-shadow: 0 3px 10px rgba(99, 66, 245, 0.24); }
.course-pill.st-ASSIGNED { background: #F7F7FC; border-color: var(--line); color: var(--muted); }
.cp-mark { font-size: 11px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.item-card:hover {
  border-color: #CFC5FF;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.item-card.urgent {
  border-color: #DACFFF;
  background: linear-gradient(90deg, #FAF8FF 0%, #FFFFFF 36%);
}
.item-card.done { opacity: 0.88; }

.item-title {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.025em;
  color: var(--ink);
}
.item-meta {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 4px;
  font-weight: 450;
}
.item-note {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  background: var(--red-soft);
  color: #9F1239;
  border: 1px solid #FECDD3;
}
.item-memo {
  margin-top: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  background: var(--violet-soft);
  color: #4C1D95;
}
.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pill Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.8px;
  font-weight: 700;
  white-space: nowrap;
}
.st-ASSIGNED { background: #F2F3F7; color: #525266; }
.st-SUBMITTED { background: var(--violet-soft); color: var(--violet); }
.st-RESUBMIT_NEEDED { background: var(--red-soft); color: var(--red); }
.st-PASSED, .st-REVIEWED, .st-FEEDBACK_SENT { background: var(--green-soft); color: var(--green); }

/* Pill & Soft-Rounded Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1.2px solid transparent;
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--violet-grad);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(99, 66, 245, 0.28);
}
.btn-primary:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn-red {
  background: var(--red);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.24);
}
.btn-red:hover { background: #BE123C; transform: translateY(-1px); }
.btn-outline {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line-strong);
}
.btn-outline:hover { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
}
.btn-ghost:hover { background: #F2F1FA; color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 12.8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Inputs */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 13px;
  border: 1.2px solid var(--line-strong);
  border-radius: 11px;
  background: #FFFFFF;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3.5px rgba(99, 66, 245, 0.12); }
textarea.input { resize: vertical; min-height: 78px; }

/* Entry Screen — Clean Seoltab Hero Style */
.entry-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 86% 16%, rgba(139, 107, 255, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 12% 88%, rgba(99, 66, 245, 0.10) 0%, transparent 38%),
    #FFFFFF;
}
.entry-box {
  width: 100%;
  max-width: 600px;
  text-align: center;
}
.entry-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 16px;
}
.entry-box h1 {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.entry-box h1 span { color: var(--violet); }
.entry-box p {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.entry-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  padding: 30px 22px;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.entry-card:hover {
  border-color: var(--violet);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(99, 66, 245, 0.14);
}
.entry-icon-circle {
  width: 58px; height: 58px;
  border-radius: 18px;
  background: var(--violet-soft);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.entry-role { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.025em; }
.entry-desc { font-size: 13px; color: var(--muted); font-weight: 500; }

details.manual-login {
  text-align: left;
  background: #FAF9FF;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
}
details.manual-login summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

/* =========================================================================
   GOODNOTES / NOTABILITY STYLE FLOATING MATH CANVAS STUDIO
   ========================================================================= */
.studio-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  background: #EFEEF6;
  overflow: hidden;
  position: relative;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* GoodNotes 6-Style Single-Row Icon Toolbar (Auto 2-Row on iPad) */
.studio-top {
  background: #23335A;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px max(14px, env(safe-area-inset-right)) 7px max(14px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  z-index: 32;
}
.st-title-lbl {
  font-weight: 800;
  font-size: 13.8px;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#st-panel-tog.is-on {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
}
.studio-top .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}
.studio-top .btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  color: #FFFFFF;
}
.gn-dock {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gn-dock::-webkit-scrollbar { display: none; }
.gn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 38px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  font-size: 12px;
  transition: all 0.14s;
  position: relative;
  flex-shrink: 0;
}
.gn-btn:hover { background: rgba(255, 255, 255, 0.13); color: #FFFFFF; }
.gn-btn.active {
  background: #E7ECF8;
  color: #1A2747;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.gn-btn.active.red {
  background: #FFE4E9;
  color: #C81E45;
}
.gn-btn.recording {
  background: #E11D48;
  color: #FFFFFF;
  animation: pulseRec 1.2s ease-in-out infinite;
}
@keyframes pulseRec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(225, 29, 72, 0); }
}
.gn-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.gn-btn .gn-caret { width: 11px; height: 11px; margin-left: -1px; opacity: 0.72; }
.gn-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 4px;
  flex-shrink: 0;
}

.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 2px 4px;
}
.page-pill .gn-btn { width: 28px; height: 28px; border-radius: 50%; }
.gn-toc-select {
  max-width: 196px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
}
.gn-toc-select:hover, .gn-toc-select:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}
.gn-toc-select option {
  background: #1E2B4A;
  color: #FFFFFF;
}
.gn-page-inp {
  width: 40px;
  padding: 2px 2px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  text-align: center;
  font-size: 12.2px;
  font-weight: 800;
  outline: none;
  -moz-appearance: textfield;
}
.gn-page-inp::-webkit-outer-spin-button,
.gn-page-inp::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.gn-page-inp:focus {
  background: rgba(255, 255, 255, 0.28);
}
.gn-view-seg {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}
.gn-vbtn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.4px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: all 0.14s;
  white-space: nowrap;
}
.gn-vbtn:hover { color: #FFFFFF; }
.gn-vbtn.active {
  background: #FFFFFF;
  color: #1E2B4A;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.sub-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-divider { width: 1px; height: 18px; background: var(--line-strong); }

.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1.2px #D1D5DB;
  padding: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.color-swatch.active {
  transform: scale(1.16);
  box-shadow: 0 0 0 2.4px var(--violet);
}

.chip-opt {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}
.chip-opt.active {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
}

/* GoodNotes 6 Floating Dark Options Pill Capsule */
.gn-capsule {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(34, 36, 44, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #FFFFFF;
  font-size: 12.2px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(15, 16, 28, 0.28);
  max-width: calc(100% - 20px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}
.gn-capsule::-webkit-scrollbar { display: none; }
.gn-cap-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.gn-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 12.2px;
  font-weight: 700;
  transition: background 0.14s;
}
.gn-mode-btn:hover { background: rgba(255, 255, 255, 0.24); }
.gn-mode-btn.on { background: #3B82F6; color: #FFFFFF; }
.gn-mode-btn.violet { background: var(--violet); color: #FFFFFF; }
.gn-mode-btn.danger { background: rgba(225, 29, 72, 0.8); color: #FFFFFF; }

.gn-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.8px;
  font-weight: 700;
  transition: all 0.14s;
}
.gn-toggle-btn:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.gn-toggle-btn.on {
  background: rgba(59, 130, 246, 0.28);
  color: #93C5FD;
  box-shadow: inset 0 0 0 1.4px #3B82F6;
}

/* GoodNotes 6 Checkered-Circle Eraser Size Selector */
.gn-eraser-sizes {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}
.gn-eraser-dot {
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background-color: #FFFFFF;
  background-image: repeating-conic-gradient(#DCDFE8 0% 25%, #FFFFFF 0% 50%);
  background-size: 6px 6px;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  flex-shrink: 0;
}
.gn-eraser-dot:hover { transform: scale(1.08); }
.gn-eraser-dot.active {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.45);
}

/* Capsule Pen Size & Color Swatches */
.gn-pen-dot-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.gn-pen-dot-btn.active {
  border-color: #60A5FA;
  background: rgba(59, 130, 246, 0.25);
}
.gn-pen-dot {
  border-radius: 50%;
  background: #FFFFFF;
  display: block;
}
.gn-swatch {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.78);
  padding: 0;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}
.gn-swatch.active {
  transform: scale(1.18);
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2.4px #3B82F6;
}

/* Main Split Area */
.studio-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.studio-body.panel-collapsed {
  grid-template-columns: minmax(0, 1fr) 0px;
}
.studio-body.panel-collapsed .studio-panel {
  display: none;
}
.studio-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 32, 0.34);
  z-index: 54;
}
.studio-drawer-backdrop.open { display: block; }
.drawer-head-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.ipad-quick-bar {
  display: none;
}
.canvas-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  min-width: 0;
}
.canvas-area {
  flex: 1;
  overflow: auto;
  padding: 66px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.page-frame {
  position: relative;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(24, 18, 66, 0.12);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  flex-shrink: 0;
}
.page-frame canvas.pdf-layer { display: block; position: relative; z-index: 1; }
.ws-doc-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
  background: #FFFFFF;
  padding: 22px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-sizing: border-box;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;
}
.ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ECEAF5;
  flex-shrink: 0;
}
.ws-head-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ws-book-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #6342F5;
  color: #FFFFFF;
  font-size: 11.4px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ws-chap-title {
  font-size: 14px;
  font-weight: 800;
  color: #161822;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-counter {
  font-size: 12.2px;
  font-weight: 700;
  color: #8B8AA0;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ws-concept-card {
  background: #F8F6FF;
  border: 1.2px solid #DED6FA;
  border-radius: 13px;
  padding: 14px 18px;
  flex-shrink: 0;
}
.ws-concept-title {
  font-size: 14px;
  font-weight: 800;
  color: #5B38F0;
  margin-bottom: 7px;
  letter-spacing: -0.02em;
}
.ws-concept-desc {
  margin: 0 0 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E7E1FB;
  font-size: 13.2px;
  line-height: 1.65;
  color: #2B2A42;
  font-weight: 500;
  word-break: keep-all;
}
.ws-concept-desc .katex {
  font-size: 1.04em;
  color: #161822;
  white-space: nowrap;
}
.ws-concept-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-concept-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  line-height: 1.62;
  color: #3B3A52;
  word-break: keep-all;
}
.ws-concept-item b {
  color: #16152B;
  font-weight: 800;
  min-width: 118px;
  flex-shrink: 0;
  margin-right: 0;
}
.ws-concept-item > span {
  flex: 1;
  min-width: 0;
}
.ws-concept-item .katex {
  font-size: 1.06em;
  color: #161822;
  display: inline-block;
  white-space: nowrap;
}

.ws-prob-card {
  background: #FFFFFF;
  border: 1.1px solid #E4E0F5;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.ws-prob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #F8F7FE;
  border-bottom: 1px solid #ECEAF6;
}
.ws-prob-hl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-prob-pill {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 10px;
  border-radius: 999px;
  background: #ECE7FF;
  color: #6342F5;
  font-size: 11.4px;
  font-weight: 800;
}
.ws-prob-stage {
  font-size: 12px;
  font-weight: 700;
  color: #4A4960;
}
.ws-tex-badge {
  font-size: 10px;
  font-weight: 800;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 1px 6px;
  border-radius: 999px;
}
.ws-prob-pg {
  font-size: 11px;
  font-weight: 600;
  color: #9493AA;
}
.ws-prob-body {
  padding: 15px 18px 16px;
  background: #FFFFFF;
}
.ws-prob-body.is-img {
  padding: 11px 16px 13px;
}
/* Pixel-for-pixel clean Pretendard + KaTeX typography matching reference worksheet */
.ws-md-body {
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.9;
  color: #161822;
  letter-spacing: -0.015em;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ws-md-body .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 8px 0;
  padding-bottom: 2px;
}
.ws-md-body .ws-md-p { margin: 0 0 9px; }
.ws-md-body .ws-md-p:last-child { margin-bottom: 0; }
.ws-md-body .ws-md-sub { margin: 7px 0; line-height: 2.15; }
.ws-md-body .ws-md-choice {
  margin: 8px 0 2px;
  font-size: 15.5px;
  line-height: 2.15;
  letter-spacing: 0.01em;
}
.ws-md-body .ws-md-choice .katex { font-size: 1.15em; }
.ws-md-body .ws-md-box {
  margin: 11px 0;
  padding: 13px 17px;
  border: 1.5px solid #D6D1EA;
  border-radius: 10px;
  background: #FAF9FF;
  font-size: 15.2px;
  line-height: 1.92;
  color: #141622;
}
.ws-md-body .ws-md-box > div { margin-bottom: 4px; }
.ws-md-body .ws-md-box > div:last-child { margin-bottom: 0; }
.ws-md-body .ws-md-box .katex { font-size: 1.12em; }
.ws-md-body .ws-md-table {
  margin: 12px auto;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.65;
  color: #0F172A;
  background: #FFFFFF;
  border: 1.5px solid #C7C3DE;
}
.ws-md-body .ws-md-table tr:first-child td {
  background: #F4F2FC;
  font-weight: 700;
  color: #1E1B4B;
}
.ws-md-body .ws-md-table td {
  border: 1px solid #CBC7DF;
  padding: 8px 16px;
  text-align: center;
  min-width: 64px;
  font-variant-numeric: tabular-nums;
}
.ws-md-body .ws-md-table .katex { font-size: 1.13em; }
.ws-md-body .ws-md-fig {
  margin: 12px 0 6px;
  display: flex;
  justify-content: center;
}
.ws-md-body .ws-fig-img {
  display: block;
  max-width: min(100%, 640px);
  max-height: 380px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #ECEAF5;
  background: #FFFFFF;
  padding: 4px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  image-rendering: -webkit-optimize-contrast;
}
.ws-md-body .ws-fig-img:hover {
  box-shadow: 0 4px 16px rgba(99, 66, 245, 0.14);
}
.ws-md-body .katex { font-size: 1.1em; color: #11131C; }
.ws-crop-img {
  display: block;
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: contrast(1.06) brightness(1.02);
}

.ws-grid-card {
  flex: 1 0 560px;
  min-height: 560px;
  background: #FFFFFF;
  border: 1px solid #EAE8F5;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ws-grid-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #8D8CA5;
  border-bottom: 1px dashed #F0EFF8;
}
.ws-grid-expand-btn {
  pointer-events: auto;
  border: 1px solid #DDD8F5;
  background: #F8F6FF;
  color: #5B38F0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.ws-grid-expand-btn:hover {
  background: #ECE7FF;
}
/* Live Mic Check & Real-Time Moving Level Bars */
.live-meter-track {
  display: inline-block;
  width: 58px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
  margin-left: 4px;
  vertical-align: middle;
}
.live-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #10B981;
  transition: width 60ms linear, background-color 120ms ease;
}
.mic-check-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E0F2;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.mic-check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mic-eq-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  padding: 4px 10px;
  background: #F6F5FC;
  border: 1px solid #E5E1F6;
  border-radius: 10px;
  min-width: 148px;
}
.mic-eq-bar {
  flex: 1;
  min-width: 5px;
  height: 14%;
  border-radius: 999px;
  background: #A5B4FC;
  transition: height 55ms linear, background-color 100ms ease;
}
.mic-level-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ECEAF6;
  overflow: hidden;
  margin-top: 10px;
}
.mic-level-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10B981 0%, #34D399 70%, #F59E0B 100%);
  transition: width 55ms linear;
}
.live-prob-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #E2DFF2;
  background: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.live-prob-chip:hover {
  border-color: var(--accent, #6342F5);
  background: #F8F6FF;
}
.live-prob-chip.is-wrong { border-color: #FECDD3; background: #FFF1F2; color: #BE123C; }
.live-prob-chip.is-unsure { border-color: #DDD6FE; background: #F5F3FF; color: #6D28D9; }

/* Lesson Schedule Monthly Calendar */
.cal-wrap {
  background: #FFFFFF;
  border: 1.5px solid #E2E0F2;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.cal-rules-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.cal-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #F8F7FE;
  border: 1px solid #DFDBF5;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.cal-rule-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cal-month-lbl {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #E6E4F2;
  border-left: 1px solid #E6E4F2;
  border-radius: 10px;
  overflow: hidden;
}
.cal-dow {
  text-align: center;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 800;
  background: #F6F5FC;
  color: #4A4964;
  border-right: 1px solid #E6E4F2;
  border-bottom: 1px solid #E6E4F2;
}
.cal-dow.sun { color: #E11D48; }
.cal-dow.sat { color: #2563EB; }
.cal-cell {
  min-height: 78px;
  padding: 5px 6px;
  background: #FFFFFF;
  border-right: 1px solid #E6E4F2;
  border-bottom: 1px solid #E6E4F2;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-cell:hover { background: #FAF9FF; }
.cal-cell.is-other { background: #FAFAFC; opacity: 0.52; }
.cal-cell.is-today { background: #F5F3FF; }
.cal-cell.is-selected { box-shadow: inset 0 0 0 2px #6342F5; }
.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.cal-cell.is-sun .cal-day-num { color: #E11D48; }
.cal-cell.is-sat .cal-day-num { color: #2563EB; }
.cal-cell.is-today .cal-day-num {
  background: #6342F5;
  color: #FFFFFF;
  font-weight: 800;
}
.cal-ev {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.cal-day-detail {
  margin-top: 12px;
  padding: 12px 15px;
  border-radius: 10px;
  background: #FAF9FF;
  border: 1px solid #E4E0F7;
}
.wd-chip {
  min-width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #DBD8EE;
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
}
.wd-chip.on {
  background: #6342F5;
  border-color: #6342F5;
  color: #FFFFFF;
}

/* Pre-Class Alarm Banner (In-Flow Below Topbar, Pixel-Aligned to --page-max) */
#mc-class-alarm {
  position: relative;
  z-index: 30;
  width: 100%;
  max-width: var(--page-max);
  margin: 14px auto -10px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: none;
  flex-direction: column;
  gap: 8px;
}
.class-alarm-card {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 13px;
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 65%, #4338CA 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(30, 27, 75, 0.2);
  border: 1px solid rgba(199, 210, 254, 0.35);
  animation: alarmPop 0.2s ease-out;
}
.class-alarm-card.is-starting {
  background: linear-gradient(135deg, #881337 0%, #BE123C 60%, #E11D48 100%);
  border-color: rgba(254, 205, 211, 0.5);
}
@keyframes alarmPop {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 1:1 Coach <-> Student Floating Chat */
#mc-chat-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #5B38F0, #6342F5);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(99, 66, 245, 0.35);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
#mc-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 66, 245, 0.42);
}
.chat-unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #E11D48;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#mc-chat-drawer {
  position: fixed;
  right: 22px;
  bottom: 78px;
  z-index: 9600;
  width: min(370px, calc(100vw - 24px));
  height: min(500px, calc(100vh - 110px));
  background: #FFFFFF;
  border: 1.5px solid #DEDBF2;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(24, 18, 66, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-head {
  padding: 12px 15px;
  background: linear-gradient(135deg, #5B38F0, #6342F5);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #F8F7FC;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat-msg {
  max-width: 82%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.mine .chat-bubble {
  background: #6342F5;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}
.chat-msg.other .chat-bubble {
  background: #FFFFFF;
  color: #161822;
  border: 1px solid #E5E2F5;
  border-bottom-left-radius: 4px;
}
.chat-meta {
  font-size: 10.5px;
  color: #8B8AA0;
  padding: 0 3px;
}
.chat-foot {
  padding: 10px 12px;
  border-top: 1px solid #ECEAF5;
  background: #FFFFFF;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ws-grid-paper {
  flex: 1;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(to right, #F0EFF8 1px, transparent 1px),
    linear-gradient(to bottom, #F0EFF8 1px, transparent 1px);
  background-size: 22px 22px;
}

.page-frame canvas.ink-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  z-index: 4;
}
.page-frame canvas.laser-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.page-frame.palm-scroll canvas.ink-layer { touch-action: pan-x pan-y; }

/* GoodNotes-Style Transparent Rotatable Math Ruler Overlay */
.gn-ruler {
  position: absolute;
  width: 360px;
  height: 54px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1.5px solid #6342F5;
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(34, 24, 96, 0.18);
  z-index: 12;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(99, 66, 245, 0.45) 0px,
    rgba(99, 66, 245, 0.45) 1px,
    transparent 1px,
    transparent 12px
  );
  background-size: 100% 11px;
  background-repeat: no-repeat;
  background-position: top left;
}
.gn-ruler:active { cursor: grabbing; }
.gn-ruler-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 36, 44, 0.88);
  color: #FFFFFF;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  margin-top: 8px;
}
.gn-ruler-ctrl button {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
}
.gn-ruler-ctrl button:hover { background: rgba(255, 255, 255, 0.32); }

/* Voice Memo Mini Card in Right Panel */
.voice-card {
  background: #F6F4FF;
  border: 1px solid #DDD6FE;
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voice-card audio { width: 100%; height: 32px; }

/* GoodNotes-style Zoom Writing Box Dock */
.zoom-dock {
  background: #FFFFFF;
  border-top: 2px solid var(--violet);
  box-shadow: 0 -8px 24px rgba(30, 20, 88, 0.12);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 28;
}
.zoom-dock-head {
  padding: 6px 14px;
  background: var(--violet-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.2px;
  font-weight: 700;
  color: var(--violet);
}
.zoom-canvas-wrap {
  width: 100%;
  height: 196px;
  background: #FFFFFF;
  position: relative;
  overflow: hidden;
}
.zoom-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Right Feedback Panel */
.studio-panel {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.verdict-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.v-btn {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: #FFFFFF;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.v-btn.pass-on { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.v-btn.retry-on { background: var(--red-soft); color: var(--red); border-color: var(--red); }

.fold-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #FAF9FF;
  font-size: 12.8px;
}
.fold-box summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--violet);
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

/* Math Formula Keypad Modal (LaTeX Vector Engine) */
.math-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.math-palette-scroll {
  max-height: 215px;
  overflow-y: auto;
  padding-right: 3px;
  margin-bottom: 10px;
}
.math-cat-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: -0.01em;
  margin: 7px 0 4px;
}
.math-cat-title:first-child { margin-top: 0; }
.math-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 6px;
}
.mk-btn {
  padding: 6.5px 4px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #FAF9FF;
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  transition: all 0.12s;
}
.mk-btn:hover { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }
.math-preview {
  min-height: 68px;
  border: 1.4px dashed #CFC5FF;
  border-radius: 12px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 17px;
  overflow-x: auto;
}
.math-preview .katex-display { margin: 0; }

/* Inline LaTeX Quick-Insert Bar & Live KaTeX Preview in Notes/Feedback */
.note-latex-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.note-latex-hint {
  font-size: 11px;
  font-weight: 800;
  color: var(--violet);
  margin-right: 2px;
}
.note-snip-btn {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #DDD6FE;
  background: #FAF9FF;
  color: var(--ink-2);
  font-size: 11.4px;
  font-weight: 700;
  transition: all 0.12s;
}
.note-snip-btn:hover {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
}
.note-latex-preview {
  margin-top: 7px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed #CFC5FF;
  background: #FAF9FF;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.65;
}
.note-latex-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--violet);
  margin-bottom: 3px;
}
.rich-math-body {
  line-height: 1.65;
  word-break: break-word;
}
.rich-math-body .katex {
  font-size: 1.03em;
}
.rich-math-body .katex-display {
  margin: 6px 0;
  overflow-x: auto;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 26, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 510px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.modal.modal-wide { max-width: 720px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* =========================================================================
   STUDENT SYSTEMATIC CURRICULUM + TEXTBOOK SHELF + SIMPLE REGISTRATION UI
   ========================================================================= */
.seg-toggle {
  display: inline-flex;
  background: #F1F0F9;
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 3px;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
}
.seg-btn.active {
  background: #FFFFFF;
  color: var(--violet);
  box-shadow: 0 2px 8px rgba(99, 66, 245, 0.12);
}
.seg-cnt {
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Enrolled Course Switcher Tabs */
.course-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.course-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1.2px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 13.2px;
  font-weight: 700;
  transition: all 0.15s;
}
.course-tab:hover { border-color: var(--violet); color: var(--violet); }
.course-tab.active {
  background: var(--violet);
  border-color: var(--violet);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(99, 66, 245, 0.22);
}
.course-tab .ct-meta {
  font-size: 11.5px;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.course-tab:not(.active) .ct-meta {
  background: var(--violet-soft);
  color: var(--violet);
}

/* Unified Student Hero Progress + Next Action Card */
.stu-hero-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr);
  gap: 20px;
  align-items: center;
}
.stu-course-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.stu-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.6px;
  color: var(--muted);
}
.stu-stat-row b { color: var(--violet); font-weight: 700; }
.stu-dots { display: inline-flex; gap: 9px; flex-wrap: wrap; }
.stu-dots em { font-style: normal; font-weight: 600; font-size: 12px; }
.stu-dots .dot-g { color: var(--green); }
.stu-dots .dot-r { color: var(--red); }
.stu-dots .dot-v { color: var(--violet); }
.stu-dots .dot-m { color: var(--muted); }

.stu-next-box {
  background: #F8F7FF;
  border: 1px solid #E4DFFF;
  border-radius: 15px;
  padding: 14px 16px;
}
.stu-next-box.is-retry {
  background: #FFF5F7;
  border-color: #FECDD3;
}
.stu-next-kicker {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 4px;
}
.stu-next-box.is-retry .stu-next-kicker { color: var(--red); }
.stu-next-title {
  font-size: 14.8px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stu-next-sub {
  font-size: 12.3px;
  color: var(--muted);
  margin-top: 2px;
}

/* Systematic Chapter-Grouped Curriculum Tree */
.chapter-stack { display: flex; flex-direction: column; gap: 18px; }
.chapter-block {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chapter-head {
  padding: 13px 18px;
  background: #FAFAFE;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chapter-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.chapter-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--violet);
  background: var(--violet-soft);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.chapter-rows { display: flex; flex-direction: column; }
.lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.14s;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: #FCFCFF; }
.lesson-row.is-retry { background: #FFF9FA; }
.lesson-row.is-done { opacity: 0.9; }

.lesson-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.8px solid var(--line-strong);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.lesson-dot.st-PASSED { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.lesson-dot.st-RESUBMIT_NEEDED { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.lesson-dot.st-SUBMITTED { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }
.lesson-dot.st-ASSIGNED { background: #F7F7FB; border-color: #D6D6E4; color: var(--muted); }

.lesson-main { flex: 1; min-width: 210px; }
.lesson-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-title { font-size: 14.8px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.lesson-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12.4px;
  color: var(--muted);
}
.lesson-book-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-weight: 600;
}
.lesson-book-chip svg { width: 13px; height: 13px; color: var(--violet); }
.lesson-scope { color: var(--muted); }
.lesson-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* Student Textbook Shelf Grid */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.shelf-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s;
}
.shelf-card:hover { border-color: #CFC5FF; transform: translateY(-1px); }
.shelf-top { display: flex; align-items: flex-start; gap: 12px; }
.shelf-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--violet-soft);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shelf-course { font-size: 11.8px; font-weight: 700; color: var(--violet); }
.shelf-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
  line-height: 1.35;
}
.shelf-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shelf-note { font-size: 12px; color: var(--muted); }
.shelf-actions { display: flex; gap: 8px; margin-top: auto; }
.shelf-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.shelf-sec-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.shelf-sec-title svg { color: var(--violet); }
.shelf-sec-sub {
  font-size: 12.3px;
  color: var(--muted);
  font-weight: 500;
}
.shelf-toc-cnt {
  font-size: 11.4px;
  font-weight: 700;
  color: var(--muted);
  background: #F4F3FA;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.toc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.toc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid #E4E0FA;
  background: #FAF9FF;
  color: var(--ink-2);
  font-size: 11.8px;
  font-weight: 700;
  transition: all 0.14s;
}
.toc-chip:hover {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
  transform: translateY(-1px);
}
.toc-pg {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.toc-chip:hover .toc-pg { color: var(--violet); }

/* Coach Curriculum & PDF Management Helpers */
.course-mini-tag {
  font-size: 11.2px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #F2F1FA;
  color: var(--ink-2);
}
.cur-preview-fold {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12.6px;
}
.cur-preview-fold summary { cursor: pointer; font-weight: 700; color: var(--violet); }
.cur-preview-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.cur-preview-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #FAF9FF;
  font-size: 12.3px;
}
.cur-ch { font-weight: 700; color: var(--violet); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-lt { font-weight: 600; color: var(--ink); }
.cur-wb { color: var(--muted); font-size: 11.8px; white-space: nowrap; }

.filter-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-pill {
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.filter-pill.active { background: var(--violet); border-color: var(--violet); color: #FFFFFF; }

.wb-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.wb-list-row:last-child { border-bottom: none; }
.wb-icon-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--violet-soft);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wb-icon-sm.is-coach-only {
  background: var(--red-soft);
  color: var(--red);
}

/* Drag & Drop PDF Zone + Clean Modal Form Helpers */
.dropzone {
  border: 1.6px dashed #C7BCFF;
  background: #FAF9FF;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
  transition: all 0.15s;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--violet);
  background: var(--violet-soft);
}
.dropzone.has-file {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft);
}
.dz-icon { color: var(--violet); margin-bottom: 5px; }
.dropzone.has-file .dz-icon { color: var(--green); }
.dz-title { font-size: 13.8px; font-weight: 700; color: var(--ink); }
.dz-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.opt-box {
  background: #FAF9FF;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}
.chk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.chk-row input { accent-color: var(--violet); width: 15px; height: 15px; }

.nc-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}
.nc-row {
  display: grid;
  grid-template-columns: 120px 1fr 1.1fr auto;
  gap: 6px;
  align-items: center;
}
.nc-row .input { padding: 7px 9px; font-size: 12.6px; }

.btn-red-soft {
  background: var(--red-soft);
  color: var(--red);
  border-color: #FECDD3;
}
.btn-red-soft:hover {
  background: #FFE4E6;
  border-color: var(--red);
}

/* Studio Per-Page Problem O/△/X Check Card */
.bp-card {
  background: #FAF9FF;
  border: 1px solid #E5E0FA;
  border-radius: 14px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.bp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.bp-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}
.bp-cnt {
  font-size: 11px;
  font-weight: 800;
  color: var(--violet);
  background: var(--violet-soft);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.bp-sub {
  font-size: 11.4px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}
.bp-open-sheet {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid #D9D1FF;
  background: #FFFFFF;
  color: var(--violet);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s;
}
.bp-open-sheet:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: #FFFFFF;
}
.bp-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 235px;
  overflow-y: auto;
  padding-right: 2px;
}
.bp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.bp-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bp-no {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bp-stage {
  font-size: 10.6px;
  font-weight: 700;
  color: var(--muted);
  background: #F4F3FA;
  padding: 1.5px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.bp-stu-hint {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.bp-stu-hint.st-DONE { background: var(--green-soft); color: var(--green); }
.bp-stu-hint.st-UNSURE { background: #FEF3C7; color: #B45309; }
.bp-stu-hint.st-WRONG { background: var(--red-soft); color: var(--red); }
.bp-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.bp-btn {
  width: 28px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.12s;
}
.bp-btn.is-done:hover { border-color: var(--green); color: var(--green); }
.bp-btn.is-done.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.bp-btn.is-unsure:hover { border-color: #D97706; color: #D97706; }
.bp-btn.is-unsure.on { background: #F59E0B; border-color: #F59E0B; color: #FFFFFF; }
.bp-btn.is-wrong:hover { border-color: var(--red); color: var(--red); }
.bp-btn.is-wrong.on { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.bp-left-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.bp-left-btn:hover { background: var(--violet-soft); }
.bp-big-btns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.bp-big-btn {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1.2px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  transition: all 0.13s;
  white-space: nowrap;
}
.bp-big-btn.is-done:hover { border-color: var(--green); color: var(--green); }
.bp-big-btn.is-done.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.bp-big-btn.is-unsure:hover { border-color: #D97706; color: #D97706; }
.bp-big-btn.is-unsure.on { background: #F59E0B; border-color: #F59E0B; color: #FFFFFF; }
.bp-big-btn.is-wrong:hover { border-color: var(--red); color: var(--red); }
.bp-big-btn.is-wrong.on { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.bp-sib-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bp-sib-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.bp-sibs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.bp-sib {
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 11.4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: all 0.12s;
}
.bp-sib:hover { border-color: var(--violet); color: var(--violet); }
.bp-sib.st-DONE { background: var(--green-soft); border-color: #A7F3D0; color: #065F46; }
.bp-sib.st-UNSURE { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.bp-sib.st-WRONG { background: var(--red-soft); border-color: #FDA4AF; color: #9F1239; }
.bp-sib.cur {
  background: var(--violet);
  border-color: var(--violet);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(99, 66, 245, 0.25);
}
.bp-tex-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.bp-tex-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 11.4px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.13s;
}
.bp-tex-btn:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-soft); }
.bp-tex-btn.is-ai { border-color: #D9D1FF; background: #F5F2FF; color: var(--violet); }
.bp-tex-btn.is-ai:hover { background: var(--violet); border-color: var(--violet); color: #FFFFFF; }
.bp-tex-btn.on { background: #1E293B; border-color: #1E293B; color: #FFFFFF; }
.bp-batch-btn {
  width: 100%;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px dashed #CFC6FF;
  background: #FFFFFF;
  color: var(--violet);
  font-size: 11.4px;
  font-weight: 700;
  transition: all 0.13s;
}
.bp-batch-btn:hover { background: var(--violet-soft); border-style: solid; border-color: var(--violet); }
.bp-batch-btn.running { background: var(--red-soft); border-color: var(--red); color: var(--red); border-style: solid; }

.mde-lbl {
  font-size: 11.8px;
  font-weight: 800;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.mde-ref {
  background: #FAF9FF;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.mde-ref-img {
  display: block;
  max-width: 100%;
  max-height: 175px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #FFFFFF;
  border-radius: 6px;
}
.mde-prev-box {
  margin-top: 10px;
  padding: 13px 16px;
  background: #FFFFFF;
  border: 1.2px solid #E4E0F5;
  border-radius: 11px;
}
.ps-tile.has-tex::after {
  content: "TeX";
  font-size: 8.5px;
  font-weight: 800;
  color: #059669;
  margin-top: 1px;
}
.bp-foot {
  display: flex;
  gap: 6px;
}
.bp-foot-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 11.6px;
  font-weight: 700;
  transition: all 0.12s;
}
.bp-foot-btn:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-soft); }
.bp-foot-btn.is-warn { border-color: #FECDD3; background: var(--red-soft); color: var(--red); }
.bp-foot-btn.is-warn:hover { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.bp-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 2px;
}

/* Full Textbook Problem Matrix & Wrong-Answer Modal */
.modal.modal-sheet {
  width: min(860px, 94vw);
  max-width: 860px;
}
.ps-root {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ps-summary {
  background: #FAF9FF;
  border: 1px solid #E5E0FA;
  border-radius: 12px;
  padding: 11px 14px;
}
.ps-stat-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ps-stat {
  font-size: 12.6px;
  color: var(--ink-2);
  font-weight: 600;
}
.ps-stat b { font-weight: 800; color: var(--ink); }
.ps-stat.is-done b { color: var(--green); }
.ps-stat.is-unsure b { color: #D97706; }
.ps-stat.is-wrong b { color: var(--red); }
.ps-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ps-search { flex: 1.2; min-width: 190px; padding: 8px 12px; font-size: 13px; }
.ps-chap { flex: 1; min-width: 170px; padding: 8px 11px; font-size: 13px; }
.ps-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill.is-warn:not(.active) {
  border-color: #FECDD3;
  background: var(--red-soft);
  color: var(--red);
}
.ps-scroll {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ps-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.8px;
  font-weight: 800;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.ps-group-cnt { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}
.ps-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 4px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink);
  transition: all 0.12s;
}
.ps-tile:hover {
  border-color: var(--violet);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(99, 66, 245, 0.12);
}
.ps-tile.st-DONE {
  background: var(--green-soft);
  border-color: #A7F3D0;
  color: #065F46;
}
.ps-tile.st-UNSURE {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #92400E;
}
.ps-tile.st-WRONG {
  background: var(--red-soft);
  border-color: #FDA4AF;
  color: #9F1239;
}
.ps-no {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ps-sub {
  font-size: 10.6px;
  font-weight: 600;
  opacity: 0.78;
}
.ps-sym { font-weight: 900; }

#toast-root {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1B1B28;
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
}
.toast.ok { background: var(--violet); }
.toast.err { background: var(--red); }

/* =========================================================================
   MULTI-STUDENT (N명) MANAGEMENT, PICKER & ENTRY UI
   ========================================================================= */
.entry-stu-card {
  cursor: default;
  align-items: center;
  text-align: center;
}
.entry-stu-form {
  margin-top: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.entry-stu-form .input {
  padding: 8px 10px;
  font-size: 13px;
}
.stu-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stu-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stu-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-sm);
}
.stu-kpi-lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.stu-kpi b { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }

.stu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stu-card:hover { border-color: #CFC5FF; box-shadow: var(--shadow-md); }
.stu-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.stu-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.stu-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stu-goal { font-size: 12.4px; color: var(--muted); margin-top: 3px; }
.stu-code-pill {
  border: 1px solid #DDD6FE;
  background: var(--violet-soft);
  color: var(--violet);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.6px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  flex-shrink: 0;
}
.stu-code-pill:hover { background: var(--violet); color: #FFFFFF; }
.stu-prog-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stu-prog-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #FAF9FF;
  font-size: 11.8px;
  font-weight: 700;
  color: var(--ink-2);
  transition: all 0.12s;
}
.stu-prog-chip:not(.is-static):hover { border-color: var(--violet); color: var(--violet); background: var(--violet-soft); }
.stu-prog-chip.is-static { cursor: default; }
.spc-val { color: var(--violet); font-variant-numeric: tabular-nums; }
.spc-wrong {
  background: var(--red-soft);
  color: var(--red);
  padding: 0 5px;
  border-radius: 6px;
  font-size: 11px;
}
.stu-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.stu-book-hint { font-size: 11.8px; color: var(--muted); font-weight: 600; }
.stu-card-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.stu-multi-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stu-multi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stu-all-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--violet);
  cursor: pointer;
}
.stu-all-toggle input { accent-color: var(--violet); }
.stu-chk-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stu-chk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  font-size: 12.6px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
}
.stu-chk-pill:has(input:checked) {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
}
.stu-chk-pill input { accent-color: var(--violet); margin: 0; }

.stu-switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55dvh;
  overflow-y: auto;
}
.stu-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  text-align: left;
  transition: all 0.13s;
}
.stu-switch-row:hover { border-color: var(--violet); background: var(--violet-soft); }

/* =========================================================================
   2-Tier Subject Group Navigation (공통수학 / 대수 / 미적분 / 확률과 통계 / 기하 / 심화·본고사)
   ========================================================================= */
.subj-group-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.subj-group-bar::-webkit-scrollbar { display: none; }
.subj-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1.3px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--ink-2);
  font-size: 13.8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.subj-pill:hover { border-color: var(--violet); color: var(--violet); }
.subj-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 5px 14px rgba(22, 24, 34, 0.18);
}
.subj-pill .sp-cnt {
  font-size: 11.4px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: var(--radius-pill);
  background: #F3F2FA;
  color: var(--muted);
}
.subj-pill.active .sp-cnt {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}
.subj-pill .sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
}
.subj-pill.active .sp-dot { background: #A78BFA; }

.sub-subj-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sm-books-grouped {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.sm-subj-group {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px;
  background: #FAF9FF;
}
.sm-subj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
}
.sm-subj-all {
  border: none;
  background: transparent;
  color: var(--violet);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.sm-subj-all:hover { background: var(--violet-soft); }

/* Private 2-Tab Login & Sign-Up Card */
.login-card-box {
  max-width: 460px;
}
.auth-mode-bar {
  display: inline-flex;
  gap: 18px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 14px;
  padding: 0 8px;
}
.auth-mode-btn {
  border: none;
  background: transparent;
  padding: 7px 6px 9px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: all 0.15s;
}
.auth-mode-btn.active {
  color: var(--violet);
  border-bottom-color: var(--violet);
}
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #F1F0F9;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 18px;
}
.login-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.8px;
  font-weight: 800;
  transition: all 0.15s;
}
.login-tab.active {
  background: #FFFFFF;
  color: var(--violet);
  box-shadow: 0 3px 10px rgba(99, 66, 245, 0.14);
}
.login-form {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.login-privacy-note {
  margin-top: 13px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #F7F6FD;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Dual Persistent Session Switcher (Coach + Student Simultaneous Login) */
.dual-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft, #F3F2FA);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.dual-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}
.dual-pill:hover { color: var(--ink); }
.dual-pill.active {
  background: #FFFFFF;
  color: var(--violet);
  box-shadow: 0 2px 8px rgba(99, 66, 245, 0.16);
}
.dual-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
}
.dual-dot.off { background: #CBD5E1; }
.dual-resume-box {
  background: linear-gradient(135deg, #F6F3FF 0%, #EEF6FF 100%);
  border: 1.5px solid #DDD6FE;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 14px;
  text-align: left;
}
.dual-resume-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--violet);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dual-resume-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.dual-test-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #F8F7FE;
  border: 1px dashed #C4B5FD;
  text-align: center;
}
.dual-test-box p {
  margin: 0 0 9px;
  font-size: 12px;
  color: var(--muted);
}
.dual-test-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================================================================
   Real-Time Live Coaching (Voice + Ink + Laser + Nav Sync)
   ========================================================================= */
.st-live-btn.live-on {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FCA5A5;
  font-weight: 800;
}
.live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 14px;
  background: linear-gradient(90deg, #1E1B4B 0%, #312E81 100%);
  color: #FFFFFF;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 25;
}
.live-bar-left, .live-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
}
.live-status-pill.connected {
  background: rgba(16, 185, 129, 0.24);
  color: #A7F3D0;
}
.live-status-pill.waiting {
  background: rgba(251, 191, 36, 0.22);
  color: #FDE68A;
}
.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: livePulse 1.5s infinite;
  flex-shrink: 0;
}
.live-status-pill.connected .live-pulse-dot {
  background: #34D399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.live-transport-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #E0E7FF;
  font-size: 11px;
  font-weight: 700;
}
.live-hint-txt {
  font-size: 11.8px;
  color: rgba(255, 255, 255, 0.78);
}
.live-voice-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #E0E7FF;
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.12s;
}
.live-voice-chip.speaking {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}
.live-ctrl-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}
.live-ctrl-btn:hover { background: rgba(255, 255, 255, 0.2); }
.live-ctrl-btn.on {
  background: rgba(99, 66, 245, 0.55);
  border-color: #A5B4FC;
}
.live-ctrl-btn.speaking {
  background: #10B981;
  border-color: #6EE7B7;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}
.live-ctrl-btn.muted {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(252, 165, 165, 0.5);
  color: #FECACA;
}
.live-ctrl-btn.end {
  background: #DC2626;
  border-color: #EF4444;
  color: #FFFFFF;
}
.live-home-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FEF2F2 0%, #F5F3FF 100%);
  border: 1.5px solid #DDD6FE;
  box-shadow: 0 4px 14px rgba(99, 66, 245, 0.08);
}
.live-home-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

/* =========================================================================
   Ultra-Clean Per-Student Workbook Focus View (Zero Curriculum Clutter)
   ========================================================================= */
.my-wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.my-wb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.my-wb-card:hover {
  border-color: #D4CBFF;
  box-shadow: 0 8px 24px rgba(99, 66, 245, 0.08);
}
.my-wb-title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.my-wb-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.my-wb-acts {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.mini-lib-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.mini-lib-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #FAF9FE;
  border: 1px solid #EAE6FA;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.mini-lib-row:hover {
  background: #FFFFFF;
  border-color: #CFC6FC;
  box-shadow: 0 4px 14px rgba(99, 66, 245, 0.08);
}
.mini-lib-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.mini-lib-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.stu-book-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stu-focus-card {
  padding: 18px 20px;
}
.stu-active-books {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stu-bk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: 13px;
  background: #FAF9FE;
  border: 1px solid #ECE9F8;
}
.stu-bk-info {
  flex: 1;
  min-width: 220px;
}
.stu-bk-title {
  font-size: 14.2px;
  color: var(--ink);
}
.stu-bk-prog-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.stu-bk-bar {
  width: 110px;
  height: 6px;
  border-radius: 999px;
  background: #E6E2F8;
  overflow: hidden;
  flex-shrink: 0;
}
.stu-bk-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet) 0%, #8B5CF6 100%);
  border-radius: 999px;
}
.stu-bk-stat {
  font-size: 12.2px;
  color: var(--muted);
}
.stu-bk-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.stu-bk-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FAF9FE;
  border: 1px dashed #D8D2F5;
  font-size: 13px;
  color: var(--muted);
}
.pending-strip {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #F6F3FF;
  border: 1.5px solid #DDD6FE;
}
.pending-strip-head {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--violet);
  margin-bottom: 8px;
}
.pending-strip-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pending-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}

/* =========================================================================
   iPadOS Safari & Tablet Responsive Optimizations (Landscape + Portrait + Split View)
   ========================================================================= */
@media (max-width: 1220px) {
  .studio-top {
    padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
    row-gap: 5px;
  }
  .st-top-left { order: 1; min-width: 0; flex-shrink: 1; }
  .st-top-right { order: 2; flex-shrink: 0; }
  .studio-top .gn-dock {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 5px 2px 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .st-title-lbl { max-width: 150px; font-size: 13px; }
  .gn-toc-select { max-width: 135px; }
  .studio-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .studio-panel { padding: 14px; }
}

@media (max-width: 960px) {
  .topbar { padding: 6px max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left)); }
  .topbar-inner { gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 15.5px; }
  .nav-simple { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .nav-btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
  .topbar-right { gap: 6px; flex-wrap: wrap; }
  .container { padding: 18px max(14px, env(safe-area-inset-right)) calc(80px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  #mc-class-alarm { padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); margin: 12px auto -6px; }
  .cal-wrap { padding: 14px 12px; }
  .cal-cell { min-height: 66px; padding: 4px; }
  .cal-ev { font-size: 10.5px; padding: 2px 4px; }
  .my-wb-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
  .billing-plan-grid { gap: 10px; }
  .billing-plan-grid .card { padding: 16px !important; }
  #btn-open-other-tab { display: none; }
  .st-title-lbl, .gn-toc-select, .st-upload-btn { display: none; }

  /* Full-height canvas on iPad Portrait / Split View; Panel becomes slide-over drawer */
  .studio-body { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .canvas-area { padding: 58px 10px 72px; }
  .studio-panel {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: min(360px, 88vw);
    z-index: 60;
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 36px rgba(15, 16, 32, 0.22);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
    display: flex;
  }
  .studio-panel.drawer-open { transform: translateX(0); }
  .drawer-head-mobile { display: flex; }

  /* Thumb-reachable bottom quick-check bar on iPad Portrait */
  .ipad-quick-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(22, 24, 44, 0.08);
    flex-shrink: 0;
    z-index: 35;
  }
  .iq-marks {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
  }
  .iq-btn {
    flex: 1;
    max-width: 112px;
    height: 38px;
    border-radius: 10px;
    border: 1.2px solid var(--line-strong);
    background: #FFFFFF;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }
  .iq-btn.is-done.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
  .iq-btn.is-unsure.on { background: #F59E0B; border-color: #F59E0B; color: #FFFFFF; }
  .iq-btn.is-wrong.on { background: var(--red); border-color: var(--red); color: #FFFFFF; }
  .iq-nav {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: #F6F5FC;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
  }
  .iq-nav:disabled { opacity: 0.35; }
  .iq-sheet {
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #D7CEFF;
    background: var(--violet-soft);
    color: var(--violet);
    font-size: 12.6px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .entry-grid, .stu-hero-card, .shelf-grid, .form-row-2, .stu-grid { grid-template-columns: 1fr; }
  .stu-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stu-kpi { padding: 10px 11px; }
  .stu-kpi b { font-size: 17px; }
  .course-pills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nc-row { grid-template-columns: 1fr; }
  .lesson-row { flex-wrap: wrap; }
  .modal { max-height: 88dvh; width: min(94vw, 680px); }
  .ps-scroll { max-height: 52dvh; }
}

/* Touch Devices (iPad / Tablet): Prevent Safari input auto-zoom & boost tap targets */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  textarea,
  select {
    font-size: 16px;
  }
  .gn-page-inp { font-size: 15px; width: 46px; }
  .gn-btn { width: 40px; height: 38px; }
  .gn-swatch { width: 24px; height: 24px; }
  .bp-big-btn { min-height: 40px; }
  .ps-tile { min-height: 46px; }
}

/* Student Subject-by-Subject Workbook Bar & Sections */
.stu-subj-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.stu-subj-bar .filter-pill,
.filter-pills .filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(99, 66, 245, 0.1);
  color: var(--violet);
}
.filter-pill.active .pill-cnt {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}
.stu-subj-sections {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.stu-subj-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.stu-subj-sec-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stu-subj-sec-cnt {
  font-size: 12px;
  font-weight: 700;
  color: var(--violet);
  background: var(--violet-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

/* Workbook Level & Problem Count Info Pills */
.wb-lvl-pill,
.wb-cnt-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wb-cnt-pill {
  background: #F3F2FA;
  color: #4A4863;
  border: 1px solid #E4E1F2;
}
.wb-lvl-pill.lvl-base { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.wb-lvl-pill.lvl-type { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.wb-lvl-pill.lvl-mid  { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.wb-lvl-pill.lvl-hard { background: #FFF7ED; color: #C2410C; border: 1px solid #FED7AA; }
.wb-lvl-pill.lvl-top  { background: #FFF1F2; color: #BE123C; border: 1px solid #FECDD3; }
.mini-lib-desc {
  font-size: 11.8px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live Coaching Voice Volume Visualizer (5-bar Equalizer) */
.live-mic-meter-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.live-mic-meter-box.on {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
}
.live-mic-meter-box.speaking {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(110, 231, 183, 0.72);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}
.live-mic-meter-box.muted {
  opacity: 0.55;
}
.live-mic-meter-lbl {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}
.live-vu {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
  width: 24px;
}
.live-vu i {
  display: block;
  width: 3px;
  height: 18%;
  min-height: 3px;
  border-radius: 2px;
  background: #6EE7B7;
  opacity: 0.42;
  transition: height 55ms ease-out, opacity 80ms ease;
}
.live-vu.active i {
  background: linear-gradient(180deg, #A7F3D0 0%, #34D399 100%);
}
.live-voice-chip .live-vu {
  margin-left: 5px;
}
.live-voice-chip .live-vu i {
  background: #93C5FD;
}
.live-voice-chip .live-vu.active i {
  background: linear-gradient(180deg, #DBEAFE 0%, #60A5FA 100%);
}

/* Coach-only Answer & Solution Card + Crisp Geometry Figure Loading */
.coach-sol-box {
  background: linear-gradient(180deg, #FAF8FF 0%, #FFFFFF 100%);
  border: 1.5px solid #DDD6FE !important;
  border-radius: 13px;
}
.coach-sol-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.coach-sol-tag {
  font-size: 11px;
  font-weight: 800;
  color: #6D28D9;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}
.coach-sol-ans {
  background: #F5F3FF;
  border: 1px solid #E9D5FF;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #3B0764;
  line-height: 1.6;
}
.coach-sol-exp {
  background: #FFFFFF;
  border: 1px solid #ECEAF5;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.6px;
  color: #1E2030;
  line-height: 1.72;
  max-height: 300px;
  overflow-y: auto;
}
.coach-sol-empty {
  font-size: 12.2px;
  color: var(--muted);
  line-height: 1.55;
  background: #FFFFFF;
  border: 1px dashed #DDD6FE;
  border-radius: 9px;
  padding: 9px 10px;
}
.coach-sol-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.coach-sol-actions .btn {
  font-size: 11.8px;
  padding: 5px 9px;
}
.ws-fig-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 76px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #F8F7FC;
  border: 1px dashed #DCD6F7;
  color: #7C73A8;
  font-size: 12px;
  font-weight: 600;
}

/* Larger, clearer Student Browse Workbook Library (목적 · 과목별 전체 문제집 보관함) */
.stu-browse-card .stu-browse-tracks .filter-pill {
  font-size: 15px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
}
.stu-browse-card .stu-browse-subjs .filter-pill {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 999px;
}
.stu-browse-card .filter-pill .pill-cnt {
  font-size: 12.5px;
  padding: 2px 7px;
}
.stu-browse-card .mini-lib-list {
  gap: 16px;
}
.stu-browse-card .mini-lib-row {
  padding: 20px 22px;
  border-radius: 16px;
  gap: 16px;
}
.stu-browse-card .mini-lib-meta {
  gap: 7px;
  margin-bottom: 8px;
}
.stu-browse-card .mini-lib-meta .course-mini-tag,
.stu-browse-card .mini-lib-meta .wb-info-pill {
  font-size: 12.8px;
  padding: 4px 10px;
}
.stu-browse-card .mini-lib-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 5px;
}
.stu-browse-card .mini-lib-desc {
  font-size: 14px;
  line-height: 1.45;
}
.stu-browse-card .btn-primary {
  font-size: 14.5px;
  font-weight: 800;
  padding: 11px 22px;
  border-radius: 999px;
}

/* Visual Bookshelf Grid for Student Browse Workbook Library */
.stu-browse-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.stu-browse-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stu-browse-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}
.stu-browse-sub b {
  color: var(--violet);
}
.stu-browse-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stu-browse-search {
  width: 240px;
  max-width: 56vw;
  padding: 8px 14px !important;
  font-size: 13.5px !important;
  border-radius: 999px !important;
  background: #F8F7FC !important;
}
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.shelf-book-card {
  position: relative;
  display: flex;
  background: #FFFFFF;
  border: 1.5px solid #ECEAF5;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.shelf-book-card:hover {
  transform: translateY(-2px);
  border-color: #C4B5FD;
  box-shadow: 0 12px 26px rgba(99, 66, 245, 0.09);
}
.shelf-book-accent {
  width: 7px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #6342F5 0%, #8B5CF6 100%);
}
.shelf-book-card.tone-gj .shelf-book-accent {
  background: linear-gradient(180deg, #0D9488 0%, #10B981 100%);
}
.shelf-book-card.tone-essay .shelf-book-accent {
  background: linear-gradient(180deg, #EA580C 0%, #F59E0B 100%);
}
.shelf-book-card.tone-iv .shelf-book-accent {
  background: linear-gradient(180deg, #2563EB 0%, #4F46E5 100%);
}
.shelf-book-inner {
  flex: 1;
  min-width: 0;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shelf-book-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.shelf-book-top .course-mini-tag,
.shelf-book-top .wb-lvl-pill {
  font-size: 12.2px;
  padding: 3px 10px;
}
.shelf-book-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.shelf-book-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shelf-book-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  background: #F9F8FD;
  border: 1px solid #EFEBF9;
  border-radius: 12px;
}
.shelf-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.shelf-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #84819B;
}
.shelf-stat-val {
  font-size: 13.8px;
  font-weight: 800;
  color: #1E1B3A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-book-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.shelf-book-toc-hint {
  font-size: 12px;
  color: #787592;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.shelf-open-btn {
  flex-shrink: 0;
  font-size: 14px !important;
  font-weight: 800 !important;
  padding: 9px 18px !important;
  border-radius: 999px !important;
}

/* Prevent browser scroll clamping when switching to categories with fewer books */
.stu-browse-card {
  min-height: 620px;
}

.shelf-book-card.tone-csat .shelf-book-accent {
  background: linear-gradient(180deg, #E11D48 0%, #F43F5E 100%);
}

/* Year / Month / Subject / University Quick Filter Rows for CSAT & Interview sections */
.exam-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #F9F8FD;
  border: 1px solid #ECE8F9;
  border-radius: 13px;
}
.exam-filter-stack.compact {
  padding: 9px 11px;
  gap: 6px;
}
.exam-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.exam-filter-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #6D28D9;
  min-width: 44px;
  flex-shrink: 0;
}
.exam-filter-stack.compact .filter-pill {
  font-size: 12px;
  padding: 4px 10px;
}

/* CSAT / Mock Exam Elective Quick-Jump Bar */
.csat-jump-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 16px;
  background: linear-gradient(90deg, #1E1B3A 0%, #272252 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  flex-shrink: 0;
}
.csat-jump-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #C4B5FD;
  letter-spacing: -0.01em;
}
.csat-jump-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.csat-jump-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.csat-jump-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}
.csat-jump-btn.active {
  background: #6342F5;
  border-color: #8B5CF6;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(99, 66, 245, 0.45);
}
.csat-jump-btn.is-pref:not(.active) {
  border-color: #FBBF24;
  color: #FDE68A;
}
.csat-jump-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
}
@media (max-width: 900px) {
  .csat-jump-hint { display: none; }
}
@media (max-width: 720px) {
  .billing-plan-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 54px; padding: 3px; }
  .cal-ev { font-size: 9.8px; padding: 1px 3px; }
  .cal-rule-pill { font-size: 11px; padding: 4px 8px; }
  #btn-open-other-tab { display: none; }
}

/* Minimal PG-Compliant Business & Legal Footer */
.mc-biz-footer {
  margin-top: 32px;
  padding: 18px 4px 8px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.mc-biz-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.mc-biz-links button {
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mc-biz-links button:hover {
  color: var(--violet);
  text-decoration: underline;
}
.mc-biz-meta {
  font-size: 11.5px;
  color: var(--muted);
  word-break: keep-all;
}


/* =========================================================================
   3-Role Login + 32-Inch Wide Monitor Admin Console + iPad/Galaxy Tab Polish
   ========================================================================= */
.login-tabs-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.login-tabs-3 .login-tab {
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
}

/* ---------- 32-Inch Wide Monitor Admin Console (body.ui-admin) ---------- */
body.ui-admin {
  background: #F2F4F9;
  font-size: 16px;
}
.adm32-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100dvh;
  width: 100%;
}
.adm32-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: linear-gradient(180deg, #131629 0%, #0E1020 100%);
  color: #EEF0F8;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 30;
}
.adm32-brand {
  padding: 2px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  margin-bottom: 16px;
}
.adm32-brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
}
.adm32-role-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(110, 79, 255, 0.28);
  color: #D7CEFF;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.adm32-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}
.adm32-nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 13px 15px;
  cursor: pointer;
  color: #CBD0E6;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.adm32-nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.adm32-nav-item.active {
  background: linear-gradient(135deg, #6342F5 0%, #4E2FE0 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(99, 66, 245, 0.36);
}
.adm32-nav-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.adm32-nav-desc {
  font-size: 13px;
  opacity: 0.78;
}
.adm32-side-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.09);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.adm32-side-footer .btn {
  font-size: 14.5px;
  min-height: 42px;
}
.adm32-side-footer .btn-outline {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: #F4F5FF;
}
.adm32-side-footer .btn-outline:hover {
  background: rgba(255,255,255,0.15);
}
.adm32-side-footer .btn-ghost {
  color: #B2B9D4;
}
.adm32-side-footer .btn-ghost:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.adm32-user-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}
.adm32-user-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
}
.adm32-user-mail {
  font-size: 13px;
  color: #A5ADC9;
  margin-top: 3px;
  word-break: break-all;
}

.adm32-main {
  min-width: 0;
  padding: 32px 42px 56px;
}
.adm32-content {
  max-width: 1880px;
  margin: 0 auto;
}
.adm32-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.adm32-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #121526;
}
.adm32-header p {
  margin: 6px 0 0;
  font-size: 15.5px;
  color: #5C627A;
}
.adm32-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.ui-admin .btn {
  font-size: 15px;
  min-height: 43px;
  padding: 9px 18px;
  border-radius: 12px;
}
body.ui-admin .btn-sm {
  font-size: 14px;
  min-height: 38px;
  padding: 7px 14px;
}
body.ui-admin .input,
body.ui-admin select.input,
body.ui-admin textarea.input {
  font-size: 15.5px;
  padding: 10px 14px;
  min-height: 44px;
}
body.ui-admin .field label {
  font-size: 14.5px;
  font-weight: 700;
}

.adm32-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.adm32-kpi-card {
  background: #fff;
  border: 1px solid #E4E7F2;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 4px 18px rgba(18, 21, 38, 0.04);
}
.adm32-kpi-card.accent {
  background: linear-gradient(135deg, #6342F5 0%, #482AD8 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(99, 66, 245, 0.25);
}
.adm32-kpi-label {
  font-size: 14.5px;
  font-weight: 700;
  color: #5C627A;
}
.adm32-kpi-card.accent .adm32-kpi-label,
.adm32-kpi-card.accent .adm32-kpi-sub {
  color: rgba(255,255,255,0.88);
}
.adm32-kpi-val {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 10px 0 6px;
  line-height: 1.15;
}
.adm32-kpi-sub {
  font-size: 13.5px;
  color: #6B718A;
}

.adm32-grid-3 {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.95fr;
  gap: 20px;
  align-items: start;
}
.adm32-panel {
  padding: 24px 26px !important;
  margin: 0 !important;
  max-width: none !important;
  border: 1px solid #E4E7F2 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 18px rgba(18, 21, 38, 0.04) !important;
}
.adm32-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.adm32-panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #141729;
}
.adm32-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adm32-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #F7F8FC;
  border: 1px solid #EAEDF6;
}
.adm32-list-row.compact {
  padding: 11px 14px;
}
.adm32-row-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #181B2C;
  line-height: 1.4;
}
.adm32-row-sub {
  font-size: 14px;
  color: #60667F;
  margin-top: 2px;
  line-height: 1.45;
}
.adm32-row-muted {
  font-weight: 500;
  color: #676E87;
  font-size: 14px;
}
.adm32-divider {
  height: 1px;
  background: #E6E9F2;
  margin: 20px 0 18px;
}
.adm32-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #EBEEF6;
  color: #3E4560;
  vertical-align: middle;
  white-space: nowrap;
}
.adm32-chip.violet { background: #EFEAFF; color: #5433E6; }
.adm32-chip.green { background: #E4F8EC; color: #0B743E; }
.adm32-chip.amber { background: #FFF2D6; color: #9E5900; }
.adm32-chip.red { background: #FEE9E9; color: #C12424; }

.adm32-pg-box {
  padding: 16px 18px;
  border-radius: 14px;
  background: #FFF8EB;
  border: 1px solid #F5D592;
}
.adm32-pg-box.ready {
  background: #EAF9F0;
  border-color: #96DDB4;
}

.adm32-table-card {
  padding: 0 !important;
  overflow-x: auto;
  max-width: none !important;
  border: 1px solid #E4E7F2 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 18px rgba(18, 21, 38, 0.04) !important;
}
.adm32-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
.adm32-table th {
  text-align: left;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #5A6078;
  background: #F7F8FC;
  border-bottom: 1px solid #E6E9F2;
  white-space: nowrap;
}
.adm32-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #EFF1F7;
  vertical-align: middle;
}
.adm32-table tr:last-child td { border-bottom: none; }
.adm32-table tr:hover td { background: #FAFBFD; }
.adm32-inline-select {
  min-width: 180px;
  padding: 8px 12px !important;
  font-size: 15px !important;
  min-height: 40px !important;
}
.adm32-credit-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.adm32-credit-val {
  min-width: 78px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
}

/* 32-inch 2-column side-by-side Billing + PG split */
.adm32-billing-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  align-items: start;
}
.adm32-split-col {
  min-width: 0;
}
.adm32-split-col .card,
.adm32-books-wrap .card {
  max-width: none !important;
}
.adm32-books-wrap .wb-grid,
.adm32-books-wrap .book-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
}

@media (max-width: 1420px) {
  .adm32-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm32-grid-3 { grid-template-columns: 1fr 1fr; }
  .adm32-billing-split { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .adm32-shell { grid-template-columns: 1fr; }
  .adm32-sidebar { position: static; height: auto; }
  .adm32-nav { flex-direction: row; flex-wrap: wrap; }
  .adm32-nav-item { width: auto; flex: 1 1 150px; }
  .adm32-main { padding: 18px; }
  .adm32-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm32-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Global Typography & Visual Polish (Login + Tablets) ---------- */
.entry-box h1 {
  font-size: 30px !important;
  line-height: 1.28 !important;
}
.entry-box p,
.entry-box .field label {
  font-size: 15px !important;
}
.entry-box .input,
.entry-box .btn-primary {
  font-size: 16px !important;
  min-height: 48px;
}
.entry-box .login-tab,
.entry-box .auth-mode-btn {
  font-size: 15px !important;
}
.entry-box .login-privacy-note {
  font-size: 13.5px !important;
  line-height: 1.55 !important;
}

/* ---------- iPad & Samsung Galaxy Tab Dedicated Typography + Touch Polish ---------- */
body.ui-coach,
body.ui-student {
  font-size: 15.5px;
  line-height: 1.58;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.ui-coach button,
body.ui-student button,
body.ui-coach a,
body.ui-student a,
body.ui-coach select,
body.ui-student select,
body.ui-coach input,
body.ui-student input {
  touch-action: manipulation;
}
body.ui-coach .topbar,
body.ui-student .topbar {
  min-height: 66px;
}
body.ui-coach .topbar-inner,
body.ui-student .topbar-inner,
body.ui-coach .container,
body.ui-student .container,
body.ui-coach #mc-class-alarm,
body.ui-student #mc-class-alarm {
  max-width: 1024px;
}
body.ui-coach .brand,
body.ui-student .brand {
  font-size: 18.5px;
}
body.ui-coach .role-pill,
body.ui-student .role-pill {
  font-size: 13.5px !important;
  padding: 4px 11px !important;
}
body.ui-coach .nav-btn,
body.ui-student .nav-btn {
  min-height: 44px;
  padding: 9px 17px;
  font-size: 15.5px !important;
  font-weight: 700;
  white-space: nowrap;
}
body.ui-coach .btn,
body.ui-student .btn,
body.ui-coach .live-subtab,
body.ui-student .live-subtab {
  min-height: 44px;
  font-size: 15px;
  padding: 10px 18px;
}
body.ui-coach .btn-sm,
body.ui-student .btn-sm {
  min-height: 40px;
  font-size: 14px;
  padding: 8px 14px;
}
body.ui-coach .input,
body.ui-student .input,
body.ui-coach select.input,
body.ui-student select.input,
body.ui-coach textarea.input,
body.ui-student textarea.input {
  font-size: 16px;
  min-height: 44px;
  padding: 10px 14px;
}

/* Crisp, Larger Readable Cards & Badges on iPad / Galaxy Tab */
body.ui-coach .page-head h1,
body.ui-student .page-head h1,
body.ui-coach h1,
body.ui-student h1 {
  font-size: 27px;
  letter-spacing: -0.025em;
}
body.ui-coach .page-head p,
body.ui-student .page-head p,
body.ui-coach .page-sub,
body.ui-student .page-sub {
  font-size: 15px !important;
}
body.ui-coach .sec-label,
body.ui-student .sec-label,
body.ui-coach .card h2,
body.ui-student .card h2,
body.ui-coach .card h3,
body.ui-student .card h3 {
  font-size: 18px;
}
body.ui-coach .card,
body.ui-student .card {
  border-radius: 18px;
  border-color: #E6E8F2;
  box-shadow: 0 3px 14px rgba(22, 24, 34, 0.045);
}
body.ui-coach .wb-lvl-pill,
body.ui-student .wb-lvl-pill,
body.ui-coach .wb-cnt-pill,
body.ui-student .wb-cnt-pill,
body.ui-coach .book-subj-pill,
body.ui-student .book-subj-pill,
body.ui-coach .badge,
body.ui-student .badge,
body.ui-coach .course-mini-tag,
body.ui-student .course-mini-tag {
  font-size: 13px !important;
  padding: 3px 10px !important;
}
body.ui-coach .book-title,
body.ui-student .book-title,
body.ui-coach .wb-title,
body.ui-student .wb-title,
body.ui-coach .stu-book-title,
body.ui-student .stu-book-title {
  font-size: 18px !important;
  line-height: 1.38 !important;
}
body.ui-coach .book-prog,
body.ui-student .book-prog,
body.ui-coach .stu-book-meta,
body.ui-student .stu-book-meta,
body.ui-coach .wa-body,
body.ui-student .wa-body,
body.ui-coach .prep-sub,
body.ui-student .prep-sub {
  font-size: 14.5px !important;
  line-height: 1.5 !important;
}
body.ui-coach .filter-pill,
body.ui-student .filter-pill,
body.ui-coach .track-pill,
body.ui-student .track-pill,
body.ui-coach .chip-btn,
body.ui-student .chip-btn {
  font-size: 14px !important;
  min-height: 38px;
  padding: 7px 14px !important;
}
body.ui-coach .billing-plan-card h3,
body.ui-student .billing-plan-card h3 {
  font-size: 20px;
}
body.ui-coach .billing-plan-price,
body.ui-student .billing-plan-price {
  font-size: 28px;
}
body.ui-coach .billing-plan-features li,
body.ui-student .billing-plan-features li {
  font-size: 14.5px;
}
body.ui-coach .biz-footer,
body.ui-student .biz-footer {
  font-size: 13.5px;
}

/* Covers BOTH iPad (768–1180px) AND Samsung Galaxy Tab (800×1280 / 1280×800 16:10) */
@media (max-width: 1280px) and (min-width: 720px) {
  body.ui-coach .container,
  body.ui-student .container {
    padding: 20px 22px 40px;
  }
  body.ui-coach .topbar-inner,
  body.ui-student .topbar-inner {
    padding: 0 20px;
    gap: 10px;
  }
  body.ui-coach .billing-plan-grid,
  body.ui-student .billing-plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  body.ui-coach .cal-day,
  body.ui-student .cal-day {
    min-height: 82px;
    font-size: 14px;
  }
}

/* Galaxy Tab Portrait (800×1280) & iPad Mini / Air Portrait (768–834px) */
@media (max-width: 860px) {
  body.ui-coach .topbar-inner,
  body.ui-student .topbar-inner {
    padding: 0 14px;
    gap: 8px;
  }
  body.ui-coach .nav-btn,
  body.ui-student .nav-btn {
    padding: 8px 13px;
    font-size: 14.5px !important;
  }
  body.ui-coach .billing-plan-grid,
  body.ui-student .billing-plan-grid {
    grid-template-columns: 1fr;
  }
  body.ui-coach .cal-day,
  body.ui-student .cal-day {
    min-height: 74px;
    padding: 7px;
  }
}
