:root {
  --blue: #1d4ed8; --blue-d: #1e3a8a; --blue-l: #dbeafe;
  --orange: #f97316; --green: #16a34a; --green-l: #dcfce7; --red: #dc2626; --red-l: #fee2e2;
  --yellow-l: #fef9c3; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.5; }
a { color: var(--blue); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--blue-d); color: #fff; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 20px; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--orange); font-weight: 900; font-size: 22px; }
#who { display: flex; gap: 10px; align-items: center; font-size: 15px; }
#who button { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); }
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
h1 { font-size: 28px; margin: 0 0 6px; } h2 { font-size: 21px; margin: 0 0 12px; } h3 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
button, .btn { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer; background: var(--blue); color: #fff; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.08); }
button.secondary, .btn.secondary { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 600; padding: 6px 12px; }
button.danger { background: #fff; color: var(--red); border: 1px solid #fca5a5; font-weight: 600; padding: 6px 12px; }
button.big, .btn.big { font-size: 20px; padding: 14px 28px; }
button:disabled { opacity: .5; cursor: default; }
label { display: block; font-weight: 700; margin: 10px 0 4px; font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input:not([type]) {
  font: inherit; width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
input:focus { outline: none; border-color: var(--blue); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-weight: 600; }
.msg.err { background: var(--red-l); color: #991b1b; } .msg.ok { background: var(--green-l); color: #166534; } .msg.warn { background: var(--yellow-l); color: #854d0e; }
.hero { text-align: center; padding: 30px 10px; }
.hero h1 { font-size: 36px; }
.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 640px; margin: 24px auto; }
.pick a { display: block; text-decoration: none; color: inherit; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 28px 20px; text-align: center; transition: .15s; }
.pick a:hover { border-color: var(--blue); transform: translateY(-2px); }
.pick .ico { font-size: 40px; font-weight: 900; color: var(--blue); }
.narrow { max-width: 440px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { background: #e2e8f0; color: var(--ink); }
.tabs button.on { background: var(--blue); color: #fff; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 3px; background: var(--blue-l); color: var(--blue-d); padding: 2px 10px; border-radius: 8px; }
.code.huge { font-size: 40px; padding: 6px 18px; display: inline-block; }

/* progress */
.bar { height: 12px; background: #e2e8f0; border-radius: 99px; overflow: hidden; min-width: 120px; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.skillrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.skillrow:first-of-type { border-top: 0; }
.skillrow .nm { flex: 2; min-width: 200px; }
.std { font-size: 12px; font-weight: 800; color: var(--blue); background: var(--blue-l); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.done { color: var(--green); font-weight: 800; }

/* practice */
.practice { max-width: 760px; margin: 0 auto; }
.ptop { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.count { font-weight: 800; font-size: 18px; white-space: nowrap; }
.prompt { font-size: 21px; line-height: 1.7; margin-bottom: 16px; }
.eq { font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; font-size: 1.1em; white-space: nowrap; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .85em; line-height: 1.1; margin: 0 2px; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.frac > span:last-child { padding: 0 3px; }
.mixed { white-space: nowrap; }
table.data { border-collapse: collapse; margin: 6px 0 16px; font-size: 19px; }
table.data th, table.data td { border: 2px solid #94a3b8; padding: 8px 18px; text-align: center; }
table.data th { background: var(--blue-l); font-size: 16px; }
.graphwrap { margin: 4px 0 16px; }
.graphwrap svg { width: 100%; max-width: 440px; height: auto; background: #fff; }
.answer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.answer input { max-width: 300px; font-size: 22px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.choices { display: grid; gap: 10px; margin-bottom: 12px; }
.choice { text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 600; padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.choice .let { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; background: #e2e8f0; font-weight: 800; }
.choice.sel { border-color: var(--blue); background: var(--blue-l); }
.choice.right { border-color: var(--green); background: var(--green-l); }
.choice.wrong { border-color: var(--red); background: var(--red-l); }
.result { border-radius: 14px; padding: 16px 18px; margin-top: 16px; }
.result.good { background: var(--green-l); border: 2px solid #86efac; }
.result.bad { background: #fff7ed; border: 2px solid #fdba74; }
.result h3 { font-size: 22px; margin-bottom: 6px; }
.steps { margin: 12px 0 4px; padding: 0; list-style: none; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; line-height: 1.8; }
.finished { text-align: center; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, #fde68a, #fdba74); font-weight: 800; font-size: 20px; margin-bottom: 12px; }

/* teacher tables */
table.grid { border-collapse: collapse; width: 100%; font-size: 15px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.grid th { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
table.grid tr.click:hover td { background: #f8fafc; cursor: pointer; }
.cell { display: inline-block; min-width: 64px; text-align: center; border-radius: 8px; padding: 3px 8px; font-weight: 800; }
.cell.full { background: var(--green-l); color: #166534; } .cell.part { background: var(--yellow-l); color: #854d0e; } .cell.none { background: #f1f5f9; color: #94a3b8; }
.label-in { width: 140px !important; padding: 4px 8px !important; font-size: 14px !important; }
.skillpick { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.skillpick input[type=number] { width: 80px; }
.attempt { border-left: 5px solid var(--line); }
.attempt.correct { border-left-color: var(--green); } .attempt.wrong { border-left-color: var(--red); }
.scroll { overflow-x: auto; }
@media print { .top, .foot, button { display: none !important; } body { background: #fff; } .card { border: 0; box-shadow: none; } }
