:root {
  --bg: #F2F3F5;
  --card: #FFFFFF;
  --ink: #0F1222;
  --ink-soft: #5B6070;
  --ink-faint: #9CA0AD;
  --line: #ECEDF0;
  --lime: #B8F36B;
  --lime-deep: #8FDB3A;
  --lime-ink: #2F6B0A;
  --dark: #0F1222;
  --on-dark: #FFFFFF;
  --ctx: #F5F6F8;
  --up: #22A447;
  --down: #E5484D;
  --radius: 22px;
  --tabbar-h: 68px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0C10; --card: #17191F; --ink: #F3F4F6; --ink-soft: #A7ABB6; --ink-faint: #6B7080;
    --line: #23262E; --ctx: #1F2229; --dark: #F3F4F6; --on-dark: #0F1222; --lime-ink: #B8F36B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0C10; --card: #17191F; --ink: #F3F4F6; --ink-soft: #A7ABB6; --ink-faint: #6B7080;
  --line: #23262E; --ctx: #1F2229; --dark: #F3F4F6; --on-dark: #0F1222; --lime-ink: #B8F36B;
  color-scheme: dark;
}
/* náhled v rámečku telefonu – nahrazuje bezpečné okraje displeje */
html.framed { --safe-top: 50px; --safe-bottom: 22px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.text-large { font-size: 18px; }
/* podklad pod stavovým řádkem telefonu, aby pod něj text nepodjížděl */
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: var(--safe-top); background: var(--bg); z-index: 20; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 8px) 18px calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
}

/* ---------- horní lišta ---------- */
.topbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 52px; margin-bottom: 8px; }
.topbar h1 { margin: 0; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); }
.round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.logo img, .logo svg { width: 100%; height: 100%; display: block; }

.demo-note { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: -2px 0 12px; }

/* ---------- úvod: seznam přehledů ---------- */
.label { font-size: 14px; color: var(--ink-soft); font-weight: 500; margin: 0 2px 8px; display: flex; align-items: center; gap: 4px; }
.hero {
  display: block; width: 100%; text-align: left;
  background: linear-gradient(150deg, var(--lime) 0%, var(--lime-deep) 100%);
  color: #0F1222; border-radius: 26px; padding: 22px 20px 20px; margin-bottom: 26px;
  box-shadow: 0 10px 30px -12px rgba(120, 200, 40, .55);
}
.hero .kicker { font-size: 13px; font-weight: 600; opacity: .7; }
.hero .when { font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; margin: 4px 0 10px; }
.hero .what { font-size: 15px; line-height: 1.4; font-weight: 500; opacity: .85; margin-bottom: 18px; }
.hero .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero .count { font-size: 13px; font-weight: 600; opacity: .7; }
.pill { display: inline-block; background: #0F1222; color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; }

.rows { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.row-link { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-top: 1px solid var(--line); }
.row-link:first-child { border-top: 0; }
.datebox { flex: 0 0 auto; width: 46px; height: 50px; border-radius: 14px; background: var(--ctx); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.datebox b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.datebox span { font-size: 11px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; }
.row-link .txt { flex: 1; min-width: 0; }
.row-link .t1 { font-size: 15px; font-weight: 600; }
.row-link .t2 { font-size: 13.5px; color: var(--ink-soft); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { flex: 0 0 auto; color: var(--ink-faint); font-size: 22px; line-height: 1; }

/* ---------- detail přehledu ---------- */
.d-date { font-size: 14px; color: var(--ink-soft); font-weight: 500; margin: 4px 2px 2px; }
.d-title { font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; margin: 0 2px 18px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime-deep); flex: 0 0 auto; }
.summary ul { margin: 0; padding: 0; list-style: none; }
.summary li { position: relative; padding-left: 18px; margin: 8px 0; font-size: 15px; line-height: 1.45; }
.summary li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.from { font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; }

.watch .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.watch .wrow { background: var(--ctx); border-radius: 14px; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.watch .n { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.watch .r { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.watch .v { font-size: 15px; font-weight: 650; }
.watch .c { font-size: 12.5px; font-weight: 650; }
.c.up { color: var(--up); } .c.down { color: var(--down); } .c.flat { color: var(--ink-faint); }

.sec-title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin: 26px 2px 12px; }

.topic { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.topic-head { display: flex; gap: 10px; align-items: flex-start; }
.topic h3 { flex: 1; margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.topic .body { margin: 8px 0 0; font-size: 15.5px; color: var(--ink); }
.ctx { margin-top: 14px; background: var(--ctx); border-radius: 16px; padding: 14px; }
.ctx-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--lime-ink); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ctx p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.ctx p:last-child { margin: 0; }
.src { margin-top: 12px; font-size: 12.5px; color: var(--ink-faint); font-weight: 500; }
.src a { color: var(--ink-faint); }

.save { flex: 0 0 auto; width: 36px; height: 36px; margin: -6px -8px 0 0; display: grid; place-items: center; border-radius: 50%; color: var(--ink-faint); }
.save svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.save[aria-pressed="true"] { color: var(--ink); }
.save[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- nastavení ---------- */
.group { background: var(--card); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.row:first-child { border-top: 0; }
.row small { display: block; color: var(--ink-faint); font-size: 12.5px; font-weight: 400; }
.switch { position: relative; width: 50px; height: 30px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--lime-deep); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn { display: block; width: 100%; text-align: center; background: var(--dark); color: var(--on-dark); border-radius: 999px; padding: 15px 18px; font-size: 15px; font-weight: 600; text-decoration: none; }
.btn[disabled] { opacity: .35; cursor: default; }
.hint { font-size: 13px; color: var(--ink-faint); margin: 10px 4px 22px; text-align: center; }
.seg { display: inline-flex; background: var(--ctx); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-soft); border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.empty { text-align: center; color: var(--ink-faint); padding: 60px 20px; font-size: 15px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- spodní lišta ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0 24px var(--safe-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-faint); font-size: 11px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); }

/* ---------- filtr rubrik ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 18px; padding: 0 18px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: var(--card); border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.rubric-title { margin-bottom: 2px; }
.rubric-sub { margin: 0 2px 16px; }
.day-label { font-size: 13px; font-weight: 650; color: var(--ink-soft); margin: 20px 2px 8px; }
.day-label:first-of-type { margin-top: 4px; }

/* ---------- pojmy ---------- */
.terms { margin-top: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.terms dl { margin: 0; }
.terms dt { font-size: 14px; font-weight: 700; margin-top: 10px; }
.terms dt:first-child { margin-top: 0; }
.terms dd { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

/* ---------- sbalitelné rubriky ---------- */
button.sec-title { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; }
.sec-title span:first-child { flex: 0 1 auto; }
.sec-count { font-size: 13px; font-weight: 650; color: var(--ink-soft); background: var(--card); border-radius: 999px; padding: 1px 9px; letter-spacing: 0; }
.sec-chev { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--card); display: grid; place-items: center; transition: transform .2s; }
.sec-chev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sec.closed .sec-chev { transform: rotate(-90deg); }
.sec.closed .sec-body { display: none; }

/* ---------- náznak posouvání filtrů ---------- */
.chips {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 44px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 44px), transparent 100%);
  padding-right: 44px;
}

/* ---------- hero se dvěma tlačítky ---------- */
.hero .foot { justify-content: flex-end; gap: 8px; }
.pill.ghost { background: rgba(255, 255, 255, .55); color: #0F1222; }
.hero .kicker { margin-bottom: 2px; }

/* ---------- důležitost ---------- */
.imp { flex: 0 0 auto; display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; margin-top: 4px; }
.imp i { width: 4px; border-radius: 2px; background: var(--line); }
.imp i:nth-child(1) { height: 7px; } .imp i:nth-child(2) { height: 11px; } .imp i:nth-child(3) { height: 15px; }
.imp-1 i:nth-child(-n+1), .imp-2 i:nth-child(-n+2), .imp-3 i:nth-child(-n+3) { background: var(--lime-deep); }
.imp-3 i { background: var(--ink) !important; }

/* ---------- to nejdůležitější ---------- */
.top-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-soft); margin: 18px 2px 8px; }
.top-n { width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: #0F1222; display: grid; place-items: center; font-size: 13px; font-weight: 750; }
.top-label + .topic { margin-bottom: 4px; }
.view > .btn { margin-top: 22px; }

/* ---------- týdenní přehled ---------- */
.week-card { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: 18px 20px; margin: -10px 0 26px; }
.wk-kicker { font-size: 13px; font-weight: 600; opacity: .65; }
.wk-title { font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.wk-cta { margin-top: 8px; font-size: 14px; font-weight: 650; color: var(--lime); }
.datebox.week { background: var(--dark); color: var(--on-dark); }
.datebox.week span { color: inherit; opacity: .7; }
.prose p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; }
.prose p:last-child { margin: 0; }
.sec-title.static { display: block; }

/* ---------- učení ---------- */
.tab { position: relative; }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lime-deep); color: #0F1222; font-size: 11px; font-weight: 750; display: grid; place-items: center; }
.badge[hidden] { display: none; }
.due-line { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border-radius: 16px; padding: 12px 16px; margin: -12px 0 26px; font-size: 14.5px; font-weight: 600; text-align: left; }
.due-line .chev { margin-left: auto; }
.due-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime-deep) 25%, transparent); }
.week-card { margin-top: 0; }
.hero + .week-card { margin-top: -10px; }

.learn-hero { background: linear-gradient(150deg, var(--lime) 0%, var(--lime-deep) 100%); color: #0F1222; border-radius: 26px; padding: 20px; margin-bottom: 24px; }
.lh-kicker { font-size: 13px; font-weight: 600; opacity: .7; }
.lh-num { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.lh-sub { font-size: 14.5px; font-weight: 500; opacity: .8; margin-bottom: 14px; }
.lic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; background: var(--ctx); display: grid; place-items: center; font-weight: 750; font-size: 15px; }
.lic.dark { background: var(--dark); color: var(--on-dark); }
.rows + .label { margin-top: 22px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--card); border-radius: 16px; padding: 12px; text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 750; }
.stats span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

.check-card { background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: 20px; margin-top: 26px; }
.cc-title { font-size: 19px; font-weight: 750; }
.cc-sub { font-size: 14px; opacity: .7; margin: 2px 0 14px; }
.check-card .pill { background: var(--lime); color: #0F1222; }

.progress { height: 6px; border-radius: 3px; background: var(--card); overflow: hidden; margin-top: 4px; }
.progress span { display: block; height: 100%; background: var(--lime-deep); border-radius: 3px; transition: width .25s; }
.progress-txt { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin: 8px 2px 14px; }

.flash { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 360px; background: var(--card); border-radius: 26px; padding: 28px 22px; text-align: center; box-shadow: 0 10px 30px -18px rgba(15, 18, 34, .35); }
.flash.flipped { justify-content: flex-start; }
.fl-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--lime-ink); }
.fl-term { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.fl-exp { font-size: 16.5px; line-height: 1.55; color: var(--ink); margin-top: 6px; }
.fl-hint { font-size: 13px; color: var(--ink-faint); margin-top: 12px; }
.fl-from { font-size: 13px; color: var(--ink-faint); margin-top: 8px; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn.secondary { background: var(--card); color: var(--ink); }

.qcard { background: var(--card); border-radius: 26px; padding: 22px 18px; margin-bottom: 14px; }
.q { font-size: 19px; line-height: 1.35; font-weight: 700; margin: 8px 0 0; letter-spacing: -.01em; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.opt { text-align: left; background: var(--ctx); border-radius: 14px; padding: 13px 14px; font-size: 15px; font-weight: 500; line-height: 1.4; border: 2px solid transparent; }
.opt.right { border-color: var(--up); background: color-mix(in srgb, var(--up) 12%, var(--card)); }
.opt.wrong { border-color: var(--down); background: color-mix(in srgb, var(--down) 10%, var(--card)); }
.opt.dim { opacity: .5; }
.opt[disabled] { cursor: default; color: var(--ink); }

.done { text-align: center; padding: 40px 10px; }
.done-num { font-size: 56px; font-weight: 800; letter-spacing: -.03em; }
.done-sub { font-size: 16px; color: var(--ink-soft); margin: 4px 0 28px; }

.m-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.m-term { background: var(--card); border-radius: 999px; padding: 9px 15px; font-size: 14.5px; font-weight: 650; border: 2px solid transparent; }
.m-term.sel { border-color: var(--ink); }
.m-term.ok { background: var(--lime); color: #0F1222; opacity: .55; }
.m-exps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.m-exp { text-align: left; background: var(--card); border-radius: 16px; padding: 13px 14px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); border: 2px solid transparent; }
.m-exp.ok { border-color: var(--up); color: var(--ink); }
.m-exp.bad { border-color: var(--down); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.search { width: 100%; border: 0; background: var(--card); border-radius: 14px; padding: 13px 16px; font: inherit; font-size: 15px; color: var(--ink); margin-bottom: 14px; outline: none; }
.search:focus { box-shadow: 0 0 0 2px var(--ink); }
.g-item { background: var(--card); border-radius: 18px; padding: 14px 16px; margin-bottom: 8px; }
.g-item[hidden] { display: none; }
.g-head { display: flex; align-items: center; gap: 8px; }
.g-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.g-ok { width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: #0F1222; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.g-item p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
.g-where { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.g-where button { font-size: 12px; font-weight: 650; background: var(--ctx); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft); }

/* ---------- učení v2 ---------- */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 8px; }
.label-row .label { margin: 0; }
.pill.small { padding: 8px 16px; font-size: 13.5px; background: var(--dark); color: var(--on-dark); }
.last-result { font-size: 13px; color: var(--ink-soft); margin: -2px 2px 8px; }

/* otočná kartička */
.flip-wrap { perspective: 1200px; }
.flip { position: relative; display: block; width: 100%; min-height: 360px; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .7, .3, 1); }
.flip.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 22px; text-align: center; background: var(--card); border-radius: 26px; box-shadow: 0 10px 30px -18px rgba(15, 18, 34, .35); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); overflow-y: auto; }
.grade { opacity: 0; pointer-events: none; transition: opacity .25s .25s; }
.grade.show { opacity: 1; pointer-events: auto; }
.match-head { font-size: 13px; color: var(--ink-soft); margin: 0 2px 12px; display: flex; gap: 8px; align-items: center; }

/* vyhodnocení */
.done { padding: 24px 10px 18px; }
.bd-row { margin-top: 12px; }
.bd-row:first-of-type { margin-top: 2px; }
.bd-top { display: flex; justify-content: space-between; font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.bd-top b { font-variant-numeric: tabular-nums; }
.bd-bar { height: 8px; border-radius: 4px; background: var(--ctx); overflow: hidden; }
.bd-bar span { display: block; height: 100%; background: var(--lime-deep); border-radius: 4px; }

/* slovník */
.gloss { padding-right: 26px; }
.az { position: fixed; right: 4px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 1px; background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 12px; padding: 6px 2px; }
.az button { font-size: 11px; font-weight: 700; color: var(--lime-ink); width: 22px; line-height: 17px; }
.g-group { scroll-margin-top: calc(var(--safe-top) + 12px); }
.g-group[hidden] { display: none; }
.g-letter { font-size: 13px; font-weight: 750; color: var(--ink-soft); margin: 16px 4px 6px; }
.g-group:first-child .g-letter { margin-top: 0; }
.g-item { padding: 0; }
.g-item summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 13px 14px 13px 16px; cursor: pointer; }
.g-item summary::-webkit-details-marker { display: none; }
.g-name { font-size: 15.5px; font-weight: 650; }
.g-chev { margin-left: auto; color: var(--ink-faint); display: grid; transition: transform .2s; }
.g-chev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.g-item[open] .g-chev { transform: rotate(180deg); }
.g-item p { margin: 0; padding: 0 16px; }
.g-item .g-where { padding: 0 16px 14px; }

/* ---------- v náhledu v rámečku skrýt posuvník (iPhone ho nezobrazuje trvale) ---------- */
html.framed { scrollbar-width: none; }
html.framed::-webkit-scrollbar { display: none; }

/* ---------- inverzní (tmavé) karty čitelné v obou motivech ---------- */
:root { --inv-bg: #0F1222; --inv-ink: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --inv-bg: #262A37; --inv-ink: #FFFFFF; } }
:root[data-theme="dark"] { --inv-bg: #262A37; --inv-ink: #FFFFFF; }
.week-card, .check-card { background: var(--inv-bg); color: var(--inv-ink); }
.datebox.week, .lic.dark { background: var(--inv-bg); color: var(--inv-ink); }
.wk-cta { color: var(--lime); }

/* skóre u typů kartiček */
.score { flex: 0 0 auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--lime); color: #0F1222; border-radius: 999px; padding: 2px 9px; }
.score.low { background: var(--ctx); color: var(--ink-soft); }
.row-btn { width: 100%; text-align: left; }
.row-end { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.lic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn[disabled] { opacity: 1; background: var(--card); color: var(--ink-faint); }
.imp-1 i:nth-child(-n+1), .imp-2 i:nth-child(-n+2) { background: var(--lime-ink); }

/* ---------- ukazatel důležitosti: jedna tmavá barva, vyplněno 1–3 ---------- */
.imp i, .imp-3 i { background: var(--line) !important; }
.imp-1 i:nth-child(-n+1), .imp-2 i:nth-child(-n+2), .imp-3 i:nth-child(-n+3) { background: var(--ink) !important; }

/* ---------- šipka Další v záhlaví ---------- */

/* ---------- odebírání pojmů ---------- */
.skip-term { grid-column: 1 / -1; font-size: 13px; color: var(--ink-faint); padding: 10px 0 2px; text-decoration: underline; text-underline-offset: 3px; }
.g-row { position: relative; margin-bottom: 8px; border-radius: 18px; overflow: hidden; touch-action: pan-y; }
.g-row[hidden] { display: none; }
.g-row .g-item { margin-bottom: 0; position: relative; z-index: 1; transition: transform .2s; }
.g-row.dragging .g-item { transition: none; }
.g-row.swiped .g-item { transform: translateX(-96px); }
.g-del { position: absolute; right: 0; top: 0; bottom: 0; width: 96px; background: var(--down); color: #fff; font-size: 14px; font-weight: 650; }
.flip { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

.ex-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 14px 16px; margin-bottom: 8px; }
.ex-txt { flex: 1; min-width: 0; }
.ex-txt b { display: block; font-size: 15.5px; }
.ex-txt span { display: block; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }

.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background .25s; display: flex; align-items: flex-end; }
.sheet-wrap.open { background: rgba(0, 0, 0, .35); }
.sheet { width: 100%; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(var(--safe-bottom) + 18px); transform: translateY(100%); transition: transform .25s; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-title { font-size: 18px; font-weight: 750; }
.sheet p { color: var(--ink-soft); font-size: 14.5px; margin: 6px 0 18px; }
.sheet .btn + .btn { margin-top: 8px; }
.btn.danger { background: var(--down); color: #fff; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); z-index: 40; display: flex; align-items: center; gap: 12px; background: var(--inv-bg); color: var(--inv-ink); border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 500; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; max-width: 528px; margin: 0 auto; }
.toast.open { opacity: 1; transform: none; }
.toast span { flex: 1; }
.toast button { color: var(--lime); font-weight: 700; }
.done-skip { font-size: 14px; color: var(--ink-faint); margin-top: -2px; }

/* posun mezi otázkami přejetím */
.sess { touch-action: pan-y; min-height: calc(100dvh - 190px); }
.sess.in-right { animation: in-right .2s ease-out; }
.sess.in-left { animation: in-left .2s ease-out; }
@keyframes in-right { from { transform: translateX(40%); opacity: 0; } }
@keyframes in-left { from { transform: translateX(-40%); opacity: 0; } }
.swipe-hint { font-size: 12.5px; color: var(--ink-faint); text-align: center; margin-top: 22px; }
.was { margin-top: 14px; text-align: center; font-size: 14px; font-weight: 650; color: var(--ink-soft); background: var(--card); border-radius: 14px; padding: 12px; }
.was.ok { color: var(--up); }
.was.bad { color: var(--down); }
.hero[data-go] { cursor: pointer; }

/* stažení dolů pro obnovení */
html, body { overscroll-behavior-y: none; }
.ptr { position: fixed; top: calc(var(--safe-top) + 4px); left: 50%; z-index: 19; width: 36px; height: 36px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 14px -6px rgba(15, 18, 34, .35); display: grid; place-items: center; opacity: 0; transform: translate3d(-50%, -48px, 0); pointer-events: none; will-change: transform, opacity; }
.ptr svg { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.ptr.ready .arrow { transform: rotate(180deg); }
.ptr .spinner, .ptr.spin .arrow { display: none; }
.ptr.spin .spinner { display: block; animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
