/* Rozvrhy GOA – vzhled převzatý z původní aplikace (Tailwind + DaisyUI, světlé téma):
   tmavě modrá lišta (blue-900), tlačítka btn-outline btn-primary, zebra tabulka s modrou hlavičkou,
   změněné hodiny s červeným podbarvením. */

:root {
  --primary: oklch(45% .24 277.023);            /* DaisyUI primary (indigo) */
  --primary-content: oklch(93% .034 272.788);
  --primary-15: color-mix(in oklab, var(--primary) 15%, transparent);
  --blue-900: #1e3a8a;
  --blue-900-15: rgba(30, 58, 138, .15);
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --base-100: #ffffff;
  --base-200: #fafafa;
  --base-300: #f2f2f2;
  --base-content: oklch(21% .006 285.885);
  --border-soft: rgba(31, 31, 43, .06);
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --red-50: #fef2f2;
  --red-500-60: rgba(239, 68, 68, .6);
  --red-600: #dc2626;
  --green-50: #f0fdf4;
  --green-500-60: rgba(34, 197, 94, .6);
  --green-700: #15803d;
  --amber-50: #fffbeb;
  --amber-500-60: rgba(245, 158, 11, .6);
  --amber-700: #b45309;
  --violet-50: #f5f3ff;
  --violet-500-60: rgba(139, 92, 246, .6);
  --rose-50: #fff1f2;
  --rose-400-60: rgba(251, 113, 133, .6);
  --radius-box: .5rem;
  --radius-field: .25rem;
  --radius-selector: .5rem;
  --font-sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  color: #000; background: var(--base-100);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 700; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--base-300); padding: .05rem .3rem; border-radius: .2rem; }
.muted { color: var(--gray-500); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: .4em .8em; border-radius: var(--radius-field); }
.skip:focus { left: 8px; z-index: 100; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.max-w { max-width: 80rem; margin: 0 auto; }

/* ---------- navbar ---------- */

.topbar { background: var(--blue-900); color: #fff; }
.navbar { display: flex; align-items: center; gap: 1rem; min-height: 4rem; padding: .5rem 1rem; }
.navbar .brand { flex: 1; min-width: 0; font-weight: 700; font-size: 1.25rem; color: #fff; padding: 0 .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar .brand:hover { text-decoration: none; }
.navbar .brand small { display: block; font-size: .7rem; font-weight: 400; opacity: .75; line-height: 1; }
.mainnav { display: flex; align-items: center; gap: 1rem; }
.mainnav a {
  display: inline-flex; align-items: center; gap: .4rem; color: #fff; transition: color .2s ease-in-out;
  font-size: .95rem; padding: .25rem 0;
}
.mainnav a:hover { color: var(--blue-300); text-decoration: none; }
.mainnav a[aria-current="page"] { color: var(--blue-300); }
.mainnav a span { display: none; }
/* pod 640px zůstává u Rozvrhu i text, ostatní položky jsou jen ikony */
.mainnav a.nav-rozvrh span { display: inline; }
/* pod 375px se Změny, Historie a Info schovají úplně - zůstávají v nabídce pod hamburgerem */
@media (max-width: 374px) { .mainnav a.nav-zmeny, .mainnav a.nav-historie, .mainnav a.nav-info { display: none; } }
@media (min-width: 640px) { .mainnav a span { display: inline; } }
@media (max-width: 500px) {
  .navbar { gap: .5rem; padding: .5rem .5rem; }
  .navbar .brand { font-size: 1.1rem; }
  .mainnav { gap: .5rem; }
}
.ico { width: 22px; height: 22px; flex: none; vertical-align: -5px; }
.mainnav .ico { width: 20px; height: 20px; }
.mainnav .dropdown > summary .ico { width: 26px; height: 26px; }

/* dropdown (DaisyUI dropdown-end) v čistém HTML: <details> */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; color: #fff; padding: .25rem 0; transition: color .2s ease-in-out; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary:hover { color: var(--blue-300); }
.dropdown[open] > summary { color: var(--blue-300); }
.dropdown .menu {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 40; min-width: 16rem;
  margin: 0; padding: .5rem; list-style: none;
  background: var(--base-100); color: var(--base-content); border-radius: var(--radius-box);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1); border: 1px solid var(--border-soft);
}
.dropdown .menu li a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .75rem; border-radius: var(--radius-field); color: var(--base-content); font-size: .95rem; }
.dropdown .menu li a:hover { background: var(--base-300); text-decoration: none; }
.dropdown .menu li a .badge { font-size: .7rem; }
.dropdown .menu .divider { margin: .25rem 0; }
.dropdown .menu p { margin: .25rem .75rem .5rem; font-size: .8rem; color: var(--gray-500); text-align: center; }

/* ---------- obsah ---------- */

main.page { flex: 1; background: var(--base-100); color: #000; padding: 0 .5rem 1.5rem; }
.wrap { max-width: 80rem; margin: 0 auto; padding: 0 .25rem 1rem; }
.wrap > h1:first-child, .wrap > .title:first-child, .wrap > p:first-child, .wrap > .note:first-child { margin-top: 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 .5rem 1rem; } }
.divider { display: flex; align-items: center; height: 1rem; margin: 1rem auto; max-width: 80rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(31, 31, 43, .1); }

/* filtry (app-filter-buttons) */
.filters { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.filters .terms { display: flex; flex-direction: row; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.selects { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: .5rem; width: 100%; max-width: 48rem; padding: 0 .5rem; }
@media (min-width: 500px) { .selects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; } }
.selects > div { min-width: 0; }
.selects label { display: flex; align-items: center; gap: .35rem; font-size: 1rem; margin-bottom: .2rem; }
.selects label .ico { width: 18px; height: 18px; color: var(--primary); }
.selects form { display: flex; gap: .25rem; align-items: stretch; }
.select {
  flex: 1; min-width: 0; height: 2.5rem; padding: 0 2rem 0 1rem; font: inherit; font-size: .875rem; color: var(--base-content);
  background: var(--base-100); border: 1px solid rgba(31, 31, 43, .2); border-radius: var(--radius-field);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231f1f2b' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 14px;
}
.select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (max-width: 380px) { .select { height: 2rem; font-size: .8rem; } }
.selects .go { padding: 0 .6rem; }
.no-js-only { }

/* tlačítka (DaisyUI btn) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 2.5rem; padding: 0 1rem; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-field); border: 1px solid rgba(31, 31, 43, .2); background: var(--base-200); color: var(--base-content);
  transition: background .2s ease-in-out, color .2s ease-in-out, border-color .2s ease-in-out; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--base-300); }
.btn-primary, .btn-outline.btn-primary[aria-current="page"], .btn-outline.btn-primary.active {
  background: var(--primary); border-color: var(--primary); color: var(--primary-content);
}
.btn-primary:hover { filter: brightness(.92); background: var(--primary); }
.btn-outline.btn-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline.btn-primary:hover { background: var(--primary); color: var(--primary-content); }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8rem; }
@media (max-width: 380px) { .filters .btn { height: 2rem; padding: 0 .75rem; font-size: .8rem; } }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 1rem; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.tabs a, .tabs span { display: inline-flex; align-items: center; height: 2.25rem; padding: 0 .9rem; font-size: .85rem; font-weight: 600; border-radius: var(--radius-field); border: 1px solid var(--primary); color: var(--primary); }
.tabs a:hover { text-decoration: none; background: var(--primary); color: var(--primary-content); }
.tabs a[aria-current="page"], .tabs span[aria-current="page"] { background: var(--primary); color: var(--primary-content); }

/* badge / tag */
.tag, .badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--base-300); color: var(--gray-700); vertical-align: middle; }
.tag.current { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-500-60); }
.tag.warn { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-500-60); }
.tag.bad { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-500-60); }

/* karty / alerty */
.panel { background: var(--base-100); border: 1px solid rgba(31, 31, 43, .08); border-radius: var(--radius-box); padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.panel.error { border-color: var(--red-500-60); background: var(--red-50); }
.note { padding: .75rem 1rem; border-radius: var(--radius-box); border: 1px solid var(--primary); background: var(--primary-15); margin-bottom: 1rem; }
.note.warn { border-color: var(--red-500-60); background: var(--red-50); }
.note.history { border-color: var(--violet-500-60); background: var(--violet-50); }
.note p:last-child { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 .25rem; }
.title h1 { margin: 0; }
.sub { color: var(--gray-500); margin: 0 0 1rem; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* tabulky (DaisyUI table) */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5rem .75rem; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.table th { font-weight: 600; font-size: .8rem; color: var(--gray-500); }
.table tbody tr:nth-child(2n) { background: var(--base-200); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-box); }
dl.props { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: .3rem 1rem; margin: 0; }
dl.props dt { color: var(--gray-500); }
dl.props dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.props { grid-template-columns: 1fr; gap: 0; } dl.props dd { margin-bottom: .5rem; } }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: var(--radius-field); border: 1px solid var(--primary); color: var(--primary); font-size: .85rem; font-weight: 600; }
.chip:hover { background: var(--primary); color: var(--primary-content); text-decoration: none; }
.chip.active { background: var(--primary); color: var(--primary-content); }
.chip small { font-weight: 400; opacity: .8; }
form.filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.filter .select { flex: none; width: auto; min-width: 12rem; }

/* ---------- rozvrh (app-schedule-display) ---------- */

.schedule-wrap { max-width: 80rem; margin: 0 auto; overflow-x: auto; border-radius: var(--radius-box); background: var(--base-100); position: relative; -webkit-overflow-scrolling: touch; }
.schedule-table { margin: 0 auto; width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-box); overflow: hidden; }
.schedule-table thead tr { background: var(--blue-900); }
.schedule-table th { border: 1px solid var(--border-soft); text-align: center; color: #fff; padding: .375rem .25rem; font-weight: 700; }
@media (min-width: 640px) { .schedule-table th { padding: .5rem .25rem; } }
.schedule-table th .time { display: block; font-size: 12px; font-weight: 400; color: #fff; }
.schedule-table th.now { background: var(--primary); }
.schedule-table tbody tr:nth-child(2n) { background: var(--base-200); }
.schedule-table td { padding: 7px 5px; vertical-align: top; }
.schedule-table td.day {
  border: 1px solid var(--border-soft); text-align: center; font-weight: 500; background: var(--blue-900-15);
  position: sticky; left: 0; z-index: 2; min-width: 3.25rem; vertical-align: middle; backdrop-filter: blur(2px);
}
.schedule-table td.day small { display: block; font-size: .7rem; line-height: 17px; font-weight: 400; color: var(--gray-700); }
.schedule-table tr.today td.day { background: var(--primary-15); box-shadow: inset 3px 0 0 var(--primary); }
.schedule-table tr.today td.day .tag { display: inline-block; margin-top: 2px; line-height: 17px; padding: 0 .5rem; }
.schedule-table th.corner { min-width: 3.25rem; position: sticky; left: 0; z-index: 3; background: var(--blue-900); }
.slot { display: flex; flex-direction: column; gap: 6px; min-width: 7rem; padding: 4px 0; }
.slot:empty { min-height: 2.4rem; }

.lesson {
  position: relative; display: block; box-shadow: inset 0 0 0 1px rgba(31, 31, 43, .18); border-radius: .3rem; padding: 7px 11px; min-height: 54px;
  background: var(--base-100); color: var(--base-content); transition: background .2s ease-in-out, box-shadow .2s ease-in-out;
  cursor: pointer; text-align: left;
}
.lesson:hover, .lesson:focus { text-decoration: none; box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-15); }
.lesson .l1 { display: flex; justify-content: space-between; gap: .75rem; font-size: 15px; line-height: 23px; }
.lesson .l1 .abbr { color: var(--primary); font-weight: 700; font-size: 17px; }
.lesson .l1 .right { color: var(--gray-800); }
.lesson .l2 { display: flex; justify-content: space-between; gap: .5rem; font-size: 12.5px; color: var(--gray-800); line-height: 17px; }
.lesson .l2 .grp { color: var(--gray-500); }
.lesson .badge { position: absolute; top: -.5rem; right: -.4rem; padding: 0 .4rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.3rem; background: var(--gray-800); color: #fff; }
.lesson .cycle { position: absolute; top: -.45rem; left: -.3rem; padding: 0 .3rem; border-radius: .2rem; font-size: .6rem; font-weight: 700; background: var(--blue-900); color: #fff; line-height: 1.1rem; }
.lesson.changed, .lesson.substitution, .lesson.room-changed { background: var(--red-50); box-shadow: inset 0 0 0 1px var(--red-500-60); }
.lesson.substitution .badge, .lesson.room-changed .badge, .lesson.changed .badge { background: var(--red-600); }
.lesson.added { background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green-500-60); }
.lesson.added .badge { background: var(--green-700); }
.lesson.removed { background: var(--red-50); box-shadow: inset 0 0 0 1px var(--red-500-60); }
.lesson.removed .abbr { text-decoration: line-through; color: var(--red-600); }
.lesson.removed .l1 .right, .lesson.removed .l2 { color: var(--red-600); }
.lesson.removed .badge { background: var(--red-600); }
.lesson.absent { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(220, 38, 38, .08) 6px 8px); }
/* prázdné místo, aby stejná skupina byla v každé hodině ve stejném řádku */
.lesson-pad { visibility: hidden; cursor: default; }

/* navazující hodiny (dvouhodinovky): přivrácené rohy srovnané + můstek přes mezeru mezi buňkami */
.lesson.chain-next { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lesson.chain-prev { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.lesson.tall { min-height: 71px; }

.lesson.chain-prev::before {
  content: ""; position: absolute; top: 18px; right: 100%; width: 10px; height: 2px;
  background: color-mix(in oklab, var(--primary) 55%, transparent);
}
.lesson.changed.chain-prev::before, .lesson.substitution.chain-prev::before,
.lesson.room-changed.chain-prev::before { background: var(--red-500-60); }
.lesson.added.chain-prev::before { background: var(--green-500-60); }

.lesson .info { display: block; font-size: 11.5px; color: var(--red-600); line-height: 15px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* tooltip při hover/focus (group-hover:opacity-100) */
.lesson .tip {
  position: absolute; left: 50%; bottom: calc(100% + .35rem); transform: translateX(-50%); z-index: 20;
  min-width: 12rem; max-width: 18rem; padding: .35rem .6rem; border-radius: .25rem;
  background: var(--gray-800); color: #fff; font-size: .75rem; line-height: 1.35; text-align: left; white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity .2s ease-in-out;
}
.lesson .tip b { color: #fff; }
.lesson:hover .tip, .lesson:focus .tip { opacity: 1; }
.schedule-table tbody tr:first-child .lesson .tip { bottom: auto; top: calc(100% + .35rem); }

.absence { display: block; border: 1px solid var(--rose-400-60); border-radius: .3rem; padding: 5px 10px; min-height: 54px; background: var(--rose-50); font-size: 13px; line-height: 18px; color: var(--gray-800); }
.absence b { color: var(--red-600); }
.absence small { display: block; font-size: 10.5px; line-height: 14px; color: var(--gray-500); }
.absence.cont { display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 15px; padding: 2px 6px; color: var(--gray-500); text-align: center; }
.absence.cont b { color: var(--red-600); opacity: .8; }
@media (min-width: 1024px) {
  .schedule-table { table-layout: fixed; }
  .schedule-table th.corner, .schedule-table td.day { width: 3.6rem; }
  .slot { min-width: 0; }
  .lesson { padding: 6px 8px; min-height: 52px; }
  .absence { min-height: 52px; }
  .lesson.tall { min-height: 69px; }
  .lesson .l1 { gap: .35rem; }
  .lesson .l1 .abbr { flex: none; white-space: nowrap; }
  .lesson .l1 .right, .lesson .l2 .grp, .lesson .l2 .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
.dayoff { display: block; padding: .5rem .75rem; font-size: .85rem; color: var(--gray-500); }
.skeleton { display: block; height: 2rem; border-radius: .25rem; background: var(--gray-300); }

.schedule-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; max-width: 80rem; margin: 0 auto .5rem; padding: 0 .5rem; }
.schedule-head h1 { margin: 0; font-size: 1.35rem; }
.schedule-head .sub { margin: 0; }
.schedule-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; max-width: 80rem; margin: .75rem auto 0; padding: 0 .5rem; font-size: .8rem; color: var(--gray-500); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .78rem; color: var(--gray-700); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -2px; border: 1px solid rgba(31, 31, 43, .2); background: #fff; }
.legend .l-chg::before { background: var(--red-50); border-color: var(--red-500-60); }
.legend .l-add::before { background: var(--green-50); border-color: var(--green-500-60); }
.legend .l-abs::before { background: var(--rose-50); border-color: var(--rose-400-60); }
.legend .l-now::before { background: var(--primary); border-color: var(--primary); }
.legend .l-plain::before { display: none; }
.legend .l-sub::before, .legend .l-room::before, .legend .l-rem::before { background: var(--red-50); border-color: var(--red-500-60); }
.empty-hint { text-align: center; color: var(--gray-500); padding: 1rem; }

.ptime { display: none; }
.free { display: none; }
.seo-intro { max-width: 80rem; margin: 1.5rem auto 0; padding: 1rem 1.1rem; border: 1px solid rgba(31, 31, 43, .08); border-radius: var(--radius-box); background: var(--base-200); }
.seo-intro h2 { font-size: 1.1rem; }
.seo-intro p { color: var(--gray-700); }
.seo-links { columns: 3; column-gap: 1rem; list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.seo-links li { padding: .1rem 0; break-inside: avoid; }
@media (min-width: 640px) { .seo-links { columns: 4; } }
@media (min-width: 900px) { .seo-links { columns: 6; } }
.pwa-status { margin: 0 0 .75rem; padding-left: 1.2rem; font-size: .9rem; }
.pwa-status li { margin: .15rem 0; }

/* mobil: místo široké tabulky přehled po dnech (hodina | dlaždice) */
@media (max-width: 759px) {
  .schedule-wrap { overflow: visible; border-radius: 0; }
  .schedule-wrap.no-selection .schedule-table { display: none; }
  .schedule-table, .schedule-table tbody, .schedule-table tr, .schedule-table td { display: block; width: 100%; }
  .schedule-table thead { display: none; }
  .schedule-table { border: 0; border-radius: 0; overflow: visible; }
  .schedule-table tbody tr { margin-bottom: .75rem; border: 1px solid rgba(31, 31, 43, .12); border-radius: var(--radius-box); overflow: hidden; background: var(--base-100); }
  .schedule-table tbody tr:nth-child(2n) { background: var(--base-100); }
  .schedule-table td.day {
    display: flex; align-items: baseline; gap: .5rem; position: static; text-align: left; min-width: 0;
    padding: .5rem .75rem; font-weight: 700; font-size: 1.05rem; background: var(--blue-900-15); border: 0; backdrop-filter: none;
  }
  .schedule-table td.day small { display: inline; font-size: .85rem; font-weight: 400; }
  .schedule-table tr.today td.day { box-shadow: inset 4px 0 0 var(--primary); background: var(--primary-15); }
  .schedule-table tr.today td.day .tag { margin: 0 0 0 auto; }
  .schedule-table td.period { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: .5rem; padding: 6px 10px 6px 8px; box-shadow: inset 0 1px 0 var(--border-soft); }
  .schedule-table td.period.empty, .schedule-table td.period.cont-only { display: none; }
  .schedule-table td.period.gap { display: grid; }
  .free { display: flex; align-items: center; justify-content: center; min-height: 54px; border: 1px dashed rgba(31, 31, 43, .25); border-radius: .3rem; color: var(--gray-500); font-size: .85rem; background: var(--base-200); }
  .schedule-table td[colspan]:not(.period) { padding: .5rem .75rem; border-top: 1px solid var(--border-soft); }
  .ptime { display: flex; flex-direction: column; justify-content: center; font-size: .72rem; color: var(--gray-500); line-height: 15px; }
  .ptime b { font-size: 1.15rem; color: var(--base-content); line-height: 22px; }
  /* skupiny vedle sebe: každá skupina má svůj sloupec, takže navazující hodiny jdou svisle pod sebou */
  .slot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); min-width: 0; padding: 0; }
  .lesson .tip { display: none; }
  .lesson.chain-next { border-radius: .3rem .3rem 0 0; }
  .lesson.chain-prev { border-radius: 0 0 .3rem .3rem; }
  .lesson.chain-prev.chain-next { border-radius: 0; }
  .lesson.chain-prev::before { right: auto; left: 18px; bottom: 100%; top: auto; width: 2px; height: 12px; }
  .lesson.tall { min-height: 54px; }
  .lesson .info { white-space: normal; max-width: none; }
  .schedule-head { padding: 0; }
  .schedule-foot { padding: 0; }
}

/* ---------- změny ---------- */

.chg-day { margin-bottom: 1.25rem; }
.chg-day h2 { display: flex; align-items: baseline; gap: .5rem; font-size: 1.1rem; }
.chg-day h2 time { color: var(--gray-500); font-weight: 400; font-size: .95rem; }
.chg-list { display: grid; gap: .35rem; }
@media (min-width: 900px) { .chg-list { grid-template-columns: 1fr 1fr; } }
.chg-item { display: grid; grid-template-columns: 4.5rem 1fr; gap: .1rem .75rem; align-items: start; padding: .4rem .75rem; border: 1px solid rgba(31, 31, 43, .15); border-left-width: 4px; border-radius: .25rem; background: var(--base-100); color: var(--base-content); font-size: .9rem; }
.chg-item:hover { text-decoration: none; border-color: var(--primary); }
.chg-item .when { font-weight: 700; line-height: 1.2; }
.chg-item .when small { display: block; font-weight: 400; font-size: .72rem; color: var(--gray-500); }
.chg-item .what b { color: var(--primary); }
.chg-item .what .cls { font-weight: 600; margin-right: .4rem; }
.chg-item .what .desc { display: block; font-size: .8rem; color: var(--gray-700); }
.chg-item.substitution, .chg-item.room-changed, .chg-item.changed, .chg-item.removed { border-left-color: var(--red-500-60); background: var(--red-50); }
.chg-item.removed .what b { text-decoration: line-through; color: var(--red-600); }
.chg-item.added { border-left-color: var(--green-500-60); background: var(--green-50); }
.chg-item.absence { border-left-color: var(--rose-400-60); background: var(--rose-50); }
.chg-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 1rem; }

/* ---------- historie ---------- */

.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.ver { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; align-items: center; padding: .5rem .75rem; border: 1px solid rgba(31, 31, 43, .12); border-radius: .25rem; background: var(--base-100); }
.ver.current { border-color: var(--green-500-60); background: var(--green-50); }
.ver .when { font-weight: 700; }
.ver .meta { grid-column: 1; font-size: .8rem; color: var(--gray-500); }
.ver .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .ver { grid-template-columns: 1fr; } .ver .acts { grid-column: 1; grid-row: auto; justify-content: flex-start; } }
.diff { display: grid; gap: 1rem; }
@media (min-width: 900px) { .diff { grid-template-columns: repeat(3, 1fr); } }
.diff section { border: 1px solid rgba(31, 31, 43, .1); border-radius: var(--radius-box); padding: .75rem 1rem; background: var(--base-200); }
.diff h3 { display: flex; align-items: center; gap: .5rem; }
.diff ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.diff li { padding: .4rem .6rem; border-radius: .25rem; border-left: 4px solid var(--gray-300); background: var(--base-100); font-size: .9rem; }
.diff-add li { border-left-color: var(--green-500-60); }
.diff-del li { border-left-color: var(--red-500-60); }
.diff-mod li { border-left-color: var(--amber-500-60); }
.diff li b { color: var(--primary); margin-right: .3rem; }
.diff li .arrow { color: var(--gray-500); margin: 0 .3rem; }

/* ---------- detail hodiny ---------- */

.lesson-hero { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: center; padding: 1rem; border: 1px solid rgba(31, 31, 43, .12); border-left: 6px solid var(--primary); border-radius: var(--radius-box); background: var(--base-200); margin-bottom: 1rem; }
.lesson-hero .abbr { grid-row: 1 / span 2; font-size: 2.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.lesson-hero h1 { margin: 0; font-size: 1.3rem; }
.lesson-hero .meta { color: var(--gray-500); font-size: .9rem; }
.lesson-hero.substitution, .lesson-hero.room-changed, .lesson-hero.changed, .lesson-hero.removed { border-left-color: var(--red-600); background: var(--red-50); }
.lesson-hero.removed .abbr { text-decoration: line-through; color: var(--red-600); }
.lesson-hero.added { border-left-color: var(--green-700); background: var(--green-50); }
.raw td:first-child { color: var(--gray-500); white-space: nowrap; }
.raw td { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(31, 31, 43, .2); vertical-align: -2px; margin-right: .3rem; }

/* ---------- info ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { padding: .6rem .9rem; background: var(--base-200); border: 1px solid rgba(31, 31, 43, .1); border-radius: var(--radius-box); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--primary); }
.stat span { font-size: .8rem; color: var(--gray-500); }
.status-ok { color: var(--green-700); font-weight: 600; } .status-partial { color: var(--amber-700); font-weight: 600; } .status-failed, .status-running { color: var(--red-600); font-weight: 600; }
details.section { border: 1px solid rgba(31, 31, 43, .1); border-radius: var(--radius-box); background: var(--base-100); margin-bottom: .75rem; }
details.section summary { padding: .75rem 1rem; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
details.section summary::-webkit-details-marker { display: none; }
details.section summary .tag { margin-left: auto; }
details.section summary::after { content: "+"; font-size: 1.3rem; color: var(--gray-500); line-height: 1; }
details.section[open] summary::after { content: "–"; }
details.section .body { padding: 0 1rem 1rem; }
.list-cols { columns: 2; column-gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.list-cols li { break-inside: avoid; padding: .25rem 0; border-bottom: 1px dashed var(--border-soft); }
@media (min-width: 760px) { .list-cols { columns: 3; } }

/* ---------- patička (app-footer) ---------- */

.foot { background: var(--blue-900); color: #fff; margin-top: auto; }
.foot .inner { max-width: 80rem; margin: 0 auto; padding: 1rem; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; text-align: center; font-size: .95rem; }
.foot svg { width: 36px; height: 36px; fill: currentColor; flex: none; }
.foot a { color: #fff; font-weight: 700; position: relative; transition: color .2s ease-in-out; }
.foot a:hover { color: var(--blue-400); text-decoration: none; }
.foot a .tip { position: absolute; left: 50%; top: -2rem; transform: translateX(-50%); background: var(--gray-800); color: #fff; font-size: .75rem; font-weight: 400; padding: .25rem .5rem; border-radius: .25rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s ease-in-out; }
.foot a:hover .tip, .foot a:focus .tip { opacity: 1; }
@media (max-width: 759px) { .foot a .tip { display: none; } }
.foot .links { width: 100%; font-size: .8rem; opacity: .8; }
.foot .links a { font-weight: 400; margin: 0 .4rem; }

/* ---------- instalace (nová funkce) ---------- */

.install {
  position: fixed; left: .5rem; right: .5rem; bottom: .75rem; z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start;
  padding: .8rem .9rem; border-radius: var(--radius-box);
  background: var(--blue-900); color: #fff; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
  font-size: .9rem; line-height: 1.35;
}
.install-icon .ico { width: 26px; height: 26px; color: var(--blue-300); }
.install-text { display: grid; gap: .25rem; }
.install-text strong { font-weight: 700; }
.install-text span { opacity: .9; }
.install-text .ico { width: 16px; height: 16px; vertical-align: -3px; }
.install-text .btn { justify-self: start; margin-top: .3rem; }
.install-close { color: #fff; font-size: 1.5rem; line-height: 1; opacity: .75; padding: 0 .2rem; }
.install-close:hover { opacity: 1; text-decoration: none; }
@media (min-width: 760px) { .install { left: auto; right: 1.25rem; bottom: 1.25rem; max-width: 420px; } }
@media (display-mode: standalone), (display-mode: fullscreen) { .install { display: none !important; } }

/* ---------- souhlas s cookies ---------- */

.cookiebar {
  position: fixed; left: .5rem; right: .5rem; bottom: .75rem; z-index: 35;
  display: grid; gap: .75rem;
  padding: .9rem 1rem; border-radius: var(--radius-box);
  background: var(--base-100); color: var(--base-content);
  border: 1px solid rgba(31, 31, 43, .12);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35);
  font-size: .88rem; line-height: 1.4;
}
.cookiebar-text { display: grid; gap: .25rem; }
.cookiebar-text strong { font-weight: 700; }
.cookiebar-text span { color: var(--gray-700); }
.cookiebar-acts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.cookiebar-acts .btn { flex: 1 1 auto; }
@media (min-width: 760px) {
  .cookiebar { left: auto; right: 1.25rem; bottom: 1.25rem; max-width: 30rem; }
  .cookiebar-acts { justify-content: flex-end; }
  .cookiebar-acts .btn { flex: 0 0 auto; }
}

/* stav souhlasu na stránce Cookies a soukromí */
.consent-state { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .75rem; }
.consent-acts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }

/* profesionální režim – přepínač v Info */
.pro-gate { margin: 0 0 1rem; padding: .9rem 1rem 1rem; border: 2px dashed var(--gray-300); border-radius: var(--radius-box); background: var(--base-200); }
.pro-gate.on { border-style: solid; border-color: var(--primary); background: var(--primary-15); }
.pro-gate h2 { margin: 0 0 .15rem; font-size: 1rem; }
.pro-gate p { margin: 0 0 .7rem; max-width: 56ch; font-size: .85rem; color: var(--gray-500); }
.pro-gate form { margin: 0; }
.pro-arrow { flex: none; width: 3.4rem; height: 2.1rem; color: var(--primary); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pro-arrow.away { color: var(--gray-500); }

/* dialog pro stažení PDF */
.pdf-dialog { width: min(60rem, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: var(--radius-box); background: var(--base-100); color: var(--base-content); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.pdf-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border-soft); }
.pdf-head h2 { margin: 0; font-size: 1.05rem; }
.pdf-body { display: grid; gap: 1rem; padding: 1rem; }
@media (min-width: 760px) { .pdf-body { grid-template-columns: 15rem minmax(0, 1fr); } }
.pdf-opts { display: flex; flex-direction: column; gap: .75rem; margin: 0; }
.pdf-opts fieldset { margin: 0; padding: 0; border: 0; }
.pdf-opts legend { padding: 0 0 .25rem; font-size: .78rem; font-weight: 700; color: var(--gray-500); }
.pdf-opts label { display: flex; align-items: center; gap: .4rem; font-size: .88rem; padding: .1rem 0; cursor: pointer; }
.pdf-preview { display: flex; flex-direction: column; gap: .5rem; min-height: 18rem; }
.pdf-preview iframe { width: 100%; height: 100%; min-height: 24rem; border: 1px solid var(--border-soft); border-radius: var(--radius-field); background: var(--base-200); }
/* náhled vykreslený knihovnou pdf.js tam, kde prohlížeč PDF v rámu nezobrazí */
.pdf-preview canvas { display: block; width: 100%; height: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-field); background: #fff; }
.pdf-preview canvas[hidden] { display: none; }
.pdf-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--border-soft); background: var(--base-200); }
@media (max-width: 759px) { .pdf-preview iframe { min-height: 14rem; } }
