:root {
  --bg: #ffffff;
  --card: #f2f2f7;
  --text: #111111;
  --muted: #6b6b70;
  --line: #d9d9de;
  --green: #3da366;
  --orange: #f0801a;
  --primary-bg: #111111;
  --primary-text: #ffffff;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f2f2f2;
    --muted: #9a9aa0;
    --line: #333336;
    --primary-bg: #f2f2f2;
    --primary-text: #000000;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
header#top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header h1 { font-size: 17px; margin: 0; flex: 1; text-align: center; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .spacer { width: 36px; }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--card); font-size: 24px; line-height: 1; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.stack > * + * { margin-top: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 12px; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 6px 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flag-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.flagbtn { background: var(--card); border: 0; border-radius: var(--radius); padding: 10px 6px; text-align: center; width: 100%; }
.flagbtn .flag { font-size: 44px; line-height: 1.1; display: block; }
.flagbtn b { display: block; font-size: 15px; }
.flagbtn small { color: var(--muted); font-size: 12px; }
.tile { display: flex; align-items: center; gap: 10px; background: var(--card); border: 0; border-radius: var(--radius); padding: 12px; text-align: left; width: 100%; }
.tile .em { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; font-size: 22px; background: rgba(127,127,127,.15); flex: none; }
.tile b { display: block; font-size: 16px; }
.tile small { color: var(--muted); font-size: 13px; }
.menu { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); }
.menu button:last-child { border-bottom: 0; }
.menu button::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 22px; }
.primary { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; background: var(--primary-bg); color: var(--primary-text); font-weight: 600; font-size: 18px; }
.primary small { display: block; font-weight: 400; font-size: 16px; opacity: .85; margin-top: 2px; }
.primary:disabled { opacity: .3; }
.secondary { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); font-weight: 600; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grade button { border: 0; border-radius: 12px; padding: 14px; color: #fff; font-weight: 600; font-size: 18px; }
.know { background: var(--green); }
.remind { background: var(--orange); }
.remind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.remind-grid button { border: 0; border-radius: 12px; padding: 8px 0; color: #fff; }
.remind-grid b { display: block; font-size: 28px; }
.remind-grid small { font-size: 12px; opacity: .9; }
.remind-grid .rec { outline: 3px solid var(--text); }
.q { font-size: 34px; font-weight: 700; text-align: center; margin: 18px 0 6px; }
.a { font-size: 34px; font-weight: 700; text-align: center; color: var(--green); margin: 6px 0 14px; }
.sent { font-size: 24px; font-weight: 700; text-align: center; margin: 14px 0; line-height: 1.35; }
.sent.ans { color: var(--green); }
.hint { font-family: ui-monospace, Menlo, monospace; font-size: 22px; text-align: center; color: var(--muted); letter-spacing: .08em; }
.w { cursor: pointer; text-decoration: underline dotted rgba(127,127,127,.7); text-underline-offset: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(61,163,102,.14); color: var(--green); font-weight: 600; font-size: 14px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts button { border: 0; border-radius: 12px; padding: 14px 6px; font-size: 20px; font-weight: 600; background: var(--primary-bg); color: var(--primary-text); }
.kids .opts button { background: var(--orange); color: #fff; font-size: 28px; }
.ok { color: var(--green); font-weight: 700; text-align: center; }
.bad { color: #d33; font-weight: 700; text-align: center; }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; }
.levels button { border: 0; background: none; padding: 0; text-align: center; }
.levels .bar { height: 40px; background: rgba(127,127,127,.18); border-radius: 6px; position: relative; overflow: hidden; }
.levels .bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--green); }
.levels .lv { display: block; margin-top: 4px; padding: 3px 0; border-radius: 8px; font-weight: 700; font-size: 14px; }
.levels .on .lv { background: var(--green); color: #fff; }
.levels .off { opacity: .45; }
.levels .pct { font-size: 12px; color: var(--muted); }
.planned button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 0; text-align: left; }
.planned .go { margin-left: auto; background: var(--primary-bg); color: var(--primary-text); border-radius: 10px; padding: 4px 10px; font-weight: 700; }
.ex { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ex:last-child { border-bottom: 0; }
.ex b { display: block; font-size: 17px; }
.ex small { color: var(--muted); }
.lvl1 { color: var(--green); } .lvl2 { color: var(--orange); } .lvl3 { color: #b0479b; }
table.t { border-collapse: collapse; width: 100%; font-size: 15px; }
table.t td, table.t th { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line); }
table.t th { color: var(--muted); font-weight: 600; font-size: 13px; }
.rule p { margin: 0 0 10px; }
#panel-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 9; }
#panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 82vh; overflow: auto;
  background: var(--bg); border-radius: 18px 18px 0 0; padding: 16px 16px 28px; box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
#panel .inner { max-width: 560px; margin: 0 auto; }
.list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
.list button.sel { font-weight: 700; color: var(--green); }
.stars { font-size: 40px; font-weight: 800; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.cal div { padding: 6px 0; border-radius: 6px; background: rgba(127,127,127,.12); }
.cal .h { background: none; color: var(--muted); font-weight: 600; }
.cal .n { background: var(--green); color: #fff; font-weight: 700; }
.cal .today { outline: 2px solid var(--text); }
.notice { background: #fff4e5; color: #6a3d00; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .notice { background: #3a2a10; color: #ffd9a0; } }

.close-x { float: right; font-size: 18px; margin-left: 8px; }

/* --- 1.3: poslech, psaní, vlajky jazyků, úroveň --- */
.langbar { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.langbar button { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; font-size: 24px; padding: 4px 10px; opacity: .6; }
.langbar button.sel { opacity: 1; border: 2px solid #2f7de1; background: rgba(47,125,225,.14); }
.qwrap { position: relative; padding: 0 40px; }
.wr-toggle { position: absolute; left: -6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 19px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; }
.wr-toggle.on { color: #1a9a96; border-color: #1a9a96; background: rgba(26,154,150,.16); }
.inline-sig svg { vertical-align: -3px; color: #1a9a96; }
.a.peek { color: #2f7de1; cursor: pointer; }
.a.peek small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.listen { text-align: center; margin-top: 18px; }
.listen .play { width: 110px; height: 110px; border-radius: 55px; border: 0; background: rgba(47,125,225,.14); font-size: 54px; }
.listen .q, .listen .sent { margin-top: 12px; }
.listen .chip { margin-top: 12px; }
.listenbtn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 12px; background: rgba(47,125,225,.14); color: #2f7de1; font-weight: 600; font-size: 17px; }
.listenbtn small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 2px; }
.listenbtn:disabled { opacity: .45; }
.lvlhint { color: #2f7de1; }
.lvlrow { cursor: default; }
.wr-in { display: block; width: 100%; margin-top: 16px; font: inherit; font-size: 26px; text-align: center; padding: 12px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg); color: var(--text); }
.wr-in:focus { outline: none; border-color: #2f7de1; }
.marked { font-size: 30px; font-weight: 700; text-align: center; margin: 2px 0 10px; letter-spacing: .02em; }
.marked u { color: #d93a2b; text-decoration-thickness: 2px; }
.marked.right { color: var(--green); }
.marked.typed { color: var(--text); }
.okc { color: var(--green); }
.icon.small-x { width: 30px; height: 30px; font-size: 14px; margin-left: 8px; }
.checks button::after { content: none; }
.checks .ck { margin-left: auto; width: 24px; height: 24px; border-radius: 12px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 14px; color: #fff; }
.checks .ck.on { background: var(--green); border-color: var(--green); }
