/* =====================================================================
   No pique do TOPIK — paleta tirada da arte da mascote:
   creme de fundo, nuvens lilás e rosa, contorno roxo, título pêssego,
   estrelinhas amarelas.
   ===================================================================== */
:root {
  color-scheme: only light;
  --bg: #fffdf0;          /* creme */
  --card: #ffffff;
  --ink: #3a2e6e;         /* roxo dos contornos */
  --muted: #8a82ad;
  --line: #ebe6fb;

  --lav: #c3c8fb;         /* nuvem lilás */
  --lav-deep: #7c80e8;    /* cor principal (botões) */
  --lav-dark: #6267d4;
  --lav-soft: #eff0ff;

  --pink: #ffc6d9;        /* nuvem rosa */
  --pink-deep: #ec7aa3;
  --pink-soft: #fff0f5;

  --peach: #ffc8ae;       /* letras do título */
  --peach-soft: #fff1ea;

  --star: #ffd84d;        /* estrelinhas */
  --star-deep: #d9a514;
  --star-soft: #fff8d8;

  --ok: #3fb58f;          /* acerto */
  --ok-soft: #dff7ee;
  --bad: #ef6a8b;         /* erro */
  --bad-soft: #ffe7ee;

  --radius: 22px;
  --shadow: 0 2px 0 rgba(58, 46, 110, .06), 0 10px 28px rgba(124, 128, 232, .12);
  --pop: 0 3px 0 var(--ink);
  --title: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --ko: 'Jua', 'Gowun Dodum', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(195, 200, 251, .35) 1.5px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 198, 217, .35) 1.5px, transparent 1.6px);
  background-size: 34px 34px, 34px 34px;
  background-position: 0 0, 17px 17px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--lav-dark); font-weight: 700; }
h1, h2, h3 { font-family: var(--title); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: .3em 0 .7em; }
code { background: var(--lav-soft); padding: 1px 7px; border-radius: 7px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.cell-end { text-align: right; white-space: nowrap; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.loading { padding: 40px; text-align: center; color: var(--muted); font-weight: 600; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--title); font-weight: 600; font-size: 1.2rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: var(--lav); border: 2px solid var(--ink);
}
.brand b { color: var(--pink-deep); font-weight: 700; }
.topbar nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  color: var(--ink); text-decoration: none; padding: 7px 14px; border-radius: 99px; font-weight: 700;
  border: 2px solid transparent;
}
.topbar nav a:hover { background: var(--lav-soft); }
.topbar nav a.active { background: var(--lav); border-color: var(--ink); }
.badge { background: var(--pink-deep); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; margin-left: 6px; }
.who { display: flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 600; }
main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }

/* ---------- Cartões ---------- */
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.error-card { border-color: var(--bad); }
.grid { display: grid; gap: 16px; }
.grid.lessons { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.acts { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid .card { margin: 0; }
.section-title { margin: 30px 0 14px; }
.page-head input { width: auto; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col .card { margin: 0; }

/* ---------- Botões ---------- */
.btn {
  font: inherit; font-weight: 800; cursor: pointer; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); padding: 9px 18px; border-radius: 99px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  transition: transform .08s, background .15s, box-shadow .08s;
}
.btn:hover:not(:disabled) { background: var(--lav-soft); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--lav-deep); border-color: var(--ink); color: #fff; box-shadow: var(--pop); }
.btn.primary:hover:not(:disabled) { background: var(--lav-dark); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: .85rem; }
.btn.big { padding: 13px 30px; font-size: 1.1rem; }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); }
.btn.add { border-style: dashed; border-color: var(--lav); color: var(--lav-dark); }
.btn.add:hover { background: var(--lav-soft); border-color: var(--lav-deep); }
.btn.speak { background: var(--pink); border-color: var(--ink); color: var(--ink); box-shadow: var(--pop); font-size: 1.05rem; }
.btn.speak:hover:not(:disabled) { background: #ffb3cd; }

/* ---------- Formulários ---------- */
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 12px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 11px 14px; margin-top: 5px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #b8b2d3; }
input:focus, textarea:focus { outline: none; border-color: var(--lav-deep); box-shadow: 0 0 0 4px var(--lav-soft); }
input[type=radio], input[type=checkbox] { width: auto; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.hint { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 10px; }
.unlock-row { display: flex; gap: 8px; align-items: center; }
.unlock-row input { margin: 0; flex: 1; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; margin: 0; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #dcd7ef; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }

/* ---------- Avisos ---------- */
.notice { background: var(--star-soft); border: 2px solid #ffeaa0; padding: 11px 16px; border-radius: 16px; margin-bottom: 16px; font-size: .93rem; }
.notice.ok { background: var(--ok-soft); border-color: #bfe9d9; }
.notice.warn { background: var(--bad-soft); border-color: #ffc9d6; }
.pill { display: inline-block; font-size: .8rem; font-weight: 800; padding: 3px 11px; border-radius: 99px; background: var(--lav-soft); color: var(--lav-dark); }
.pill.ok { background: var(--ok-soft); color: #23876a; }
.pill.warn { background: var(--star-soft); color: #9a7406; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); }
.toast { background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px; font-weight: 700; box-shadow: var(--shadow); animation: up .25s; transition: opacity .4s; }
.toast.ok { background: var(--ok); } .toast.error { background: var(--bad); } .toast.warn { background: #b88a0c; }
.toast.out { opacity: 0; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: auto auto; place-content: center; align-items: center;
  gap: 40px; padding: 140px 24px 140px; position: relative; overflow: hidden;
}
/* nuvens em cima e embaixo, como na arte */
.auth-wrap::before, .auth-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; height: 120px; pointer-events: none;
  background:
    radial-gradient(ellipse 130px 95px at 50% -10px, var(--lav) 98%, var(--ink) 99%, var(--ink) 101.5%, transparent 102.5%) 0 0 / 260px 100px repeat-x,
    radial-gradient(ellipse 135px 115px at 50% -10px, var(--pink) 98%, var(--ink) 99%, var(--ink) 101.5%, transparent 102.5%) 130px 0 / 260px 120px repeat-x;
}
.auth-wrap::before { top: 0; }
.auth-wrap::after { bottom: 0; transform: rotate(180deg); }
.auth-hero { text-align: center; position: relative; }
.auth-hero img { width: 230px; height: auto; display: block; margin: 0 auto -8px; filter: drop-shadow(0 10px 16px rgba(124,128,232,.25)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.logo-title {
  font-family: var(--title); font-weight: 700; color: var(--pink); line-height: 1;
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; margin: 14px 0 6px;
}
.logo-title span { display: block; font-size: 2.3rem; }
.logo-title strong { display: block; font-size: 3.6rem; letter-spacing: .05em; color: var(--pink); -webkit-text-stroke: 5px var(--ink); }
.auth-hero p { color: var(--muted); font-weight: 700; margin: 8px 0 0; }
.star { position: absolute; color: var(--star); -webkit-text-stroke: 1.5px var(--ink); font-size: 1.6rem; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.8) rotate(15deg); opacity: .7; } }
.auth-card { width: min(400px, 92vw); position: relative; border-color: var(--ink); box-shadow: 0 6px 0 var(--ink), var(--shadow); }
.tabs { display: flex; background: var(--lav-soft); border-radius: 99px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; font: inherit; font-weight: 800; border: 0; background: transparent; padding: 9px; border-radius: 99px; cursor: pointer; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(124,128,232,.25); }

/* ---------- Início do aluno ---------- */
.hello {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; margin-bottom: 20px;
  background: linear-gradient(120deg, var(--lav-soft), var(--pink-soft)); border: 2px solid var(--line);
  border-radius: 28px; padding: 22px 26px; position: relative; overflow: hidden;
}
.hello-text { display: flex; align-items: center; gap: 16px; }
.hello-text img { width: 92px; height: auto; flex-shrink: 0; filter: drop-shadow(0 6px 10px rgba(124,128,232,.25)); }
.hello h1 { margin-bottom: 4px; }
.stat-row { display: flex; gap: 10px; }
.stat { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 16px; text-align: center; min-width: 100px; }
.stat b { display: block; font-family: var(--title); font-size: 1.6rem; color: var(--lav-deep); }
.stat:nth-child(2) b { color: var(--pink-deep); }
.stat:nth-child(3) b { color: var(--ok); }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.unlock-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border: 2px dashed var(--star-deep); background: var(--star-soft); }
.unlock-card .unlock-row { min-width: 280px; flex: 1; max-width: 400px; }
.unlock-card input { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; font-size: 1.15rem; text-align: center; }
.lesson { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, box-shadow .15s; font-weight: 400; position: relative; }
.lesson.open { border-color: var(--lav); }
.lesson.open:nth-child(3n+2) { border-color: var(--pink); }
.lesson.open:nth-child(3n+3) { border-color: var(--peach); }
.lesson.open:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: 0 5px 0 var(--ink), var(--shadow); border-color: var(--ink); }
.lesson.locked { opacity: .55; background: rgba(255,255,255,.5); box-shadow: none; border-style: dashed; }
.lesson .pill { align-self: flex-start; margin-top: auto; }
.lesson-num { font-family: var(--title); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--pink-deep); }
.act { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; flex-wrap: wrap; font-weight: 400; transition: transform .15s, box-shadow .15s; }
.act:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink), var(--shadow); }
.act > div { flex: 1; min-width: 140px; }
.act h3 { margin: 0; }
.act-icon { font-size: 1.6rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--lav-soft); border-radius: 18px; flex-shrink: 0; }
.grid.acts .act:nth-child(4n+2) .act-icon { background: var(--pink-soft); }
.grid.acts .act:nth-child(4n+3) .act-icon { background: var(--star-soft); }
.grid.acts .act:nth-child(4n+4) .act-icon { background: var(--peach-soft); }
.act-icon.big { width: 64px; height: 64px; font-size: 2rem; }
.act-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.act-head h1 { margin: 0; }
.instructions { background: var(--star-soft); border-color: #ffeaa0; }

/* ---------- Questões ---------- */
.scorebar { position: sticky; top: 70px; z-index: 5; display: flex; gap: 22px; flex-wrap: wrap; background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px; margin-bottom: 16px; font-weight: 700; }
.scorebar b { color: var(--star); }
.question { transition: border-color .2s; }
.question.is-right { border-color: var(--ok); }
.question.is-wrong { border-color: var(--bad); }
.q-top { display: flex; gap: 12px; align-items: flex-start; }
.q-num { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; background: var(--lav); color: var(--ink); border: 2px solid var(--ink); border-radius: 50%; font-family: var(--title); font-weight: 600; font-size: .95rem; }
.q-prompt { font-size: 1.12rem; font-weight: 700; margin: 3px 0 12px; }
.speak-row { display: flex; gap: 8px; align-items: center; margin: 0 0 14px 44px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-left: 44px; }
.opt {
  font-family: var(--ko); font-size: 1.8rem; padding: 16px 10px; border-radius: 20px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink); transition: .15s;
  box-shadow: 0 3px 0 var(--line);
}
.opt:hover:not(:disabled) { border-color: var(--lav-deep); box-shadow: 0 3px 0 var(--lav-deep); transform: translateY(-1px); }
.opt.chosen { border-color: var(--lav-deep); background: var(--lav-soft); box-shadow: 0 3px 0 var(--lav-deep), 0 0 0 4px var(--lav-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 3px 0 var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 var(--bad); text-decoration: line-through; }
.opt.was-right { border-color: var(--ok); border-style: dashed; }
.opt:disabled { cursor: default; }
.q-foot { margin: 14px 0 0 44px; min-height: 40px; display: flex; align-items: center; }
.result { font-weight: 800; }

/* ---------- Memória ---------- */
.memory { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; max-width: 760px; margin: 0 auto 20px; }
.mcard { aspect-ratio: 3/4; perspective: 800px; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; }
.mcard-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.mcard.flipped .mcard-inner { transform: rotateY(180deg); }
.mcard-back, .mcard-front { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.mcard-back {
  background: var(--lav); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.55) 0 6px, transparent 7px),
    radial-gradient(circle at 30% 85%, rgba(255,255,255,.4) 0 10px, transparent 11px);
}
.mcard-back img { width: 62%; height: auto; }
.mcard:nth-child(odd) .mcard-back { background-color: var(--pink); }
.mcard:hover:not(.flipped) .mcard-back { filter: brightness(1.04); transform: translateY(-2px); }
.mcard-front { background: #fff; border: 2px solid var(--line); transform: rotateY(180deg); padding: 6px; }
.mcard-front .hangul { font-family: var(--ko); font-size: clamp(1.4rem, 5vw, 2.5rem); }
.mcard-front .emoji { font-size: clamp(2rem, 7vw, 3.4rem); }
.mcard-front img { width: 100%; height: 100%; object-fit: contain; }
.mcard.matched .mcard-front { border-color: var(--ok); background: var(--ok-soft); }
.mcard.nope .mcard-front { border-color: var(--bad); background: var(--bad-soft); }
.done { max-width: 520px; margin: 0 auto; }
.done img { width: 120px; height: auto; }

/* ---------- PDF ---------- */
.file-drop { display: block; border: 2px dashed var(--lav); border-radius: 20px; padding: 26px; text-align: center; cursor: pointer; margin: 10px 0 14px; font-weight: 800; background: var(--lav-soft); color: var(--lav-dark); }
.file-drop:hover { border-color: var(--lav-deep); }
.file-drop input { display: none; }
.pdf-page { position: relative; margin: 0 auto 16px; max-width: 100%; box-shadow: var(--shadow); background: #fff; border-radius: 6px; }
.pdf-page canvas { width: 100%; height: 100%; display: block; border-radius: 6px; }
.pdf-overlay { position: absolute; inset: 0; }
.pdf-overlay.editable { cursor: crosshair; }
.page-num { position: absolute; bottom: -20px; right: 0; font-size: .75rem; color: var(--muted); }
.anno { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; pointer-events: auto; }
.pdf-overlay.editable .anno { cursor: pointer; }
.anno-sym { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(58,46,110,.3); flex-shrink: 0; }
.anno.certo .anno-sym { background: var(--ok); }
.anno.errado .anno-sym { background: var(--bad); }
.anno.nota .anno-sym { background: var(--star-deep); font-size: .9rem; }
.anno-text { width: max-content; background: var(--star-soft); border: 1.5px solid #f5d76e; color: #6b5200; padding: 3px 9px; border-radius: 10px; font-size: .85rem; font-weight: 700; max-width: 220px; box-shadow: 0 2px 6px rgba(58,46,110,.15); }
.anno.errado .anno-text { background: var(--bad-soft); border-color: #ffb8c9; color: #a02c4b; }
.anno.certo .anno-text { background: var(--ok-soft); border-color: #a9e2cc; color: #1d6e55; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: 70px; z-index: 5; }
.tool { font: inherit; font-weight: 800; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.tool.certo { color: var(--ok); } .tool.errado { color: var(--bad); } .tool.nota { color: var(--star-deep); } .tool.apagar { color: var(--muted); }
.tool.active { border-color: currentColor; box-shadow: 0 3px 0 currentColor; }
.grading { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.grade-form { position: sticky; top: 150px; }
.grade-card { display: flex; gap: 20px; align-items: center; }
.grade { background: var(--lav-deep); color: #fff; border: 2px solid var(--ink); box-shadow: var(--pop); border-radius: 20px; padding: 14px 22px; text-align: center; flex-shrink: 0; }
.grade b { display: block; font-family: var(--title); font-size: 2.4rem; line-height: 1; }
.grade span { font-size: .8rem; font-weight: 700; }
.feedback { background: var(--pink-soft); padding: 10px 14px; border-radius: 14px; }
.legend { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; font-size: .9rem; color: var(--muted); font-weight: 700; }
.anno-mini { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem; }
.anno-mini.certo { background: var(--ok); } .anno-mini.errado { background: var(--bad); } .anno-mini.nota { background: var(--star-deep); }

/* ---------- Tabelas ---------- */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; padding: 13px 16px; border-bottom: 2px solid var(--line); background: var(--lav-soft); }
.table td { padding: 12px 16px; border-bottom: 2px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbff; }
.table tr.me td { background: var(--star-soft); font-weight: 800; }
.table tr.inactive td { opacity: .5; }
.code { font-weight: 800; letter-spacing: .12em; background: var(--star-soft); color: #8a6600; }

/* ---------- Editor ---------- */
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.act-row { display: flex; gap: 10px; align-items: center; }
.q-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.opt-edit { display: flex; flex-direction: column; gap: 8px; }
.opt-line { display: flex; gap: 10px; align-items: center; }
.opt-line input[data-opt] { margin: 0; font-family: var(--ko); font-size: 1.15rem; }
.opt-line input[type=radio] { width: 22px; height: 22px; accent-color: var(--ok); }
.opt-edit > .btn { align-self: flex-start; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pairs .card { margin: 0; }
.pair-preview { height: 84px; display: grid; place-items: center; background: var(--lav-soft); border-radius: 16px; margin-bottom: 10px; font-size: 2.6rem; }
.pair-preview { overflow: hidden; }
.pair-preview img { width: 100%; height: 100%; object-fit: contain; }
.pair input[data-f=word] { font-family: var(--ko); font-size: 1.15rem; }
.upload { margin: 0; }
.savebar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Código em tela cheia ---------- */
.bigcode {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; text-align: center; cursor: pointer;
  background: var(--bg); color: var(--ink);
}
.bigcode::before, .bigcode::after {
  content: ''; position: absolute; left: 0; right: 0; height: 120px;
  background:
    radial-gradient(ellipse 130px 95px at 50% -10px, var(--lav) 98%, var(--ink) 99%, var(--ink) 101.5%, transparent 102.5%) 0 0 / 260px 100px repeat-x,
    radial-gradient(ellipse 135px 115px at 50% -10px, var(--pink) 98%, var(--ink) 99%, var(--ink) 101.5%, transparent 102.5%) 130px 0 / 260px 120px repeat-x;
}
.bigcode::before { top: 0; } .bigcode::after { bottom: 0; transform: rotate(180deg); }
.bigcode p { font-family: var(--title); font-size: 1.6rem; font-weight: 600; }
.bigcode b {
  display: block; font-family: var(--title); font-size: clamp(4rem, 18vw, 12rem); letter-spacing: .12em; line-height: 1.1;
  color: var(--peach); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.bigcode small { color: var(--muted); font-weight: 700; }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 10px; padding: 100px 16px; }
  .auth-wrap::before, .auth-wrap::after {
    height: 70px;
    background:
      radial-gradient(ellipse 70px 52px at 50% -6px, var(--lav) 97%, var(--ink) 98%, var(--ink) 101.5%, transparent 103%) 0 0 / 140px 60px repeat-x,
      radial-gradient(ellipse 72px 64px at 50% -6px, var(--pink) 97%, var(--ink) 98%, var(--ink) 101.5%, transparent 103%) 70px 0 / 140px 70px repeat-x;
  }
  .auth-hero img { width: 150px; }
  .logo-title span { font-size: 1.7rem; } .logo-title strong { font-size: 2.6rem; }
  .auth-card { justify-self: center; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand-name { display: none; }
  .topbar nav { order: 3; flex: 1 1 100%; }
  .who { margin-left: auto; }
  .who span { display: none; }
  main { padding: 18px 14px 80px; }
  h1 { font-size: 1.45rem; }
  .hello { padding: 18px; }
  .hello-text img { width: 64px; }
  .two-col, .grading { grid-template-columns: 1fr; }
  .grade-form { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .options, .speak-row, .q-foot { margin-left: 0; }
  .memory { gap: 8px; }
  .memory.wide { --cols: 4 !important; }
  .scorebar, .toolbar { top: 112px; }
  .scorebar { border-radius: 20px; gap: 6px 18px; }
  .stat-row { width: 100%; }
  .stat { flex: 1; min-width: 0; }
}

/* ---------- Vocabulário / Material de apoio ---------- */
.page-head input[type=search] { min-width: 240px; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.vcard {
  position: relative; background: #fff; border: 2px solid var(--line); border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.vcard:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink), var(--shadow); }
.vcard-img { position: relative; aspect-ratio: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; background: #fff; border-bottom: 2px solid var(--line); }
.vcard-img img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; display: block; }
.vcard-img .emoji { font-size: 4.2rem; }
.vcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.vcard-word { font-family: var(--ko); font-size: 1.7rem; line-height: 1.2; overflow-wrap: anywhere; }
.vcard-meaning { color: var(--muted); font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-speak {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--pink); box-shadow: 0 2px 0 var(--ink); cursor: pointer; font-size: 1.1rem;
}
.vcard-speak:active { transform: translateY(2px); box-shadow: none; }
.vcard-actions { display: flex; justify-content: center; gap: 4px; padding: 0 10px 12px; }
.vocab-form { display: flex; gap: 20px; align-items: flex-start; }
.vocab-preview { width: 130px; height: 130px; flex-shrink: 0; border-radius: 22px; background: var(--lav-soft); border: 2px dashed var(--lav); display: grid; place-items: center; font-size: 3.6rem; overflow: hidden; }
.vocab-preview { background: #fff; }
.vocab-preview img { width: 100%; height: 100%; object-fit: contain; }
.vocab-fields { flex: 1; min-width: 0; }
.vocab-fields input[name=word] { font-family: var(--ko); font-size: 1.2rem; }
.upload-btn { align-self: end; margin-bottom: 12px; height: 46px; }
.empty img { width: 110px; height: auto; }
@media (max-width: 720px) {
  .vocab-form { flex-direction: column; align-items: center; }
  .vocab-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vcard-word { font-size: 1.4rem; }
  .page-head input[type=search] { min-width: 0; width: 100%; }
}

/* ---------- Dúvidas ---------- */
.ask-card { display: flex; gap: 14px; align-items: flex-start; border-color: var(--lav); }
.ask-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); background: var(--lav); flex-shrink: 0; }
.ask-card textarea, .reply-form textarea { margin: 0; resize: vertical; }
.ask-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.attach-btn { margin: 0; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--lav-soft); color: var(--ink); border-radius: 99px; padding: 4px 10px; font-size: .85rem; font-weight: 700; text-decoration: none; max-width: 100%; }
.attach-chip.link:hover { background: var(--lav); }
.attach-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 800; padding: 0 2px; }
.q-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
.q-filter .pill { text-decoration: none; padding: 6px 14px; font-size: .88rem; border: 2px solid transparent; }
.q-filter .pill.on { background: var(--lav); color: var(--ink); border-color: var(--ink); }
.q-filter input { width: auto; flex: 1; min-width: 180px; margin: 0; }
.qcard.open { border-left: 6px solid var(--star); }
.qcard.answered { border-left: 6px solid var(--ok); }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-head .btn { margin-left: auto; }
.q-author { font-family: var(--title); font-weight: 600; font-size: 1.05rem; }
.q-body { margin: 8px 0 4px; white-space: normal; overflow-wrap: anywhere; }
.q-atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.q-thumb { display: block; width: 120px; height: 90px; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: var(--lav-soft); }
.q-thumb:hover { border-color: var(--ink); }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.reply { display: flex; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: #faf9ff; border: 2px solid var(--line); }
.reply.from-prof { background: var(--lav-soft); border-color: var(--lav); }
.reply-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); background: var(--lav); flex-shrink: 0; display: grid; place-items: center; }
.reply-avatar.alt { background: var(--pink-soft); border-color: var(--pink); font-size: 1rem; }
.reply-form { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); }
@media (max-width: 720px) {
  .ask-avatar { display: none; }
  .q-thumb { width: 96px; height: 72px; }
}

/* ---------- Aulas agrupadas por número ---------- */
.aula-group { margin-bottom: 26px; }
.aula-group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.aula-group-head .add-content { margin-left: auto; }
.aula-badge {
  font-family: var(--title); font-weight: 600; font-size: 1.15rem; color: var(--ink);
  background: var(--pink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  padding: 4px 16px; border-radius: 99px;
}
.aula-group.alt .aula-badge { background: var(--lav); }
.aula-group .table-card { margin-bottom: 0; }

/* ---------- Lições passadas ---------- */
.pill.treino { background: var(--star-soft); color: #8a6600; }
.treino-note { margin-top: 8px; }
.passadas-link { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; text-decoration: none; color: var(--ink); font-weight: 400; margin-top: 8px; border-style: dashed; border-color: var(--lav); }
.passadas-link b { font-family: var(--title); font-weight: 600; font-size: 1.1rem; }
.passadas-link .arrow { margin-left: auto; font-size: 1.3rem; color: var(--lav-dark); }
.passadas-link:hover { border-color: var(--ink); border-style: solid; }

/* ---------- Aprovação de contas ---------- */
.pending-card { border: 2px dashed var(--star-deep); background: var(--star-soft); }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; }

.sound-toggle { font-size: 1rem; padding: 4px 10px; }

/* ---------- Progresso nas aulas do aluno ---------- */
.lesson-progress { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.lp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lp-label { font-weight: 800; font-size: .9rem; }
.lp-pct { font-family: var(--title); font-weight: 600; color: var(--lav-dark); }
.lp-bar { height: 10px; border-radius: 99px; background: var(--lav-soft); overflow: hidden; border: 1.5px solid var(--line); }
.lp-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lav-deep), var(--pink-deep)); transition: width .4s; }
.lp-date { font-size: .78rem; color: var(--muted); }
.lesson.complete { border-color: var(--ok) !important; }
.lesson.complete .lp-bar span { background: var(--ok); }
.lesson.complete .lp-label, .lesson.complete .lp-pct { color: #23876a; }
