/* jayzip — visual style v2
 * Direction: Linear / Vercel — minimal, white base, generous whitespace,
 * 1px hairlines, two font weights only. Navy is the SINGLE brand accent
 * and lives on ~10% of pixels: CTAs, active indicators, links, key numbers.
 * Large surfaces (cards, tables, panels) stay white. Hover/selection is
 * navy at 5% tint, never a saturated fill.
 */

@font-face {
  font-family: "Pretendard Variable";
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
  src: url("../vendor/pretendard/PretendardVariable.woff2")
       format("woff2-variations");
}

:root {
  /* base palette */
  --bg:         #f7f8fa;        /* app canvas — cards float on this */
  --surface:    #ffffff;
  --surface-2:  #fafafa;       /* very light gray for stripes / hover-on-white */
  --border:     #e9eaee;        /* hairline */
  --border-2:   #d4d4d4;        /* slightly stronger (inputs) */
  --text:       #0a0a0b;
  --text-2:     #6b6b70;
  --text-3:     #a0a0a5;
  /* legacy aliases — 일부 컴포넌트 inline style 이 참조 */
  --bg-1:       #f4f5f8;
  --line:       var(--border);
  --accent:     #34327B;

  /* brand — navy (sampled from the actual Blueye logo). Used on ~10% of pixels only. */
  --navy:       #34327B;
  --navy-hover: #292766;        /* darker for button hover */
  --navy-fg:    #ffffff;
  --navy-5:     rgba(52, 50, 123, 0.05);
  --navy-10:    rgba(52, 50, 123, 0.10);
  --navy-20:    rgba(52, 50, 123, 0.20);

  /* status — kept understated */
  --ok:         #1f7a45;
  --warn:       #8a6b1a;
  --danger:     #9a2b2b;

  /* elevation — 매우 절제된 그림자 2단 */
  --shadow-sm:  0 1px 2px rgba(16, 17, 26, 0.04);
  --shadow-md:  0 2px 8px rgba(16, 17, 26, 0.06), 0 1px 2px rgba(16, 17, 26, 0.04);
  --shadow-lg:  0 12px 32px rgba(16, 17, 26, 0.14), 0 2px 8px rgba(16, 17, 26, 0.08);

  /* motion */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint 느낌 */
  --t-fast: 0.13s;
  --t-med:  0.22s;

  /* shape */
  --r:    8px;
  --r-sm: 6px;
  --r-lg: 10px;

  /* spacing */
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-6: 24px;
  --gap-8: 32px;
  --gap-10: 40px;

  /* type — Pretendard, two weights only */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system,
               BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  /* sidebar width */
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.008em;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
code, kbd { font-family: var(--font-mono); font-size: 0.92em; color: var(--text-2); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }

/* ============================== Shell ============================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
/* identity 블록 (2026-07-24) — 브랜드 + 현재 워크스페이스를 18px 기준선에 한
   그룹으로. 기존 ws-chip(좌측 2px에 붙는 pill)은 정렬·소속·affordance 문제로
   폐기 — 전환은 프로필 메뉴 '과목 변경'. */
.sidebar-ident {
  display: flex; flex-direction: column; gap: 3px;
  padding: 20px 18px 14px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.sidebar-ws {
  align-self: flex-start;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  text-decoration: none;
  transition: color var(--t-fast);
}
.sidebar-ws:hover { color: var(--navy); text-decoration: none; }

.sidebar-brand:hover { text-decoration: none; }

/* 학생 그룹 전환 (사이드바 좌상단·모바일 상단바) — 어느 선생님 그룹의
   과제/시험/일정을 볼지 고른다. */
.group-switch { padding: 0 18px 12px; }
.gs-select {
  width: 100%; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background: var(--surface-2, #f4f4f7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 26px 8px 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.mobile-topbar .group-switch { padding: 0 8px 0 0; flex-shrink: 0; }
.mobile-topbar .gs-select { width: auto; max-width: 150px; padding: 6px 22px 6px 8px; font-size: 12px; }

.brand-mark {
  width: 18px; height: 18px;
  background: var(--navy);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
}
/* tiny dandelion glyph inside the mark — radiating hairlines */
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(  0deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%),
    linear-gradient( 90deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%);
  background-size: 100% 100%;
  opacity: 0.85;
}
.brand-mark::after {
  background:
    linear-gradient( 45deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%),
    linear-gradient(135deg, transparent 47%, #fff 47%, #fff 53%, transparent 53%);
  opacity: 0.55;
}

.sidebar-nav {
  display: flex; flex-direction: column;
  padding: 4px 12px;
  gap: 1px;
}
.sidebar-section-label {
  padding: 12px 12px 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.sidebar-nav a {
  position: relative;
  display: flex; align-items: center;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.sidebar-nav a:hover { background: var(--navy-5); color: var(--text); text-decoration: none; }
.sidebar-nav a.active {
  background: var(--navy-5);
  color: var(--navy);
  font-weight: 700;
}
/* 비활성 탭 (2026-07-26) — 아직 지원하지 않는 워크스페이스의 '문제 제작'.
   숨기지 않고 회색으로 남겨 '준비 중'임을 알린다. 클릭·포커스 불가. */
.sidebar-nav .nav-off {
  display: flex; align-items: center;
  padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text-3); font-size: 13.5px; font-weight: 500;
  cursor: not-allowed; user-select: none;
}
.sidebar-nav .nav-off:hover { background: none; }
.sidebar-nav .nav-off .ic { opacity: 0.55; }
.nav-off-tag {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 1px 7px; letter-spacing: -0.01em;
}
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 6px; bottom: 6px;
  width: 2px; background: var(--navy);
  border-radius: 0 2px 2px 0;
}
.avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--navy-10); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: none;
}
.avatar.lg { width: 38px; height: 38px; font-size: 15px; }

.app-main {
  flex: 1; min-width: 0;
  background: var(--bg);
}

/* 하단 nav 그룹 (쓰레기통·문의) — 메인 탭과 분리, 크레딧 위 경계선 바로 위.
   margin-top:auto 는 이쪽에만 — .sidebar-bottom 에도 남기면 flex 남는 공간이
   둘로 갈라져 이 그룹이 중간에 뜬다. */
.sidebar-nav-foot { margin-top: auto; padding-bottom: 6px; }

/* ---- sidebar bottom — 크레딧 pill + 프로필 버튼 (좌하단) ---- */
.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  position: relative;   /* 프로필 팝업(absolute, 위로 열림)의 기준 */
}
.sidebar-bottom .credit-pill { margin: 0 0 2px; }
/* 문의 = nav 탭과 동일 형태(.sidebar-nav a)지만 href 없는 액션 → 커서만 보정 */
.sidebar-nav a.sidebar-nav-action { cursor: pointer; }

/* ---- profile menu (아바타 버튼 → 설정 메뉴) ----
   ⚠️ variant 클래스는 반드시 namespaced(`--sidebar`/`--mobile`). bare `sidebar`
   는 앱 전역 `.sidebar`(display:flex; height:100vh)와 충돌해 팝업이 100vh 로
   늘어난다. */
.profile-menu { position: relative; }
.profile-menu--sidebar { width: 100%; }

/* sidebar 트리거 = 전폭 행 (아바타 + 역할 라벨, 이메일 없음 — Claude 풍) */
.profile-menu--sidebar .profile-trigger {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 7px 8px; cursor: pointer;
  transition: background var(--t-fast);
}
.profile-menu--sidebar .profile-trigger:hover { background: var(--navy-5); }
.pm-name {
  flex: 1; min-width: 0; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-chev { width: 14px; height: 14px; flex: none; color: var(--text-3); transition: transform var(--t-fast); }
.profile-menu--sidebar .pm-chev { transform: rotate(180deg); }   /* 기본=위 방향(메뉴가 위로 열림) */
.profile-menu--sidebar .pm-chev.up { transform: rotate(0deg); }  /* 열리면 아래 */

/* mobile 트리거 = 아바타만 */
.profile-menu--mobile .profile-trigger { padding: 0; border: none; background: none; cursor: pointer; }

/* 팝업 공통 */
.profile-pop {
  min-width: 244px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 200;
  animation: pm-in 0.16s var(--ease);
}
/* sidebar: body 로 portal + inline fixed(트리거 바로 위). 폭만 CSS 로. */
.profile-pop--sidebar { width: 284px; }
/* mobile: body 로 portal → 화면 우상단 고정 (상단바 overflow 에 안 갇힘) */
.profile-pop--mobile { position: fixed; top: 54px; right: 12px; left: auto; }
@keyframes pm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pm-section-label { padding: 4px 12px 2px; font-size: 11px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.pm-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.pm-id { display: flex; flex-direction: column; min-width: 0; }
.pm-id-email {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-id-role { font-size: 12px; color: var(--text-3); }
.pm-sep { height: 1px; background: var(--border); margin: 2px 0 6px; }
.pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text);
}
.pm-item:hover { background: var(--navy-5); }
.pm-item .ic { width: 16px; height: 16px; }
.pm-item.danger { color: var(--danger); }
.pm-item.danger:hover { background: #fdf2f2; }

/* 과목 변경 행 (2026-07-24) — 현재 워크스페이스를 오른쪽에 + 펼침 화살표 */
.pm-item-note { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--navy); }
.pm-item .pm-exp {
  width: 14px; height: 14px; flex: none; color: var(--text-3);
  transition: transform var(--t-fast);
}
.pm-item .pm-exp.up { transform: rotate(180deg); }
/* 과목 변경 펼침 목록 — pm-item 텍스트(패딩 10 + 아이콘 16 + 갭 10)에 맞춰 들여쓰기 */
.pm-sub { display: flex; flex-direction: column; gap: 1px; padding: 0 0 4px 36px; }
.pm-sub-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.pm-sub-item:hover { background: var(--navy-5); color: var(--text); }
.pm-sub-item.active { color: var(--navy); font-weight: 700; }
.pm-sub-item:disabled { color: var(--text-3); cursor: default; }
.pm-sub-item:disabled:hover { background: none; }
.pm-sub-item .ic { width: 13px; height: 13px; margin-left: auto; color: var(--navy); }

/* ---- 프로필 페이지 (#/profile — 설정 / 구독 탭) ---- */
/* 프로필 정보 카드 상단 신원 행 (아바타 + 이름 + 이메일) */
.profile-id { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.profile-id-meta { min-width: 0; }
.profile-id-name { font-size: 15px; font-weight: 700; color: var(--text); }
.profile-id-email {
  font-size: 13px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 입력 칸들 — 데스크탑 2열, 좁은 화면 1열 */
.profile-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
}
.profile-form .field { margin: 0; }
@media (max-width: 560px) { .profile-form { grid-template-columns: 1fr; } }
.profile-save { margin-top: 16px; }

/* 자동화 설정 토글 한 줄 */
.set-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; cursor: pointer;
}
.set-toggle + .set-toggle { border-top: 1px solid var(--border); }
.set-toggle-text { flex: 1; min-width: 0; }
.set-toggle-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.set-toggle-hint { display: block; font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.set-toggle input[type="checkbox"] { width: 16px; height: 16px; flex: none; cursor: pointer; }

/* 페이지 entrance — 라우트 전환 시 살짝 떠오르며 등장. main 의 key 가 route 라
   전환마다 리마운트 → 애니메이션 재생.
   ⚠️ fill-mode(both/forwards) 금지: transform 이 계속 적용된 것으로 남아
   position:fixed 자손(모달 backdrop·lightbox)의 containing block 이 .page 로
   바뀌어 화면 전체를 못 덮는다. fill 없이 애니메이션 종료 후 스타일 원복. */
.page { animation: page-in 0.32s var(--ease); }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================== Page ============================== */
/* 와이드 모니터에서 좌우 데드 스페이스를 줄인다 — 콘텐츠 폭을 화면에 맞춰
   유동적으로 쓰되 1680px 에서 캡 (가독성 한계). 헤더는 컴팩트하게. */
.page {
  padding: 26px 40px 44px;
  max-width: 1680px;
  margin: 0 auto;
}
.page-header { margin-bottom: 16px; position: relative; }
.page-header h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}

/* page hero — tab-name eyebrow + big navy 멘트 (박현우 2026-07-01) */
.page-hero { margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.page-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-2);
}
.page-hero-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin: 0;
  line-height: 1.25;
}
@media (max-width: 640px) { .page-hero-title { font-size: 23px; } }

/* layout helpers */
.row { display: flex; gap: var(--gap-3); }
.col { display: flex; flex-direction: column; gap: var(--gap-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: var(--gap-4) 0; border: 0; }
.cluster { display: flex; gap: var(--gap-2); flex-wrap: wrap; align-items: center; }
.stretch { width: 100%; }

/* ============================== Card ============================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--gap-3);
}
.card-header h3 {
  font-size: 14.5px; font-weight: 700; margin: 0;
  letter-spacing: -0.01em;
  position: relative; padding-left: 11px;
}
/* navy accent bar on every titled card — keeps navy present across the UI */
.card-header h3::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 13px; border-radius: 2px;
  background: var(--navy);
}
/* a card given actions but no title renders an empty <h3> — don't leave a
   lone navy bar floating with no text. */
.card-header h3:empty { padding-left: 0; }
.card-header h3:empty::before { content: none; }
.card-body { padding: 16px; }
.card-pad-lg { padding: 28px; }

/* ---- section heading (in-page) — navy-accented, replaces bare <h4> ---- */
.h-sec {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); margin: 4px 0 10px;
}
.h-sec::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--navy); flex: none;
}
.h-sec .count { font-size: 12px; font-weight: 500; color: var(--text-3); }

/* ============================== Tabs ============================== */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs button {
  background: none; border: none; cursor: pointer;
  padding: 11px 18px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  color: var(--navy);
  font-weight: 700;
  border-bottom-color: var(--navy);
}

/* ============================== Buttons ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
  transition: background var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: #c4c4cc; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.primary {
  background: var(--navy); color: var(--navy-fg); border-color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(52, 50, 123, 0.3);
}
.btn.primary:hover {
  background: var(--navy-hover); border-color: var(--navy-hover);
  box-shadow: 0 2px 8px rgba(52, 50, 123, 0.32);
}
.btn.danger {
  background: var(--surface); color: var(--danger);
  border-color: var(--border-2);
}
.btn.danger:hover { background: #fdf2f2; border-color: #f0d6d6; }
.btn.ghost {
  background: none; border-color: transparent; color: var(--text-2);
}
.btn.ghost:hover { background: var(--navy-5); color: var(--text); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.lg { padding: 11px 20px; font-size: 14.5px; font-weight: 700; }
.btn.block { width: 100%; }
/* anchor-styled buttons (landing nav/CTA) must not pick up the global link underline */
a.btn, a.btn:hover { text-decoration: none; }
/* light ghost — for use on the navy hero (white-ish text + hairline border) */
.btn.ghost-light {
  background: rgba(255, 255, 255, 0.06); color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.55); }

/* ============================== Form ============================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  letter-spacing: 0;
}
.input, .select, .textarea {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font-size: 13.5px;
  width: 100%;
  outline: none;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-10);
}
.select[multiple] { padding: 6px; }
.help { font-size: 12px; color: var(--text-3); }

.checkbox, .radio {
  display: inline-flex; gap: 8px; align-items: center; cursor: pointer;
  font-size: 13.5px;
}
.checkbox input, .radio input {
  accent-color: var(--navy);
  margin: 0;
}

input[type="range"] {
  accent-color: var(--navy);
  height: 4px;
}

/* segmented control */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.segmented button {
  background: none; border: none; cursor: pointer;
  padding: 4px 12px;
  border-radius: 5px;
  color: var(--text-2);
  font-weight: 400;
  font-size: 13px;
  transition: background 0.1s, color 0.1s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--border);
}

/* ============================== Badge / chip ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
}
.badge.solid { background: var(--navy); color: var(--navy-fg); border-color: var(--navy); }
.badge.ok    { color: var(--ok);     background: #f1f8f4; border-color: #d4ead9; }
.badge.warn  { color: var(--warn);   background: #fdf6e3; border-color: #ecdfb0; }
.badge.danger{ color: var(--danger); background: #fdf2f2; border-color: #f0d6d6; }
.badge.navy  { color: var(--navy);   background: var(--navy-5); border-color: var(--navy-10); }
.badge.mono  { font-family: var(--font-mono); font-size: 11px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.chip:hover { background: var(--navy-5); color: var(--text); }
/* 준비 중인 시험 칩 — 자리는 지키되 고를 수 없다는 게 한눈에 보이게. */
.chip:disabled { cursor: default; opacity: 0.5; }
.chip:disabled:hover { background: var(--surface); color: var(--text-2); }
.chip.active {
  background: var(--navy-5);
  color: var(--navy);
  border-color: var(--navy-20);
  font-weight: 600;
}

/* ============================== Folder grid (굿노트 스타일) ======== */
/* 폴더 = 시각적 폴더 타일. 클릭=필터 토글, PDF 행을 끌어다 놓으면 이동. */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px 14px;
}
.folder-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  min-width: 0;
  transition: background var(--t-fast), border-color var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
}
.folder-tile:hover { background: var(--navy-5); }
/* 폴더 이름 옆 ˅ 캐럿 — 클릭=이름변경·삭제 (박현우 2026-06-14). 반투명이라 안 보인다는
   피드백(2026-07-17)으로 항상 진한 네이비 화살표로 — 박스·배경 없이 아이콘만. */
.folder-caret {
  position: absolute; top: 6px; right: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--navy);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.folder-caret .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.folder-caret:hover { background: var(--navy-10); }
.folder-tile:hover .folder-glyph { transform: translateY(-1px); }
.folder-tile.active { background: var(--navy-5); border-color: var(--navy-20); }
.folder-tile.drag-over {
  background: var(--navy-10);
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy-20);
  transform: scale(1.03);
}
/* 파일(셋) 타일이 낱개 문제를 받을 때 — 폴더 타일과 같은 신호 (2026-07-29).
   이게 없으면 "여기 놓으면 들어간다"는 걸 알 방법이 없다. */
.doc-tile.drag-over {
  background: var(--navy-10);
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy-20);
  transform: scale(1.03);
}
.folder-tile .f-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  max-width: 100%;
  /* 제목 2줄까지 보이게 (긴 과목명도 잘 안 잘리게) */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.folder-tile.active .f-name { color: var(--navy); }
.folder-tile .f-count { font-size: 12px; color: var(--text-3); margin-top: 0; }

/* CSS 로 그린 입체 폴더 — 탭(뒤) + 본체(앞) 2톤 */
.folder-glyph {
  position: relative;
  width: 84px; height: 64px;
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.folder-glyph::before {            /* 탭 */
  content: ""; position: absolute; top: 0; left: 0;
  width: 46%; height: 21px;
  border-radius: 7px 9px 0 0;
  background: #45438f;
}
.folder-glyph::after {             /* 본체 */
  content: ""; position: absolute; left: 0; right: 0; top: 9px; bottom: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #5d5baa, #403e8e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
              0 1px 2px rgba(16, 17, 26, 0.14);
}
.folder-glyph.gray::before { background: #a7a8b1; }
.folder-glyph.gray::after  { background: linear-gradient(180deg, #cfd0d8, #b3b4bf); }
/* "새 폴더" — 점선 placeholder + plus */
.folder-glyph.add::before, .folder-glyph.add::after { content: none; }
.folder-glyph.add {
  border: 1.5px dashed var(--border-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.folder-glyph.add .ic { width: 26px; height: 26px; }
.folder-tile.new:hover .folder-glyph.add { border-color: var(--navy-20); color: var(--navy); }

/* draggable PDF row affordance */
.pdf-draggable .grip { color: var(--text-3); cursor: grab; opacity: 0.5; }
.pdf-draggable:hover .grip { opacity: 1; }
.pdf-draggable[draggable="true"]:active { cursor: grabbing; }

/* ============================== Doc tile (문제집 타일) ============== */
/* 파일 = 종이 문제집 그림 타일. 폴더 타일과 같은 책장에 나열, 클릭=열기,
   끌어다 폴더 타일로 놓으면 이동. (folder-grid 레이아웃을 그대로 공유) */
.doc-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  min-width: 0;
  transition: background var(--t-fast), border-color var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
}
.doc-tile:hover { background: var(--navy-5); }
.doc-tile:hover .doc-glyph { transform: translateY(-2px); }
.doc-tile:active { cursor: grabbing; }
.doc-tile .f-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.3; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.doc-tile .f-count { font-size: 12px; color: var(--text-3); margin-top: 0; }

/* 파일 타일 우상단 버튼은 .folder-caret 재사용 (2026-07-23: doc-move 폐기) */

/* CSS 로 그린 종이 문제집 — 흰 종이 + 줄 + 표지 띠 + 뒤에 겹친 한 장 */
.doc-glyph {
  position: relative;
  width: 64px; height: 80px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  /* 본문 줄 */
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 13px, var(--navy-10) 13px 14px);
  /* 뒤에 겹친 한 장(좌상으로 살짝) + 살짝 떠 있는 그림자 */
  box-shadow: -3px -3px 0 -1px #fff,
              -3px -3px 0 0 var(--border-2),
              0 2px 5px rgba(16, 17, 26, 0.10);
  transition: transform var(--t-fast);
}
.doc-glyph .doc-band {        /* 표지 제목 띠 */
  position: absolute; left: 0; right: 0; top: 0; height: 16px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #5d5baa, #403e8e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ============================== Library 서브페이지 헤더 ============= */
.lib-subhead { display: flex; align-items: center; gap: 10px; }
.backbtn {
  display: inline-flex; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 14px; font-weight: 600;
  padding: 6px 10px 6px 6px; border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.backbtn:hover { color: var(--navy); background: var(--navy-5); }
/* 파일을 ← 버튼에 끌어다 놓으면 이 폴더에서 빼기 — drop hover 강조 */
.backbtn.drag-over {
  color: var(--navy); background: var(--navy-10);
  box-shadow: 0 0 0 2px var(--navy-20);
}
.backbtn .ic { width: 18px; height: 18px; }

/* ============================== Library 검색 결과 행 ================ */
/* 자료 탭 전역 검색(lib-hit) — 파일·폴더·셋을 눌러 바로 이동하는 행. */
.lib-hit {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer; text-align: left;
  color: var(--text); font: inherit;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.lib-hit:hover { background: var(--navy-5); border-color: var(--navy-20); }
.lib-hit > .ic { color: var(--navy); flex-shrink: 0; }
.lib-hit-name {
  font-weight: 600; font-size: 14px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-hit-loc { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================== Metric ============================== */
.metric-grid {
  display: grid; gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
}
.metric .label {
  font-size: 12px; color: var(--text-2);
  font-weight: 500;
}
.metric .value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-top: 4px;
  font-feature-settings: "tnum" 1;
  color: var(--text);
}
.metric.highlight .value { color: var(--navy); }
.metric .delta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.metric .delta.ok { color: var(--ok); }
.metric .delta.bad { color: var(--danger); }

/* 카드 4개짜리 metric-grid 의 컴팩트 대체 — 한 줄 요약 스트립 */
.stat-strip {
  display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
}
.stat-strip b {
  font-size: 15px; font-weight: 700; color: var(--text);
  font-feature-settings: "tnum" 1;
  margin-right: 1px;
}
.stat-strip .hl b { color: var(--navy); }

/* ============================== Banner ============================== */
.banner {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.banner.info   { background: var(--navy-5); border-color: var(--navy-10); }
.banner.warn   { background: #fdf6e3; border-color: #ecdfb0; color: #6b531a; }
.banner.error  { background: #fdf2f2; border-color: #f0d6d6; color: #6b1a1a; }
.banner.ok     { background: #f1f8f4; border-color: #d4ead9; color: #1f4a2a; }
.banner h4 { margin: 0 0 4px 0; font-size: 13px; font-weight: 600; }
.banner p { margin: 0; font-size: 13px; }

/* ============================== Empty state ============================== */
.empty {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty .title {
  font-weight: 600; font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}

/* ============================== Progress ============================== */
.progress {
  position: relative;
  height: 4px;
  background: var(--navy-5);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--navy);
  transition: width 0.3s;
}
.progress.indeterminate > span {
  width: 35%;
  animation: indeterm 1.6s ease-in-out infinite;
}
@keyframes indeterm {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(285%); }
}

/* Spinner for long-running operations (workbook PDF build, etc.) */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.build-overlay-card {
  text-align: center;
  padding: 30px 28px;
  max-width: 380px;
}
.build-overlay-card .build-overlay-title {
  font-size: 17px; font-weight: 700; margin-bottom: 10px;
}
.build-overlay-card .build-overlay-hint {
  font-size: 13px; color: var(--text-2); line-height: 1.55;
}

/* ============================== Problem grid / crop placeholder ============================== */
.problem-grid {
  display: grid; gap: 14px;
  /* 화면 폭에 맞춰 칼럼 수가 늘어난다 — 와이드에선 4칼럼, 좁으면 2칼럼 */
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  min-width: 0;          /* never let the grid blow past its container */
}
/* FRQ = 1칼럼 + 문항 사이 넉넉한 간격 (2026-07-17 박현우 '너무 빽빽') */
.problem-grid.frq { grid-template-columns: 1fr; gap: 32px; }
.problem-grid.frq .problem { padding-bottom: 18px; }
.problem {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), background var(--t-fast),
              box-shadow var(--t-med), transform var(--t-med);
  /* grid/flex items default to min-width:auto → a natural-size crop wider
     than the column expands the cell and pushes the layout right. Pin to 0
     so the card stays in its track and the image scrolls inside instead. */
  min-width: 0;
}
.problem:hover {
  border-color: var(--navy-20);
  box-shadow: var(--shadow-md);
}
.problem.selectable:hover { transform: translateY(-2px); }
.problem .head {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding-right: 30px;   /* clear the absolute .prob-edit button */
}
.problem .head strong { font-weight: 600; }
.problem .meta { font-size: 12px; color: var(--text-3); }
.problem.selectable { cursor: pointer; }
.problem.selectable:hover { background: var(--navy-5); }
.problem.selected {
  border-color: var(--navy);
  background: var(--navy-5);
}
/* 공유 자료(material) 카드 — 첫 멤버 문제 바로 앞에 인라인으로(별도 '공유 자료'
   칸 없이). 다른 문제 카드와 같은 한 칸 크기로 두고(박현우 2026-06-15: 한 줄
   전체 차지 X), 은은한 보라 틴트로만 'material' 임을 구분. */
.problem.material {
  background: var(--surface);
  border-color: var(--border);
}
.crop {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  background-image: repeating-linear-gradient(
    45deg, transparent 0, transparent 7px, #f0f0f0 7px, #f0f0f0 8px);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}
.crop.frq    { aspect-ratio: 8 / 11; }
.crop.figure { aspect-ratio: 1 / 1; }

/* Real cropped-problem image. Base (FRQ single-column cards, scoring guide,
   History): fit the card width — tall is fine, never overflows sideways. */
.crop-real { width: 100%; max-width: 100%; }
/* clickable crop → fullscreen viewer */
.crop-real.zoomable { cursor: zoom-in; }
.crop-real img {
  display: block; width: auto; height: auto; max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
}

/* MCQ 3-up grid: every cell is the SAME fixed-size box and the WHOLE crop is
   scaled to fit inside it (object-fit: contain) — no pan bars, the entire
   problem is always visible at a glance. Click the crop for the fullscreen
   viewer to read fine detail. (PDF export keeps the true consistent size;
   this fit-to-cell is preview-only.) */
.problem-grid:not(.frq) .problem .crop-real {
  height: var(--mcq-crop-h, 360px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: grid;
  place-content: center;
}
.problem-grid:not(.frq) .problem .crop-real img {
  border: 0; border-radius: 0;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}

/* unit editor chip */
.unit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  align-self: flex-start;
}
.unit-chip:hover { background: var(--navy-5); border-color: var(--navy-20); color: var(--navy); }
.unit-chip.empty { color: var(--text-3); border-style: dashed; }
.unit-chip .edit-mark {
  color: var(--text-3); font-size: 10px;
}

/* ============================== File picker / search ============================== */
.filepick { display: flex; flex-direction: column; gap: 8px; }
.filepick-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font-size: 13.5px; color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.filepick-toggle:hover { border-color: var(--navy-20); }
.filepick-toggle:focus-visible {
  border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-10); outline: none;
}
.filepick-summary { flex: 1; min-width: 0; }
.filepick-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
}
.filepick-search { display: flex; align-items: center; gap: 8px; }
.filepick-search svg { color: var(--text-3); flex-shrink: 0; }
.filepick-search .input { flex: 1; }
.filepick-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
  margin-top: 2px;
}
.filepick-row {
  width: 100%; padding: 6px 6px; border-radius: var(--r-sm);
}
.filepick-row:hover { background: var(--navy-5); }

/* ============================== Upload log tail ============================== */
.log-tail {
  max-height: 220px; overflow-y: auto;
  background: #0f1115; color: #c8d0da;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px; line-height: 1.55;
}
.log-line { white-space: pre-wrap; word-break: break-word; }

/* ============================== Modal ============================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 11, 0.32);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
  animation: backdrop-in 0.18s ease-out both;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  /* footer 고정 (2026-07-25 박현우 '수정하기 버튼이 스크롤 아래에 묻힌다') —
     모달 자체는 스크롤하지 않고 body 만 스크롤해 header·footer 가 항상 보인다. */
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  /* fill-mode 는 backwards — forwards(both) 로 두면 애니메이션이 끝난 뒤에도
     transform 이 '적용 중'으로 남아 .modal 이 고정 위치 자식의 containing block
     이 된다. 그러면 이 모달 안에서 연 2층 모달(? 도움말)의 backdrop 이 화면
     전체가 아니라 이 박스 안으로 갇혀서(+overflow:hidden 으로 잘려서) 바깥을
     눌러도 안 닫힌다 (2026-07-28 박현우). 끝 상태 값은 어차피 기본값과 같다. */
  animation: modal-in 0.24s var(--ease) backwards;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex: none;
}
.modal-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body { padding: 20px; overflow: auto; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  flex: none;
}

/* ============================== Lightbox (fullscreen crop) ============================== */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 10, 11, 0.82);
  display: flex; flex-direction: column;
  backdrop-filter: blur(2px);
  animation: backdrop-in 0.16s ease-out both;
}
.lightbox-stage img { animation: modal-in 0.2s var(--ease) both; }
/* 전체화면에서 연 재크롭 모달 — 기본 modal z-index(100)가 lightbox(200) 뒤에
   깔리므로 위로 끌어올린다. */
.lightbox-recrop .modal-backdrop { z-index: 300; }
.lightbox-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  color: #fff; flex-shrink: 0;
}
.lightbox-title {
  font-family: var(--font-mono); font-size: 12px;
  color: rgba(255, 255, 255, 0.72); flex: 1;
}
.lightbox-count {
  font-family: var(--font-mono); font-size: 12px;
  color: rgba(255, 255, 255, 0.9); flex: none;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
/* prev/next — fixed to the viewport edges, vertically centered */
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 201;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff; cursor: pointer;
  transition: background 0.12s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-nav .ic { width: 24px; height: 24px; }
/* eraser canvas — laid exactly over the displayed crop (positioned in JS) */
.erase-canvas {
  position: absolute; z-index: 202;
  cursor: none; touch-action: none;   /* native cursor hidden → brush circle shown */
}
/* brush-size circle that follows the pointer (size = 2×brush, set inline) */
.erase-cursor {
  position: absolute; z-index: 203; pointer-events: none;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.08s;
}
.erase-cursor.visible { opacity: 1; }
.lightbox-hint {
  flex-shrink: 0; text-align: center;
  padding: 8px 16px 16px;
  font-size: 12px; color: rgba(255, 255, 255, 0.78);
}
.lightbox-bar input[type="range"] { accent-color: #fff; width: 110px; }
.lightbox-bar .icon-btn { color: #fff; }
.lightbox-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.lightbox-stage {
  flex: 1; min-height: 0; position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 0 72px 28px;
}
/* whole problem fits the viewport — never need scroll bars to read it */
.lightbox-stage img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: var(--r-sm);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ============================== Table ============================== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.table th {
  color: var(--text-2); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.table tr:last-child td { border-bottom: 0; }

/* ============================== Icons (inline SVG carriers) ============================== */
.ic { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -2px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 18px; height: 18px; vertical-align: -3px; }
.ic-sm { width: 12px; height: 12px; }
.ic-flip { transform: rotate(180deg); }
.icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: none; border: 1px solid transparent;
  cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--navy-5); color: var(--text); }

/* 라벨 옆 설명 토글 '?' 버튼 (2026-07-24 — Upload '처리 후 AI 답 자동 생성').
   상시 설명 문구를 접어 두고 누률 때만 펼친다. */
.qmark-btn { width: 22px; height: 22px; border-radius: 50%; color: var(--text-3); margin-left: 2px; flex: none; }
.qmark-btn:hover, .qmark-btn.on { color: var(--navy); background: var(--navy-5); }

/* 수정 모드 카드 우상단 도구 — 재크롭 + 삭제(휴지통) 나란히. 둘 다 들어가면
   헤더 텍스트가 가리지 않게 head 의 우측 여백을 늘린다. */
.prob-edit-tools { display: flex; gap: 6px; }
.prob-edit-tools .icon-btn { background: rgba(255, 255, 255, 0.86); }
.prob-del:hover { background: #fdf2f2; color: var(--danger); }
.problem:has(.prob-edit-tools) .head { padding-right: 64px; }

/* ============================== Login ============================== */
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
  background: var(--bg);
  word-break: keep-all;
}
.login-hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  display: flex; flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px;
  color: #fff;
}
.login-hero canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
.login-hero-brand {
  position: absolute; top: 40px; left: 40px;
  z-index: 3;
  display: flex; flex-direction: row; align-items: center;
  gap: 14px;
  pointer-events: auto; cursor: pointer; text-decoration: none;
}
.login-hero-brand:hover { text-decoration: none; opacity: 0.9; }
.login-hero-brand .wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: #ffffff;
}
.login-hero-body {
  position: relative; z-index: 2;
  pointer-events: none;
  max-width: 620px;
  text-align: center;
}
.login-hero-body .greeting {
  font-size: 76px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0 0 4px;
  color: #fff;
}
.login-hero-body h1 {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 24px;
  color: #fff;
}
.login-hero-body .hero-sub {
  font-size: 19px;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 6px;
  line-height: 1.55;
  font-weight: 400;
}
.login-hero-body .hero-sub.muted {
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}
/* 로그인 히어로 슬로건 한 줄 표시 (2026-07-24 박현우) — 문장이 길어 데스크톱
   에서만 컨테이너를 넓히고 폰트를 줄여 nowrap. 모바일은 자연 줄바꿈. */
@media (min-width: 1100px) {
  .login-hero-body { max-width: 740px; }
  .login-hero-body .hero-sub.one-line { white-space: nowrap; font-size: 15px; }
}

.login-form {
  display: flex; align-items: center; justify-content: center;
  padding: 64px 56px;
}
.login-card {
  width: 100%; max-width: 380px;
}
.login-card h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.login-card .sub {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
  margin: 0 0 28px;
}
/* 가입 후 인증 대기 / 인증 결과 화면 (2026-07-26 박현우 '전체적인 디자인이 좀
   별로야, 정리해줘'). 링크 하나 던지고 끝내는 대신 '어디로 갔고 · 무엇을 누르고 ·
   그다음 무슨 일이 일어나는지' 를 순서로 보여 준다. */
.verify-to {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 11px 13px;
  margin: 0 0 18px;
}
.verify-to-label {
  color: var(--text-3);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: none;
}
.verify-to-email {
  color: var(--text);
  font-size: 13px; font-weight: 600;
  overflow-wrap: anywhere;      /* 긴 주소가 카드를 밀지 않게 */
}
.verify-steps {
  list-style: none;
  counter-reset: verify-step;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 13px;
}
.verify-steps > li {
  counter-increment: verify-step;
  position: relative;
  padding-left: 32px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.verify-steps > li::before {
  content: counter(verify-step);
  position: absolute; left: 0; top: -1px;
  width: 21px; height: 21px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--navy); color: var(--navy-fg);
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.verify-steps > li strong { color: var(--text); font-weight: 600; }
.verify-note {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.65;
  margin: 16px 0 0;
}

.signup-ai-consent {
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 12px;
}
.signup-ai-consent > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.signup-ai-consent input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--navy);
}
.signup-ai-consent-detail {
  display: block;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.55;
  margin-top: 4px;
}
.signup-ai-consent-links {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.5;
  margin: 8px 0 0 26px;
}
.signup-ai-consent a {
  color: var(--navy);
  text-decoration: underline;
}

@media (max-width: 920px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: 320px; padding: 32px; }
  .login-form { padding: 40px 28px; }
  .login-hero-brand { top: 24px; left: 24px; gap: 10px; }
  .login-hero-brand .wordmark { font-size: 18px; }
  .login-hero-body { max-width: 100%; }
  .login-hero-body .greeting { font-size: 48px; }
  .login-hero-body h1 { font-size: 30px; }
  .login-hero-body .hero-sub { font-size: 15px; }
}

/* ============================== Landing (anonymous) ============================== */
/* Marketing + product page for logged-out visitors. Same visual language as the
 * app: white base, navy(#34327B) accent on ~10% of pixels, Pretendard, hairlines,
 * shadow tokens sm/md/lg only. All mocks are plain divs (no images). Entrance
 * motion is transform/opacity only, toggled by .is-mounted (load) or .is-in
 * (scroll reveal) — the global prefers-reduced-motion rule neutralises it. */
/* overflow-x: clip (not hidden) — clip trims horizontal overflow without turning
 * .landing into a scroll container, so the sticky nav keeps anchoring to the window. */
.landing { background: var(--surface); color: var(--text); overflow-x: clip; word-break: keep-all; }

/* ---- reveal primitives (scoped to .landing; no permanent will-change — reveal
 *      is one-shot, the observer disconnects after the first intersection) ---- */
.landing .spec-row {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.landing .spec-row.is-in {
  opacity: 1; transform: none;
}

/* ---- sticky top nav ---- */
.landing-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 32px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.landing-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.landing-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.landing-brand:hover { text-decoration: none; }
.landing-brand .lb-word { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); }
.landing-nav-links { display: flex; gap: 2px; margin-left: 10px; }
.landing-nav-links .ln-link {
  position: relative; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color var(--t-fast);
}
.landing-nav-links .ln-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform 0.22s var(--ease);
}
.landing-nav-links .ln-link:hover { color: var(--text); text-decoration: none; }
.landing-nav-links .ln-link:hover::after { transform: scaleX(1); }
.landing-nav-cta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---- hero (navy + dandelion particles) ---- */
.landing-hero {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff;
  padding: 104px 32px 104px; text-align: center;
}
.landing-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.landing-hero-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.lh-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  padding: 6px 14px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px;
  margin-bottom: 22px;
}
.lh-title {
  font-size: 60px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.08;
  margin: 0 0 24px; color: #fff; text-wrap: balance;
}
.lh-sub {
  font-size: 20px; line-height: 1.65; font-weight: 400;
  color: rgba(255, 255, 255, 0.82); max-width: 660px; margin: 0 auto 30px; text-wrap: pretty;
}
.lh-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lh-trust { margin: 18px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* hero entrance stagger (load → .is-mounted) */
.lh-eyebrow, .lh-title, .lh-sub, .lh-cta, .lh-trust {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.landing.is-mounted .lh-eyebrow { opacity: 1; transform: none; transition-delay: 0.02s; }
.landing.is-mounted .lh-title   { opacity: 1; transform: none; transition-delay: 0.08s; }
.landing.is-mounted .lh-sub     { opacity: 1; transform: none; transition-delay: 0.16s; }
.landing.is-mounted .lh-cta     { opacity: 1; transform: none; transition-delay: 0.24s; }
.landing.is-mounted .lh-trust   { opacity: 1; transform: none; transition-delay: 0.30s; }

/* ---- shared section scaffolding ---- */
.landing-section { max-width: 1080px; margin: 0 auto; padding: 96px 32px; scroll-margin-top: 76px; }
.landing-section.alt { max-width: none; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-section.alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.ls-head { text-align: center; max-width: 660px; margin: 0 auto 48px; }
.ls-head.left { text-align: left; max-width: 620px; margin: 0 0 40px; }
.ls-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); margin-bottom: 12px; }
.ls-head h2 { font-size: 42px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.2; margin: 0 0 14px; text-wrap: balance; }
.ls-lede { font-size: 17.5px; color: var(--text-2); font-weight: 400; line-height: 1.6; margin: 0; text-wrap: pretty; }

/* ---- capabilities (clean feature cards — replaced the imitation-UI mocks) ---- */
.cap-section { padding-bottom: 76px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px 24px;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease),
              border-color var(--t-fast), box-shadow var(--t-fast);
}
.feat-grid.is-in .feat-card { opacity: 1; transform: none; }
.feat-card:hover { border-color: var(--navy-20); box-shadow: var(--shadow-md); }
.feat-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  background: var(--navy-5); border: 1px solid var(--navy-10); color: var(--navy);
}
.feat-ico .ic { width: 21px; height: 21px; }
.feat-card h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.feat-lead { font-size: 14px; font-weight: 600; color: var(--navy); line-height: 1.45; margin: 0 0 10px; }
.feat-body { flex: 1; font-size: 16px; color: var(--text-2); line-height: 1.65; font-weight: 400; margin: 0 0 16px; text-wrap: pretty; }
.feat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.feat-chip .ic { width: 12px; height: 12px; color: var(--ok); }
@media (max-width: 860px) { .feat-grid { grid-template-columns: 1fr; } }

/* ---- workbook (panel + canvas) ---- */
.wb-section .ls-head.left { margin-bottom: 36px; }
.wb-demo { display: grid; grid-template-columns: 296px 1fr; gap: 24px; align-items: stretch; }
.wb-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px; }
.wb-field { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wb-field-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); margin: 16px 0 9px; }
.wb-field .wb-field-label { margin: 0; flex: 0 0 auto; }
.wb-select { flex: 1; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b70' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 7px 30px 7px 11px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.wb-target-note { max-height: 0; opacity: 0; overflow: hidden; font-size: 12.5px; color: var(--navy); line-height: 1.5; transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease), margin 0.3s var(--ease); }
.wb-target-note.show { max-height: 80px; opacity: 1; margin-top: 8px; }
.wb-chips { display: flex; flex-direction: column; gap: 6px; }
.wb-chip { display: flex; align-items: center; gap: 8px; appearance: none; cursor: pointer; text-align: left; width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 8px 11px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.wb-chip:hover { border-color: var(--border-2); }
.wb-chip.on { background: var(--navy-5); border-color: var(--navy-20); color: var(--text); }
.wb-check { display: inline-flex; width: 16px; height: 16px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid var(--border-2); border-radius: 4px; background: var(--surface); }
.wb-chip.on .wb-check { background: var(--navy); border-color: var(--navy); }
.wb-check .ic { width: 12px; height: 12px; color: #fff; }
.wb-chip-n { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wb-seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r-sm); overflow: hidden; }
.wb-seg-btn { appearance: none; background: var(--surface); border: 0; border-right: 1px solid var(--border); cursor: pointer; padding: 7px 16px; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.wb-seg-btn:last-child { border-right: 0; }
.wb-seg-btn.on { background: var(--navy); color: #fff; }
.wb-canvas { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 24px; }
.wb-stack { position: relative; flex: 1; display: flex; justify-content: center; padding: 8px 0 10px; }
.wb-page { width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.wb-page.front { position: relative; z-index: 3; padding: 18px 20px; }
.wb-page.ghost { position: absolute; top: 0; height: 100%; z-index: 1; }
.wb-page.ghost.g1 { transform: translate(8px, 8px); z-index: 2; }
.wb-page.ghost.g2 { transform: translate(16px, 16px); z-index: 1; }
.wb-page-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: -0.02em; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.wb-page-head .brand-mark { width: 15px; height: 15px; }
.wb-q { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; animation: wb-qin 0.3s var(--ease) both; }
@keyframes wb-qin { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.wb-q-no { font-size: 12px; font-weight: 700; color: var(--navy); flex: 0 0 14px; font-variant-numeric: tabular-nums; }
.wb-q-line { flex: 1; height: 7px; border-radius: 4px; background: #eceef2; }
.wb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.wb-counter { font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.wb-print .ic { width: 15px; height: 15px; }

/* ---- features (definition list) ---- */
.spec-section { padding-top: 88px; padding-bottom: 88px; }
.spec-title { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 22px; }
.spec-list { border-top: 1px solid var(--border); }
.spec-row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: baseline; position: relative; padding: 20px 16px; border-bottom: 1px solid var(--border); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background var(--t-fast); }
.spec-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; background: var(--navy); border-radius: 2px; transform: scaleY(0); transform-origin: top; transition: transform 0.25s var(--ease); }
.spec-row:hover { background: var(--surface-2); }
.spec-row:hover::before { transform: scaleY(1); }
.spec-term { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.spec-def { font-size: 14.5px; color: var(--text-2); line-height: 1.6; font-weight: 400; }

/* ---- proof (comparison table) ---- */
.proof-section { padding-top: 88px; padding-bottom: 96px; }
/* before/after comparison — 기존 방식(회색·✗) vs Jayzip(네이비·✓) 2-card */
.cmp-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 860px; margin: 0 auto;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.cmp-wrap.is-in { opacity: 1; transform: none; }
.cmp-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 30px 26px; background: var(--surface); }
.cmp-card.old { background: var(--surface-2); }
.cmp-card.new { border: 1.5px solid var(--navy); background: var(--navy-5); box-shadow: var(--shadow-md); }
.cmp-tag { font-size: 13px; font-weight: 700; text-align: center; color: var(--text-3); }
.cmp-card.new .cmp-tag { color: var(--navy); }
.cmp-num { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; text-align: center; margin-top: 6px; color: var(--text-3); }
.cmp-card.new .cmp-num { color: var(--navy); }
.cmp-sub { font-size: 12.5px; color: var(--text-3); text-align: center; margin-top: 2px; }
.cmp-list { display: flex; flex-direction: column; gap: 13px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.cmp-card.new .cmp-list { border-top-color: var(--navy-10); }
.cmp-item { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.cmp-item .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--text-3); }
.cmp-card.new .cmp-item { color: var(--text); font-weight: 500; }
.cmp-card.new .cmp-item .ic { color: var(--navy); }
@media (max-width: 640px) { .cmp-wrap { grid-template-columns: 1fr; } }

/* ---- pricing (요금제) — navy plan card + credit cost list ---- */
.pricing-section { padding-top: 88px; padding-bottom: 96px; }
.pricing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 860px; margin: 0 auto;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.pricing-grid.is-in { opacity: 1; transform: none; }
.price-plan { border: 1.5px solid var(--navy); border-radius: var(--r-lg); background: var(--navy-5); padding: 30px 28px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.pp-name { font-size: 15px; font-weight: 700; color: var(--navy); }
.pp-price { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin: 6px 0 18px; line-height: 1; }
.pp-price span { font-size: 16px; font-weight: 600; color: var(--text-2); margin-left: 5px; }
.pp-feats { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 11px; }
.pp-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; color: var(--text); line-height: 1.45; }
.pp-feats li .ic { width: 17px; height: 17px; color: var(--navy); flex: none; margin-top: 1px; }
.pp-feats b { color: var(--navy); }
.price-plan .btn { margin-top: auto; }
.price-costs { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 30px 28px; }
.pc-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.price-cost-list { display: flex; flex-direction: column; }
.price-cost-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.price-cost-row:last-child { border-bottom: 0; }
.pcr-label { font-weight: 600; color: var(--text); }
.pcr-v { color: var(--text-2); font-size: 13.5px; }
.pcr-v b { color: var(--navy); font-size: 15px; font-variant-numeric: tabular-nums; }
.price-foot { margin: 14px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }

/* ---- final CTA (navy band) ---- */
.landing-cta { text-align: center; padding: 96px 32px; }
.landing-cta.navy { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.lc-glow { position: absolute; left: 50%; top: 40%; width: 680px; height: 680px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 62%); animation: lc-breathe 8s ease-in-out infinite; pointer-events: none; }
@keyframes lc-breathe { 0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
.lc-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.landing-cta.navy h2 { font-size: 38px; letter-spacing: -0.03em; line-height: 1.2; margin: 0 0 12px; color: #fff; text-wrap: balance; }
.landing-cta.navy p { font-size: 17.5px; color: rgba(255, 255, 255, 0.78); font-weight: 400; margin: 0 0 26px; }
.lc-go { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.lc-textlink { display: block; width: fit-content; margin: 16px auto 0; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.lc-textlink:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lc-trust { margin-top: 22px !important; font-size: 13px; color: rgba(255, 255, 255, 0.55) !important; }

/* ---- footer ---- */
.landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 32px; border-top: 1px solid var(--border); background: var(--bg); }
.landing-footer .lf-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); }
.landing-footer .lf-copy { font-size: 13px; color: var(--text-3); }

/* ---- subject logos band (지원 과목 — 실제 공식 시험 로고, 풀컬러) ---- */
.subj-band {
  text-align: center;
  padding: 40px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.subj-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 22px;
}
.subj-logos {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 40px; max-width: 960px; margin: 0 auto;
}
.subj-logo {
  height: 40px; width: auto; max-width: 174px; object-fit: contain;
  opacity: 0.92; transition: opacity var(--t-fast);
}
.subj-logo:hover { opacity: 1; }
/* 래스터(JPG) 로고 — 흰 배경을 밴드에 녹이고(multiply) 글씨만 조금 더 크게 */
.subj-logo-photo { mix-blend-mode: multiply; height: 46px; max-width: 210px; }

/* ---- feature walk (핵심 기능 좌우 교차 이미지/설명) ---- */
/* 스크린샷을 키워 달라는 요청(2026-07-26 박현우 '전체 사진들만 조금만 더')에
   맞춰 섹션만 1080→1160 으로 넓혔다. 칸 비중(1.4fr)은 그대로 둔다 — 비중을
   올리면 사진이 더 커지는 대신 좁은 데스크톱(≤1160px)에서 글 칸이 같이
   좁아진다. 섹션만 넓히면 사진·글 칸이 함께 커져 손해 보는 쪽이 없다. */
.lp-feature-sec { padding-top: 64px; padding-bottom: 64px; max-width: 1160px; }
.lp-feature {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 52px; align-items: center;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.lp-feature.is-in { opacity: 1; transform: none; }
/* reversed: 이미지 왼쪽, 텍스트 오른쪽 (데스크톱) — 이미지 칸(1.4fr)을 항상 넓게 */
.lp-feature.reversed { grid-template-columns: 1.4fr 1fr; }
/* wide: 가로로 넓은 스크린샷(AI 채점 화면) 전용 (2026-07-26 박현우 '사진이
   작아 잘 안 보인다' → '텍스트와 사진 둘 다' → '전체 사진들만 조금만 더').
   학습지 위쪽 UI 를 잘라내 1.71:1 로 더 납작해졌다 — 세로가 긴 다른 두 장과
   같은 칸 폭이면 혼자 작아 보이므로, 이 행만 섹션을 더 넓히고(1160→1360)
   이미지 칸 비중을 올려 사진·글 칸·글자를 함께 키운다.
   임계폭 1300px = 이 행 글 칸이 다른 행(435px)과 같아지는 지점
   ((W-64-52)/2.7 ≈ 435) — 그 아래에선 이 행만 좁아지므로 기본 비중·글자를
   그대로 쓴다 (모바일도 이 가드로 자동 제외). */
.lp-feature-sec.wide { max-width: 1360px; }
@media (min-width: 1300px) {
  .lp-feature.wide { grid-template-columns: 1fr 1.7fr; }
  .lp-feature.wide.reversed { grid-template-columns: 1.7fr 1fr; }
  .lp-feature.wide .lp-feat-text { max-width: 500px; }
  .lp-feature.wide .lp-eyebrow { font-size: 18px; }
  .lp-feature.wide .lp-feat-text h2 { font-size: 37px; }
  .lp-feature.wide .lp-body { font-size: 19px; }
  .lp-feature.wide .lp-points li { font-size: 17px; }
  .lp-feature.wide .lp-points li .ic { width: 20px; height: 20px; }
}
.lp-feature.reversed .lp-feat-text  { order: 2; }
.lp-feature.reversed .lp-feat-media { order: 1; }
.lp-feat-text { max-width: 470px; }
.lp-eyebrow {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--navy); margin-bottom: 14px;
}
.lp-feat-text h2 {
  font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.22;
  margin: 0 0 16px; text-wrap: balance;
}
.lp-body { font-size: 17.5px; color: var(--text-2); line-height: 1.7; font-weight: 400; margin: 0 0 22px; text-wrap: pretty; }
.lp-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lp-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; color: var(--text); line-height: 1.5; font-weight: 500; }
.lp-points li .ic { width: 19px; height: 19px; color: var(--navy); flex: none; margin-top: 1px; }
/* 스크린샷 플레이스홀더 프레임 — 실제 스샷으로 교체 시 div → <img className="lp-shot lp-shot-img" …/> */
.lp-shot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; aspect-ratio: 16 / 10; width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  color: var(--text-3);
}
.lp-shot-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--navy-5); border: 1px solid var(--navy-10); color: var(--navy);
}
.lp-shot-ico .ic { width: 23px; height: 23px; }
.lp-shot-cap { font-size: 14px; font-weight: 700; color: var(--text-2); }
.lp-shot-hint { font-size: 12px; color: var(--text-3); }
.lp-shot-img { aspect-ratio: auto; height: auto; padding: 0; object-fit: cover; background: var(--surface); overflow: hidden; }

/* ---- extra features (2-card, 좁은 그리드) ---- */
.extra-section { padding-top: 72px; padding-bottom: 88px; }
.lp-extra { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 980px; margin: 0 auto; }

/* feature walk / subject band 반응형 */
@media (max-width: 860px) {
  .lp-feature, .lp-feature.reversed,
  .lp-feature.wide, .lp-feature.wide.reversed { grid-template-columns: 1fr; gap: 34px; }
  /* 모바일: 항상 텍스트 먼저, 이미지 아래 (reversed 무시) */
  .lp-feature.reversed .lp-feat-text  { order: 0; }
  .lp-feature.reversed .lp-feat-media { order: 0; }
  .lp-feat-text { max-width: none; }
  .lp-feat-text h2 { font-size: 30px; }
}
@media (max-width: 640px) {
  .subj-band { padding: 30px 22px; }
  .subj-logos { gap: 24px 30px; }
  .subj-logo { height: 30px; max-width: 116px; }
  .subj-logo-photo { height: 34px; max-width: 150px; }
  .lp-extra { grid-template-columns: 1fr; }
}

/* ---- responsive ---- */
@media (max-width: 980px) {
  .wb-demo { grid-template-columns: 1fr; gap: 36px; }
  .wb-panel { order: 0; }
}
@media (max-width: 860px) {
  .spec-row { grid-template-columns: 130px 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .landing-nav { padding: 0 18px; height: 58px; gap: 10px; }
  .landing-nav-links { display: none; }
  .landing-hero { padding: 64px 22px 72px; }
  .lh-title { font-size: 40px; }
  .lh-sub { font-size: 17px; }
  .landing-section { padding: 60px 22px; }
  .ls-head h2, .landing-cta.navy h2 { font-size: 30px; }
  .landing-cta { padding: 64px 22px; }
  .spec-row { grid-template-columns: 1fr; gap: 4px; padding: 16px 14px; }
}
/* reduced-motion: the global rule zeroes durations but not delays — kill the
 * landing's entrance/stagger delays too so content appears at once, no drip. */
@media (prefers-reduced-motion: reduce) {
  .landing *, .landing *::before, .landing *::after {
    transition-delay: 0s !important; animation-delay: 0s !important;
  }
}

/* ============================== Utility ============================== */
.muted { color: var(--text-2); }
.mono  { font-family: var(--font-mono); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }
.right { text-align: right; }
.nowrap{ white-space: nowrap; }
.navy  { color: var(--navy); }
.scroll-x { overflow-x: auto; }

/* student roster row */
.student-row {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  background: none; border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-2);
  position: relative;
}
.student-row:hover { background: var(--navy-5); color: var(--text); }
.student-row[data-active="true"] {
  background: var(--navy-5);
  color: var(--text);
}
.student-row[data-active="true"]::before {
  content: ""; position: absolute;
  left: -1px; top: 8px; bottom: 8px;
  width: 2px; background: var(--navy);
  border-radius: 0 2px 2px 0;
}
.student-row .name {
  font-weight: 600; font-size: 13.5px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.student-row[data-active="true"] .name { color: var(--navy); }

/* ---- 학생 로스터 리디자인 (2026-07-24) — 심플: 아바타 + 이름만 ---- */
.sr-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-5); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.sr-avatar.lg { width: 32px; height: 32px; font-size: 14px; }
/* 그룹 시험 배지 (그룹 상세 헤더) */
.rg-exam {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; background: var(--navy-5); color: var(--navy);
  flex: none;
}
/* 그룹 설정 모달 — 삭제 구역은 위와 구분선으로만 조용히 분리 */
.rg-danger { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 2px; }

/* 학생 타일 (2026-07-24 재편) — 라이브러리 folder-tile 문법 공유, 아바타 글리프.
   색은 이름 기반 파스텔(인라인 style)이 덮는다 — 여기는 형태·폴백만. */
.st-tile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--navy-5); color: var(--navy);
  border: 1.5px solid var(--navy-10);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  /* folder-glyph(64px 높이)와 세로 리듬 맞춤 */
  margin: 8px 0;
}
.folder-tile:hover .st-tile-avatar {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 17, 26, 0.10);
}

/* 그룹 글리프 (2026-07-25) — 폴더 대신 멤버 아바타 클러스터 카드 */
.grp-glyph {
  width: 84px; height: 64px; border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--navy-5));
  border: 1px solid var(--navy-10);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.folder-tile:hover .grp-glyph {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 17, 26, 0.10);
}
.grp-glyph .ic { width: 24px; height: 24px; }
.grp-avatars { display: flex; align-items: center; }
.grp-avatars .ga {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff;
  background: var(--navy-5); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  margin-left: -9px;
  box-shadow: 0 1px 2px rgba(16, 17, 26, 0.10);
}
.grp-avatars .ga:first-child { margin-left: 0; }
.grp-avatars .ga.more { background: var(--navy); color: #fff; font-size: 10px; }

/* 폴더 순서 삽입 표시 (2026-07-25) — 가장자리 드롭 시 그 옆에 세로 바 */
.folder-tile.ins-before { box-shadow: -8px 0 0 -5px var(--navy); }
.folder-tile.ins-after  { box-shadow:  8px 0 0 -5px var(--navy); }

/* 학생 추가 모달 — 초대 채널 섹션 */
.inv-sec {
  padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r);
}
.inv-head { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.inv-qr { margin-top: 8px; }
.inv-qr-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px;
  display: inline-block; margin-top: 8px;
}

/* 초대 수락 화면 — 학생이 링크로 들어와 보는 첫 화면. 카드 제목도 부연 설명도
   없이 '누가 불렀는지 + 수락' 만 가운데 세운다 (2026-08-02 박현우). */
.inv-accept {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center; padding: 14px 0;
}
.inv-accept-msg { font-size: 16px; }

/* MCQ grid responsive — auto-fill 이 칼럼 수를 알아서 줄이고, 모바일만 1칼럼 강제 */
@media (max-width: 720px) {
  .problem-grid { grid-template-columns: 1fr; }
  .page { padding: 24px 20px; }
  .sidebar { display: none; }
}

/* hide focus rings when not keyboard nav */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ============================================================
   v3 polish — 모션·토스트·부트 스플래시·모바일 내비·드롭존·스켈레톤
   ============================================================ */

/* ---- boot splash: bootstrap 응답 전 로그인 화면 플래시 방지 ---- */
.boot-splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center;
  background: var(--surface);
}
.boot-splash .mark {
  width: 52px; height: 52px; border-radius: 50%;
  animation: splash-pulse 1.5s ease-in-out infinite;
}
.boot-splash .word {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-2);
}
@keyframes splash-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.94); }
}

/* ---- toast (alert() 대체) ---- */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 40px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; gap: 10px; align-items: flex-start;
  background: #1c1c21; color: #f3f3f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 11px 14px;
  font-size: 13px; line-height: 1.5;
  animation: toast-in 0.26s var(--ease) both;
}
.toast.leaving { animation: toast-out 0.2s ease-in both; }
.toast .t-dot {
  width: 7px; height: 7px; border-radius: 99px; margin-top: 6px; flex: none;
  background: var(--text-3);
}
.toast.ok    .t-dot { background: #3ecf6f; }
.toast.error .t-dot { background: #ff6b6b; }
.toast.info  .t-dot { background: #7b8cff; }
/* 진행 중 상태 pill 스피너 (window.status run) */
.toast .t-spin {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #7b8cff;
  animation: t-spin 0.8s linear infinite;
}
@keyframes t-spin { to { transform: rotate(360deg); } }
.toast button.t-close {
  margin-left: auto; flex: none;
  background: none; border: 0; color: rgba(255, 255, 255, 0.5);
  cursor: pointer; padding: 0 0 0 6px; font-size: 14px; line-height: 1.3;
}
.toast button.t-close:hover { color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(6px); }
}

/* ---- 모바일 상단 내비 (사이드바 숨김 시 유일한 이동 수단) ---- */
.mobile-topbar { display: none; }
@media (max-width: 720px) {
  .mobile-topbar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; gap: 4px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .mobile-topbar .mt-brand {
    font-weight: 800; font-size: 15px; letter-spacing: -0.03em;
    color: var(--navy); text-decoration: none;
    margin-right: 6px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 7px;
  }
  /* 모바일 현재 워크스페이스 라벨 (2026-07-24) — 브랜드 옆 축약 표기 */
  .mobile-topbar .mt-ws {
    font-size: 11px; font-weight: 700; color: var(--text-2);
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    margin-right: 4px;
  }
  .mobile-topbar .mt-ws:hover { color: var(--navy); text-decoration: none; }
  .mobile-topbar a.mt-link {
    padding: 6px 10px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--text-2); text-decoration: none;
    white-space: nowrap;
  }
  .mobile-topbar a.mt-link.active {
    background: var(--navy-5); color: var(--navy); font-weight: 600;
  }
  .mobile-topbar .mt-link-off {
    padding: 6px 10px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--text-3); white-space: nowrap;
    cursor: not-allowed; opacity: 0.7;
  }
  .mobile-topbar .mt-out {
    margin-left: auto; flex: none;
  }
}

/* ---- 업로드 드롭존 ---- */
.dropzone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 22px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.dropzone:hover { border-color: var(--navy-20); background: var(--navy-5); }
.dropzone.drag-over {
  border-color: var(--navy); background: var(--navy-5);
  transform: scale(1.005);
}
.dropzone .dz-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--navy-10); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.dropzone .dz-icon .ic { width: 20px; height: 20px; }
.dropzone .dz-title { font-weight: 600; font-size: 14px; }
.dropzone .dz-hint { font-size: 12px; color: var(--text-3); }
/* 업로드 단위 안내 — 바로 윗줄 '여러 개 한 번에'의 범위를 한정한다. 종전엔
   드롭존 아래 info 배너였는데 시선을 뺏어 힌트 줄로 합쳤다 (2026-08-02 박현우).
   hint 보다 한 단계 진한 색 + 아이콘으로 '조건'이라는 걸 구분한다. */
.dropzone .dz-note {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2);
}
.dropzone .dz-note .ic { width: 13px; height: 13px; flex: none; color: var(--navy); }
.dropzone.disabled { opacity: 0.55; pointer-events: none; }

/* 파일 행 — 추가된 업로드 후보 */
.file-row {
  display: flex; gap: 8px; align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  animation: page-in 0.22s var(--ease);
}

/* ---- crop 이미지 로딩 스켈레톤 ---- */
.crop-real { position: relative; }
.crop-real img { transition: opacity 0.25s ease-out; }
.crop-real.loading img { opacity: 0; }
.crop-real.loading::before {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, #f1f2f5 40%, #fafbfc 50%, #f1f2f5 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}

/* ---- 사이드바 미세 모션 ---- */
.sidebar-nav a { transition: background var(--t-fast), color var(--t-fast); }
.sidebar-nav a .ic { transition: transform var(--t-fast); }
.sidebar-nav a:hover .ic { transform: translateY(-1px); }
.sidebar-nav a.active .ic { color: var(--navy); }
.icon-btn { transition: background var(--t-fast), color var(--t-fast); }
.chip { box-shadow: var(--shadow-sm); }
.chip:active { transform: scale(0.97); }

/* metric 카드도 카드 — 살짝 그림자 */
.metric { box-shadow: var(--shadow-sm); }

/* 빈 상태 — 아이콘 슬롯 */
.empty .empty-ic {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--navy-5); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.empty .empty-ic .ic { width: 22px; height: 22px; }

/* 정돈된 스크롤바 (내부 패널) */
.filepick-list::-webkit-scrollbar,
.log-tail::-webkit-scrollbar { width: 8px; }
.filepick-list::-webkit-scrollbar-thumb,
.log-tail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18); border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}

/* ---- 접근성: 모션 최소화 선호 시 전부 끔 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 크레딧 & 결제 ===== */
/* 크레딧 탭 — 사이드바 맨 아래에 붙도록 auto 마진으로 하단 정렬
   (프로필은 우상단 상단바로 이동, 사이드바 footer 제거 — 2026-06-29). */
.credit-pill {
  display: flex; align-items: center; gap: 8px;
  margin: auto 10px 12px;
  padding: 9px 12px;
  background: var(--navy-5);
  border: 1px solid var(--navy-10);
  border-radius: var(--r);
  color: var(--navy);
  font-weight: 700; font-size: 13px;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
.credit-pill:hover { background: var(--navy-10); text-decoration: none; }
.credit-pill.active { background: var(--navy); color: var(--navy-fg); border-color: var(--navy); }
.credit-pill.active .cp-label { color: rgba(255,255,255,0.78); }
.credit-pill svg { width: 16px; height: 16px; flex: none; }
.credit-pill .cp-label { font-weight: 600; font-size: 13px; }
.credit-pill .cp-val { margin-left: auto; font-variant-numeric: tabular-nums; }
.credit-pill.compact { margin: 0; padding: 5px 9px; font-size: 12px; }
.credit-pill.compact .cp-val { margin-left: 0; }

/* 버튼 옆 크레딧 안내 문구 */
.credit-hint {
  display: inline-block; margin-left: 10px;
  font-size: 12px; color: var(--text-3);
  vertical-align: middle;
}

/* 버튼 안 작은 크레딧 표시 (2026-07-24 박현우 — 버튼 옆 안내 문구 대신 버튼 안에 작게) */
.btn-credit { font-size: 11px; font-weight: 500; opacity: .72; margin-left: 7px; letter-spacing: 0; }

/* 결제수단 선택 */
.billing-methods { margin-bottom: var(--gap-4); }
.paymethods { display: flex; gap: var(--gap-3); flex-wrap: wrap; }
.paymethod {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: 13.5px;
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.paymethod:hover:not(.disabled) { border-color: var(--navy); }
.paymethod.active { border-color: var(--navy); background: var(--navy-5); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.paymethod.disabled { opacity: 0.55; cursor: not-allowed; }
.paymethod .pm-tag {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; padding: 1px 7px; letter-spacing: 0.02em;
}
.pm-note { margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); }

/* 빌링 그리드 */
.billing-grid {
  display: grid; gap: var(--gap-4);
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--gap-4);
}
@media (max-width: 880px) { .billing-grid { grid-template-columns: 1fr; } }

.billing-balance .bal-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.billing-balance .bal-row svg { width: 34px; height: 34px; color: var(--navy); flex: none; }
.bal-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.bal-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bal-renew { margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* 아래 plan-* / pack-* / paymethod-* / billing-grid 규칙은 2026-07-26 부터
   휴면 상태 — 요금 확정 전이라 Billing.jsx 에서 월 구독·추가 크레딧·결제수단
   카드를 뺐다. 요금이 정해져 카드를 되살릴 때 그대로 다시 쓴다. */
.plan-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text-2); }
.plan-feats { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; gap: 8px; }
.plan-feats li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); line-height: 1.45; }
.plan-feats li svg { width: 15px; height: 15px; color: var(--ok); flex: none; margin-top: 2px; }
.pack-price { font-size: 15px; font-weight: 700; margin-top: 4px; }
.pack-price .pack-unit { font-size: 12px; font-weight: 500; color: var(--text-2); }
.pack-note { font-size: 12.5px; color: var(--text-2); margin: 10px 0 16px; line-height: 1.5; }

/* 비용표 */
/* (크레딧 사용량 비용표 카드는 2026-07-24 제거 — cost-* 규칙 함께 삭제) */

/* 사용 내역 */
.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger-table td { padding: 9px 6px; border-bottom: 1px solid var(--border); }
.ledger-table tr:last-child td { border-bottom: none; }
.lg-date { color: var(--text-3); white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
.lg-reason { color: var(--text); }
.lg-delta { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-delta.pos { color: var(--ok); }
.lg-delta.neg { color: var(--text-2); }
.lg-bal { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* '더보기' — 내역이 길어 페이지가 끝없이 늘어나지 않게 (2026-07-26) */
.ledger-more { display: flex; justify-content: center; padding-top: 10px;
  border-top: 1px solid var(--border); margin-top: 4px; }
.billing-page .card { margin-bottom: var(--gap-4); }

/* 결제 안내(문의 → 계좌이체) — 자동결제 미연결 동안의 결제 방법 카드 */
.billing-inquiry { background: var(--navy-5); border-color: var(--navy); }
.billing-inquiry .bi-lead { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 14px; }
.billing-inquiry .bi-steps { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 7px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.billing-inquiry .bi-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.billing-inquiry .bi-mail { font-size: 13px; color: var(--navy); text-decoration: underline; font-weight: 600; }

/* 문제집 편집 캔버스 — 선택된 문제 박스 바로 위 '수정하기' pill */
.wb-edit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  color: #fff; background: var(--navy);
  border: none; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(16, 17, 26, 0.25);
}
.wb-edit-btn:hover { background: var(--navy-hover); }
.wb-edit-btn .ic { width: 13px; height: 13px; }

/* ============================================================
   Bluebook digital test (Bluebook.jsx) — College Board 디지털
   응시 UI 모사. 전체화면 흰 캔버스. 모든 클래스 bb- 프리픽스.
   ============================================================ */
.bb-root {
  --bb-blue:   #3253dc;
  --bb-blue-d: #2641b8;
  --bb-ink:    #1b1b1f;
  --bb-line:   #d6d6dc;
  position: fixed; inset: 0; z-index: 3000;
  background: #fff; color: var(--bb-ink);
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
.bb-rule { height: 0; border-bottom: 1.5px dashed var(--bb-line); }

/* ---- top bar ---- */
.bb-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px; min-height: 58px; flex: 0 0 auto;
}
.bb-top-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.bb-top-c { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bb-top-r { display: flex; align-items: center; gap: 10px; }
.bb-section { font-size: 16px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.bb-timer { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px; }
.bb-link { background: none; border: none; color: var(--bb-blue); cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 2px 4px; text-decoration: underline; }
.bb-exit { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: none; background: none; color: var(--bb-ink); font-size: 13px; font-weight: 600;
  padding: 6px 8px; border-radius: 6px; }
.bb-exit:hover { background: #f1f1f4; }
.bb-tool { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: #fff; border: 1px solid var(--bb-line); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--bb-ink); }
.bb-tool:hover { background: #f6f6f9; }
.bb-tool-ic { font-size: 14px; }

/* ---- main / question ---- */
.bb-main { flex: 1 1 auto; overflow-y: auto; padding: 22px 24px 28px;
  display: flex; flex-direction: column; align-items: center; }
.bb-qhead { width: 100%; max-width: 760px; display: flex; align-items: center;
  gap: 14px; padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid #ececf1; }
.bb-qnum { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 5px;
  background: var(--bb-ink); color: #fff; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.bb-mark { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: none; border: none; color: var(--bb-ink); font-size: 13.5px; font-weight: 600;
  padding: 4px 6px; border-radius: 6px; }
.bb-mark:hover { background: #f1f1f4; }
.bb-mark.on { color: var(--bb-blue); }
.bb-qhead-sp { flex: 1 1 auto; }
.bb-abc { cursor: pointer; border: 1px solid var(--bb-line); background: #fff;
  border-radius: 8px; padding: 5px 12px; font-weight: 800; letter-spacing: 1px;
  color: var(--bb-ink); position: relative; }
.bb-abc .bb-abc-txt { position: relative; }
.bb-abc .bb-abc-txt::after { content: ""; position: absolute; left: -2px; right: -2px;
  top: 50%; height: 1.6px; background: currentColor; }
.bb-abc.on { background: var(--bb-ink); color: #fff; border-color: var(--bb-ink); }

.bb-qbody { width: 100%; display: flex; justify-content: center; }
.bb-qcol { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 20px; }

.bb-img-wrap { position: relative; width: 100%; min-height: 40px; }
/* 그림 폭을 em 으로 지정할 때(figWidthStyle) 기준 글자 크기 = 본문(.bb-rich)과
   같아야 인쇄 지면 대비 그림 크기 비율이 맞는다 (2026-07-26). 인쇄는 본문
   10.5pt(=200DPI 29.17px/em) 기준이라, 화면 본문 15.5px 에 맞춰 놓으면 지면과
   같은 비율이 된다. */
.bb-img-wrap.bb-fig { font-size: 15.5px; }
/* 파일 타일의 처리 시간·원가 (연구용 전용, 2026-07-26) — 문항 수 아래 한 줄. */
.f-usage { display: flex; gap: 8px; align-items: baseline; margin-top: 2px;
  font-size: 11px; color: var(--text-3, #8a8f98); white-space: nowrap; }
.f-usage-c { font-variant-numeric: tabular-nums; }
/* 2026-07-17: width 100% 강제 확대 폐기 — BbImage 가 natural×0.87(실물 인쇄
   크기)로 inline width 를 지정하고, CSS 는 상한(컨테이너·720px)만 잡는다.
   작은 그림 크롭이 3배 업스케일돼 흐릿하고 실제 시험보다 크던 것 해소. */
.bb-img { width: auto; max-width: min(100%, 720px); height: auto; display: block; margin: 0 auto;
  opacity: 0; transition: opacity .18s ease; }
.bb-img.ok { opacity: 1; }
.bb-img-skel { position: absolute; inset: 0; height: 160px; border-radius: 8px;
  background: linear-gradient(90deg, #f3f3f6 25%, #ececf1 37%, #f3f3f6 63%);
  background-size: 400% 100%; animation: bb-shimmer 1.3s ease infinite; }
@keyframes bb-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.bb-img-err { padding: 28px; text-align: center; color: var(--danger);
  border: 1px dashed var(--bb-line); border-radius: 8px; font-size: 14px; }
/* 제출 실패 배너 (2026-07-17) — 답안 유지 + 재시도 버튼 */
.bb-submit-err { display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 10px auto 0; padding: 10px 18px; max-width: 760px; border-radius: 10px;
  background: #fff5f5; border: 1.5px solid #ffc9c9; color: #c92a2a;
  font-size: 14px; font-weight: 600; }

/* ---- choices ---- */
.bb-choices { display: flex; flex-direction: column; gap: 12px; max-width: 720px;
  width: 100%; margin: 0 auto; }
.bb-multi-hint { font-size: 13px; font-weight: 700; color: var(--bb-blue); }
.bb-choice { display: flex; align-items: center; gap: 14px; cursor: pointer;
  border: 1.6px solid var(--bb-line); border-radius: 11px; padding: 13px 16px;
  min-height: 52px; background: #fff; transition: border-color .12s, background .12s; }
.bb-choice:hover { border-color: #b9b9c4; }
.bb-choice-letter { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
  border: 1.6px solid var(--bb-ink); display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; color: var(--bb-ink);
  transition: background .12s, color .12s, border-color .12s; }
.bb-choice-body { flex: 1 1 auto; }
.bb-choice.sel { border-color: var(--bb-blue); background: rgba(50,83,220,.05); }
.bb-choice.sel .bb-choice-letter { background: var(--bb-blue); border-color: var(--bb-blue); color: #fff; }
.bb-choice.elim { opacity: .5; }
.bb-choice.elim .bb-choice-letter { position: relative; }
.bb-choice.elim .bb-choice-letter::after { content: ""; position: absolute;
  left: -4px; right: -4px; top: 50%; height: 1.6px; background: var(--bb-ink); }
.bb-cross { margin-left: auto; flex: 0 0 auto; border: 1px solid var(--bb-line);
  background: #fff; border-radius: 999px; min-width: 30px; height: 26px; padding: 0 9px;
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--bb-ink); }
.bb-cross:hover { background: #f3f3f6; }
.bb-cross-letter { position: relative; }
.bb-cross-letter::after { content: ""; position: absolute; left: -3px; right: -3px;
  top: 50%; height: 1.4px; background: currentColor; }
.bb-cross-undo { color: var(--bb-blue); }

/* ---- grid-in / frq ---- */
.bb-gridin { max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.bb-gridin-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.bb-gridin-input { border: 1.6px solid var(--bb-line); border-radius: 9px; padding: 12px 14px;
  font-size: 18px; font-weight: 600; outline: none; font-family: var(--font-mono); }
.bb-gridin-input:focus { border-color: var(--bb-blue); }
.bb-gridin-prev { font-size: 13px; color: var(--text-2); }
.bb-frq-note { font-size: 13.5px; color: var(--text-2); line-height: 1.6;
  background: #f6f6f9; border-radius: 8px; padding: 12px 14px; }
.bb-empty { color: var(--text-2); padding: 40px; }

/* ---- SAT 구조화(텍스트) 렌더 — 지문/발문/선지 텍스트 + KaTeX 수식 ---- */
.bb-rich { font-size: 15.5px; line-height: 1.75; color: var(--bb-ink); }
.bb-rich p { margin: 0 0 12px; }
.bb-rich p:last-child { margin-bottom: 0; }
.bb-rich .katex { font-size: 1.06em; }
.bb-passage { }
.bb-stem { font-weight: 500; }
.bb-choice.bb-choice-text { align-items: flex-start; }
.bb-choice.bb-choice-text .bb-choice-letter { margin-top: 1px; }
.bb-choice.bb-choice-text .bb-choice-body { font-size: 15px; line-height: 1.55;
  color: var(--bb-ink); }
/* 2단 선지 그리드 — 실제 시험지의 열 정렬 (2026-07-21) */
.bb-choice-head { display: flex; align-items: flex-end; gap: 14px;
  padding: 0 16px; }
.bb-choice-cols { display: grid; column-gap: 26px; row-gap: 3px;
  align-items: start; }
.bb-choice-col { min-width: 0; }
/* 머리글 밑줄은 추출 텍스트의 <u> 태그가 그린다 (bbInline 복원) */
/* 그림 선지 — 선지당 그래프/도형 1장 */
.bb-choice.bb-choice-fig .bb-choice-img { display: block; max-width: 100%;
  height: auto; }
/* 넓은 표는 카드/문항 폭을 넘지 않고 컨테이너 안에서 가로 스크롤(2026-07-17).
   min-width:0 = flex 컬럼(.prob-content 등) 안에서 콘텐츠 폭 이하로 줄어들게 */
.bb-tbl-wrap { max-width: 100%; overflow-x: auto; min-width: 0; }
.bb-tbl { border-collapse: collapse; margin: 0 auto; background: #fff; }
.bb-tbl th, .bb-tbl td { border: 1px solid var(--bb-ink); padding: 7px 16px;
  font-size: 14.5px; text-align: center; white-space: nowrap; }
.bb-tbl th { font-weight: 700; background: #f6f6f9; }
/* 본문 위 그림 — 상한은 컨테이너뿐. 폭은 BbImage 가 natural×0.87(실물 인쇄
   크기)로 inline 지정 — 종전 480px 상한은 넓은 그림만 텍스트 대비 작게
   눌러 그림마다 비율이 오락가락해 보였다 (2026-07-25 박현우). */
.bb-img-wrap.bb-fig .bb-img { max-width: 100%; }

/* ---- 시험 모드 (AP Section II FRQ 파트 + 결과) ---- */
.bb-parts { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.bb-part { display: flex; gap: 10px; align-items: baseline; }
.bb-part-label { font-weight: 700; flex: 0 0 auto; color: var(--bb-ink); }
.bb-part-text { flex: 1; }
/* 렌더 순서 모드 — 파트가 그림 사이에 직접 놓이므로 .bb-parts 의 gap 대신
   자체 여백을 준다 (2026-07-26). */
.bb-qcol > .bb-part { margin-top: 14px; }
/* 좌/우 2단 인쇄 파트 — 라이브러리 카드 .prob-frq-cols 와 같은 배치. */
.bb-part-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 14px; }
.bb-part-cols > * { min-width: 0; }
.bb-nav-cell.frq { border-style: solid; border-color: var(--bb-line);
  background: #f6f6f9; color: var(--text-2); }
.exam-score-card { display: flex; gap: 18px; align-items: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  background: var(--surface-2, #f6f6f9); }
.exam-score-big { font-size: 44px; font-weight: 800; line-height: 1;
  color: var(--navy, #1b2a4a); min-width: 64px; text-align: center; }

/* ---- bottom bar ---- */
.bb-bot { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px; min-height: 60px; flex: 0 0 auto; }
.bb-bot-l { font-size: 13px; font-weight: 700; color: var(--text-2);
  flex: 1 1 0; min-width: 0; }
.bb-bot-c { flex: 0 0 auto; position: relative; }
.bb-bot-r { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.bb-navbtn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--bb-ink); color: #fff; border: none; border-radius: 999px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 700; }
.bb-navbtn:hover { background: #000; }
.bb-caret { font-size: 10px; opacity: .85; }
.bb-btn { cursor: pointer; border-radius: 999px; padding: 10px 22px; font-size: 14px;
  font-weight: 700; border: 1.5px solid transparent; }
.bb-btn:disabled { opacity: .5; cursor: not-allowed; }
.bb-btn-primary { background: var(--bb-blue); color: #fff; }
.bb-btn-primary:hover:not(:disabled) { background: var(--bb-blue-d); }
.bb-btn-ghost { background: #fff; color: var(--bb-blue); border-color: var(--bb-blue); }
.bb-btn-ghost:hover:not(:disabled) { background: rgba(50,83,220,.06); }

/* ---- navigator popup ---- */
.bb-nav-back { position: fixed; inset: 0; z-index: 1; }
.bb-nav { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  z-index: 2; width: min(440px, 92vw); background: #fff; border: 1px solid var(--bb-line);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.22); padding: 16px; }
.bb-nav-title { text-align: center; font-weight: 700; font-size: 14px; padding-bottom: 8px;
  border-bottom: 1px solid #ececf1; margin-bottom: 10px; }
.bb-nav-legend, .bb-review-legend { display: flex; gap: 16px; justify-content: center;
  font-size: 12px; color: var(--text-2); margin-bottom: 12px; flex-wrap: wrap; }
.bb-nav-legend span, .bb-review-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bb-dot { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1.5px solid var(--bb-line); }
.bb-dot.cur { background: var(--bb-ink); border-color: var(--bb-ink); }
.bb-dot.ans { background: var(--bb-blue); border-color: var(--bb-blue); }
.bb-dot.un  { background: #fff; border-style: dashed; }
.bb-dot.mk  { background: #fff; border-color: var(--bb-blue); position: relative; }
.bb-nav-grid, .bb-review-grid { display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
/* 교사 미리보기 정답 요약 (답지 포함, 2026-07-17) */
.bb-answerkey { max-width: 560px; margin: 20px auto 0; padding: 14px 16px;
  border: 1px solid var(--bb-line); border-radius: 10px; background: #f6f7fb; }
.bb-answerkey-h { font-weight: 700; margin-bottom: 10px; }
.bb-answerkey-grid { display: grid; gap: 6px 14px;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.bb-answerkey-cell { font-family: var(--font-mono); font-size: 14px; }
.bb-answerkey-cell b { color: var(--bb-ink); }
.bb-nav-cell { position: relative; height: 42px; border: 1.5px dashed var(--bb-line);
  border-radius: 7px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 700;
  color: var(--bb-ink); }
.bb-nav-cell:hover { border-color: var(--bb-blue); }
.bb-nav-cell.ans { background: var(--bb-blue); border: 1.5px solid var(--bb-blue); color: #fff; }
.bb-nav-cell.un { border-style: dashed; }
.bb-nav-cell.cur { border: 2.5px solid var(--bb-ink); border-style: solid; }
.bb-nav-cell.cur.ans { box-shadow: 0 0 0 2px #fff inset; }
.bb-nav-cell.mk { border-color: var(--bb-blue); border-style: solid; }
.bb-nav-flag { position: absolute; top: -7px; right: -5px; color: var(--bb-blue); }
.bb-nav-review { width: 100%; margin-top: 14px; }

/* ---- review page ---- */
.bb-review { max-width: 720px; margin: 0 auto; }
.bb-review-h { font-size: 26px; font-weight: 800; text-align: center; margin: 8px 0 6px; }
.bb-review-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.bb-review-grid { width: 100%; max-width: 560px; margin: 0 auto; }

/* ---- done ---- */
.bb-done { margin: auto; text-align: center; max-width: 420px; padding: 40px 24px; }
.bb-done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--bb-blue);
  color: #fff; font-size: 34px; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px; }
.bb-done h2 { font-size: 24px; margin: 0 0 8px; }
.bb-done p { color: var(--text-2); margin: 0 0 22px; line-height: 1.6; }

/* ---- directions modal ---- */
.bb-modal-backdrop { position: fixed; inset: 0; z-index: 3100; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.bb-modal { background: #fff; border-radius: 14px; padding: 26px; max-width: 460px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.bb-modal h3 { margin: 0 0 12px; font-size: 19px; }
.bb-modal p { color: var(--text-2); line-height: 1.7; font-size: 14px; margin: 0 0 20px; }

/* ---- responsive ---- */
@media (max-width: 640px) {
  .bb-section { max-width: 30vw; font-size: 14px; }
  .bb-top, .bb-bot { padding: 10px 12px; }
  .bb-tool span:not(.bb-tool-ic) { display: none; }
  .bb-btn { padding: 9px 16px; }
}

.bb-topgen { padding: 8px 16px; font-size: 13px; }
@media (max-width: 640px) { .bb-topgen { padding: 7px 12px; } }

/* ---- SAT digital: countdown / grid-in hint / review warning ---- */
.bb-timer.danger { color: var(--danger); }
.bb-gridin-hint { font-size: 12.5px; color: var(--text-2); }
.bb-review-warn { color: var(--danger); font-weight: 700; }

/* ---- SAT R&W split: 지문/prompt 좌 · 선지 우 (넓은 화면). 좁으면 세로 ---- */
.bb-qbody.bb-split { max-width: 1180px; margin: 0 auto; align-items: flex-start; gap: 26px; }
.bb-qbody.bb-split .bb-col-q,
.bb-qbody.bb-split .bb-col-a { max-width: none; }
@media (max-width: 899px) {
  .bb-qbody.bb-split { flex-direction: column; align-items: center; }
  .bb-qbody.bb-split .bb-col-q,
  .bb-qbody.bb-split .bb-col-a { max-width: 760px; width: 100%; }
}
@media (min-width: 900px) {
  .bb-qbody.bb-split { flex-wrap: nowrap; }
  .bb-qbody.bb-split .bb-col-q { flex: 1 1 54%; min-width: 0; }
  .bb-qbody.bb-split .bb-col-a { flex: 1 1 46%; min-width: 0;
    position: sticky; top: 8px; align-self: flex-start; }
  .bb-qbody.bb-split .bb-col-q .bb-img { max-width: 100%; }
  .bb-qbody.bb-split .bb-choices { max-width: none; }
}

/* ---- SAT Math reference sheet modal ---- */
.bb-modal.bb-ref-modal { max-width: 560px; }
.bb-ref-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
@media (min-width: 480px) { .bb-ref-grid { grid-template-columns: 1fr 1fr; } }
.bb-ref-row { display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--bb-line); border-radius: 8px; padding: 9px 12px; }
.bb-ref-f { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--bb-ink); }
.bb-ref-d { font-size: 12px; color: var(--text-2); }
.bb-ref-notes { margin: 0 0 20px; padding-left: 18px; color: var(--text-2);
  font-size: 12.5px; line-height: 1.7; }
.bb-ref-notes li { margin-bottom: 2px; }
/* AP 과목별 formula sheet (2026-07-22) — 긴 시트라 넓은 모달 + 낶 스크롤,
   유닛/주제 섹션 헤더로 묶어 표시. */
.bb-ref-modal--ap { max-width: 760px; max-height: 86vh; overflow-y: auto; }
.bb-ref-note { margin: -6px 0 14px; font-size: 12.5px; color: var(--text-3); }
.bb-ref-sec { margin-bottom: 14px; }
.bb-ref-secname { font-size: 13px; font-weight: 700; color: var(--bb-ink);
  border-bottom: 1px solid var(--bb-line); padding-bottom: 4px; margin-bottom: 8px; }

/* ===================== 홈 · 일정 · 통계 (dashboard / schedule / stats) ===================== */

/* ---- lesson color tokens (chip bg / text / border) — keyed by data.py LESSON_COLORS ---- */
.lc-navy   { --lc-bg: var(--navy-10); --lc-fg: var(--navy);  --lc-bd: var(--navy-20); --lc-dot: var(--navy); }
.lc-green  { --lc-bg: #e9f6ee; --lc-fg: #1f7a45; --lc-bd: #cfe9d8; --lc-dot: #2e9c5e; }
.lc-amber  { --lc-bg: #fbf3df; --lc-fg: #8a6b1a; --lc-bd: #efe0b5; --lc-dot: #c79318; }
.lc-rose   { --lc-bg: #fceef0; --lc-fg: #a83246; --lc-bd: #f2d3da; --lc-dot: #d24a63; }
.lc-violet { --lc-bg: #f1ecfb; --lc-fg: #6b3fb0; --lc-bd: #e0d3f5; --lc-dot: #8a5fd1; }
.lc-cyan   { --lc-bg: #e6f5f8; --lc-fg: #1c6f80; --lc-bd: #c7e7ee; --lc-dot: #2a93a8; }

/* ---- schedule toolbar ---- */
.sched-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sched-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; min-width: 150px; }
.sched-nav { display: inline-flex; align-items: center; gap: 2px; }
.sched-nav button {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.sched-nav button:hover { background: var(--navy-5); color: var(--text); }
.sched-spacer { flex: 1; }

/* ---- month grid ---- */
.cal { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-dow > div { padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--text-2); text-align: left; letter-spacing: 0.02em; }
.cal-dow .sun { color: var(--danger); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 104px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px; background: var(--surface);
  cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--navy-5); }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-daynum { color: var(--text-3); }
.cal-daynum { font-size: 12.5px; font-weight: 600; color: var(--text-2); width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.today .cal-daynum { background: var(--navy); color: #fff; }
.cal-cell .cal-daynum.sun { color: var(--danger); }
.cal-cell.today .cal-daynum.sun { color: #fff; }
/* 월 보기에서 눌러 선택한 날짜 — 아래에 그 날 시간표가 뜬다 (박현우 2026-07-22) */
.cal-cell.sel { background: var(--navy-5); box-shadow: inset 0 0 0 2px var(--navy); }

.cal-event {
  display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 1.25; cursor: pointer;
  background: var(--lc-bg); color: var(--lc-fg); border: 1px solid var(--lc-bd);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: filter var(--t-fast) var(--ease);
}
.cal-event:hover { filter: brightness(0.97); }
.cal-event .ce-time { font-variant-numeric: tabular-nums; opacity: 0.85; flex-shrink: 0; }
.cal-event .ce-title { overflow: hidden; text-overflow: ellipsis; }
.cal-event.done { opacity: 0.62; }
.cal-event.canceled { opacity: 0.5; text-decoration: line-through; }
.cal-more { font-size: 11px; font-weight: 600; color: var(--text-2); padding: 1px 6px; }
.cal-more:hover { color: var(--navy); text-decoration: underline; }

/* ---- week / agenda list ---- */
.sched-daygroup { margin-bottom: 14px; }
.sched-dayhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.sched-dayhead .d-num { font-size: 17px; font-weight: 800; }
.sched-dayhead .d-dow { font-size: 12px; color: var(--text-2); font-weight: 600; }
.sched-dayhead.today .d-num { color: var(--navy); }
.sched-dayhead .d-count { margin-left: auto; font-size: 12px; color: var(--text-3); }
/* 월 보기 날짜 클릭 시 달력 아래 뜨는 하루 시간표 패널 — 카드 안 단독 그룹이라 아래 여백 제거 */
.sched-daypanel .sched-daygroup { margin-bottom: 0; }

/* ---- week time grid (아이폰 주간 캘린더 식, 박현우 2026-07-22) ---- */
.wk { overflow: hidden; }
.wk-scroll { max-height: calc(100vh - 270px); overflow: auto; }
.wk-grid { display: grid; grid-template-columns: 44px repeat(7, 1fr); }
.wk-hd { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.wk-dayhd { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-left: 1px solid var(--border); }
.wk-dayhd .wd-dow { font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.wk-dayhd .wd-num { font-size: 13px; font-weight: 700; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.wk-dayhd .wd-num.sun { color: var(--danger); }
.wk-dayhd.today .wd-num { background: var(--navy); color: #fff; }
.wk-dayhd.today .wd-num.sun { color: #fff; }
.wk-ad { position: sticky; top: 47px; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); }
.wk-adlbl { font-size: 10px; color: var(--text-3); text-align: right; padding: 4px 6px 4px 0; }
.wk-adcell { border-left: 1px solid var(--border); padding: 2px 3px; display: flex; flex-direction: column; gap: 2px; }
.wk-chip { font-size: 10.5px; font-weight: 600; padding: 2px 5px; border-radius: 4px; cursor: pointer;
  background: var(--lc-bg); color: var(--lc-fg); border: 1px solid var(--lc-bd);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wk-chip.done, .wk-ev.done { opacity: 0.62; }
.wk-chip.canceled, .wk-ev.canceled { opacity: 0.5; text-decoration: line-through; }
.wk-hours { position: relative; }
.wk-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wk-col { position: relative; border-left: 1px solid var(--border); cursor: pointer; }
.wk-ev { position: absolute; border-radius: 6px; padding: 2px 5px; font-size: 11px; line-height: 1.25; overflow: hidden; cursor: pointer;
  background: var(--lc-bg); color: var(--lc-fg); border: 1px solid var(--lc-bd); border-left-width: 3px; }
.wk-ev .we-time { font-size: 9.5px; opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-ev .we-title { font-weight: 700; overflow: hidden; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
@media (max-width: 720px) { .wk-grid { min-width: 720px; } }

.lesson-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; margin-bottom: 6px;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.lesson-row:hover { border-color: var(--navy-20); background: var(--navy-5); }
.lesson-row .lr-bar { width: 4px; align-self: stretch; border-radius: 3px; background: var(--lc-dot); flex-shrink: 0; }
.lesson-row .lr-time { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; min-width: 92px; flex-shrink: 0; }
.lesson-row .lr-main { min-width: 0; flex: 1; }
.lesson-row .lr-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-row .lr-sub { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-row .lr-sub .ic { width: 12px; height: 12px; }
.lesson-row.done .lr-title { color: var(--text-2); }
.lesson-row.canceled { opacity: 0.6; }
.lesson-row.canceled .lr-title { text-decoration: line-through; }

/* status pill (shared with detail modal) */
.lp { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.lp.scheduled { background: var(--navy-10); color: var(--navy); }
.lp.done { background: #e9f6ee; color: #1f7a45; }
.lp.canceled { background: #f3f3f4; color: var(--text-2); }

/* 외부 캘린더(구독) 일정 — 읽기 전용 회색 점선 (inbound ICS, 2026-07-24) */
.lc-ext { --lc-bg: var(--surface-2); --lc-fg: var(--text-2); --lc-bd: var(--text-3); --lc-dot: var(--text-3); }
.cal-event.ext, .wk-chip.ext, .wk-ev.ext { border-style: dashed; cursor: default; opacity: 0.85; }
.lesson-row.ext { cursor: default; }
.lesson-row.ext:hover { border-color: var(--border); background: var(--surface); }
.lp.ext-src { background: var(--surface-2); color: var(--text-2); }
.bk-sub-err { flex: 0 0 100%; color: var(--danger); font-size: 12px; padding-left: 26px; }

/* weekday picker (recurring lessons) */
.wd-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-pick button {
  width: 38px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.wd-pick button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.wd-pick button.sun { color: var(--danger); }
.wd-pick button.on.sun { color: #fff; }

/* color picker (lesson) */
.color-pick { display: flex; gap: 8px; }
.color-pick button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--cp); }
.color-pick button.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }

/* ---- stats: horizontal bars ---- */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; }
.bar-row .bl-label { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar-track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--navy); transition: width var(--t-med) var(--ease); }
.bar-fill.alt { background: #2e9c5e; }
.bar-row .bl-val { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* progress ring (avg score, etc.) */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; --rc: var(--navy); width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; }
.ring .ring-in { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font-size: 18px; font-weight: 800; color: var(--navy); }

/* ---- home dashboard ---- */
.home-greet { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.home-greet .hg-sub { display: block; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-top: 4px; }
.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qa-btn {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left;
  color: var(--text); font-weight: 600; font-size: 13.5px; transition: all var(--t-fast) var(--ease);
}
.qa-btn:hover { border-color: var(--navy-20); background: var(--navy-5); text-decoration: none; }
.qa-btn .qa-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--navy-10); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-btn .qa-ic .ic { width: 16px; height: 16px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.mini-row:last-child { border-bottom: none; }
.mini-row .mr-main { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .mr-meta { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cal-cell { min-height: 76px; padding: 4px; }
  .cal-event .ce-time { display: none; }
  .cal-daynum { width: 20px; height: 20px; font-size: 11.5px; }
  .bar-row { grid-template-columns: 96px 1fr 40px; }
  .qa-grid { grid-template-columns: 1fr; }
  .lesson-row .lr-time { min-width: 74px; }
}

/* ============================== Legal (약관·환불·개인정보) ============================== */
.legal-wrap { background: var(--surface); min-height: 100vh; color: var(--text); }
.legal-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 24px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.legal-nav .landing-brand { margin-right: auto; }
.legal-doc { max-width: 760px; margin: 0 auto; padding: 48px 24px 72px; }
.legal-doc > h1 { font-size: 30px; letter-spacing: -0.03em; margin: 0 0 6px; }
.legal-updated { color: var(--text-3); font-size: 13px; margin: 0 0 24px; }
.legal-banner {
  background: var(--navy-5); border: 1px solid var(--navy-10);
  border-radius: var(--r); padding: 12px 14px; font-size: 13px;
  color: var(--text-2); line-height: 1.6; margin-bottom: 32px;
}
.legal-sec { margin-bottom: 26px; }
.legal-sec h2 { font-size: 17px; letter-spacing: -0.02em; margin: 0 0 10px; }
.legal-sec p { font-size: 14.5px; line-height: 1.75; color: var(--text-2); margin: 0 0 8px; font-weight: 400; }
.legal-sec ul { margin: 0; padding-left: 20px; }
.legal-sec li { font-size: 14.5px; line-height: 1.75; color: var(--text-2); margin-bottom: 6px; font-weight: 400; }
.legal-sec a { color: var(--navy); }

/* 사업자 정보 푸터 (랜딩·법적페이지 공통) */
.legal-footer-wrap { border-top: 1px solid var(--border); background: var(--bg); }
.biz-footer { max-width: 1080px; margin: 0 auto; padding: 26px 24px; }
.biz-info { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.biz-info > strong { color: var(--text-2); font-weight: 700; }
.biz-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.biz-links a { font-size: 13px; color: var(--text-2); text-decoration: none; }
.biz-links a:hover { color: var(--navy); text-decoration: underline; }
/* 결제 화면 동의 문구 */
.pay-consent { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-top: 10px; }
.pay-consent a { color: var(--text-2); text-decoration: underline; }

/* ===========================================================================
   TOEFL 스튜디오 (문제 제작 탭) — ts- 프리픽스
   =========================================================================== */
.ts-typegrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ts-typecard { display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  text-align: left; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.ts-typecard:hover { border-color: var(--navy-20); background: var(--navy-5); }
.ts-typecard b { font-size: 14px; }
.ts-typecard .muted { line-height: 1.5; }

.ts-taskgrid { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ts-taskcard { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.ts-taskcard:hover { border-color: var(--navy-20); box-shadow: var(--shadow-md); }
.ts-taskcard-title { font-size: 14px; line-height: 1.4; }

.ts-qcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.ts-qcard textarea, .ts-qcard input { background: var(--surface); }

.ts-mini { border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 6px; font-size: 12px; padding: 2px 8px; cursor: pointer; line-height: 1.5; }
.ts-mini:hover { background: var(--navy-5); color: var(--text); }
.ts-mini.danger:hover { color: var(--danger); border-color: var(--danger); }
.ts-mini svg { width: 13px; height: 13px; display: block; }

.ts-letter { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-2);
  background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; flex: none; }
.ts-letter.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.ts-ctest-preview { border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; background: var(--surface); line-height: 2.0; font-size: 14.5px; }
.ts-word { cursor: pointer; border-radius: 4px; padding: 1px 1px; }
.ts-word:hover { background: var(--navy-10); }
.ts-word.gap { background: var(--navy-5); color: var(--navy); font-weight: 600; }
.ts-word.gap u { text-decoration: none; letter-spacing: 2px; color: var(--text-3); }
.ts-gapchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: var(--surface); }
.ts-gapchip b { color: var(--navy); }

.ts-audio { border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }

.ts-pickrow { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  cursor: pointer; }
.ts-pickrow:hover { background: var(--navy-5); }
.ts-pickrow.off { opacity: .55; cursor: not-allowed; }
.ts-pick-title { font-size: 13.5px; font-weight: 600; }

.ts-result-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ts-result-cell { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.ts-result-cell.ok { border-color: rgba(31,122,69,.35); background: rgba(31,122,69,.05); }
.ts-result-cell.bad { border-color: rgba(154,43,43,.3); background: rgba(154,43,43,.05); }
.ts-writing { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 14px;
  background: var(--surface); margin-top: 8px; }
.ts-writing-text { white-space: pre-wrap; font-family: var(--font-sans); font-size: 13.5px;
  line-height: 1.7; margin: 6px 0 0; }

/* ===========================================================================
   TOEFL 디지털 플레이어 — tf- 프리픽스 (bb- 셸 위에 얹음)
   =========================================================================== */
.tf-center { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; text-align: center; }
.tf-cover-h { font-size: 26px; margin: 0; }
.tf-cover-secs { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.tf-cover-sec { display: flex; flex-direction: column; gap: 2px; min-width: 120px;
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 18px; }
.tf-sec-eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; }
.tf-sec-h { font-size: 24px; margin: 0; }
.tf-sec-h .muted { font-size: 15px; font-weight: 400; }
.tf-sec-time { font-size: 14px; color: var(--text-2); }
.tf-summary { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

.tf-task-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tf-task-type { font-weight: 700; font-size: 15px; }
.tf-task-timer { margin-left: auto; font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 16px; }
.tf-task-timer.danger { color: var(--danger); }

.tf-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
@media (max-width: 860px) { .tf-split { grid-template-columns: 1fr; } }
.tf-split-l, .tf-split-r { min-width: 0; }

.tf-stim { border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 16px 18px; }
.tf-stim-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.tf-stim-badge { font-size: 12px; color: var(--text-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; background: var(--surface-2); }
.tf-stim-title { font-weight: 700; margin-bottom: 8px; }
.tf-stim-body { white-space: pre-wrap; line-height: 1.8; font-size: 14.5px; }
.tf-stim-notice { background: #fffdf4; }
.tf-stim-ad { background: #f4fbff; }
.tf-bullets { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; font-size: 14px; }

.tf-chat { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; background: var(--surface); }
.tf-bubble-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tf-bubble-row.mine { align-items: flex-end; }
.tf-bubble-who { font-size: 11.5px; color: var(--text-3); }
.tf-bubble { display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 7px 13px; font-size: 14px; max-width: 85%; line-height: 1.55; }
.tf-bubble-row.mine .tf-bubble { background: var(--navy-5); }

.tf-q { margin-bottom: 20px; }
.tf-q-text { font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.tf-choices { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.tf-choice-text { font-size: 14.5px; line-height: 1.5; }

.tf-ctest { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px 20px; line-height: 2.3; font-size: 15px; max-width: 760px; }
.tf-gap-wrap { white-space: nowrap; }
.tf-gap { border: none; border-bottom: 2px solid var(--navy-20); background: var(--navy-5);
  border-radius: 4px 4px 0 0; padding: 1px 4px; font: inherit; letter-spacing: 1px;
  min-width: 2em; }
.tf-gap:focus { outline: none; border-bottom-color: var(--navy); background: var(--navy-10); }

.tf-listen-stage { display: flex; justify-content: center; padding: 60px 0; }
.tf-audio { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tf-audio-disc { width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: var(--surface-2); }
.tf-audio-disc.on { border-color: var(--navy); background: var(--navy-5); }
.tf-eq { display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.tf-eq i { width: 5px; background: var(--navy); border-radius: 2px;
  animation: tf-eq 0.9s ease-in-out infinite; }
.tf-eq i:nth-child(1) { height: 12px; animation-delay: 0s; }
.tf-eq i:nth-child(2) { height: 24px; animation-delay: .18s; }
.tf-eq i:nth-child(3) { height: 16px; animation-delay: .36s; }
@keyframes tf-eq { 0%,100% { transform: scaleY(.5);} 50% { transform: scaleY(1);} }
.tf-listen-q { max-width: 680px; margin: 0 auto; }

.tf-build { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.tf-build-context { display: flex; }
.tf-slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 46px; padding: 10px;
  border: 1.5px dashed var(--border-2); border-radius: var(--r-lg); background: var(--surface-2); }
.tf-slot-empty { width: 74px; height: 32px; border: 1.5px dashed var(--border-2);
  border-radius: 8px; background: var(--surface); }
.tf-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-tile { border: 1px solid var(--border-2); background: var(--surface); border-radius: 8px;
  padding: 6px 14px; font-size: 14.5px; cursor: pointer; box-shadow: var(--shadow-sm); }
.tf-tile:hover:not(:disabled) { border-color: var(--navy); }
.tf-tile.placed { background: var(--navy-5); border-color: var(--navy-20); }
.tf-tile.used { opacity: .3; cursor: default; }

.tf-typed { display: flex; flex-direction: column; gap: 6px; }
.tf-textarea { width: 100%; min-height: 260px; resize: vertical; font: inherit;
  font-size: 14.5px; line-height: 1.7; padding: 14px 16px; border: 1px solid var(--border-2);
  border-radius: var(--r-lg); }
.tf-textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-10); }
.tf-wordcount { align-self: flex-end; font-size: 12.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums; }
.tf-wordcount.ok { color: var(--ok); }

.tf-board { display: flex; flex-direction: column; gap: 10px; }
.tf-post { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 12px 16px; }
.tf-post.prof { background: var(--navy-5); }
.tf-post-name { font-weight: 700; font-size: 13px; display: block; margin-bottom: 4px; }
.tf-post p { margin: 0; font-size: 14px; line-height: 1.7; }

.tf-rec { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border);
  border-radius: 999px; padding: 12px 22px; background: var(--surface); font-size: 15px; }
.tf-rec.live { border-color: rgba(154,43,43,.4); }
.tf-rec.err { flex-direction: column; border-radius: var(--r-lg); gap: 10px; }
.tf-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-2); flex: none; }
.tf-rec.live .tf-rec-dot { background: #d33; animation: tf-blink 1s ease-in-out infinite; }
@keyframes tf-blink { 0%,100% { opacity: 1;} 50% { opacity: .35;} }
.tf-rec-label { font-variant-numeric: tabular-nums; font-weight: 600; }

.tf-run-controls { display: flex; align-items: center; gap: 12px; margin-top: 22px;
  justify-content: flex-end; flex-wrap: wrap; }
.tf-review-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px;
  margin: 0 auto 18px; }
.tf-review-row { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); cursor: pointer; font: inherit; text-align: left; }
.tf-review-row:hover { background: var(--navy-5); }
/* Check Your Work 문항별 행 — [번호] [문두] [고른 답] */
.tf-rv-num { flex: 0 0 auto; min-width: 26px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 6px;
  background: var(--navy, #1b2a4a); color: #fff; font-weight: 700; font-size: 13px; }
.tf-rv-q { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2); font-size: 13.5px; }
.tf-rv-ans { flex: 0 0 auto; font-family: var(--font-mono); }

/* 문제 제작 홈 — 시험 선택 카드 */
.ts-examgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ts-examcard { display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  text-align: left; padding: 20px 22px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); cursor: pointer;
  box-shadow: var(--shadow-sm); font: inherit;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.ts-examcard:hover:not(:disabled) { border-color: var(--navy-20); box-shadow: var(--shadow-md); }
.ts-examcard.off { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.ts-examcard-head { display: flex; align-items: center; gap: 10px; }
.ts-examcard-head b { font-size: 17px; }

/* ===== 새 문제 만들기 피커 v2 — 영역 필 + 아이콘 카드 ===== */
.ts-pick-pills { display: flex; gap: 6px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; width: max-content; }
.ts-pick-pill { border: none; background: transparent; border-radius: 999px;
  padding: 7px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all var(--t-fast) var(--ease); }
.ts-pick-pill:hover { color: var(--text); }
.ts-pick-pill.on { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }

/* 물음표 도움 버튼 (2026-07-22) — 동그라미 속 ? 만 두고 인라인 설명 문구는
   걷어냈다 (박현우 '필요없는 설명 다 삭제, 필요한 건 ? 버튼으로'). 클릭 시
   그 영역·유형의 설명 모달(설명 페이지)이 뜬다. */
.help-q { width: 20px; height: 20px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--text-3); border-radius: 999px;
  background: transparent; color: var(--text-3);
  font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.help-q:hover { color: var(--navy); border-color: var(--navy); }
/* 유형 카드 우상단에 띄우는 ? — 카드(<button>) 안에 버튼을 중첩하지 않도록
   래퍼 기준 절대 위치. */
.ts-typecard-wrap { position: relative; }
.ts-typecard-wrap > .ts-typecard { width: 100%; }
.ts-typecard-wrap > .help-q { position: absolute; top: 10px; right: 10px; z-index: 1; }

/* 유형 카드 — 아이콘 + 계층 텍스트 + 화살표 (v1 column 스타일 재정의) */
.ts-typegrid { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .ts-typegrid { grid-template-columns: 1fr; } }
.ts-typecard { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.ts-typecard:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ts-typecard:hover .ts-type-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ts-type-name { font-weight: 700; font-size: 14px; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-type-audio { font-size: 10.5px; font-weight: 600; color: var(--navy);
  background: var(--navy-5); border: 1px solid var(--navy-10); border-radius: 999px;
  padding: 1px 8px; letter-spacing: .02em; }
.ts-type-ko { font-size: 12px; color: var(--text-2); font-weight: 600; }
.ts-type-go { color: var(--text-3); flex: none; opacity: 0;
  transition: opacity var(--t-fast) var(--ease); }
.ts-typecard:hover .ts-type-go { opacity: 1; color: var(--navy); }

/* ===== 스튜디오 선택 모드 (셋으로 묶기) ===== */
.ts-taskcard.selectable { user-select: none; }
.ts-taskcard.selected { border-color: var(--navy); background: var(--navy-5);
  box-shadow: 0 0 0 1px var(--navy); }
.ts-selmark { width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border-2); background: var(--surface);
  display: flex; align-items: center; justify-content: center; }
.ts-selmark.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ts-selmark svg { width: 13px; height: 13px; }

/* ===== 라이브러리 — TOEFL 셋 파일 상세의 문제 카드 ===== */
.ts-libgrid { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ts-libtask { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.ts-libtask:hover { border-color: var(--navy-20); box-shadow: var(--shadow-md); }
.ts-libtask-title { font-size: 14px; line-height: 1.4; }
/* TOEFL 카드 피커(문제집 탭·시험 수정) 선택 상태 — 셋 묶기 선택과 같은 표시 */
.ts-libtask.wb-pick.on { border-color: var(--navy); background: var(--navy-5);
  box-shadow: 0 0 0 1.5px var(--navy); }

/* ---- TOEFL 카드의 '실제 시험 화면' mock (2026-07-22) ----
 * 카드 안에 응시 화면(tfi-/tf- 클래스)을 축소해 넣는다. .ts-screen 이 높이를
 * 잘라 '한눈에 보기'용 프리뷰로 만들고, 확대(CardZoomOverlay)에서는 .ts-mock.wide
 * 가 실제 화면처럼 좌우 분할로 그려진다. */
.ts-screen { border: 1px solid var(--border); border-radius: 10px; background: #fff;
  overflow: hidden; position: relative; max-height: 250px; }
.ts-screen::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 40px; background: linear-gradient(rgba(255, 255, 255, 0), #fff);
  pointer-events: none; }
.ts-screen-in { zoom: .8; padding: 14px 16px 22px; }
/* 카드 폭에선 실제 화면의 좌우 분할을 세로로 쌓는다 (확대(.wide)는 원래 분할). */
.ts-mock .tfi-split { grid-template-columns: 1fr; gap: 16px; }
.ts-mock.wide .tfi-split { grid-template-columns: 58fr 42fr; gap: 30px; }
.ts-mock.wide .tfi-split.tfi-wsplit { grid-template-columns: 42fr 58fr; }
.ts-mock .tfi-response { grid-template-columns: 1fr; gap: 12px; }
.ts-mock.wide .tfi-response { grid-template-columns: 220px minmax(0, 1fr); gap: 30px; }
.ts-mock .tf-listen-stage { padding: 6px 0 12px; }
.ts-mock .tfi-h { font-size: 15px; margin: 2px 0 14px; }
.ts-mock .tfi-h-lg { font-size: 19px; }
.ts-mock .tfi-tbtn, .ts-mock .tfi-wc { cursor: default; }
.ts-mock-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* C-test 빈칸 — 실제 화면의 .tf-gap 입력칸 흉내 (정적) */
.ts-gapbox { display: inline-block; border-bottom: 2px solid var(--navy-20);
  background: var(--navy-5); border-radius: 3px 3px 0 0; padding: 0 3px;
  color: var(--text-3); line-height: 1.25; }
/* 에디터 mock 의 빈 입력 영역 (.tfi-editor .tf-textarea 와 같은 외형) */
.ts-mock-ta { min-height: 120px; border: 1px solid #c9ccd0; border-radius: 0 0 4px 4px;
  background: #fff; }
/* 확대 뷰 — 카드줌 페이지(1.5x)를 상쇄해 실제 화면에 가까운 크기로 */
.ts-zoomwrap { zoom: .8; }
.ts-zoom-audio { margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; }
.ts-zoom-audio audio { height: 32px; flex: 1; min-width: 0; }
/* 확대 뷰의 전사 스크립트 (학생 화면엔 없는 교사 검수용) */
.ts-zoom-script { margin-top: 12px; }
.ts-zoom-script summary { cursor: pointer; }
.ts-zoom-script-body { margin-top: 6px; padding: 10px 12px; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; line-height: 1.7; }

/* ===== 스튜디오 폼 (.ts-form) — 에디터 입력 요소 전면 리스타일 =====
 * 에디터의 input/textarea/select 는 bare 엘리먼트(전역 .input 클래스 미사용)라
 * 브라우저 기본(각진) 모양이었다 → 부드러운 라운드 + 포커스 링으로 통일. */
.ts-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.ts-form textarea,
.ts-form select {
  width: 100%; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  box-shadow: none;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.ts-form input:hover:not(:focus):not([type="checkbox"]),
.ts-form textarea:hover:not(:focus),
.ts-form select:hover:not(:focus) { border-color: #c6c6d0; }
.ts-form input:focus, .ts-form textarea:focus, .ts-form select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3.5px var(--navy-10);
  background: #fff;
}
.ts-form ::placeholder { color: var(--text-3); }
.ts-form textarea { resize: vertical; line-height: 1.65; min-height: 46px; }
.ts-form select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.ts-form input[type="number"] { text-align: center; padding: 9px 6px; }
.ts-form input[type="checkbox"] {
  width: 17px; height: 17px; flex: none; accent-color: var(--navy); cursor: pointer;
}
.ts-form .field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ts-form .field { gap: 7px; }
.ts-form .help { line-height: 1.55; }

/* 문항 카드 — 회색 각진 박스 → 흰 라운드 카드 + 은은한 그림자 */
.ts-form .ts-qcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.ts-form .ts-qcard > .row:first-child {
  padding-bottom: 8px; border-bottom: 1px dashed var(--border);
  align-items: center;
}
.ts-form .ts-qcard > .row:first-child b { color: var(--navy); font-size: 12.5px;
  letter-spacing: .02em; }

/* 미니 버튼 (삭제·+/−) — 알약 + 부드러운 hover */
.ts-form .ts-mini, .ts-gapchip .ts-mini {
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600;
  transition: all var(--t-fast) var(--ease);
}
.ts-form .ts-mini:hover { border-color: var(--navy-20); }

/* 정답 글자 버튼 — 조금 크게 + 포커스/hover 링 */
.ts-form .ts-letter {
  width: 32px; height: 32px; font-size: 13.5px;
  transition: all var(--t-fast) var(--ease);
}
.ts-form .ts-letter:hover:not(.on) { border-color: var(--navy);
  background: var(--navy-5); color: var(--navy); }
.ts-form .ts-letter.on { box-shadow: 0 1px 4px rgba(52,50,123,.35); }

/* '+ 선지/문항 추가' — 점선 추가 버튼 느낌 */
.ts-form .btn:not(.primary):not(.ghost) {
  border-style: dashed; box-shadow: none; color: var(--text-2);
  border-radius: 11px;
}
.ts-form .btn:not(.primary):not(.ghost):hover {
  border-color: var(--navy); color: var(--navy); background: var(--navy-5);
}

/* AI 음성 섹션 — 라운드 통일 + 오디오 행 정돈 */
.ts-form .ts-audio { border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.ts-form .ts-audio audio { border-radius: 999px; background: var(--surface-2); }

/* C-test 미리보기·시험구성 선택행도 같은 라운드 결 */
.ts-form .ts-ctest-preview { border-radius: 14px; }
.ts-form .ts-pickrow { border-radius: 11px; padding: 10px 14px; }

/* ===========================================================================
   TOEFL iBT 리스킨 (ToeflTest.jsx) — tfi- 프리픽스.
   실제 2026 TOEFL iBT 크롬 모사: 진초록(#0d2b1c) 헤더 + 흰 알약 버튼 +
   "Section | Question N of M" 서브바 + teal Type-of-Task 표.
   ⚠ bb- (SAT Bluebook) 규칙과 완전 분리 — 여기서는 tf-/tfi- 만 사용.
   =========================================================================== */
.tfi-root { position: fixed; inset: 0; z-index: 3000; background: #fff;
  color: #1b1b1f; display: flex; flex-direction: column;
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }

/* ---- 헤더바 ---- */
.tfi-top { flex: 0 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; background: #0d2b1c; color: #fff;
  padding: 9px 20px; min-height: 54px; position: relative; z-index: 30; }
.tfi-mark { font-size: 20px; letter-spacing: .02em; white-space: nowrap;
  display: flex; align-items: baseline; gap: 6px; }
.tfi-mark b { font-weight: 800; }
.tfi-mark span { font-weight: 800; }
.tfi-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end; }
.tfi-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff;
  color: #141414; border: none; border-radius: 999px; padding: 7px 15px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  font-family: inherit; line-height: 1.2; }
.tfi-pill:hover:not(:disabled) { background: #e6ede8; }
.tfi-pill:disabled { opacity: .45; cursor: not-allowed; }
.tfi-pill.primary { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.tfi-qmark { width: 15px; height: 15px; border-radius: 50%; background: #141414;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; }
.tfi-x { background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.4); padding: 7px 11px; }
.tfi-x:hover:not(:disabled) { background: rgba(255,255,255,.12); }

/* Volume 팝오버 */
.tfi-volwrap { position: relative; }
.tfi-pop { position: absolute; top: calc(100% + 8px); right: 0; background: #fff;
  color: #1b1b1f; border: 1px solid #d6d6dc; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 12px 14px; display: flex;
  align-items: center; gap: 10px; z-index: 60; }
.tfi-pop input[type="range"] { width: 140px; accent-color: #0d2b1c; }
.tfi-pop-num { font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

/* Help 모달 */
.tfi-modal-bg { position: fixed; inset: 0; background: rgba(10,20,14,.45);
  z-index: 3600; display: flex; align-items: center; justify-content: center;
  padding: 20px; }
.tfi-modal { background: #fff; color: #1b1b1f; border-radius: 14px;
  max-width: 560px; width: 100%; padding: 24px 26px;
  box-shadow: 0 16px 48px rgba(0,0,0,.25); text-align: left; }
.tfi-modal h3 { margin: 0 0 10px; font-size: 18px; }
.tfi-modal p { margin: 0 0 12px; line-height: 1.7; font-size: 14px; }

/* ---- 서브바 ---- */
.tfi-sub { flex: 0 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; background: #fff;
  border-bottom: 1px solid #d6d6dc; padding: 9px 20px; font-size: 14px; }
.tfi-sub-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tfi-sub-sec { font-weight: 400; white-space: nowrap; }
.tfi-sub-div { color: #b9b9c2; }
.tfi-sub-q { white-space: nowrap; }
.tfi-sub-q b { font-weight: 800; }
.tfi-sub-r { display: flex; align-items: center; gap: 10px; }
.tfi-time { font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.tfi-time.danger { color: var(--danger); }
.tfi-timetoggle { border: 1px solid #d6d6dc; background: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; color: #444; font-family: inherit; white-space: nowrap; }
.tfi-timetoggle:hover { background: #f4f4f7; }

/* ---- 본문 셸 ---- */
.tfi-main { flex: 1 1 auto; overflow-y: auto; padding: 26px 28px 44px; }
.tfi-center { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; text-align: center; }
.tfi-body { max-width: 1020px; margin: 0 auto; }
.tfi-h { text-align: center; font-size: 18px; font-weight: 800; margin: 4px 0 20px; }
.tfi-h-lg { text-align: center; font-size: 24px; font-weight: 800; margin: 4px 0 8px; }

.tfi-btn { display: inline-flex; align-items: center; gap: 8px;
  background: #0d2b1c; color: #fff; border: none; border-radius: 999px;
  padding: 11px 26px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; }
.tfi-btn:hover:not(:disabled) { background: #17402c; }
.tfi-btn:disabled { opacity: .5; cursor: not-allowed; }
.tfi-btn.ghost { background: #fff; color: #0d2b1c; border: 1.5px solid #0d2b1c; }
.tfi-btn.ghost:hover:not(:disabled) { background: #eef4f0; }
.tfi-link { background: none; border: none; color: #2c6e49; cursor: pointer;
  font-size: 12.5px; font-weight: 600; text-decoration: underline;
  padding: 2px 4px; font-family: inherit; }
.tfi-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.tfi-done-check { width: 64px; height: 64px; border-radius: 50%;
  background: #0d2b1c; color: #fff; font-size: 30px; display: flex;
  align-items: center; justify-content: center; }

/* ---- 섹션 인트로 (ETS 스타일) ---- */
.tfi-intro { max-width: 860px; margin: 0 auto; }
.tfi-intro-h { font-size: 22px; font-weight: 800; margin: 8px 0 10px; }
.tfi-intro-rule { height: 2px; background: #1b1b1f; margin-bottom: 16px; }
.tfi-intro-p { font-size: 14.5px; line-height: 1.75; margin: 0 0 18px; }
.tfi-tasktable { width: 100%; border-collapse: collapse; border: 1px solid #d9dee0; }
.tfi-tasktable th { background: #57a8a8; color: #fff; text-align: left;
  font-size: 13.5px; font-weight: 700; padding: 10px 14px; }
.tfi-tasktable th:first-child { width: 36%; border-right: 2px solid #fff; }
.tfi-tasktable td { background: #fff; border-bottom: 1px solid #e4e7e9;
  padding: 10px 14px; font-size: 13.5px; line-height: 1.5; vertical-align: top; }
.tfi-tasktable td:first-child { font-weight: 600; }
.tfi-intro-time { margin-top: 14px; font-size: 14px; }
.tfi-intro-ko { margin-top: 12px; line-height: 1.7; }

/* ---- 선지 (라디오풍 동그라미 글자) ---- */
.tfi-choices { display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.tfi-multi-hint { font-size: 12.5px; font-weight: 700; color: #2c6e49;
  margin-bottom: 2px; }
.tfi-choice { display: flex; align-items: flex-start; gap: 12px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.tfi-choice:hover { background: #f2f6f3; }
.tfi-dot { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid #4a4a52; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; background: #fff;
  margin-top: -2px; }
.tfi-dot.sq { border-radius: 6px; }
.tfi-choice.sel .tfi-dot { background: #0d2b1c; border-color: #0d2b1c; color: #fff; }
.tfi-choice-text { font-size: 14.5px; line-height: 1.55; min-width: 0; }

/* ---- 분할 패널 (지문 좌 ~58% / 문항 우) ---- */
.tfi-split { display: grid; grid-template-columns: 58fr 42fr; gap: 30px;
  align-items: start; }
.tfi-wsplit { grid-template-columns: 42fr 58fr; }
@media (max-width: 900px) { .tfi-split, .tfi-wsplit { grid-template-columns: 1fr; } }
.tfi-split-l, .tfi-split-r { min-width: 0; }

/* ---- 생활문 이메일 — 메일 창 목업 ---- */
.tfi-mail { border: 2px solid #57a8a8; background: #d9e9e4; padding: 12px;
  border-radius: 3px; }
.tfi-mail-row { display: flex; gap: 10px; margin-bottom: 10px; }
.tfi-mail-lab { background: #fff; border: 1px solid #a8cbc4; padding: 4px 12px;
  font-size: 13px; flex: 0 0 auto; }
.tfi-mail-subj { flex: 1 1 auto; background: #fff; border: 1px solid #a8cbc4;
  padding: 4px 12px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.tfi-mail-body { background: #fff; border: 1px solid #a8cbc4; padding: 16px 18px;
  font-family: Georgia, "Times New Roman", serif; font-size: 14.5px;
  line-height: 1.75; white-space: pre-wrap; }

/* 학술 지문 (좌 패널 본문) */
.tfi-passage { font-size: 15px; line-height: 1.85; white-space: pre-wrap; }

/* C-test·Build 중앙 정렬 래퍼 */
.tfi-ctest-wrap { display: flex; justify-content: center; }
.tfi-build-wrap { display: flex; justify-content: center; }
.tfi-build-wrap .tf-build { width: 100%; }

/* ---- Listening: Choose a Response (오디오+선지 동시) ---- */
.tfi-response { display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px; align-items: start; max-width: 860px; margin: 0 auto; }
.tfi-response-l { display: flex; justify-content: center; }
.tfi-response-r { min-width: 0; }
@media (max-width: 760px) { .tfi-response { grid-template-columns: 1fr;
  justify-items: center; } }

/* 오디오 인디케이터 라벨 (TfAudioOnce) */
.tf-audio-label { text-align: center; font-size: 13.5px; }

/* ---- Writing ---- */
.tfi-wpanel { border: 1px solid #c9ccd0; border-radius: 4px; background: #fff;
  padding: 16px 18px; }
.tfi-wpanel-body { white-space: pre-wrap; line-height: 1.75; font-size: 14.5px; }
.tfi-resp-h { font-weight: 800; font-size: 14.5px; margin-bottom: 8px; }
.tfi-mailfixed { border: 1px solid #c9ccd0; border-radius: 4px;
  background: #fafbfb; padding: 8px 12px; font-size: 13px; display: flex;
  flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tfi-editor { display: flex; flex-direction: column; }
.tfi-toolbar { display: flex; align-items: center; gap: 6px;
  border: 1px solid #c9ccd0; border-bottom: none; border-radius: 4px 4px 0 0;
  background: #f2f3f4; padding: 6px 10px; flex-wrap: wrap; }
.tfi-tbtn { border: 1px solid #b9bcc1; background: #fff; border-radius: 4px;
  padding: 3px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  color: #333; font-family: inherit; }
.tfi-tbtn:hover { background: #f6f6f8; }
.tfi-wc { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  border: none; background: none; font-size: 12px; font-weight: 600; color: #333;
  cursor: pointer; font-variant-numeric: tabular-nums; font-family: inherit;
  white-space: nowrap; }
.tfi-editor .tf-textarea { border-radius: 0 0 4px 4px; border-color: #c9ccd0;
  min-height: 300px; margin-top: 0; }
.tfi-editor .tf-textarea:focus { border-color: #57a8a8; box-shadow: none; }
.tfi-minhint { margin-top: 6px; align-self: flex-end; }
.tfi-minhint.ok { color: var(--ok); }

/* 토론 포럼 — 원형 이니셜 아바타 */
.tfi-post { display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 12px 14px; }
.tfi-post.prof { background: #eef4f0; }
.tfi-post > div { min-width: 0; }
.tfi-post p { margin: 2px 0 0; font-size: 14px; line-height: 1.65; }
.tfi-avatar { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  background: #0d2b1c; color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 16px; }

/* ---- Speaking ---- */
.tfi-scenario { font-weight: 800; font-size: 17px; max-width: 640px;
  margin: 0 auto; line-height: 1.6; text-align: center; }
.tfi-scene { display: block; max-width: 420px; width: 100%; margin: 6px auto;
  border: 1px solid #d6d6dc; border-radius: 6px; background: #fff; }

/* RESPONSE TIME 위젯 — 검은 알약 라벨이 흰 박스 윗변에 겹침 */
.tfi-rt { display: flex; flex-direction: column; align-items: center;
  margin-top: 10px; }
.tfi-rt-label { background: #101512; color: #fff; font-size: 11px;
  font-weight: 800; letter-spacing: .14em; padding: 6px 24px;
  border-radius: 999px; position: relative; z-index: 1; }
.tfi-rt-box { display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #3c3c40; background: #fff; border-radius: 8px;
  padding: 18px 30px 12px; margin-top: -12px; font-weight: 800; font-size: 17px;
  font-variant-numeric: tabular-nums; }
.tfi-rt.live .tfi-rt-box { border-color: #b3261e; }
.tfi-rt-mic { color: #333; flex: none; }
.tfi-rt.live .tfi-rt-mic { color: #b3261e;
  animation: tf-blink 1s ease-in-out infinite; }
.tfi-rt-num { line-height: 1; }
.tfi-rt-sub { margin-top: 10px; display: flex; gap: 12px; align-items: center; }
.tfi-rec-err { display: flex; flex-direction: column; align-items: center;
  gap: 10px; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 22px; background: var(--surface); }

/* 좁은 화면(≈1024px 이하)에서도 크롬이 깨지지 않게 */
@media (max-width: 1024px) {
  .tfi-top { padding: 8px 14px; }
  .tfi-pill { padding: 6px 12px; font-size: 12px; }
  .tfi-main { padding: 20px 16px 36px; }
}

/* ==== 쓰레기통 (/trash) — 삭제된 문제 7일 보관 목록 ==== */
.trash-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 12px 16px;
}
.trash-thumb {
  width: 200px; max-height: 128px; flex: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: #fff;
}
.trash-thumb img { display: block; width: 100%; }
.trash-noimg {
  height: 72px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
}
.trash-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.trash-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trash-meta { color: var(--text-2); font-size: 12.5px; }
.trash-meta .trash-due { font-weight: 700; }
.trash-meta .trash-due.danger { color: var(--danger); }
.trash-actions { flex: none; }
@media (max-width: 640px) {
  .trash-card { flex-direction: column; align-items: stretch; }
  .trash-thumb { width: 100%; }
}

/* ===== 캘린더 연동 + 예약 링크 (2026-07-16) ================================ */

/* 연동 안내 모달 */
.bk-howto { display: flex; flex-direction: column; gap: 12px; }
.bk-howto-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; font-size: 13px; }
.bk-howto-item b { font-size: 13.5px; }
.bk-howto-item ol { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); line-height: 1.7; }
.bk-howto-item a { color: var(--navy); font-weight: 600; }
.bk-note { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* 예약 링크 목록 */
.bk-linkrow { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.bk-linkrow + .bk-linkrow { margin-top: 0; }
.bk-linkrow-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.bk-linkrow-main { min-width: 0; }
.bk-linkrow-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bk-linkrow-meta { margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.bk-bookings { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bk-booking-item { display: flex; gap: 10px; flex-wrap: wrap; }
.bk-booking-item span { color: var(--text-2); }
.bk-w-rm { border: none; background: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: var(--r-sm); }
.bk-w-rm:hover { color: var(--danger); background: var(--surface-2); }

/* 공개 예약 페이지 (#/book?t=…) — standalone, 사이드바 없음 */
.bk-page { min-height: 100vh; background: var(--bg); padding: 32px 16px 80px; }
.bk-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.bk-brand { font-weight: 800; font-size: 15px; color: var(--navy); letter-spacing: -0.01em; }
.bk-head h1 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.bk-head p { margin: 0 0 4px; font-size: 14px; color: var(--text-2); }
.bk-eyebrow { font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.06em; }
.bk-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.bk-day-label { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.bk-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-slot { border: 1px solid var(--border-2); background: var(--surface); border-radius: var(--r-sm); padding: 8px 14px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: all var(--t-fast) var(--ease); }
.bk-slot:hover { border-color: var(--navy); color: var(--navy); }
.bk-slot.on { background: var(--navy); border-color: var(--navy); color: var(--navy-fg); }
.bk-form { position: sticky; bottom: 12px; box-shadow: var(--shadow-lg); }
.bk-form-sel { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--navy); }
.bk-center { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; }
.bk-center h2 { margin: 0 0 8px; font-size: 18px; }
.bk-center p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.bk-done-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: #e9f6ee; color: #1f7a45; display: flex; align-items: center; justify-content: center; }
.bk-done-line { margin: 6px 0 10px !important; font-size: 16px !important; color: var(--text) !important; }

/* ==== 채점 기준 탭 (/criteria) — 문제별 기준 작성/정답 입력 (2026-07-16) ==== */
.cr-layout { display: grid; grid-template-columns: 280px 1fr; gap: var(--gap-4); align-items: start; }
.cr-side { position: sticky; top: 12px; }
.cr-files { display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow-y: auto; }
.cr-file { display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); padding: 10px 12px; cursor: pointer;
  transition: border-color .12s, background .12s; }
.cr-file:hover { border-color: var(--navy-20); }
.cr-file.active { border-color: var(--navy); background: var(--navy-5); }
.cr-file-name { font-weight: 600; font-size: 13.5px; word-break: break-all; }
.cr-file-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cr-toolbar { margin-bottom: 12px; align-items: center; }
.cr-card { border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); padding: 14px; }
.cr-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cr-qnum { font-weight: 700; color: var(--navy); }
.cr-card-body { display: grid; grid-template-columns: minmax(220px, 42%) 1fr; gap: var(--gap-4); align-items: start; }
.cr-editor { display: flex; flex-direction: column; gap: 8px; }
.cr-textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.6; resize: vertical; }
.cr-textarea:focus { outline: none; border-color: var(--navy); }
/* 파트별 채점 기준 칸 헤더 (라벨 + 글자수 카운터) — 2026-07-22 */
.cr-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cr-count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cr-answer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-answer-input { width: 130px; }
@media (max-width: 900px) {
  .cr-layout { grid-template-columns: 1fr; }
  .cr-side { position: static; }
  .cr-card-body { grid-template-columns: 1fr; }
}

/* 오답 원인 분석 (Students 탭, 2026-07-16) */
.wa-item { border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); padding: 10px 12px; }

/* 구조화 콘텐츠 — 라이브러리/선택 그리드의 문제 카드 텍스트 렌더 (2026-07-16).
   2026-07-17 박현우 '실제 AP 시험처럼': 본문·선지를 실제 시험 지면과 같은
   serif 서체로, 그림은 경계선 없이 원본 배치 크기 그대로 중앙에. */
.prob-content { display: flex; flex-direction: column; gap: 8px; font-size: 14px;
  line-height: 1.6; color: #111;
  font-family: "Times New Roman", "Nimbus Roman", Georgia, "Noto Serif", serif; }
.prob-content .prob-passage { max-height: 240px; overflow-y: auto; padding: 10px 12px;
  background: #f8f8fb; border: 1px solid var(--border); border-radius: var(--r); }
.prob-content .bb-rich p { margin: 0 0 8px; }
.prob-content .bb-rich p:last-child { margin-bottom: 0; }
.prob-content .prob-stem { font-weight: 400; }
.prob-choices { display: flex; flex-direction: column; gap: 4px; }
.prob-choice { display: flex; gap: 8px; align-items: flex-start; }
/* 실제 AP 지면의 "(A)" 형식 — 칩 대신 같은 serif 플레인 텍스트 */
.prob-choice-letter { flex: 0 0 auto; min-width: 26px; font-size: 14px;
  color: #111; }
.prob-choice-body { flex: 1 1 auto; min-width: 0; }
/* 그림 선지 — 선지당 그림 1장(그래프/도형). 경계선 없이 지면 그대로.
   표시 폭 = inline style(원본 크롭 폭×0.5, 실지면 크기). 넓은 2그래프 선지가
   좁은 카드를 꽉 채우지 않게 max-width 로도 여유를 둔다 (박현우 '너무 커'). */
.prob-choices-fig { gap: 8px; }
.prob-choice-fig { align-items: center; }
.prob-choice-fig .prob-choice-img { flex: 0 1 auto; max-width: 100%; height: auto;
  display: block; }
/* 2단(다열) 선지 그리드 — 실제 시험지의 열 정렬 (2026-07-22, Bluebook
   .bb-choice-cols 와 같은 배치). 행 = (A) 문자 + repeat(nCols,1fr) 셀 그리드,
   머리글 행은 <u> 밑줄 그대로(bbInline 복원). */
.prob-choices-grid { display: flex; flex-direction: column; gap: 4px; }
.prob-choices-grid-cells { display: grid; column-gap: 26px; row-gap: 3px; }
.prob-choices-grid-cell { min-width: 0; }
/* 표 = 실제 시험지 인쇄 모양 (2026-07-19 박현우 '경계선 검정·폰트 그대로'):
   검정 단선 테두리, serif(.prob-content 상속), 헤더 배경/볼드 없음. 정렬은
   markdown 구분선 행(:---)을 BbTable 이 인라인으로 지정. */
.prob-content .bb-tbl { margin: 2px auto 8px; }
.prob-content .bb-tbl th, .prob-content .bb-tbl td {
  border: 1px solid #000; padding: 4px 14px; font-size: 13.5px;
}
.prob-content .bb-tbl th { font-weight: 400; background: none; }
/* 그림: 경계선·박스 없이 실제 시험처럼 지면에 그대로 (컨테이너 안 중앙) */
.prob-content .crop-real,
.problem-grid:not(.frq) .problem .prob-content .crop-real {
  height: auto; border: 0; background: transparent; overflow: visible;
  display: flex; justify-content: center;
}
.prob-content .crop-real img,
.problem-grid:not(.frq) .problem .prob-content .crop-real img {
  border: 0; border-radius: 0; max-width: 100%; width: auto; height: auto;
}
/* FRQ 하위문항 텍스트도 동일 serif */
.prob-frq-part { font-size: 14px; }
/* FRQ 파트 2단 배치 (content.parts[].columns = [left, right]) — 실제 시험지의
   좌우 나란히 인쇄 (2026-07-22) */
.prob-frq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prob-frq-cols > * { min-width: 0; }

/* 카드 클릭 = 전체화면 (2026-07-17 박현우 'MCQ 카드 고르면 확대') */
.prob-content.zoomable { cursor: zoom-in; }

/* 카드 확대 오버레이 (2026-07-19 박현우 '사진 버전 말고 카드가 그대로 확대'):
   같은 카드 콘텐츠(실제 텍스트/표/그림)를 CSS zoom 으로 키워 띄운다 — 텍스트
   드래그·복사 그대로 가능. 폭은 zoom 배율로 나눠 화면을 안 넘게. */
.cardzoom-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(15, 17, 26, .64);
  overflow-y: auto; padding: 54px 16px 44px;
  display: flex; flex-direction: column; align-items: center;
}
.cardzoom-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px; z-index: 1001;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; color: #fff;
  background: linear-gradient(rgba(10, 12, 20, .55), transparent);
}
.cardzoom-title { font-size: 13px; font-weight: 600; opacity: .92; }
.cardzoom-bar .icon-btn { color: #fff; }
.cardzoom-page {
  --cz: 1.5;
  zoom: var(--cz);
  width: calc(min(96vw, 1240px) / var(--cz));
  background: #fff; border-radius: 10px; padding: 26px 30px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
  cursor: default; margin: auto 0;
}
@media (max-width: 640px) { .cardzoom-page { --cz: 1.15; padding: 18px 16px; } }
/* 카드 확대의 ←/→ 넘김 버튼 (2026-07-22) — 라이트박스(.lightbox-nav)와 같은
   자리·모양이라 사용자는 같은 손동작으로 카드를 넘긴다. */
.cardzoom-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 1002;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff; cursor: pointer;
  transition: background 0.12s;
}
.cardzoom-nav:hover { background: rgba(255, 255, 255, 0.28); }
.cardzoom-nav.prev { left: 16px; }
.cardzoom-nav.next { right: 16px; }
.cardzoom-nav .ic { width: 24px; height: 24px; }

/* 수정 중인 대상 칩 (2026-07-25 박현우 '어떤 파일의 어떤 문제 재수정하고 있는지')
   — 수정창이 떠 있는 동안 화면 우하단 고정. 진행 상태 pill(.toast-host)과 같은
   자리라, 칩이 떠 있는 동안엔 pill 스택을 위로 올린다. */

/* 파일 상세 카드 좌우의 파일 넘김 화살표 (2026-07-25 박현우 '카드들 양쪽 옆에
   화살표 — 바로 옆 파일로'). position: sticky 라 카드 목록이 길어도 화면
   중앙 높이에 머문다 (fixed 로 하면 사이드바 위에 겹친다). */
.filenav { display: flex; align-items: flex-start; gap: 12px; }
.filenav-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.filenav-arrow {
  position: sticky; top: calc(50vh - 22px);
  flex: 0 0 auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--navy); cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 17, 26, 0.08);
  transition: background 0.12s, box-shadow 0.12s;
}
.filenav-arrow:hover:not(:disabled) {
  background: var(--navy-5); box-shadow: 0 4px 12px rgba(15, 17, 26, 0.14);
}
.filenav-arrow:disabled { opacity: 0.26; cursor: default; box-shadow: none; }
.filenav-arrow .ic { width: 20px; height: 20px; vertical-align: 0; }
@media (max-width: 760px) {
  .filenav { gap: 4px; }
  .filenav-arrow { width: 30px; height: 30px; }
  .filenav-arrow .ic { width: 15px; height: 15px; }
}

/* 공유 자료 배너 "Questions N-M refer to ..." — 이모지 없이 문제 본문과
   같은 serif·검정 (2026-07-17 박현우, 실제 지면과 동일하게) */
.stim-banner { font-size: 14px; line-height: 1.5; color: #111;
  font-family: "Times New Roman", "Nimbus Roman", Georgia, "Noto Serif", serif; }

/* 디지털 응시(Bluebook) 공유 자료 블록 — 문제 위에 여백만 살짝 (2026-07-22) */
.bb-stimulus { margin-bottom: 18px; }
.bb-stimulus .stim-banner { margin-bottom: 8px; }

/* 채점 기준 인라인 박스 (2026-07-17, 채점 기준 탭 → 라이브러리 통합) */
.prob-criteria { display: flex; flex-direction: column; gap: 6px;
  border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; }
/* 채점 기준 칸 — 누르면 그 자리에서 편집 (2026-07-28 박현우 '수정 버튼 없이
   칸을 누르면 고쳐지고 알아서 저장'). 표시 칸(.cr-cell-view)과 편집 칸
   (textarea)의 글꼴·여백을 맞춰 전환할 때 레이아웃이 튀지 않게 한다. */
/* 글꼴은 렌더 본문(.bb-rich)에 맞춘다 — 종전 읽기 화면과 같은 크기로 보이고,
   textarea 로 바뀌어도 글자가 커지거나 작아지지 않는다. (.cr-textarea 뒤에
   와야 13.5px 를 덮는다 — 그 클래스는 문제 본문 편집칸과 공용이라 못 건드림) */
.cr-cell { font-size: 15.5px; line-height: 1.75; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.cr-cell-view { white-space: pre-wrap; cursor: text;
  transition: border-color var(--t-fast) var(--ease); }
.cr-cell-view:hover, .cr-cell-view:focus { outline: none; border-color: var(--navy); }
.cr-cell-view .bb-rich { font-size: inherit; line-height: inherit; }
/* 빈 줄(문단 사이)이 편집 칸과 같은 높이를 갖도록 — line-height 1.75 = 1.75em */
.cr-cell-view .bb-rich p { margin: 0 0 1.75em; }
.cr-cell-view .bb-rich p:last-child { margin-bottom: 0; }
.cr-cell-ph { color: var(--text-3); }
/* 편집 중 수식 미리보기 — 소스를 고치는 동안 렌더 결과를 바로 아래에 (2026-07-28) */
.cr-preview { position: relative; margin-top: 4px; padding: 10px 12px 10px;
  border: 1px dashed var(--border); border-radius: var(--r);
  background: var(--surface-2); font-size: 15.5px; line-height: 1.75; }
.cr-preview .bb-rich { font-size: inherit; line-height: inherit; }
.cr-preview .bb-rich p { margin: 0 0 1.75em; }
.cr-preview .bb-rich p:last-child { margin-bottom: 0; }
.cr-preview-tag { display: block; font-size: 11px; font-weight: 700;
  color: var(--text-3); margin-bottom: 4px; }
.cr-status { font-size: 11px; color: var(--text-3); }
.cr-status.err { color: var(--danger); }

/* 연구용 인스턴스 배지 (2026-07-28) — 브랜드 옆 작은 알약. 배포용·프로덕션은
   window.RESEARCH_INSTANCE 가 false 라 요소 자체가 렌더되지 않는다. */
.research-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  vertical-align: middle;
  white-space: nowrap;
}
.boot-splash .word .research-badge { font-size: 13px; margin-left: 10px; }
