/* I ❤ FEI STU – neoficiálny študentský rozcestník. Dark first, light via [data-theme="light"]. */
/* Bricolage Grotesque (SIL OFL, fonts/OFL.txt), self-hosted so no visitor data goes to Google */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/bricolage-grotesque-latin-ext-opsz.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/bricolage-grotesque-latin-opsz.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #0c170b; --surface: #111f10; --surface-2: #172a15; --line: #b6f06a24; --line-strong: #b6f06a5c;
  --fg: #f3f6ec; --muted: #a9bc9b; --faint: #7d9271; --accent: #b6f06a; --accent-ink: #0c170b;
  --heart: #ff4d6d; --todo: #ffcf4a;
  --glow-a: #2f6b2277; --glow-b: #b6f06a22; --shadow: 0 1px 0 #ffffff08 inset, 0 12px 32px #0006;
  --av: min(52vw, 36vh, 280px);
  --radius: 16px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7ee; --surface: #ffffff; --surface-2: #eaf1df; --line: #2f6b2224; --line-strong: #2f6b2266;
  --fg: #14210f; --muted: #4a5e40; --faint: #5d7054;  /* ≥ 4.5:1 on every light surface (axe) */ --accent: #3b7a10; --accent-ink: #ffffff;
  --heart: #e0254a; --todo: #906300;  /* ≥ 4.5:1 on every light surface */
  --glow-a: #b6f06a55; --glow-b: #2f6b2218; --shadow: 0 1px 2px #14210f14, 0 10px 28px #14210f12;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }  /* .pill etc. set display, which would beat the hidden attribute */
html { scroll-behavior: smooth; }
body {
  min-height: 100dvh; overflow-x: hidden;
  background:
    radial-gradient(60vmax 60vmax at 12% 0%, var(--glow-a), transparent 60%),
    radial-gradient(50vmax 50vmax at 95% 40%, var(--glow-b), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg); font: 1rem/1.5 "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: .6rem 1rem; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 16px; }
.wrap { width: min(100% - 32px, 1080px); margin-inline: auto; }

/* --- top bar --- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; flex: none; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--accent); background: #f6fbe9; }
.brand svg { width: .85em; height: .85em; color: var(--heart); vertical-align: -.08em; }
.actions { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 999px; font-size: .85rem; text-decoration: none;
  color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .2s, background .2s;
}
.pill:hover, .pill:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.pill b { color: var(--accent); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
:root[data-theme="light"] .i-sun, :root:not([data-theme="light"]) .i-moon { display: none; }
@media (max-width: 560px) { .pill .long { display: none; } }

/* --- hero: the cat is the "assistant", greeting + search + section chips under it --- */
.hero { position: relative; z-index: 1; padding: 40px 0 28px; text-align: center; cursor: pointer; user-select: none; }
.hero-cat { position: relative; z-index: 0; }  /* full width: phones put the quick links in a grid under the cat; z-index 0 keeps the arc links (z-index -1) clickable above this empty box */
.avatar { position: relative; width: var(--av); aspect-ratio: 1; margin: 0 auto; will-change: transform; animation: bob 3s ease-in-out infinite alternate; }
.avatar img {
  width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover;
  background: radial-gradient(circle at 50% 40%, #f6fbe9, #cfe3b0);
  border: 6px solid var(--bg); box-shadow: 0 0 0 4px var(--accent), 0 0 60px 10px #b6f06a44, 0 30px 60px #0006;
}
.badge {
  position: absolute; right: 6%; bottom: 6%; width: 22%; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 50%; background: var(--heart); border: 5px solid var(--bg); box-shadow: 0 6px 20px #ff4d6d66;
}
.badge svg { width: 55%; height: 55%; color: #fff; animation: beat 1.2s infinite; }
.hero h1 {
  margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .18em;
  font-size: clamp(2.4rem, 9vw, 5.2rem); font-weight: 800; line-height: .95; letter-spacing: -.04em;
}
.heart { width: .9em; height: .9em; color: var(--heart); filter: drop-shadow(0 0 .25em #ff4d6d99); animation: beat 1.2s infinite; }
.stu { background: linear-gradient(90deg, var(--fg), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.greet { margin-top: 1rem; font-size: clamp(1.1rem, 2.6vw, 1.35rem); font-weight: 800; }
.lead { margin: .35rem auto 0; max-width: 46ch; color: var(--muted); }
.hint { display: block; margin-top: .9rem; color: var(--faint); font-size: .8rem; }

.search {
  position: relative; display: flex; align-items: center; gap: 10px; width: min(100%, 640px); margin: 1.4rem auto 0; padding: 0 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); cursor: text;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px #b6f06a22, var(--shadow); }
.search svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 1.05rem; }
.search input::placeholder { color: var(--faint); }
.search kbd { padding: .1rem .45rem; border: 1px solid var(--line-strong); border-radius: 6px; font: .8rem ui-monospace, Consolas, monospace; color: var(--muted); }
@media (hover: none) { .search kbd { display: none; } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 1rem auto 0; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .85rem .4rem .4rem; border-radius: 999px; font: inherit; font-size: .9rem;
  color: var(--fg); text-decoration: none; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, transform .2s;
}
.chip:hover, .chip:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* quick links (from the original page): grid under the hero on phones, an arc around the cat on wide screens */
.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 420px; margin: 1.4rem auto 0; text-align: left; }
.links a {
  display: grid; padding: .55rem .8rem; border-radius: 14px; color: var(--fg); text-decoration: none; text-align: var(--align, left);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s;
  --enter: link-in; will-change: transform;
  animation: var(--enter) .7s calc(var(--i) * 70ms + .25s) cubic-bezier(.2, .8, .2, 1) both, bob 3s calc(var(--i) * -.75s) ease-in-out infinite alternate;
}
.links a:hover, .links a:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.links b { font-size: .95rem; }
.links span { color: var(--muted); font-size: .75rem; }
@media (min-width: 960px) {
  .links { position: absolute; z-index: -1; top: 0; left: 50%; width: 0; height: var(--av); margin: 0; display: block; }
  .links a {
    position: absolute; width: 210px; left: calc(var(--s) * (var(--av) / 2 + var(--dx))); top: calc(50% + var(--dy)); translate: -50% -50%;
    --enter: link-out; line-height: 1.25; min-width: max-content;  /* one line each; EN "Pedagogical Department" grows its bubble instead of wrapping */
  }
  .links a:nth-child(-n + 4) { --s: -1; --align: right; }
  .links a:nth-child(n + 5) { --s: 1; }
  /* the arc shrinks with the cat on short laptop screens (it ran into the title); at --av 280px this is the old ±117 / ±39 px.
     The px part keeps neighbours apart while they bob out of step */
  .links a:nth-child(4n + 1) { --dy: calc(var(--av) * -.3 - 33px); --dx: 110px; }
  .links a:nth-child(4n + 2) { --dy: calc(var(--av) * -.1 - 11px); --dx: 140px; }
  .links a:nth-child(4n + 3) { --dy: calc(var(--av) * .1 + 11px); --dx: 140px; }
  .links a:nth-child(4n) { --dy: calc(var(--av) * .3 + 33px); --dx: 110px; }
}

/* --- shared blocks --- */
.block { position: relative; z-index: 1; padding: 28px 0; }
.block > h2, .view h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); letter-spacing: -.02em; line-height: 1.15; }
.block > .sub { margin-top: .3rem; color: var(--muted); }
.meta { color: var(--faint); font-size: .85rem; }

/* search results, laid out like a command palette right under the search box */
#vysledky { margin-top: 12px; text-align: left; cursor: auto; user-select: text; }
.results { width: min(100%, 760px); margin: 0 auto; padding: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.tab { flex: none; padding: .35rem .75rem; border-radius: 8px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tab span { color: var(--faint); }  /* the space before it is in the markup, so the count isn't glued to the name for screen readers */
.result-list { display: grid; gap: 10px; padding: 12px; }
.result-list > .chip { justify-self: center; }  /* "Zobraziť všetky (N)" */
.empty { display: grid; justify-items: center; gap: 10px; padding: 28px 16px; color: var(--muted); text-align: center; }
.empty img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--line-strong); }

/* resource card */
.res { position: relative; min-width: 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
/* the whole card opens the link; the steps toggle and flags stay clickable on top of it */
.res h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.res details, .res .flag { position: relative; z-index: 1; }
.res:hover { border-color: var(--line-strong); }
.crumb { margin: 0 0 .25rem; color: var(--faint); font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
mark { padding: 0 .1em; border-radius: 3px; background: #b6f06a40; color: var(--fg); }  /* main text colour: muted text fell under 4.5:1 on the highlight */
:root[data-theme="light"] mark { background: #b6f06a99; }
.result-list .res { background: var(--bg); }
.res-key { border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--accent); }
.res h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 1.02rem; line-height: 1.3; }
.res h3 a { text-decoration: none; }
.res h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.nw { white-space: nowrap; }  /* the last word and the ↗ arrow wrap together */
.ext { width: .8em; height: .8em; margin-left: .2em; color: var(--faint); vertical-align: .05em; }  /* every external link, cards and inline text alike */
:where(.res) p { margin-top: .3rem; color: var(--muted); font-size: .93rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .6rem; padding: 0; list-style: none; }
.tags li { padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; color: var(--muted); background: var(--surface-2); }
.flag { padding: .05rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.flag-key { background: var(--accent); color: var(--accent-ink); }
.flag-todo { color: var(--todo); box-shadow: inset 0 0 0 1px currentColor; }
details { margin-top: .6rem; }
summary { cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 800; }
details ol { margin-top: .5rem; padding-left: 1.3rem; color: var(--fg); font-size: .92rem; overflow-wrap: anywhere; }  /* long URLs in steps wrap instead of widening the whole grid column */
details ol li + li { margin-top: .25rem; }
/* steps toggle: a finger-sized strip (~42 px) instead of a 21 px line inside the card link (a near miss opened the site) */
.res details { margin-top: 0; }
.res summary { margin-inline: -6px; padding: .6rem 6px .7rem; }  /* the 6px sides only make room for the focus ring */
.res summary:focus-visible { outline-offset: -3px; }
.res details ol { margin-top: 0; }

/* top 5 */
.top5 { display: grid; gap: 12px; margin-top: 16px; padding: 0; list-style: none; counter-reset: top; }
@media (min-width: 760px) { .top5 { grid-template-columns: repeat(2, 1fr); } .top5 li:first-child { grid-row: span 2; } }
.top5 li { counter-increment: top; }
.top5 a { position: relative; display: block; height: 100%; padding: 18px 18px 18px 64px; border-radius: var(--radius); text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.top5 a:hover, .top5 a:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.top5 a::before { content: counter(top, decimal-leading-zero); position: absolute; left: 18px; top: 16px; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.top5 b { display: block; font-size: 1.05rem; }
.top5 span { display: block; margin-top: .25rem; color: var(--muted); font-size: .93rem; }
.top5 li:first-child a { padding-right: 104px; padding-top: 64px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.top5 li:first-child img { position: absolute; right: 16px; top: 16px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--accent); }

/* section tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; margin-top: 16px; }
.tile { display: grid; grid-template-columns: 56px 1fr; gap: 4px 14px; align-items: start; padding: 16px; border-radius: var(--radius); text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.tile img { grid-row: span 3; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line-strong); }
.tile b { font-size: 1.08rem; line-height: 1.25; }
:where(.tile) span { color: var(--muted); font-size: .92rem; }

/* section / subject pages */
.view { position: relative; z-index: 1; padding: 28px 0 40px; }
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); text-decoration: none; font-size: .92rem; }
.back:hover { color: var(--fg); }
.view-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin: 18px 0 8px; }
.view-head img { grid-row: span 3; width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--accent); }
.view-head h1:focus { outline: none; }  /* focused only so screen readers announce the new page */
.view-head h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.05; letter-spacing: -.03em; }
.view-head p { color: var(--muted); }
.view section { margin-top: 30px; }
:where(.view section) > p { margin-top: .3rem; color: var(--muted); }
.grid { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.faq details { margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.faq summary { color: var(--fg); font-size: 1rem; padding-left: 1.06em; text-indent: -1.06em; }  /* hanging indent: wrapped lines start under the text, not the ▶ */
.faq details p { margin-top: .5rem; color: var(--muted); }
.note { margin-top: 14px; padding: 12px 16px; border-radius: 14px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); font-size: .93rem; }

/* footer */
.footer { position: relative; z-index: 1; margin-top: 32px; padding: 28px 0 72px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; text-align: center; }
.footer strong { color: var(--fg); }
.footer p + p { margin-top: .4rem; }
.footer .pill { margin-top: .8rem; }
/* consent bar for Google Analytics (only when NASTAVENIA.googleAnalytics is set) */
.suhlas { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); color: var(--fg); font-size: .9rem; text-align: center; }
.suhlas:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }  /* one row when it fits */
.suhlas .pill { cursor: pointer; font: inherit; font-weight: 800; }
.footer .navstevy { margin-top: 1rem; font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .8; }

/* hearts on click + fireflies */
.float { position: fixed; z-index: 60; pointer-events: none; opacity: 0; animation: rise linear forwards; }
.float.fly { z-index: 0; }
svg.float { color: var(--heart); }
.fly { border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 3px #b6f06aaa; }
:root[data-theme="light"] .fly { box-shadow: 0 0 8px 2px #3b7a1055; }

@keyframes link-in { from { opacity: 0; translate: 0 12px; } }
@keyframes link-out { from { opacity: 0; scale: .4; translate: calc(-50% - var(--s) * (var(--av) / 2 + var(--dx))) calc(-50% - var(--dy)); } }
/* floating: transform-only so the GPU moves it smoothly; the links share one rhythm, each a beat behind the previous.
   The .2deg tilt (0.7px across a link, invisible) stops Firefox snapping the slow drift to whole pixels; it ignores
   anything under ~.1deg and keeps stepping (measured on the link text: 16 positions without, 147 with) */
@keyframes bob { from { transform: translateY(-5px) rotate(.2deg); } to { transform: translateY(5px) rotate(.2deg); } }
@keyframes beat { 0%, 45%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 25% { transform: scale(1.05); } 32% { transform: scale(1.14); } }
@keyframes rise { 10% { opacity: .8; } 60% { opacity: .5; } to { transform: translate(var(--dx), -115vh) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .avatar, .heart, .badge svg, .links a { animation: none; }
  .float { display: none; }
}
.bez-pohybu .avatar, .bez-pohybu .heart, .bez-pohybu .badge svg, .bez-pohybu .links a, .bez-pohybu .xmas-btn b, .bez-pohybu #xmas[open], .bez-pohybu #xmas::backdrop { animation: none; }  /* "Obmedziť pohyb" in the footer */
.bez-pohybu .float { display: none; }

/* --- Christmas popup (js/vianoce.js) --- */
.xmas-btn {
  align-self: center;  /* the phone hero is a flex column: don't stretch */
  margin-top: 1.6rem; padding: .6rem .9rem; border: 1px solid #b6f06a55; border-radius: 4px; background: none; cursor: pointer;
  font: .95rem ui-monospace, Consolas, Menlo, monospace; color: var(--accent); transition: background .2s, border-color .2s;
}
.xmas-btn:hover, .xmas-btn:focus-visible { border-color: var(--accent); background: #b6f06a14; }
.xmas-btn i { font-style: normal; color: var(--muted); }
.xmas-btn b { font-weight: inherit; animation: blink 1.1s steps(1) infinite; }
#xmas {
  width: min(100% - 32px, 460px); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; cursor: auto;
  --muted: #a9bc9b; --fg: #f3f6ec; --accent: #b6f06a;  /* always dark: dark-theme colours in the light theme too */
  color: var(--muted); background: #05080f; border: 1px solid #2a372a; border-radius: 6px;
  font: .8rem/1.4 ui-monospace, Consolas, Menlo, monospace;
}
#xmas[open] { animation: up .35s cubic-bezier(.2, .8, .2, 1); }
#xmas::backdrop { background: #000c; animation: fade .35s; }
#xmas header { display: flex; justify-content: space-between; align-items: center; padding-left: 12px; border-bottom: 1px solid #1b241b; }
#xmas header button { width: 40px; height: 36px; border: 0; font: inherit; font-size: 1.1rem; color: inherit; background: none; cursor: pointer; }
#xmas header button:hover, #xmas header button:focus-visible { color: var(--fg); outline-offset: -2px; }  /* inside: overflow:hidden clips a ring drawn outside */
#xmas canvas { display: block; width: 100%; height: auto; max-height: calc(100dvh - 110px); object-fit: contain; }
#xmas p { margin: 0; padding: 8px 12px; font-size: inherit; letter-spacing: 0; text-align: center; border-top: 1px solid #1b241b; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #xmas[open], #xmas::backdrop, .xmas-btn b { animation: none; } }

/* subject page: names per study programme */
.table { margin-top: 14px; overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 800; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table td:nth-child(2), .kod { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
@media (max-width: 600px) {  /* rows become small cards: name · code · semester, programmes underneath */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* hidden visually, still read as headers */
  .table tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: inline; padding: 0; border: 0; }
  .table td:first-child { font-weight: 800; }
  .table td:nth-child(2)::before, .table td:nth-child(3)::before { content: " · "; content: " · " / ""; font-family: inherit; }
  .table td:last-child { display: block; margin-top: 4px; color: var(--muted); }
}

/* --- phase 2: filters, programme tiles, events, tips --- */
.filters { width: min(100%, 640px); margin: 10px auto 0; text-align: left; cursor: auto; user-select: text; }
.filters summary { display: inline-flex; gap: .3rem; padding: .3rem .2rem; color: var(--muted); font-size: .9rem; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before { content: "▸"; content: "▸" / ""; transition: transform .2s; }  /* "/ \"\"" = decorative, not read aloud */
.filters[open] summary::before { transform: rotate(90deg); }
.filters summary span { color: var(--accent); }
.filters-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.f-program { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.f-program select { width: 100%; min-width: 0; height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: inherit; font-size: 1rem; }  /* ≥ 16px, or iPhone Safari zooms in on tap */
.tag-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-toggle { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; }
.tag-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (forced-colors: active) {  /* Windows contrast themes drop backgrounds and shadows: the pressed tab / tag gets the system highlight */
  .tab[aria-pressed="true"], .tag-toggle[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; box-shadow: none; outline-color: Highlight; }
  .tab[aria-pressed="true"] span { color: inherit; }
  .search:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }  /* the border/glow focus cue is dropped in contrast themes */
  mark { background: Mark; }  /* the translucent green highlight turned dark on dark */
}
#pohyb[aria-pressed="true"]::before { content: "✓ "; content: "✓ " / ""; }  /* sighted users see it is on; screen readers hear "pressed" */
.link-btn { justify-self: start; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chip-more { padding-left: .85rem; color: var(--muted); border-style: dashed; }
.tile-plain { grid-template-columns: 1fr; }
.when { color: var(--accent); font-size: .85rem; font-weight: 800; }
.tips { display: grid; gap: 8px; margin-top: 14px; padding: 0; list-style: none; }
.tips li { position: relative; padding: 12px 16px 12px 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.tips li::before { content: "✓"; content: "✓" / ""; position: absolute; left: 16px; top: 11px; color: var(--accent); font-weight: 800; }

/* --- phase 3: language button, in-page jumps --- */
.lang-btn { font: 800 .8rem/1 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: .04em; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.jump button { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.jump button:hover, .jump button:focus-visible { border-color: var(--accent); color: var(--fg); }
main * { scroll-margin-top: 76px; }  /* anything focused or jumped to in the content stops below the 61 px sticky top bar */

/* --- UX pass: back to top, phone hero order --- */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow);
}
.to-top:hover, .to-top:focus-visible { border-color: var(--accent); }
@media (max-width: 959px) {  /* phones: search right under the cat, the quick links after the section chips */
  .hero { display: flex; flex-direction: column; padding-top: 24px; }
  .hero-cat { display: contents; }
  .hero .links { order: 1; overflow-anchor: none; }  /* first in the DOM but shown last: as the scroll anchor, results or Filtre opening above made the page jump */
  .hero .hint { order: 2; }
}
@media (max-width: 420px) {  /* narrow phones: the cat alone is the home link (its text stays for screen readers) */
  .brand > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .actions { gap: 6px; }
}
@media (max-width: 340px) { .topbar .wrap { gap: 6px; } .actions .pill { padding-inline: .6rem; } }
@media (max-width: 310px) { .actions .pill { display: none; } }  /* no room; the footer keeps the official link */
.brand span { white-space: nowrap; }

/* --- review fixes --- */
.grid.faq { align-items: start; }  /* opening one answer mustn't stretch its neighbour */
.tile, .links a { align-content: start; }  /* a card stretched to its taller neighbour keeps title and text together */
h1, h2, .greet, .tile b, .top5 b { text-wrap: balance; }  /* no lone word on the last line (older browsers ignore it) */
.faq summary { text-wrap: pretty; }
@media (max-width: 959px) { .hero .links a { animation-delay: calc(var(--i) * 70ms + .25s), 0s; } }  /* a grid bobs in step, so the gaps stay even */
@media (max-width: 560px) { .top5 li:first-child a { padding: 100px 18px 18px 64px; } }  /* the kitten sits above the text instead of beside it */

/* footer: legal information */
.legal { max-width: 680px; margin: 1rem auto 0; text-align: left; }
.legal summary { text-align: center; color: var(--muted); font-size: .88rem; }
.legal p { margin-top: .6rem; font-size: .85rem; line-height: 1.55; }

/* --- printing / Save as PDF: black on white, no buttons; closed FAQ answers and steps print, card titles get their address --- */
@media print {
  :root, :root[data-theme] { --bg: #fff; --surface: #fff; --surface-2: #fff; --fg: #000; --muted: #333; --faint: #555; --accent: #1f5c0a; --line: #bbb; --line-strong: #888; --todo: #9a6a00; --shadow: none; color-scheme: light; }
  body { background: #fff; }
  .topbar, .skip, .float, .to-top, .badge, .hero .links, .search, .filters, .chips, .hint, .xmas-btn, .jump, .back, #pohyb, .suhlas, #suhlas-zmenit { display: none !important; }
  .stu { background: none; color: inherit; }
  .flag-key { background: none; color: inherit; box-shadow: inset 0 0 0 1px; }
  details:not(.legal)::details-content { content-visibility: visible; }  /* browsers without ::details-content just print them closed */
  .res h3 a::after { content: " " attr(href); position: static; font: .75rem ui-monospace, monospace; word-break: break-all; }
  .tile, .tips li, .faq details, .top5 a { break-inside: avoid; }
}
