@import url("/css/wordmark.css");   /* 화면 글자 SeeAllai = 로고 글씨 (원본 하나) */
/* 학생 앱 (student.seeallai.co.kr) — 디자인 기준값은 여기 :root 한 곳 (원장님 2026-10-02 작업명령서 14, 9·10절).
   색·둥글기·그림자·간격을 화면마다 따로 쓰지 않는다. 버튼은 한 종류(.btn)와 글자 단추(.link)만. 큰 원형 단추 없음. */
:root {
  --bg: #F6F7F9; --card: #FFFFFF; --bubble-them: #FFFFFF; --bubble-me: #E8F1FF;
  --text: #111827; --text-2: #5D6675; --text-3: #66707F;   /* 회색 글자 대비 4.5 이상 (11-02 원장님 '시인성' — 예전 #667085·#98A2B3 은 4.6·2.6) */ --line: #E5E7EB; --line-2: #EAECF0; --line-3: #E8EAED;
  --primary: #2563EB; --primary-press: #1D4ED8; --primary-light: #EAF2FF;
  --ok: #0E7F3E; --warn: #B45309; --err: #DC2626;   /* 글자에도 쓰는 초록·주황을 진하게 (예전 3.3·2.2) — 작업탭 tokens.css 와 같은 값 */ --field: #F2F4F7;
  --accent-2: #7C3AED; --accent-2-light: #F3EEFF;   /* 숨은 기능 강조 (포인트 화면) — 다크 값은 아래 테마 절 */
  --person: #2F3A4F; --person-light: #EDF0F5; --person-line: #B9C3D3;   /* 사람(선생님)에게 보내는 상태 — 받는 사람 줄·말풍선 (작업명령서 18) */
  --r-card: 16px; --r-sheet: 22px; --r-btn: 12px; --r-input: 14px; --r-bubble: 18px; --r-tag: 8px; --r-mcard: 14px;
  --shadow: 0 2px 10px rgba(16,24,40,0.06);
  --pad: 16px; --gap: 12px; --section: 24px;
  --tab-h: 64px; --head-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --t-fast: 120ms; --t-view: 180ms; --t-sheet: 230ms;
  --font: system-ui, -apple-system, "Samsung Sans", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (min-width: 412px) { :root { --pad: 18px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 틀: 내용 + 아래 메뉴 ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 8px) var(--pad) calc(var(--section)); animation: viewIn var(--t-view) ease-out; }
.view.chatview { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: var(--card); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 12px; font-weight: 500; transition: color var(--t-fast); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--primary); }
body.kb .tabbar { display: none; }   /* 자판이 올라와 있는 동안 아래 메뉴 숨김 (student.js) */
.tabbar a:active { opacity: .7; }
.tabbar .dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--err); }

/* ---------- 머리 ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 18px; }
.top h1 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.2px; }
.top h1 small { display: block; font-size: 15px; font-weight: 500; color: var(--text-2); margin-bottom: 2px; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast); }
.iconbtn:active { background: var(--field); transform: scale(.97); }
.iconbtn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.pagehead { display: flex; align-items: center; gap: 8px; padding: 12px 0 16px; }
.pagehead h2 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; }

/* ---------- 카드 ---------- */
.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px; margin-bottom: var(--gap); }
.card .label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.card .big { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.card .sub { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.card .muted { font-size: 14px; color: var(--text-3); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .actions { margin-top: 14px; }
.lesson + .lesson { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.time { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-tag);
  background: var(--primary-light); color: var(--primary); vertical-align: 2px; margin-left: 6px; }
.tag.warn { background: #FEF3E2; color: #B45309; }
.tag.gray { background: var(--field); color: var(--text-2); }
.progress { height: 6px; border-radius: 3px; background: var(--field); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.notice { display: flex; gap: 12px; align-items: flex-start; }
.notice svg { flex: none; color: var(--primary); margin-top: 1px; }
.notice p { margin: 0 0 2px; font-size: 14.5px; }
.notice p.iosway { margin-top: 6px; }
.iosway .ic svg { width: 17px; height: 17px; margin: 0; vertical-align: -3px; }
.quiet { font-size: 13px; color: var(--text-2); padding: 2px 4px 14px; display: flex; gap: 6px; align-items: center; }
.quiet svg { width: 16px; height: 16px; color: var(--text-3); }

/* ---------- 단추 (한 종류) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px;
  border-radius: var(--r-btn); border: 0; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast); }
.btn:active { background: var(--primary-press); transform: scale(.98); }
.btn.sub { background: var(--primary-light); color: var(--primary); }
.btn.sub:active { background: #DCE8FF; }
.btn.block { width: 100%; }
.btn:disabled { background: var(--field); color: var(--text-3); }
.link { border: 0; background: none; padding: 0; color: var(--primary); font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; }
.link svg { width: 16px; height: 16px; }
.link:active { opacity: .6; }
.x { border: 0; background: none; color: var(--text-3); padding: 4px; cursor: pointer; }
.x svg { width: 18px; height: 18px; }

/* ---------- 채팅 ---------- */
.chathead { flex: none; height: calc(var(--head-h) + var(--safe-t)); padding: var(--safe-t) 12px 0 var(--pad); background: var(--card);
  border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-light); color: var(--primary); flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
button.avatar { border: 0; padding: 0; cursor: pointer; overflow: hidden; }
button.avatar:active { opacity: .8; }
/* 새 메시지: 줄무늬 띠 + 진한 말풍선 (원장님 2026-10-02 — 누가 봐도 새 메시지로) */
.newline { display: flex; align-items: center; gap: 10px; margin: 16px -4px 6px; }
.newline::before, .newline::after { content: ""; flex: 1; height: 6px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--primary) 0 6px, transparent 6px 12px); opacity: .55; }
.newline span { font-size: 12.5px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.msg.them.new .bubble { background: var(--primary-light); border-color: #BFD3FE; }
.msg.them.new .mcard { border-color: #BFD3FE; box-shadow: 0 0 0 1px #BFD3FE; }
.msg.them.new .name { color: var(--primary); font-weight: 600; }
/* 프로필 사진 팝업 */
.pview { max-height: 86dvh; overflow: auto; }
.pview .qhead { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px 14px; font-size: 16px; }
.pview .pbig { padding: 0 10px; }
.pview .pbig img { width: 100%; max-height: 60dvh; object-fit: contain; border-radius: var(--r-card); background: var(--field); display: block; }
.pview .pcap { font-size: 12.5px; color: var(--text-3); text-align: center; margin-top: 6px; }
.pview .phist { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 6px; }
.pview .phist button { flex: none; width: 60px; height: 60px; border-radius: 12px; border: 2px solid transparent; padding: 0; overflow: hidden; background: var(--field); cursor: pointer; }
.pview .phist button.on { border-color: var(--primary); }
.pview .phist img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chathead .who { flex: 1; min-width: 0; }
.chathead .who b { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; }
.chathead .who span { display: block; font-size: 12.5px; color: var(--text-2); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px var(--pad) 8px; background: var(--bg); overscroll-behavior: contain; }
.msgs .more { text-align: center; font-size: 12.5px; color: var(--text-3); padding: 6px 0 10px; }
.day { text-align: center; margin: 14px 0 8px; }
.day span { font-size: 12px; color: var(--text-2); background: #EDEFF3; padding: 3px 10px; border-radius: 10px; }
.msg { display: flex; flex-direction: column; margin-top: 10px; animation: msgIn 200ms ease-out; }
.msg.cont { margin-top: 4px; }
.msg.me { align-items: flex-end; }
.msg .name { font-size: 12.5px; color: var(--text-2); margin: 0 0 3px 4px; }
.bubble { max-width: 78%; padding: 10px 13px; font-size: 15.5px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
  background: var(--bubble-them); border: 1px solid var(--line-3); border-radius: 18px 18px 18px 6px; }
.msg.me .bubble { background: var(--bubble-me); border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .tm { display: block; text-align: right; font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.2; }
.msg.cont .bubble { border-top-left-radius: 18px; }
/* 선생님·심청이 글 — 카톡처럼 말풍선마다 왼쪽 라운드 네모 프로필 + 이름, 말풍선은 프로필 폭만큼 띄움 (원장님 2026-10-02 밤) */
.msg.them { flex-direction: row; align-items: flex-start; gap: 8px; margin-top: 16px; }
.msg.me { margin-top: 12px; }
.msg.me.cont { margin-top: 6px; }
.msg.them .av { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 13px; overflow: hidden; display: grid; place-items: center;
  background: #E3ECFF; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: -.5px; border: 1px solid #D5E1FB; }
.msg.them.person .av { background: #2F3A4F; color: #fff; border-color: #2F3A4F; }
.msg.them .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg.them .av { position: relative; }
.msg.them .av img.ph { position: absolute; inset: 0; }   /* 원장 사진이 있으면 글자 위를 덮는다 (없으면 글자) */
.msg.them .mcol { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: calc(100% - 64px); }
.msg.them .mcol .bubble { max-width: 100%; }
.msg.them .mcol .mcard { width: 100%; }
.msg.them .name { margin: 1px 0 4px 2px; font-weight: 600; color: var(--text); }
.msg.them.person .name { color: #2F3A4F; }
/* 선생님 말풍선 = 옅은 파랑 + 왼쪽 강조선 3px, 심청이(SeeAllai) = 흰색 (작업명령 39절 '선생님 중요 메시지 #EAF2FF · 강조선 Primary 3px' — 홈·알림함에만
   있고 대화 말풍선엔 빠져 있던 것, 원장님 2026-10-02 밤). 새 글이면 한 단계 더 진하게 (흰 말풍선의 '새 글' 표시와 구분) */
.msg.them.person .bubble { background: #EAF2FF; border-color: #D6E4FF; border-left: 3px solid var(--primary); }
.msg.them.person.new .bubble { background: #DCE8FF; border-color: #BFD3FE; border-left-color: #1D4ED8; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mcard { width: 78%; max-width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-mcard); overflow: hidden; }
.mcard .mbody { padding: 13px 14px 12px; }
.mcard .mtitle { font-size: 15.5px; font-weight: 700; }
.mcard .msub { font-size: 13.5px; color: var(--text-2); margin-top: 1px; }
.mcard .mscore { font-size: 22px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; }
.mcard .mact { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); }
.mcard .mact button { height: 46px; border: 0; background: none; padding: 0 14px; color: var(--primary); font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.mcard .mact button + button { border-top: 1px solid var(--line-2); }
.mcard .mact button:active { background: var(--primary-light); }
.mcard .mact svg { width: 16px; height: 16px; }
.mcard .tm { display: block; text-align: right; font-size: 11px; color: var(--text-3); padding: 0 12px 8px; }

.composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 9px 10px; background: var(--card); border-top: 1px solid var(--line-2); }
.composer .iconbtn { border-color: transparent; background: none; color: var(--text-2); }
.composer .iconbtn:active { background: var(--field); }
.composer textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; border: 1px solid var(--line-2); border-radius: var(--r-input);
  background: var(--field); padding: 10px 13px; font-size: 15.5px; line-height: 1.4; outline: none; scrollbar-width: none; }
.composer textarea::-webkit-scrollbar { display: none; }
.composer textarea:focus { border-color: #C7D7FE; background: var(--card); }   /* 예전 #fff — 다크 모드에서 글자(밝은색)가 흰 바탕에 안 보였다 (원장님 10-03 삼성 폰) */
.composer textarea { color: var(--text); -webkit-text-fill-color: var(--text); caret-color: var(--text); }   /* 폰 자체 다크 모드가 글자색을 바꾸지 않게 */
.composer .send { color: var(--text-3); }
.composer .send.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.composer .send.on:active { background: var(--primary-press); }
.composer .mic.rec { color: var(--err); }
/* 대화방 고르기 (원장님 2026-10-04 채팅방 분리) — 위쪽 프로필 아래 한 줄: [심청이] [수학 · 안쌤] [과학 · 원장]. 고른 방만 진하게, 다른 방 안 읽은 글은 빨간 숫자 */
.roomtabs { flex: none; display: flex; gap: 6px; padding: 6px var(--pad) 8px; background: var(--card); border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.roomtabs::-webkit-scrollbar { display: none; }
.roomtabs button { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 3px 12px 3px 4px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--field);
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.roomtabs button.on { background: var(--primary-light); border-color: #BFD3FE; color: var(--primary); font-weight: 700; }
.roomtabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 방 단추의 상대 사진 — 예전 입력줄 위 받는 사람 프로필과 같은 크기(30px · 둥근 네모) */
.roomtabs .rav { position: relative; flex: none; width: 30px; height: 30px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: #2F3A4F; color: #fff; font-size: 11px; font-weight: 700; }
.roomtabs .rav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.roomtabs .rav em { font-style: normal; }
.roomtabs .rbadge { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--err); color: #fff;
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.chathead .avatar span { font-size: 13px; }
.chathead .avatar img ~ span { display: none; }           /* 사진이 있으면 글자는 숨김 (사진을 못 불러오면 이름 두 글자) */
/* 내가 보낸 글: 선생님 방 말풍선 색 · 첨부 */
.msg.me .bubble.tostaff { background: var(--person-light); border: 1px solid var(--person-line); }
.msg .atts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 78%; margin-bottom: 4px; }
.msg.them .atts { justify-content: flex-start; max-width: 100%; }   /* 받은 글 첨부는 말풍선 줄(왼쪽)에 */
.msg .att { display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-3); background: var(--card); }
.msg .att.img { width: 120px; height: 120px; position: relative; justify-content: center; }
.msg .att.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg .att.img span { display: none; }
.msg .att.img.wait span { display: block; font-size: 12px; color: var(--text-3); }
.msg .att.file { padding: 8px 12px; font-size: 13.5px; max-width: 220px; }
.msg .att.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .att.file svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.sheet .sheet-note { font-size: 12.5px; color: var(--text-3); padding: 0 14px 6px; }
.sheet .item .sub { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.sheet .item.soon { color: var(--text-3); }

/* ---------- 아래에서 올라오는 판 ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(16,24,40,.32); z-index: 40; animation: fade var(--t-sheet) ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px 8px calc(12px + var(--safe-b)); animation: up var(--t-sheet) cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; }
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet .item { width: 100%; height: 56px; border: 0; background: none; display: flex; align-items: center; gap: 14px; padding: 0 14px;
  font-size: 15.5px; border-radius: 12px; cursor: pointer; text-align: left; }
.sheet .item svg { color: var(--text-2); }
.sheet .item:active { background: var(--field); }
.qview { max-height: 82dvh; display: flex; flex-direction: column; }
.qview .qhead { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px 14px; font-size: 16px; }
.qview .qimg { overflow: auto; padding: 4px 6px 8px; min-height: 120px; color: var(--text-3); font-size: 14px; text-align: center; }
.qview .qimg img { width: 100%; height: auto; display: block; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 시간표 ---------- */
.week .dayrow { display: flex; gap: 12px; margin-bottom: var(--gap); }
.week .dlabel { width: 36px; flex: none; text-align: center; padding-top: 14px; }
.week .dlabel b { display: block; font-size: 15px; }
.week .dlabel span { font-size: 11.5px; color: var(--text-3); }
.week .dlabel.today b { color: var(--primary); }
.week .ditems { flex: 1; min-width: 0; }
.week .lcard { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 13px 15px; margin-bottom: 8px; }
.week .lcard.now { background: var(--primary-light); box-shadow: none; }
.week .lcard .t { font-size: 13px; color: var(--text-2); }
.week .lcard .n { font-size: 15.5px; font-weight: 600; margin-top: 1px; }
.week .empty { padding: 14px 0; font-size: 13.5px; color: var(--text-3); }

/* ---------- 스캔 ---------- */
.scanbox { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 14px; }
.scanprev { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--field); display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--text-3); font-size: 14px; text-align: center; }
.scanprev img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; }
.thumbs button { flex: none; width: 54px; height: 70px; border-radius: 10px; border: 1px solid var(--line); background: var(--field) center/cover no-repeat;
  position: relative; cursor: pointer; padding: 0; }
.thumbs button.on { border: 2px solid var(--primary); }
.thumbs button.retake { border: 2px solid #E5484D; }            /* 서버가 못 읽은 장 — 이 장만 다시 찍기 */
.thumbs button.retake span { color: #fff; background: #E5484D; }
.thumbs button span { position: absolute; left: 4px; top: 3px; font-size: 11px; font-weight: 700; color: var(--text-2); background: rgba(255,255,255,.85);
  border-radius: 6px; padding: 0 4px; }
.thumbs .add { background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.scanact { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.hint { font-size: 13px; color: var(--text-2); margin: 10px 2px 0; }
.hint b { color: var(--text); font-weight: 600; }
.hint .small { margin-top: 3px; font-size: 12.5px; }      /* 다시 찍을 쪽마다 까닭 한 줄 */

/* ---------- 내 학습 ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.stats .card { margin: 0; padding: 15px 16px; }
.stats .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stats .k { font-size: 13px; color: var(--text-2); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 28px; background: var(--primary); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.bars .b span { font-size: 11px; color: var(--text-3); }
.list .li { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; }
.list .li + .li { border-top: 1px solid var(--line-2); }
.list .li b { font-size: 15px; font-weight: 600; display: block; }
.list .li span { font-size: 13px; color: var(--text-2); }
.seg { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.seg button { flex: none; height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ---------- 로그인 ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px var(--pad) calc(24px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login .brand img { width: 52px; height: 52px; border-radius: 14px; }
.login .brand b { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.login .brand span { display: block; font-size: 14px; color: var(--text-2); font-weight: 400; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 6px 2px; }
.field input { width: 100%; height: 50px; border-radius: var(--r-input); border: 1px solid var(--line-2); background: var(--card); padding: 0 14px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--primary); }
.login .lgmsg { font-size: 13.5px; color: var(--text-2); margin: 10px 2px 0; min-height: 20px; }
.login .lgmsg.err { color: var(--err); }
.login .alt { text-align: center; margin-top: 22px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 60;
  background: #1F2937; color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); animation: fade 160ms ease-out; }
.offline { background: #FEF3E2; color: #92400E; font-size: 13.5px; padding: 9px var(--pad); text-align: center; }
.empty-state { text-align: center; color: var(--text-3); font-size: 14px; padding: 36px 0; }


/* ---------- 홈 '새 메시지' · 알림함 · [확인했어요] (원장님 2026-10-02) ---------- */
/* 선생님 연락이 가장 강하게(아주 옅은 파랑 + 왼쪽 3px 선), SeeAllai 는 흰 카드, 기타는 더 낮게. 경고처럼 빨갛게 하지 않는다 */
.ncount { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--field); color: var(--text-2);
  font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }
.ncount.total { background: var(--primary); color: #fff; }
.newmsg .label .link { margin-left: auto; }
.ngroup { margin-top: 12px; }
.ngroup:first-of-type { margin-top: 6px; }
.ngroup .nhead { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; }
.ngroup .nhead b { color: var(--text); font-weight: 600; }
.ngroup.other .nhead b { color: var(--text-2); font-weight: 500; }
.nmsg { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); margin-top: 6px; cursor: pointer; }
.nmsg.teacher { background: var(--primary-light); border-color: #D6E4FF; border-left: 3px solid var(--primary); }
.ngroup.other .nmsg { border-color: var(--line-2); color: var(--text-2); }
.nmeta { font-size: 12.5px; color: var(--text-2); }
.nmsg.teacher .nmeta { color: var(--text); font-weight: 600; }
.ntext { font-size: 14.5px; margin-top: 2px; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nact { display: flex; justify-content: flex-end; margin-top: 8px; }
.nmore { display: inline-flex; align-items: center; margin-top: 8px; font-size: 13px; }
.ackbtn { height: 38px; padding: 0 16px; border-radius: 11px; border: 0; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.ackbtn:active { background: var(--primary-press); }
.ackbtn:disabled { opacity: .6; }
.msg .ackbtn { margin-top: 6px; }
.ackdone { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.chips { display: flex; gap: 8px; padding: 0 var(--pad) 12px; overflow-x: auto; }
.chips button { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: 14px; }
.chips button.on { background: var(--text); border-color: var(--text); color: #fff; }
.imsg.teacher { border-left: 3px solid var(--primary); }
.imsg.unread .nmeta::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-left: 6px; vertical-align: middle; }

/* ---------------- 설정 화면 (원장님 2026-10-02 작업명령 '학생용 PWA 설정 화면') — 일반 휴대폰 설정처럼 단순하게 */
.li.sw { cursor: pointer; }
.li.sw input { position: absolute; opacity: 0; pointer-events: none; }
.li.sw i { flex: 0 0 46px; width: 46px; height: 28px; border-radius: 14px; background: #D0D5DD; position: relative; transition: background .15s; }
.li.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.li.sw input:checked + i { background: var(--primary); }
.li.sw input:checked + i::after { left: 21px; }
.li.sw.off { opacity: .45; }
.li.rowbtn { width: 100%; background: none; border: 0; padding: 12px 0; font: inherit; color: inherit; text-align: left; }
.li.rowbtn span { display: inline-flex; align-items: center; gap: 2px; }
.li.rowbtn svg, .li.rowbtn span svg { width: 18px; height: 18px; }
.choices { padding: 2px 0 10px 4px; }
.choice { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.choice .pick { background: none; border: 0; font: inherit; font-size: 15px; color: var(--text); padding: 8px 0; text-align: left; flex: 1; }
.choice.on .pick { color: var(--primary); font-weight: 600; }
.choices .sub { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-top: 4px; }
.tagnow { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--primary); background: var(--primary-light); border-radius: var(--r-tag); padding: 1px 6px; margin-left: 4px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }

/* ---------------- 테마: 시스템 설정(기본) · 밝게 · 어둡게 — 색 변수만 바꾼다 (화면마다 따로 칠하지 않음) */
:root[data-theme="dark"] {
  --bg: #0F1115; --card: #1A1D23; --bubble-them: #1F232A; --bubble-me: #1E3A66;
  --text: #EEF0F3; --text-2: #A3AAB6; --text-3: #8A93A5; --ok: #16A34A; --warn: #F59E0B; --line: #2B3038; --line-2: #262A31; --line-3: #2B3038;
  --primary: #4C8DFF; --primary-press: #3B78E7; --primary-light: #1C2C4A; --field: #23272E;
  --accent-2: #A78BFA; --accent-2-light: #2A2140;
  --person: #C9D3E3; --person-light: #252C38; --person-line: #3A4558;
  --shadow: 0 2px 10px rgba(0,0,0,0.4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0F1115; --card: #1A1D23; --bubble-them: #1F232A; --bubble-me: #1E3A66;
    --text: #EEF0F3; --text-2: #A3AAB6; --text-3: #8A93A5; --ok: #16A34A; --warn: #F59E0B; --line: #2B3038; --line-2: #262A31; --line-3: #2B3038;
    --primary: #4C8DFF; --primary-press: #3B78E7; --primary-light: #1C2C4A; --field: #23272E;
    --accent-2: #A78BFA; --accent-2-light: #2A2140;
  --person: #C9D3E3; --person-light: #252C38; --person-line: #3A4558;
    --shadow: 0 2px 10px rgba(0,0,0,0.4); color-scheme: dark;
  }
  :root[data-theme="system"] .msg.them.person .bubble { background: #1C2C4A; border-color: #2A3F66; }
  :root[data-theme="system"] .msg.them.person .name { color: var(--text); }
  :root[data-theme="system"] .day span { background: #23272E; }
}
:root[data-theme="dark"] .msg.them.person .bubble { background: #1C2C4A; border-color: #2A3F66; }
:root[data-theme="dark"] .msg.them.person .name { color: var(--text); }
:root[data-theme="dark"] .day span { background: #23272E; }

/* 기기 2대 넘을 때 로그인 화면의 기기 고르기 */
.devlimit { margin-top: 16px; text-align: left; }
.devlimit p { font-size: 14px; color: var(--text); line-height: 1.5; margin: 0 0 8px; }
.devlimit .li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.devlimit .li b { display: block; font-size: 15px; }
.devlimit .li span { font-size: 12.5px; color: var(--text-2); }
.vibnote { font-size: 12.5px; color: var(--text-2); line-height: 1.5; padding: 0 0 10px; }
.appver { text-align: center; font-size: 11.5px; color: var(--text-3); padding: 4px 0 24px; }

/* ---------------- 포인트 (원장님 2026-10-02 밤 작업명령서 16) — 기존 토큰만: 일반 = --primary · 신기록 = --primary 진하게 · 숨은 기능 = --accent-2 · 보류 = --warn · 차감 = --err */
.pts-card .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.pts-card .row2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.pts-card .streak { margin-top: 8px; font-size: 13px; color: var(--text); }
.pts-card .line { margin-top: 8px; font-size: 13px; color: var(--primary); font-weight: 600; }
.pts-card.record { border: 2px solid var(--primary); }
.pts-hero { text-align: center; padding-top: 22px; padding-bottom: 20px; }
.pts-hero .m { font-size: 14px; color: var(--text-2); }
.pts-hero .big { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; margin: 4px 0 2px; }
.pts-hero .msg { font-size: 15px; font-weight: 700; margin-top: 10px; }
.pts-hero .msg.record { color: var(--primary); }
.pts-hero .progress { height: 10px; border-radius: 5px; margin-top: 14px; }
.pts-hero .cap { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.pts-cat .li { cursor: pointer; }
.pts-cat .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.pts-cat .sublist { padding: 0 2px 8px; }
.pts-led .li .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pts-led .li .v.minus { color: var(--err); }
.pts-led .li .v.xp { color: var(--text-3); font-weight: 600; }
.pts-led .li.cancel b { text-decoration: line-through; color: var(--text-3); }
.pts-hidden .hf { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pts-hidden .hf:last-child { border-bottom: 0; }
.pts-hidden .hf .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--field); font-size: 17px; flex: none; }
.pts-hidden .hf.found .ic { background: var(--accent-2-light); }
.pts-hidden .hf.found b { color: var(--accent-2); }
.pts-hidden .hint { font-size: 13px; color: var(--text-2); }
.pts-hidden .count { color: var(--accent-2); font-weight: 800; }
.pts-reward { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pts-reward:last-child { border-bottom: 0; }
.pts-hold { color: var(--warn); font-weight: 600; }
.pts-pop { animation: ptsPop 600ms ease-out; }
@keyframes ptsPop { 0% { transform: scale(0.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pts-pop { animation: none; } }
.prac-q { background: #fff; border-radius: var(--r-mcard); overflow: hidden; border: 1px solid var(--line); min-height: 120px; display: grid; place-items: center; }
.prac-q img { width: 100%; display: block; }
.prac-ans { display: flex; gap: 8px; margin-top: 12px; }
.prac-ans input { flex: 1; height: 48px; border-radius: var(--r-input); border: 1px solid var(--line); background: var(--field); color: var(--text); padding: 0 14px; font-size: 16px; }
.prac-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.prac-quick button { height: 46px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; }
.prac-fb { margin-top: 10px; font-size: 14px; }
.prac-fb.ok { color: var(--ok); } .prac-fb.no { color: var(--text-2); }

/* ---------- 학원 공용 태블릿 (master.student.seeallai.co.kr, 2026-11-21) ---------- */
.pwmask { -webkit-text-security: disc; }   /* 비밀번호 칸을 type=password 없이 점으로 — 브라우저가 '비밀번호 저장' 을 묻지 않게 (student.js masterLock) */
.mpick { max-height: 55dvh; overflow-y: auto; padding-top: 6px; padding-bottom: 6px; }
.mbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--safe-t) + 8px) var(--pad) 8px; background: var(--card); border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--text-2); }
.mbar b { color: var(--text); }
.app.mastered .view { padding-top: 8px; }
