/* 케쌤영어 마스터과정 — 브릿지와 같은 색 체계(파랑 브랜드 · 방 분석 역할 색) */
:root {
  --bg: #eef3f9; --card: #fff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #1570db; --brand-dark: #0f5bb5; --soft: #eef5ff; --soft-line: #bcd4f6;
  --good: #0e9f8a; --good-bg: #e3f6f2; --bad: #dc2626; --bad-bg: #fdecec;
  --point: #ff8a3d; --point-bg: #fff1e6; --gold: #f5a300; --gold-bg: #fff6dc;
  --S: #2563eb; --S-bg: #dbeafe; --V: #dc2626; --V-bg: #fee2e2; --O: #16a34a; --O-bg: #dcfce7;
  --C: #9333ea; --C-bg: #f3e8ff; --M: #d97706; --M-bg: #fef3c7; --T: #6b7280; --T-bg: #f3f4f6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; line-height: 1.55; font-size: 15px; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 8px 0 0; }
h1 { font-size: 21px; margin: 0; }
h2 { font-size: 18px; margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

header.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; }
.logo .k { background: var(--brand); color: #fff; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 16px; }
.logo em { font-style: normal; font-weight: 700; color: var(--brand); font-size: 14px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 2px; font-size: 14px; }
.link.back { margin-bottom: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.login { display: grid; gap: 12px; margin-top: 24px; }
.login label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); width: 100%; }
input:focus { border-color: var(--brand); outline: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.small { padding: 6px 10px; font-size: 13.5px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.course { width: 100%; margin-top: 16px; background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.course:active { background: var(--brand-dark); }

/* ---- 홈 ---- */
.hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.week-pill { background: var(--point-bg); color: #c2530a; font-weight: 700; font-size: 13px; border-radius: 14px; padding: 6px 12px; white-space: nowrap; text-align: center; }
.week-pill small { display: block; font-size: 11.5px; font-weight: 600; opacity: .9; margin-top: 1px; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.cat-head { width: 100%; display: grid; grid-template-columns: 1fr auto 18px; align-items: center; gap: 10px; padding: 15px 16px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); }
.cat-title { font-weight: 700; font-size: 16px; }
.cat-sub { font-size: 13px; color: var(--muted); font-weight: 400; display: block; margin-top: 2px; }
.cat-count { font-size: 13px; color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.chev { transition: transform .2s; color: var(--muted); }
.cat.open .chev { transform: rotate(90deg); }
.bar { height: 5px; background: var(--line); border-radius: 3px; margin: 0 16px 14px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.cat-body { border-top: 1px solid var(--line); padding: 8px 12px 12px; }
.wk { font-size: 14px; font-weight: 800; color: var(--ink, #1a1d21); margin: 12px 4px 6px; display: flex; gap: 6px; align-items: center; }
.wk .now { background: var(--point); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.vrow { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; cursor: pointer; user-select: none; }
.vrow:hover { background: var(--soft); }
.box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #cbd5e1; display: grid; place-items: center; flex: none; color: #fff; font-size: 14px; }
.vrow.on .box { background: var(--good); border-color: var(--good); }
.vrow .t { flex: 1; min-width: 0; }
.vrow .t small { display: block; color: var(--muted); font-size: 12.5px; }
.rrow { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; padding: 7px 4px; }
.rrow .rn { font-weight: 700; font-size: 14px; }
.rbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.rbtn { border: 1px solid var(--soft-line); background: var(--soft); color: var(--brand); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.rbtn.done { background: var(--good-bg); border-color: transparent; color: var(--good); }
.weak { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 4px 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.chip.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); font-weight: 600; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }

/* ---- 활동 공통 ---- */
.act-head { margin-bottom: 12px; }
.act-head .tag { display: inline-block; background: var(--soft); color: var(--brand); font-weight: 700; font-size: 12.5px; border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
.sec { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 2px 8px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.q.ok { border-color: var(--good); background: #f6fffc; }
.q.no { border-color: var(--bad); }
.q .num { font-weight: 800; color: var(--brand); margin-right: 6px; }
.q .form { font-size: 11.5px; font-weight: 700; color: #7c3aed; background: #f3e8ff; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.q .ko { color: var(--muted); font-size: 14px; margin-top: 4px; }
.q .wrongx { text-decoration: line-through; color: var(--bad); font-size: 13.5px; }
.q .line { margin-top: 6px; line-height: 2.1; }
.q input.blank { display: inline-block; width: auto; min-width: 90px; font-size: 15px; padding: 4px 8px; border-radius: 8px; margin: 0 2px; }
.q.ok input.blank { border-color: var(--good); background: var(--good-bg); color: var(--good); font-weight: 700; }
.q.no input.blank { border-color: var(--bad); }
.q .words { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.q .fb { font-size: 13.5px; margin-top: 6px; }
.q .fb.bad { color: var(--bad); }
.q .fb .reveal { margin-left: 6px; }
.bottom { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 max(8px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.bottom .btn { flex: 1; }
.result { background: var(--card); border-radius: 14px; border: 1px solid var(--line); padding: 20px; text-align: center; margin-top: 12px; }
.result b { font-size: 28px; display: block; color: var(--brand); }

/* ---- 조각 배열 ---- */
.dots { display: flex; gap: 5px; margin: 4px 0 12px; }
.dots i { width: 22px; height: 5px; border-radius: 3px; background: var(--line); }
.dots i.done { background: var(--good); }
.dots i.cur { background: var(--brand); }
.prompt { font-size: 17px; font-weight: 700; margin: 6px 0 6px; }
.vocab { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.slot { min-height: 54px; border: 2px dashed var(--soft-line); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; background: #fff; }
.slot .ph { color: var(--muted); font-size: 13.5px; padding: 6px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tile { border: 1px solid #cbd5e1; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 15px; cursor: pointer; color: var(--ink); box-shadow: 0 1px 0 #cbd5e1; }
.tile.used { visibility: hidden; }
.tile.in { background: var(--soft); border-color: var(--soft-line); box-shadow: none; }
.r-S { background: var(--S-bg) !important; color: var(--S) !important; border-color: transparent !important; }
.r-V { background: var(--V-bg) !important; color: var(--V) !important; border-color: transparent !important; }
.r-O, .r-IO, .r-DO { background: var(--O-bg) !important; color: var(--O) !important; border-color: transparent !important; }
.r-C, .r-OC { background: var(--C-bg) !important; color: var(--C) !important; border-color: transparent !important; }
.r-M { background: var(--M-bg) !important; color: var(--M) !important; border-color: transparent !important; }
.r-T { background: var(--T-bg) !important; color: var(--T) !important; border-color: transparent !important; }
.msg { min-height: 22px; font-size: 14px; margin-bottom: 8px; }
.msg.bad { color: var(--bad); } .msg.good { color: var(--good); font-weight: 700; } .msg.hint { color: #7c3aed; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; margin: 6px 0; }
.legend span { border-radius: 5px; padding: 1px 7px; }
.ana { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ana span { border-radius: 8px; padding: 5px 10px; font-size: 14.5px; }
.note { font-size: 13px; color: var(--muted); background: var(--T-bg); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }

/* ---- 대화문 ---- */
.dlg { display: grid; gap: 10px; margin: 12px 0; }
.dl { display: grid; grid-template-columns: 52px 1fr; gap: 6px; }
.dl .sp { font-weight: 800; font-size: 13px; color: var(--muted); padding-top: 2px; }
.dl .en { font-size: 16px; }
.dl .ko { font-size: 13px; color: var(--muted); }
.gap { display: inline-block; min-width: 70px; border-bottom: 2px solid var(--brand); color: var(--brand); font-weight: 700; text-align: center; padding: 0 4px; }
.gap.filled { border-color: var(--good); color: var(--good); background: var(--good-bg); border-radius: 5px 5px 0 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.opt { border: 1px solid var(--soft-line); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 14.5px; cursor: pointer; color: var(--ink); }
.opt.x { background: var(--bad-bg); border-color: transparent; color: var(--bad); text-decoration: line-through; }
.why { font-size: 13px; color: var(--bad); margin-top: 4px; }
.bold { font-weight: 800; }

/* ---- 문법 ---- */
.topic { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.topic > button { width: 100%; background: none; border: 0; padding: 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; font-size: 15.5px; color: var(--ink); text-align: left; }
.topic .formula { font-weight: 400; color: var(--muted); font-size: 13px; display: block; }
.topic .inner { padding: 0 14px 14px; }
.topic ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.ex { border-top: 1px solid var(--line); padding: 10px 0; }
.ex .ko { font-size: 13.5px; color: var(--muted); }
.ex .en { font-size: 14.5px; margin-top: 2px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; }
@keyframes shake { 0%,100% { transform: none } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }
.shake { animation: shake .25s; }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } .chev { transition: none; } }

/* ---- 버튼으로 푸는 복습 퀴즈 ---- */
.qform { font-size: 12px; font-weight: 700; color: #7c3aed; background: #f3e8ff; border-radius: 4px; padding: 1px 6px; }
.qline { font-size: 17px; line-height: 2.2; margin: 10px 0 4px; }
.qslot { display: inline; }
.qslot .tile { padding: 3px 9px; font-size: 16px; margin: 0 1px; }
.tile.big { font-size: 17px; padding: 10px 16px; }
.choices { display: grid; gap: 8px; margin: 14px 0 6px; }
.choice { border: 1.5px solid var(--soft-line); background: #fff; color: var(--ink); border-radius: 12px; padding: 13px 14px; font-size: 17px; text-align: left; cursor: pointer; }
.choice:active { background: var(--soft); }
.choice.x { background: var(--bad-bg); border-color: transparent; color: var(--bad); text-decoration: line-through; cursor: default; }
.rbtn.pdf { background: #fff; color: var(--ink); border-color: var(--line); text-decoration: none; }

/* ---- 방 분석: 덩어리 + 역할 이름 ---- */
.ana2 { display: flex; flex-wrap: wrap; gap: 10px 6px; margin: 8px 0; width: 100%; }
.ana2 .cell { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; max-width: 100%; }
.ana2 .chunk { border-radius: 8px; padding: 6px 10px; font-size: 15px; text-align: center; }
.ana2 .rl { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rl-S { color: var(--S) !important; } .rl-V { color: var(--V) !important; } .rl-O, .rl-IO, .rl-DO { color: var(--O) !important; }
.rl-C, .rl-OC { color: var(--C) !important; } .rl-M { color: var(--M) !important; } .rl-T { color: var(--T) !important; }
.slot:has(.ana2) { border-style: solid; border-color: var(--line); }
.full { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }

/* ---- 관리자 ---- */
.wrap.wide { max-width: 1000px; }
.ad-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ad-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on .muted { color: #dbe9ff; }
.ad-form h2 { margin-bottom: 10px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ad-grid label, .ad-roster { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.ad-roster { margin-top: 12px; }
select, textarea { font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn.danger { color: var(--bad); }
.ad-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ad-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.ad-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ad-stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.ad-stats span { font-size: 12.5px; color: var(--muted); }
.ad-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.ad-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: top; }
.ad-table tr[data-ph] { cursor: pointer; }
.ad-table tr[data-ph]:hover, .ad-table tr.open { background: var(--soft); }
.ad-table tr.detail td { background: #fafcff; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.idle { background: var(--T-bg); color: var(--T); }
.ad-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ad-rounds { display: grid; gap: 4px; font-size: 13px; }
.ad-memo { margin-bottom: 6px; }


/* ---- 문제 이동 (처음 · 이전 · 다음) ---- */
.qnav { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; }
.qnav .btn { flex: 1; }
.dots { flex-wrap: wrap; }
.dots button { width: 22px; height: 8px; border-radius: 4px; background: var(--line); border: 0; padding: 0; cursor: pointer; }
.dots button.done { background: var(--good); }
.dots button.cur { background: var(--brand); box-shadow: 0 0 0 2px var(--soft-line); }

/* ---- 원어민 음성 버튼 ---- */
.spk { border: 1px solid var(--soft-line); background: var(--soft); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; vertical-align: middle; white-space: nowrap; }
.spk:active { background: #dbe9ff; }
.dl .spk { padding: 1px 8px; font-size: 12.5px; }

.ad-xl { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }

.ad-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.ad-filter input { flex: 1 1 220px; width: auto; }
.ad-filter select { width: auto; }

/* ---- 활용가이드 (브릿지와 같은 모양) ---- */
.top-r { display: flex; align-items: center; gap: 10px; }
.guide-btn { flex: none; border: 1px solid var(--soft-line); background: #fff; color: var(--brand-dark); border-radius: 99px; padding: 7px 12px; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.guide-btn:active { transform: translateY(1px); }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 36px 16px; overflow-y: auto; }
.modal .scrim { position: fixed; inset: 0; background: rgba(16,24,40,.35); }
.modal .sheet { position: relative; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(16,24,40,.28); width: min(520px, 100%); overflow: hidden; }
.gg-hero { position: relative; padding: 22px 22px 18px; background: linear-gradient(135deg, #3b5bdb, #5c7cfa); color: #fff; }
.gg-hero h3 { font-size: 20px; margin: 10px 0 6px; }
.gg-pill { font-size: 11.5px; font-weight: 700; background: #ffd43b; color: #5c3c00; padding: 2px 9px; border-radius: 999px; }
.gg-hero .x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.ug-lead { font-size: 13.5px; opacity: .92; margin: 0 0 12px; word-break: keep-all; }
.ug-video { display: inline-block; background: #fff; color: #e03131; font-size: 14px; font-weight: 800; border-radius: 99px; padding: 8px 14px; border: 0; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.15); text-decoration: none; }
.ug-video.off { color: var(--muted); cursor: default; box-shadow: none; }
.ug { padding: 6px 22px 22px; }
.ug-step { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ug-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.ug-body h4 { font-size: 16px; margin: 3px 0 6px; }
.ug-body ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.55; color: #1f2937; display: flex; flex-direction: column; gap: 4px; }
.ug-body b { color: var(--brand-dark); }
.ug-faq { background: #f4f7fb; border-radius: 14px; padding: 14px 16px; font-size: 14px; margin: 18px 0 0; }
.ug-faq h4 { margin: 0 0 8px; font-size: 15px; }
.ug-faq dt { font-weight: 700; margin-top: 10px; }
.ug-faq dd { margin: 2px 0 0; color: #475569; }
.vplayer { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 16px; }
.vplayer video { max-width: 100%; max-height: 100%; border-radius: 12px; background: #000; }
.vp-x { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 20px; cursor: pointer; }
@media (max-width: 420px) {
  .ug-lead { font-size: 12.5px; }
  .logo { font-size: 17px; gap: 6px; } .logo em { font-size: 12.5px; }
  .top-r { gap: 6px; } .guide-btn { padding: 6px 10px; font-size: 12.5px; } #btn-logout { font-size: 13px; }
}
.gg-hero h3, .ug-body, .ug-faq { word-break: keep-all; }

/* ---- 문법 모르는 것은 ChatGPT로 먼저 + 문법 가이드 (브릿지와 같은 모양) ---- */
.ask-tip { --accent: #3b5bdb; margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: #eef2ff; border: 1px solid #c7d2fe;
  color: #2c3a8c; font-size: 15px; font-weight: 600; line-height: 1.55; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ask-tip .t { flex: 1; min-width: 200px; display: flex; gap: 8px; align-items: flex-start; }
.ask-tip .ico { flex: none; }
.ask-tip b { color: var(--accent); }
#grammar-guide { white-space: nowrap; background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 520px) {
  .ask-tip { flex-wrap: nowrap; font-size: 12.5px; letter-spacing: -.3px; padding: 12px 10px; gap: 6px; }
  .ask-tip .t { min-width: 0; gap: 5px; word-break: keep-all; }
  #grammar-guide { flex: none; padding: 7px 9px; font-size: 12px; letter-spacing: -.2px; }
}
.gg { --accent: #3b5bdb; --muted: #6b7280; --faint: #9aa1ab; --line2: #eef0f3; --text: #1a1d21; }
.gg .m-body { padding: 20px 22px; }
.gg-hero p { margin: 0; font-size: 13.5px; opacity: .9; }
.gg-sec { font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0 10px; }
.gg-sec small { font-weight: 500; color: var(--faint); margin-left: 4px; }
.gg-steps { display: grid; gap: 12px; margin-bottom: 20px; }
.gg-step { display: flex; gap: 12px; align-items: flex-start; }
.gg-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #eef2ff; color: var(--accent); font-weight: 700;
  font-size: 13.5px; display: flex; align-items: center; justify-content: center; }
.gg-title { font-weight: 700; font-size: 15px; }
.gg-body { font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; word-break: keep-all; }
.gg-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 5px 0 6px; }
.gg-chips span { font-size: 12px; font-weight: 600; background: #f1f3f5; color: var(--text); padding: 3px 9px; border-radius: 999px; }
.gg-prompt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #f8f9fb; border: 1px solid var(--line2);
  border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; font-family: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.gg-prompt:hover { border-color: #c7d2fe; background: #f5f7ff; }
.gg-prompt.ok { border-color: #8ce99a; background: #ebfbee; }
.gg-tag { flex: none; font-size: 11.5px; font-weight: 700; color: var(--accent); background: #eef2ff; padding: 2px 8px; border-radius: 6px; }
.gg-text { flex: 1; }
.gg-copy { flex: none; font-size: 12px; color: var(--faint); }
.gg-open { display: block; text-align: center; text-decoration: none; margin-top: 14px; padding: 13px; background: var(--accent); border-color: var(--accent); color: #fff; }
.gg-join { border: 1px solid #ffe8a3; background: #fffbeb; border-radius: 12px; margin: 0 0 20px; overflow: hidden; }
.gg-join summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 14px; }
.gg-join summary::-webkit-details-marker { display: none; }
.gg-join summary span { flex: 1; }
.gg-join summary em { font-style: normal; font-size: 11.5px; font-weight: 700; color: #8a5a00; background: #ffe8a3; padding: 2px 8px; border-radius: 999px; }
.gg-join summary::after { content: '▾'; color: #8a5a00; transition: transform .15s; }
.gg-join[open] summary::after { transform: rotate(180deg); }
.gg-join ol { margin: 0; padding: 4px 14px 14px 14px; list-style: none; counter-reset: j; display: grid; gap: 8px; }
.gg-join li { counter-increment: j; display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; flex-wrap: wrap; }
.gg-join li::before { content: counter(j); flex: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid #f5d77a;
  color: #8a5a00; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.gg-join li .alt { display: block; width: 100%; padding-left: 30px; font-size: 12px; color: var(--muted); }
.gg-join a { color: var(--accent); font-weight: 600; }

/* ---- 주차 카드 안: 신버전·구버전 묶음 · 녹음숙제 ---- */
.cat-title .now { background: var(--point); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; margin-left: 4px; vertical-align: 2px; }
.vgroup { border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px 6px; margin: 6px 0; }
.vg-t { font-size: 13px; font-weight: 700; padding: 6px 6px 2px; }
.vg-t small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.recrow { display: flex; flex-direction: column; gap: 6px; }
.rec-guide { align-self: flex-start; margin-left: 40px; white-space: nowrap; }
/* 녹음숙제 가이드 버튼: 카톡으로 제출하니까 카톡 노랑으로 눈에 띄게 */
.btn.rec-guide { background: #fee500; border-color: #f2d600; color: #3c1e1e; font-weight: 800; }
.btn.rec-guide:hover { background: #ffeb3b; }
.rg .rg-sec { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.rg .rg-sec:first-child { padding-top: 0; }
.rg .rg-sec:last-child { border-bottom: 0; }
.rg-t { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.rg-warn { color: #d9480f; font-size: 13px; }
.rg-b { font-size: 14px; line-height: 1.6; word-break: keep-all; }
.rg-b ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.rg-b b { color: var(--accent); }
.rg-links { display: grid; gap: 6px; margin-bottom: 6px; }
.rg-links a { display: block; background: #fff5f5; border: 1px solid #ffc9c9; color: #c92a2a; border-radius: 10px; padding: 9px 12px; font-weight: 700; text-decoration: none; font-size: 13.5px; }
.kakao-id { display: inline-flex; align-items: center; gap: 6px; background: #fee500; border: none; border-radius: 8px; padding: 5px 10px; font-size: 13px; color: #3c1e1e; cursor: pointer; }
.kakao-id b { font-size: 14px; color: #3c1e1e; }
.kakao-id span { font-size: 11.5px; opacity: .7; margin-left: 2px; }

/* ---- 관리자 (브릿지 관리자와 같은 구성) ---- */
.wrap.wide { max-width: 1180px; }
#v-admin { --accent: #3b5bdb; --accent-soft: #eaeeff; --faint: #9aa1ab; --line2: #eef0f3;
  --ok: #12805c; --ok-soft: #e3f5ee; --warn: #a8620a; --warn-soft: #fdf1df; --danger: #c0392b; --danger-soft: #fdeceb; }
.am-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.am-head h1 { font-size: 18px; margin: 0; }
.am-head h1 small { font-size: 12.5px; color: var(--faint); font-weight: 400; margin-left: 7px; }
.am-head select { width: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 14px; }
.am-spacer { flex: 1; }
.am-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.am-badge.ok { background: var(--ok-soft); color: var(--ok); }
.am-badge.warn { background: var(--warn-soft); color: var(--warn); }
.am-badge.danger { background: var(--danger-soft); color: var(--danger); }
.am-badge.idle { background: #eef0f3; color: var(--muted); }
.am-badge.accent { background: var(--accent-soft); color: var(--accent); }
.am-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 16px; }
.am-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.am-stat .k { font-size: 12.5px; color: var(--muted); }
.am-stat .v { font-size: 24px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.am-stat .v small { font-size: 13px; font-weight: 500; color: var(--faint); }
.am-stat.alert .v { color: var(--danger); }
.am-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.am-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.am-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.am-tab.off { opacity: .6; }
.am-tab small { font-size: 11.5px; }
.am-toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.am-toolbar input { flex: 1; min-width: 200px; font-size: 14px; padding: 9px 13px; }
.am-export { border-color: var(--accent); color: var(--accent); background: #fff; }
.am-tbl { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto; max-height: 62vh; }
.am-list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
.am-list th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; z-index: 1; }
.am-list th small { font-weight: 400; color: var(--faint); }
.am-list td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.am-list tbody tr { cursor: pointer; }
.am-list tbody tr:hover { background: #f7f9ff; }
.am-name { font-weight: 600; }
.am-name small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.am-name small.kk { color: #8a6d00; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.kk-copy { flex: none; white-space: nowrap; border: none; background: #fee500; color: #3c1e1e; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; cursor: pointer; }
.kk-copy.ok { background: var(--ok-soft); color: var(--ok); }
.mini-bar { width: 104px; height: 7px; border-radius: 999px; background: #eef0f3; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mini-bar.is-ok > i { background: var(--ok); }
.mini-bar.is-low > i { background: var(--danger); }
.num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.am-wks { display: flex; gap: 5px; }
.am-wk { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: #f1f3f5; color: var(--faint); }
.am-wk.ok { background: var(--ok-soft); color: var(--ok); }
.am-wk.part { background: var(--warn-soft); color: var(--warn); }
.am-wk.miss { background: var(--danger-soft); color: var(--danger); }
.am-lack { font-size: 12px; color: var(--danger); margin-top: 4px; }
.am-flags { display: flex; gap: 5px; flex-wrap: wrap; }
.am-empty { padding: 40px; text-align: center; color: var(--faint); background: #fff; }
.am-foot { font-size: 12.5px; color: var(--faint); margin: 12px 4px; line-height: 1.6; }
.am-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 40; }
.am-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 41; overflow-y: auto; box-shadow: -8px 0 30px rgba(16,24,40,.16); padding-bottom: 70px;
  --accent: #3b5bdb; --faint: #9aa1ab; --line2: #eef0f3; --ok: #12805c; --ok-soft: #e3f5ee; --warn: #a8620a; --warn-soft: #fdf1df; --danger: #c0392b; --danger-soft: #fdeceb; }
.am-d-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; position: sticky; top: 0; background: #fff; z-index: 1; }
.am-d-head > div { flex: 1; }
.am-d-head h3 { margin: 0; font-size: 18px; }
.am-d-head .sub { font-size: 13px; color: var(--muted); margin: 3px 0 8px; }
.am-x { border: none; background: #f0f1f4; border-radius: 8px; width: 30px; height: 30px; font-size: 17px; color: var(--muted); cursor: pointer; }
.am-d-sec { padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.am-d-sec h4 { margin: 0 0 10px; font-size: 14.5px; }
.am-d-sec h4 small { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 4px; }
.am-d-week { border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.am-d-wt { font-weight: 700; font-size: 14px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.am-d-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; align-items: center; flex-wrap: wrap; }
.am-d-row .k { color: var(--muted); }
.am-memo { width: 100%; font-size: 14px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-family: inherit; resize: vertical; }
@media (max-width: 700px) { .hide-sm { display: none; } .am-list { min-width: 0; } }

.am-list tbody tr.am-left { opacity: .55; }
.am-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.am-acts input { flex: 1 1 100%; font-size: 13.5px; padding: 8px 10px; }
.am-contacts { max-height: 180px; overflow-y: auto; }
/* 활용가이드 첫머리: 부담 갖지 말기 · 추천 학습 순서 */
.ug-relax { margin-top: 16px; background: #fff7e0; border: 1px solid #ffe08a; color: #7a5200; border-radius: 12px; padding: 12px 14px; font-size: 14.5px; font-weight: 600; line-height: 1.6; word-break: keep-all; }
.ug-relax b { color: #b45309; }
.ug-way { margin-top: 12px; background: var(--soft); border-radius: 12px; padding: 14px 16px; word-break: keep-all; }
.ug-way h4 { margin: 0 0 8px; font-size: 15px; }
.ug-way ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 14.5px; line-height: 1.55; }
.ug-way b { color: var(--brand-dark); }
.ug-sep { margin: 20px 0 0; padding-top: 14px; border-top: 2px solid var(--line); font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }

/* 수강페이지 학생코드 복사 버튼 (브릿지와 같은 모양) */
#h-code b { color: var(--ink); margin-left: 2px; }
.code-copy { margin-left: 6px; border: 1px solid var(--soft-line); background: #fff; color: var(--brand-dark); border-radius: 6px; padding: 1px 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; vertical-align: 1px; }
.code-copy.ok { border-color: transparent; background: var(--good-bg); color: var(--good); }

/* 수강 페이지 로그인 안내 창 (브릿지와 같은 모양) */
.m-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.m-head h3 { margin: 0; font-size: 18px; flex: 1; }
.mx { border: none; background: #f0f1f4; border-radius: 8px; width: 30px; height: 30px; font-size: 17px; color: var(--muted); line-height: 1; cursor: pointer; }
.sheet > .m-body { padding: 20px 22px; }
.guide-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.guide-list li { background: #f6f8fb; border-radius: 12px; padding: 12px 14px; }
.guide-list .k { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.guide-list .v { font-weight: 700; }
.guide-list .v.code { font-size: 18px; color: #3b5bdb; }
.guide-list .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.must-video { display: block; width: 100%; text-align: center; margin-top: 16px; padding: 11px; border-radius: 12px; background: #fff0f0; border: 1px solid #ffc9c9; color: #e03131; font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer; }
.mv-pill { display: block; width: max-content; margin: 0 auto 5px; background: #e03131; color: #fff; border-radius: 99px; padding: 1px 10px; font-size: 12px; }
.mv-t { white-space: nowrap; }
.cg-go { display: block; text-align: center; margin-top: 8px; padding: 13px; background: #3b5bdb; border-color: #3b5bdb; color: #fff; }

/* 진도 체크 안의 주차 펼침 */
.wkbox { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: #fff; }
.wkbox summary { list-style: none; cursor: pointer; padding: 11px 14px; display: grid; gap: 1px; position: relative; padding-right: 34px; }
.wkbox summary::-webkit-details-marker { display: none; }
.wkbox summary::after { content: '▸'; position: absolute; right: 14px; top: 14px; color: var(--muted); transition: transform .2s; }
.wkbox[open] summary::after { transform: rotate(90deg); }
.wk-t { font-weight: 700; font-size: 15px; }
.wk-t .now { background: var(--point); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; margin-left: 4px; vertical-align: 1px; }
.wk-s { font-size: 12.5px; color: var(--muted); }
.wk-body { padding: 0 10px 12px; border-top: 1px solid var(--line); }

/* 수업 복습 자료 안내 (필수는 아니지만 적극 권장) */
.rev-note { background: #fff8e6; border: 1px solid #ffe2a8; color: #5c4400; border-radius: 12px; padding: 11px 13px; margin: 12px 2px 4px; font-size: 13.5px; line-height: 1.55; }
.rev-note b { color: #3d2d00; }

/* 복습 퀴즈: 빈칸에 해당하는 한국어 부분 */
.kohl { color: #e03131; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* 홈: 권장 진도 안내 (진도 체크 바로 위, 강하게) */
.pace-note { background: #fff4d6; border: 2px solid #ffc94d; color: #4a3500; border-radius: 14px; padding: 12px 14px; margin: 12px 0 10px; font-size: 14.5px; line-height: 1.55; font-weight: 600; }
.pace-note b { color: #c2410c; font-weight: 800; }
.pace-note .pn-t { font-weight: 800; color: #c2410c; margin-bottom: 4px; }
.pace-note ol { margin: 0; padding-left: 20px; }
.pace-note li { margin: 3px 0; }
#cats + .ask-tip { margin-top: 12px; }

/* 활용가이드: 선생님 카톡 추가 (앞부분, 살짝) */
.ug-kakao { background: #fff9db; border: 1px solid #ffe066; border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.55; color: #5c4400; }
.ug-kakao .btn { display: block; width: max-content; margin-top: 8px; background: #fee500; border-color: #fee500; color: #3b1e1e; font-weight: 700; }

/* 명단 엑셀 올리기: 시트 · 구분 고르기 */
.imp { margin-top: 8px; padding: 10px 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.imp select { width: auto; display: inline-block; padding: 4px 8px; border-radius: 8px; font: inherit; margin-left: 4px; }
.imp-cats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.imp-cats > span { font-weight: 700; margin-right: 2px; }
.cat-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.cat-chip b { color: var(--muted); font-weight: 700; margin-left: 2px; }
.cat-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chip.on b { color: #dbe7ff; }

/* 맨 위 수강페이지 바로가기 */
.course-top { margin: 12px 0 4px; }
.course-top .btn.course { margin: 0; }
.course-top p { margin: 6px 0 0; }

/* 진도 체크 안 복습 퀴즈 (숙제) */
.quizrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 4px 6px; }
.am-sub2 { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 녹음숙제 가이드: 미리 제출 안내 */
.rg-early { margin: 8px 0 0; background: #fff4e5; border: 1px solid #ffd59a; color: #7a4100; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; line-height: 1.55; }


/* 문법 복습 예문: 형식 표시 (퀴즈와 같은 모양) */
.ex > .qform { display: inline-block; margin-bottom: 4px; }
