:root {
  --navy: #1e3d8e;
  --navy-2: #2c4493;
  --navy-d: #142a66;
  --ink: #14213d;
  --muted: #6b7a90;
  --line: #e3e8ef;
  --bg: #f4f6fa;
  --card: #ffffff;
  --soft: #eef2f8;
  --yellow: #ffde00;
  --yellow-d: #d9b800;
  --amber: #fab416;
  --good: #22a559;
  --good-d: #188246;
  --good-bg: #dcf5e6;
  --bad: #e5484d;
  --bad-d: #b8343a;
  --bad-bg: #fde4e4;
  --blue: #2563eb;
  --blue-d: #1d4fc0;
  --grey-node: #e5e9f0;
  --grey-node-d: #c9d0db;
  --radius: 18px;
  /* závoj přes fotku na pozadí, aby text zůstal čitelný */
  --veil: rgba(244, 246, 250, .86);
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
/* web je vždy tmavý – nezávisle na světlém / tmavém motivu systému */
:root {
  color-scheme: dark;
  --ink: #eef2f8; --muted: #9aa8bd; --line: #243049; --bg: #0b1222; --card: #121b30; --soft: #1a2540;
  --good-bg: #123b26; --bad-bg: #44191c; --grey-node: #26324d; --grey-node-d: #1a2338; --blue: #4f86f7; --blue-d: #3364c9;
  --veil: rgba(11, 18, 34, .84);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--bg); }
body { margin: 0; background: transparent; min-height: 100vh; display: flex; flex-direction: column; font-weight: 600; }
/* fotka autoškoly přes celé pozadí (pevně, i na mobilu – proto pseudo-prvek místo background-attachment) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(var(--veil), var(--veil)), url("img/pozadi.jpg") center / cover no-repeat;
}
a { color: var(--blue); }
button { font-family: inherit; }
img, video { max-width: 100%; }

/* ---------- hlavička ---------- */
.top {
  background: linear-gradient(180deg, var(--navy-2), #0b1530);
  color: #fff; display: flex; align-items: center; gap: 16px; padding: 10px 20px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
}
.brand img { display: block; }
#nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#nav a, #nav button {
  color: #fff; text-decoration: none; background: transparent; border: 2px solid transparent;
  padding: 8px 14px; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
#nav a:hover, #nav button:hover { background: rgba(255,255,255,.1); }
#nav a.on { background: rgba(255,255,255,.14); border-color: var(--yellow); color: var(--yellow); }
#nav .ico { font-size: 18px; line-height: 1; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
body.focus .top, body.focus .foot { display: none; }
body.focus main { max-width: 760px; padding-top: 12px; }

/* spodní lišta na mobilu (jako v aplikacích na učení) */
@media (max-width: 700px) {
  body.tabs #nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30; justify-content: space-around; gap: 0;
    background: var(--card); border-top: 2px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  body.tabs #nav a, body.tabs #nav button { color: var(--muted); flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; }
  body.tabs #nav a.on { background: var(--soft); border-color: transparent; color: var(--navy); }
  body.tabs #nav .ico { font-size: 22px; }
  body.tabs main { padding-bottom: 96px; }
  body.tabs .top { justify-content: center; }
}

/* ---------- typografie a základ ---------- */
h1 { font-size: 30px; margin: 0 0 6px; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; font-weight: 900; }
h3 { font-weight: 900; }
.sub { color: var(--muted); margin: 0 0 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; border: 2px solid var(--line); }
.card h3 { margin: 0 0 8px; font-size: 20px; }
.hero { background: linear-gradient(160deg, var(--navy-2), #0b1530 80%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero p { color: #cbd5e1; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; font-weight: 800; }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 600; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
input.code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
textarea { min-height: 70px; }

/* tlačítka s „plastickým“ spodním okrajem */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; font: inherit; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: 15px;
  padding: 13px 22px; border-radius: 16px; text-decoration: none; box-shadow: 0 4px 0 var(--blue-d);
  transition: transform .05s, box-shadow .05s, filter .15s; position: relative; top: 0;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--blue-d); }
.btn.yellow { background: var(--yellow); color: #1b1b1b; box-shadow: 0 4px 0 var(--yellow-d); }
.btn.green { background: var(--good); box-shadow: 0 4px 0 var(--good-d); }
.btn.red { background: var(--bad); box-shadow: 0 4px 0 var(--bad-d); }
.btn.ghost { background: var(--card); color: var(--blue); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; padding: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.err { color: var(--bad); font-weight: 800; margin-top: 10px; }
.ok { color: var(--good); font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }

.stat { background: var(--soft); border-radius: 16px; padding: 14px; text-align: center; }
.stat b { display: block; font-size: 26px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.bar { height: 14px; background: var(--grey-node); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 99px; position: relative; transition: width .4s ease; }
.bar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 9px; background: rgba(255,255,255,.35); }
.bar.blue i { background: var(--blue); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--soft); }
.tablewrap { overflow-x: auto; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #dbeafe; color: var(--navy); margin: 2px; }
.chip.amber { background: #fef3c7; color: #92400e; }
.chip.red { background: #fee2e2; color: #991b1b; }
.chip.green { background: #dcfce7; color: #166534; }
.explain { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--yellow); background: rgba(255, 222, 0, .12); border-radius: 8px; }

/* ---------- úvod ---------- */
.landing { display: grid; gap: 22px; grid-template-columns: 1.2fr 1fr; align-items: stretch; }
.landing .hero { padding: 0 30px 30px; overflow: hidden; }
/* fotka auta autoškoly se značkou „L“ nahoře v kartě, plynule přechází do textu */
.hero-photo {
  height: 320px; margin: 0 -30px 18px;
  background: linear-gradient(180deg, rgba(11, 21, 48, 0) 70%, #0b1530), url("img/auto-l.jpg") center 56% / cover no-repeat;
}
.landing .hero h1 { font-size: 38px; line-height: 1.1; }
.landing .hero .big { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.features { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 18px; }
.features div { background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px; font-size: 14px; color: #e2e8f0; }
.features b { display: block; font-size: 22px; color: #fff; }
.logins { display: grid; gap: 16px; align-content: start; }
@media (max-width: 820px) { .landing { grid-template-columns: 1fr; } .landing .hero h1 { font-size: 30px; } }

/* ---------- učení: rozložení ---------- */
.learn { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.side { display: grid; gap: 16px; position: sticky; top: 86px; }
.mobile-only { display: none; }
@media (max-width: 900px) {
  .learn { grid-template-columns: minmax(0, 1fr); } .side { position: static; }
  .side .topstats { display: none; } .topstats.mobile-only { display: flex; margin-bottom: 14px; }
}
.topstats { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 17px; padding: 8px 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); }
.pill.fire { color: #ff7a00; }
.pill.xp { color: #e0a800; }
.pill.ready { color: var(--good); }
.pill.off { color: var(--muted); filter: grayscale(1); }

.goal { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--grey-node) 0); }
.ring span { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.week { display: flex; gap: 6px; margin-top: 12px; }
.week div { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.week i { display: block; width: 28px; height: 28px; margin: 4px auto 0; border-radius: 50%; background: var(--grey-node); font-style: normal; line-height: 28px; }
.week i.on { background: #ff9600; color: #fff; }
.week i.today { outline: 3px solid var(--yellow); outline-offset: 1px; }

/* kategorie (jednotky) */
.units { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 8px; }
.unit {
  --c: var(--blue); border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px; cursor: pointer;
  text-align: left; color: var(--ink); display: grid; gap: 6px; box-shadow: 0 4px 0 var(--line); font: inherit;
}
.unit:hover { border-color: var(--c); }
.unit.on { border-color: var(--c); box-shadow: 0 4px 0 var(--c); background: color-mix(in srgb, var(--c) 8%, var(--card)); }
.unit .icon { font-size: 26px; line-height: 1; }
.unit b { font-size: 14px; line-height: 1.2; }
.unit .bar { height: 8px; margin: 0; }
.unit .bar i { background: var(--c); }
.unit .bar i::after { display: none; }
.unit small { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .units { display: flex; overflow-x: auto; gap: 8px; padding: 2px 2px 8px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; scroll-snap-type: x mandatory; }
  .unit { flex: none; width: 140px; padding: 10px; gap: 4px; scroll-snap-align: start; }
  .unit .icon { font-size: 22px; }
  .unit b { font-size: 13px; min-height: 32px; }
  .banner { padding: 14px 16px; } .banner .icon { font-size: 32px; } .banner h3 { font-size: 19px; }
}

.banner {
  --c: var(--blue); background: var(--c); color: #fff; border-radius: 18px; padding: 18px 20px; display: flex; gap: 16px; align-items: center;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, #000); margin: 18px 0 8px;
}
.banner .icon { font-size: 40px; }
.banner h3 { margin: 0; font-size: 22px; }
.banner p { margin: 2px 0 0; opacity: .9; }
.banner .btn { margin-left: auto; background: rgba(255,255,255,.18); box-shadow: 0 4px 0 rgba(0,0,0,.18); border: 2px solid rgba(255,255,255,.4); }
@media (max-width: 560px) { .banner { flex-wrap: wrap; } .banner .btn { margin-left: 0; } }

/* cesta lekcí */
.path { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 64px 0 10px; }
.node-wrap { position: relative; }
.node {
  --c: var(--blue); width: 76px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; font-size: 30px; font-weight: 900; color: #fff;
  background: var(--c); box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 68%, #000); display: grid; place-items: center;
  transition: transform .06s, box-shadow .06s;
}
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 68%, #000); }
.node.done { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); color: #7a5b00; }
.node.todo { background: var(--grey-node); box-shadow: 0 7px 0 var(--grey-node-d); color: var(--muted); font-size: 22px; }
.node.current { animation: none; }
.node-wrap.current::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 6px solid color-mix(in srgb, var(--c, var(--blue)) 30%, transparent);
  pointer-events: none;
}
.node { position: relative; z-index: 1; }
.bubble {
  position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%); background: var(--card); color: var(--c, var(--blue));
  border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 900; white-space: nowrap; font-size: 14px;
  animation: bob 1.2s ease-in-out infinite; text-transform: uppercase; letter-spacing: .04em; pointer-events: none; z-index: 2;
}
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--card); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.stars { position: absolute; top: 50%; left: calc(100% + 10px); transform: translateY(-50%); font-size: 13px; letter-spacing: -2px; white-space: nowrap; }
.node-label { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); white-space: nowrap; color: var(--muted); font-size: 13px; }
.more { margin-top: 10px; }

/* rychlé akce */
.quick { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.qa { border: 2px solid var(--line); background: var(--card); border-radius: 18px; padding: 16px; cursor: pointer; text-align: left;
  display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 var(--line); font: inherit; }
.qa:hover { border-color: var(--blue); }
.qa .icon { font-size: 34px; }
.qa b { display: block; font-size: 16px; }
.qa span { color: var(--muted); font-size: 13px; }
.qa.disabled { opacity: .5; pointer-events: none; }

/* ---------- lekce ---------- */
.lesson-top { display: flex; align-items: center; gap: 14px; margin: 6px 0 22px; }
.x { background: none; border: 0; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px 8px; }
.lesson-top .bar { flex: 1; height: 18px; margin: 0; }
.combo { font-weight: 900; color: #ff7a00; min-width: 52px; text-align: right; }
.qhead { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 900; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qhead .new { background: #ede9fe; color: #6d28d9; padding: 2px 8px; border-radius: 8px; letter-spacing: .04em; }
.q { font-size: 23px; font-weight: 800; margin: 0 0 18px; line-height: 1.35; }
.qmedia { margin: 0 0 18px; text-align: center; }
.qmedia img, .qmedia video { max-height: 340px; border-radius: 14px; background: #000; display: inline-block; }
.qmedia img { background: transparent; }
.answers { display: grid; gap: 12px; }
.answer {
  text-align: left; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 4px 0 var(--line);
  color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; display: flex; gap: 14px; align-items: center;
  transition: transform .05s;
}
.answer:hover:not(:disabled) { background: var(--soft); }
.answer:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.answer .key { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; color: var(--muted); font-weight: 900; }
.answer img { max-height: 120px; border-radius: 8px; }
.answer.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--card)); box-shadow: 0 4px 0 var(--blue); }
.answer.sel .key { border-color: var(--blue); color: var(--blue); }
.answer.good { border-color: var(--good); background: var(--good-bg); box-shadow: 0 4px 0 var(--good); }
.answer.good .key { border-color: var(--good); color: var(--good); }
.answer.bad { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 4px 0 var(--bad); }
.answer.bad .key { border-color: var(--bad); color: var(--bad); }
.answer:disabled { cursor: default; }
.sheet-space { height: 150px; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--line); background: var(--card); transform: translateY(0); transition: transform .2s ease;
}
.sheet .in { max-width: 760px; margin: 0 auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sheet .msg { flex: 1; min-width: 220px; }
.sheet .msg b { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.sheet .msg p { margin: 4px 0 0; }
.sheet.good { background: var(--good-bg); border-color: transparent; color: var(--good-d); }
.sheet.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad-d); }
.sheet.good { color: #7ee2a8; } .sheet.bad { color: #ff9ea1; }
.sheet .btn { min-width: 180px; }
@media (max-width: 560px) { .sheet .btn { width: 100%; } .q { font-size: 20px; } .answer { font-size: 16px; } .qmedia img, .qmedia video { max-height: 220px; } .hint-keys { display: none; } }

/* konec lekce */
.done-screen { text-align: center; padding: 30px 0; }
.done-screen .big { font-size: 80px; line-height: 1; animation: pop .5s ease; }
.done-screen h1 { font-size: 34px; color: var(--amber); }
.tiles { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.tile { border-radius: 16px; border: 2px solid var(--c, var(--amber)); min-width: 130px; overflow: hidden; background: var(--card); }
.tile small { display: block; background: var(--c, var(--amber)); color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 5px; }
.tile b { display: block; font-size: 24px; padding: 12px; color: var(--c, var(--amber)); }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- test nanečisto ---------- */
.exam { display: grid; gap: 20px; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .exam { grid-template-columns: 1fr; } }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.qgrid button { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 900; cursor: pointer; }
.qgrid button.ans { background: var(--blue); border-color: var(--blue); color: #fff; }
.qgrid button.cur { outline: 3px solid var(--yellow); outline-offset: 1px; }
.qgrid button.good { background: var(--good); border-color: var(--good); color: #fff; }
.qgrid button.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.clock { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--bad); }
.result { font-size: 46px; font-weight: 900; }
.catrow { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.catrow:last-child { border-bottom: 0; }
.catrow .bar { margin: 4px 0 0; height: 10px; }

/* ---------- prohlížení otázek ---------- */
.qlist .card { margin-bottom: 10px; }
.qlist ol { margin: 8px 0 0; padding-left: 22px; }
.qlist li.ok { color: var(--good); }
.qlist .thumb { max-height: 140px; border-radius: 10px; float: right; margin: 0 0 8px 12px; }
.src { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ---------- procvičování podle témat ---------- */
.tchips { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.tchip small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.tchip.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--card)); box-shadow: 0 3px 0 var(--blue); }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--card); color: var(--ink); font: inherit; font-weight: 800; font-size: 14px; padding: 9px 14px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on { background: var(--blue); color: #fff; }
.startbar { position: sticky; bottom: 12px; margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 5; }
.startbar b { font-size: 22px; font-weight: 900; }
.startbar .muted { max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .startbar { bottom: 84px; } }
.resume-card { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, var(--card)); }
.resume-card .bar { max-width: 320px; }
.qa.resume { border-color: var(--amber); box-shadow: 0 4px 0 var(--amber); }
@media (max-width: 700px) {
  .units.wrap { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; margin: 0 0 4px; padding: 0; }
  .units.wrap .unit { width: auto; }
}

[hidden] { display: none !important; }
@media (max-width: 820px) {
  .landing .hero { padding: 0 20px 22px; }
  .hero-photo { height: 240px; margin: 0 -20px 14px; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .features div { padding: 8px; font-size: 12px; }
  .features b { font-size: 17px; }
}

/* ---------- tiskopisy (evidenční kniha, třídní kniha, průkaz, seznam, výkaz) ---------- */
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.doc-scroll { overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 16px; }
.doc { background: #fff; color: #111827; margin: 0 auto; padding: 9mm; box-shadow: 0 6px 24px rgba(0,0,0,.18); border-radius: 4px;
  font: 500 9pt/1.25 Arial, Helvetica, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc.port { width: 210mm; min-height: 297mm; }
.doc.land { width: 297mm; min-height: 210mm; }
.doc .d-bar { background: #4b4b46; color: #fff; font-weight: 700; text-align: center; padding: 1.2mm 2mm; margin-top: 3mm; border: .2mm solid #3c3c3c; }
.doc .d-bar.big { font-size: 10.5pt; padding: 2mm; margin-top: 0; }
.doc .d-t { width: 100%; border-collapse: collapse; table-layout: auto; }
.doc .d-t td, .doc .d-t th { border: .25mm solid #3c3c3c; padding: 1.2mm 1.5mm; text-align: center; vertical-align: middle; font-weight: 500; }
.doc .d-t th { font-weight: 700; font-size: 7.5pt; color: #111827; text-transform: none; letter-spacing: 0; background-clip: padding-box; }
.doc .d-t td { color: #111827; }
.doc .d-t .dark { color: #fff; }
.doc .d-grid { table-layout: fixed; }
.doc .d-grid .lab { width: 12mm; }
.doc .d-grid .num { font-size: 7pt; padding: .6mm 0; }
.doc .d-grid .date { height: 8mm; font-weight: 700; font-size: 8.5pt; padding: 0; }
.doc .yel { background: #f6c428; }
.doc .pale { background: #fdecba; }
.doc .dark { background: #4b4b46; color: #fff; }
.doc .b { font-weight: 700; }
.doc .big { font-size: 11.5pt; }
.doc .small { font-size: 7.5pt; }
.doc .tiny { font-size: 6.5pt; }
.doc .left { text-align: left !important; }
.doc .right { text-align: right; }
.doc .center { text-align: center; }
.doc .w50 { width: 50%; }
.doc .w12 { width: 13%; }
.doc .muted { color: #64748b; }
.doc .d-list td { font-size: 8pt; height: 6.5mm; }
.doc .d-list tr.empty td { height: 7mm; }
.doc .d-permit td { height: 10mm; font-size: 8pt; }
.doc .sigcell { width: 23%; padding: .5mm; }
.doc .sigcell .sig { width: 100%; height: 9mm; display: block; }
.doc .sigfinal { vertical-align: top; position: relative; }
.doc .sigfinal .sig { width: 100%; height: 12mm; display: block; }
.doc .d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6mm; margin-bottom: 4mm; }
.doc .d-head > div { flex: 1; }
.doc .d-title { font-size: 18pt; font-weight: 800; }
.doc thead { display: table-header-group; }
.doc tr { break-inside: avoid; }
.doc-foot { color: #64748b; font-size: 7pt; margin-top: 4mm; }
/* třídní kniha na webu */
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.slot { width: 58px; text-align: center; border-radius: 10px; background: var(--soft); padding: 5px 0; border: 1.5px solid transparent; }
.slot span { display: block; font-size: 12px; color: var(--muted); }
.slot.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.lrow { display: grid !important; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.lrow > span:last-child { flex-wrap: nowrap; }
.lrow input[type=date] { padding: 6px 8px; }
.sigbox .sig { width: 260px; height: 70px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2px 14px; margin-top: 8px; max-height: 360px; overflow: auto; }
.pick label { padding: 5px 0; gap: 8px; }

@media print {
  body::before, header.top, footer.foot, .noprint, #nav { display: none !important; }
  body { background: #fff !important; }
  main { padding: 0 !important; max-width: none !important; }
  .doc-scroll { overflow: visible; margin: 0; padding: 0; }
  .doc { box-shadow: none; border-radius: 0; padding: 0; width: auto !important; min-height: 0 !important; zoom: 1 !important; }
}

/* jízdy, nastavení žáka, podpis */
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chipcheck { display: inline-flex !important; align-items: center; gap: 6px; padding: 5px 10px; margin: 0 !important; border-radius: 999px; border: 2px solid var(--line); font-size: 13px; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ink); }
.chipcheck input { width: auto !important; margin: 0; padding: 0; height: auto; box-shadow: none; }
.chipcheck:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 18%, transparent); }
.frow { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sigpad { position: relative; width: 100%; max-width: 520px; height: 150px; background: #fff; border-radius: 12px; border: 2px dashed var(--line); margin-top: 6px; }
.sigpad canvas { width: 100%; height: 100%; display: block; touch-action: none; border-radius: 12px; cursor: crosshair; }
.sighint { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; font-size: 14px; pointer-events: none; }
.card.danger { border: 2px solid color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.danger { background: var(--bad); box-shadow: 0 4px 0 var(--bad-d); }
.b { font-weight: 800; }
.aiexp { margin: 10px 0; }
.explain.ai { border-left: 4px solid var(--blue); }
.explain.ai p { margin: 6px 0 0; line-height: 1.5; }
