[hidden] { display: none !important; }
:root {
  --pink: #e8578f; --pink-d: #c93d74; --pink-l: #fde7ef; --teal: #1fa7a0;
  --ink: #2b2240; --muted: #7a6f8c; --bg: #fff7fa; --card: #fff; --line: #f1d9e3;
  --good: #1f9d63; --good-l: #e2f6ec; --ok: #d98a00; --ok-l: #fff2d6; --low: #d63b3b; --low-l: #fde4e4;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
main { max-width: 900px; margin: 0 auto; padding: 18px 16px 60px; }
h1 { font-size: 1.7rem; margin: 8px 0 14px; }
h2 { font-size: 1.25rem; margin: 22px 0 10px; }
h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--pink-d); }
h4 { margin: 18px 0 8px; font-size: .98rem; }
.small { font-size: .88rem; color: var(--muted); }
.demo { background: #fff3c4; color: #6b5200; text-align: center; padding: 6px 10px; font-size: .85rem; }

.topbar { background: linear-gradient(90deg, var(--pink), #f08bb2); color: #fff; padding: 12px 18px; }
.brand { display: flex; align-items: center; gap: 10px; max-width: 900px; margin: 0 auto; }
.brand b { font-size: 1.2rem; display: block; } .brand small { opacity: .9; }
.logo { font-size: 1.8rem; background: #fff; border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; box-shadow: 0 2px 8px rgba(232,87,143,.06); }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.btn { background: var(--pink); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--pink-d); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--pink-d); border: 1.5px solid var(--pink); }
.btn.ghost:hover { background: var(--pink-l); }
.btn.big { font-size: 1.1rem; padding: 14px 28px; }
.btn.stop { background: var(--low); }
.small-btn { padding: 7px 14px; font-size: .9rem; white-space: nowrap; }
.link { background: none; border: 0; color: var(--pink-d); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; }

.auth { max-width: 420px; margin: 30px auto; }
.tabs { display: flex; gap: 6px; margin: 14px 0; }
.tabs button { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { border-color: var(--pink); color: var(--pink-d); background: var(--pink-l); }
label { display: block; margin: 10px 0; font-weight: 600; font-size: .92rem; }
input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }
input:focus { outline: 2px solid var(--pink-l); border-color: var(--pink); }
form .btn { width: 100%; margin-top: 8px; }

.usage-top { display: flex; justify-content: space-between; font-weight: 600; }
.bar { height: 10px; background: var(--pink-l); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--pink)); width: 0; transition: width .2s; }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.topic { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; transition: .15s; }
.topic:hover { border-color: var(--pink); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(232,87,143,.15); }
.topic-icon { font-size: 1.8rem; } .topic-title { font-weight: 800; font-size: 1.02rem; }

.task { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.task-type { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--teal); font-weight: 800; }
.task-prompt { margin-top: 2px; }
.lt-q { margin: 6px 0 0; padding-left: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--pink-l); color: var(--pink-d); border-radius: 99px; padding: 4px 10px; font-size: .85rem; font-weight: 600; }
.chip.used { background: var(--good-l); color: var(--good); }
.chip.used::before { content: "✓ "; }

.rec-prompt { font-size: 1.15rem; font-weight: 700; margin: 6px 0; }
.drill-text { font-size: 1.35rem; color: var(--pink-d); margin-top: 4px; }
.c2 { font-weight: 600; color: var(--teal); }
.rec-box { text-align: center; }
.timer-row { font-size: 2rem; font-weight: 800; display: flex; justify-content: center; align-items: center; gap: 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #ccc; }
.recording .dot { background: var(--low); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.rec-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.live { color: var(--muted); font-style: italic; min-height: 1.2em; }

.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.score { border-radius: 14px; padding: 12px; text-align: center; background: #f4f4f6; }
.score-num { font-size: 1.9rem; font-weight: 800; }
.score-label { font-size: .85rem; font-weight: 700; }
.score.good { background: var(--good-l); color: var(--good); }
.score.ok { background: var(--ok-l); color: var(--ok); }
.score.low { background: var(--low-l); color: var(--low); }

.words { line-height: 2.1; font-size: 1.08rem; }
.w { padding: 2px 4px; border-radius: 6px; cursor: help; }
.w.good { background: var(--good-l); } .w.ok { background: var(--ok-l); } .w.low { background: var(--low-l); color: var(--low); font-weight: 700; }
.w.omit { text-decoration: line-through; color: #999; background: #eee; } .w.ins { background: #ece4ff; }
.brk { color: var(--ok); font-size: .9rem; }
.legend { font-weight: 400; font-size: .8rem; margin-left: 8px; }
.legend i { font-style: normal; padding: 1px 7px; border-radius: 6px; margin-right: 4px; }
.legend .good { background: var(--good-l); } .legend .ok { background: var(--ok-l); } .legend .low { background: var(--low-l); } .legend .omit { background: #eee; text-decoration: line-through; }
.weak li { margin: 4px 0; }
code { background: var(--pink-l); padding: 1px 5px; border-radius: 5px; }
.pill { display: inline-block; min-width: 34px; text-align: center; border-radius: 99px; padding: 1px 8px; font-weight: 800; font-size: .85rem; background: #eee; }
.pill.good { background: var(--good-l); color: var(--good); } .pill.ok { background: var(--ok-l); color: var(--ok); } .pill.low { background: var(--low-l); color: var(--low); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stats div { background: #f7f3fb; border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 1.4rem; } .stats span { font-size: .8rem; color: var(--muted); }
.tips li { margin: 5px 0; }
.note { background: #eef8f7; border-radius: 12px; padding: 12px; }
.comment { background: #eef8f7; border-left: 4px solid var(--teal); padding: 10px 12px; border-radius: 8px; margin: 8px 0; }
.transcript { background: #faf7fc; padding: 10px; border-radius: 10px; }
audio { width: 100%; margin-top: 6px; }

.hist { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.hist summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hist-date { color: var(--muted); font-size: .85rem; } .hist-title { font-weight: 700; flex: 1; }
.hist-prompt { font-style: italic; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(100px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; transition: .25s; max-width: 90%; z-index: 9; opacity: 0; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; } .toast.bad { background: var(--low); }

/* teacher */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--pink-l); }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: #fff2f7; }
textarea { width: 100%; min-height: 80px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
select { padding: 8px; border-radius: 10px; border: 1.5px solid var(--line); font: inherit; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

@media (max-width: 560px) {
  .task { flex-direction: column; align-items: stretch; }
  h1 { font-size: 1.4rem; }
}
.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.pic { margin: 0; border: 1.5px dashed #e8a2bf; border-radius: 12px; background: #fff7fa; overflow: hidden; min-height: 90px; display: flex; flex-direction: column; justify-content: center; }
.pic img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fff; display: block; }
.pic figcaption { padding: 6px 8px; font-size: .85rem; font-weight: 600; color: var(--muted); text-align: center; }
.pic figcaption b { color: var(--pink); font-size: 1.05rem; margin-right: 4px; }
@media (max-width: 560px) { .pics { grid-template-columns: 1fr 1fr 1fr; gap: 5px; } .pic figcaption { font-size: .72rem; } }
.pics.mini { grid-template-columns: repeat(3, 90px); }
.pics.mini .pic { min-height: 0; }
.pic figcaption b { margin: 0; }
.set-title { font-weight: 800; color: var(--teal); margin: 12px 0 2px; }
.thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 4px; }
.topic .topic-icon { font-size: 1.3rem; }
.mindmap { display: grid; grid-template-columns: 1fr 1.2fr 1fr; grid-template-areas: "a . b" "c q d" ". e ."; gap: 8px; margin: 10px 0; align-items: center; }
.mm-p { background: #fff; border: 1.5px solid var(--pink); border-radius: 12px; padding: 8px; text-align: center; font-weight: 600; font-size: .92rem; }
.mm-0 { grid-area: a; } .mm-1 { grid-area: b; } .mm-2 { grid-area: c; } .mm-3 { grid-area: d; } .mm-4 { grid-area: e; }
.mm-q { grid-area: q; background: var(--pink); color: #fff; border-radius: 50%; aspect-ratio: 1.4; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; font-weight: 700; font-size: .92rem; }
@media (max-width: 560px) { .mindmap { grid-template-columns: 1fr 1fr; grid-template-areas: "q q" "a b" "c d" "e e"; } .mm-q { aspect-ratio: auto; border-radius: 14px; } .pics.mini { grid-template-columns: repeat(3, 1fr); } }
