/**
 * KSSBS.SK - Mega Header
 * Hover na header = rozbalí sa panel s podkategóriami
 */

/* Farby hlavičky a mobilných panelov — v tmavom režime sa prepnú
   (<html data-theme="dark">, viď includes/theme-init.php). */
:root {
    --mh-surface: rgba(255, 255, 255, 0.78);
    --mh-surface-solid: rgba(255, 255, 255, 0.95);
    --mh-sheet: #fff;
    --mh-text: var(--color2);
    --mh-muted: var(--color3);
    --mh-fill: rgba(0, 0, 0, 0.04);
    --mh-fill-hover: rgba(0, 0, 0, 0.07);
    --mh-fill-strong: var(--color4);
    --mh-line: rgba(0, 0, 0, 0.06);
    --mh-accent: var(--color1);
    --mh-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    --mh-shadow-open: 0 24px 64px rgba(15, 23, 42, 0.18);
}

/* Miesto pod plávajúcou hlavičkou — jediný zdroj pre všetky stránky:
     --header-offset  začiatok obsahu (hlavička je fixná 20 px od vrchu, ~64 px vysoká)
     --header-sticky  „top“ pre lepkavé prvky (bočné panely, lišty) — pod zmenšenou hlavičkou
   Na mobile (≤ 600 px) je hlavička skrytá: logo je v toku stránky, ovládanie dole. */
:root {
    --header-offset: 108px;
    --header-sticky: 96px;
}

@media (max-width: 600px) {
    :root {
        --header-offset: 0px;
        --header-sticky: 16px;
    }
}

/* Kotvy (#platby, #kontakt …) nezájdu pod hlavičku */
html {
    scroll-padding-top: calc(var(--header-sticky) + 8px);
}

:root[data-theme="dark"] {
    --mh-surface: rgba(15, 23, 42, 0.74);
    --mh-surface-solid: rgba(15, 23, 42, 0.95);
    --mh-sheet: #1e293b;
    --mh-text: #e2e8f0;
    --mh-muted: #94a3b8;
    --mh-fill: rgba(255, 255, 255, 0.06);
    --mh-fill-hover: rgba(255, 255, 255, 0.1);
    --mh-fill-strong: rgba(255, 255, 255, 0.07);
    --mh-line: rgba(255, 255, 255, 0.08);
    --mh-accent: #a5b4fc;
    --mh-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    --mh-shadow-open: 0 24px 64px rgba(0, 0, 0, 0.55);
}

/* ============================================
   MEGA HEADER - CONTAINER
   ============================================ */
.mega-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 1264px; /* s pilulkou počasia a zvonenia sa celé názvy škôl zmestia od ~1300 px */

    /* Rozmazané pozadie + jedna výplň + jeden jemný tieň (bez „skla“) */
    background: var(--mh-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    box-shadow: var(--mh-shadow);

    overflow: hidden;
    transition: top 0.4s ease, background-color 0.3s ease, box-shadow 0.3s ease, border-radius 0.4s ease;
}

.mega-header.is-scrolled {
    top: 12px;
    background: var(--mh-surface-solid);
    border-radius: 16px;
}

/* Otvorené menu — plnšia výplň a väčší tieň */
.mega-header.is-open {
    background: var(--mh-surface-solid);
    box-shadow: var(--mh-shadow-open);
}

/* ============================================
   TOP BAR - Vždy viditeľný
   ============================================ */
.mega-header__top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 10px 16px 10px 20px;
    position: relative;
    z-index: 2;
}

/* ============================================
   LOGO — krížik + dva riadky ako na starom webe. Text je SVG s textLength:
   druhý riadok má presne šírku prvého a celé logo sa zväčšuje naraz,
   takže sa pri žiadnom rozlíšení nerozíde ani nedeformuje.
   ============================================ */
.mega-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: -4px -8px;
    padding: 4px 8px;
    border-radius: 12px;
    color: var(--mh-text);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.mega-header__logo:hover,
.mega-header__logo:focus-visible,
.mega-header.is-open .mega-header__logo[aria-expanded="true"] {
    background: var(--mh-fill);
}

.kss-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
}

.kss-logo__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mega-header__logo:hover .kss-logo__icon {
    transform: rotate(-6deg) scale(1.06);
}

.kss-logo__text {
    display: block;
    width: auto;
    height: 31px;
    overflow: visible;
}

.kss-logo__text text {
    fill: currentColor;
    font-family: var(--font-header);
}

.kss-logo__l1 {
    font-size: 13.6px;
    font-weight: 700;
}

.kss-logo__l2 {
    font-size: 11px;
    font-weight: 500;
}

.kss-logo--big .kss-logo__icon {
    width: 60px;
    height: 60px;
}

.kss-logo--big .kss-logo__text {
    height: 42px;
}

/* ============================================
   MAIN NAV
   ============================================ */
.mega-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.mega-header__nav-item {
    position: relative;
    padding: 9px 10px;
    font-family: var(--font-header);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mh-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}

.mega-header__nav-item:hover,
.mega-header__nav-item:focus-visible,
.mega-header__nav-item.is-current {
    background: var(--mh-fill);
}

.mega-header__nav-short {
    display: none;
}

/* Farebná čiarka školy pod položkou */
.mega-header__nav-item::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--color1);
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.25s ease;
}

.mega-header__nav-item:hover::after,
.mega-header__nav-item.is-current::after {
    transform: translateX(-50%) scaleX(1);
}

.mega-header__nav-item--ms::after { background: var(--color-ms); }
.mega-header__nav-item--zs::after { background: var(--color-zs); }
.mega-header__nav-item--wsos::after { background: var(--color-wsos); }
.mega-header__nav-item--jedalen::after { background: var(--color-jedalen); }

/* ============================================
   VPRAVO — ikony s tooltipom (štandard webu: data-tip)
   ============================================ */
.mega-header__right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mega-header__icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--mh-fill);
    color: var(--mh-text);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.mega-header__icon-btn:hover,
.mega-header__icon-btn:focus-visible {
    background: var(--mh-fill-hover);
}

.mega-header__icon-btn:active {
    transform: scale(0.94);
}

.mega-header__icon-btn .material-symbols-outlined {
    font-size: 19px;
    color: var(--mh-accent);
}

.mega-header__icon-btn--edupage {
    background: #1a73e8;
}

.mega-header__icon-btn--edupage:hover,
.mega-header__icon-btn--edupage:focus-visible {
    background: #1557b0;
}

.mega-header__icon-btn--edupage img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* Mobile toggle */
.mega-header__mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--mh-fill-strong);
    color: var(--mh-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mega-header__mobile-toggle:hover {
    background: var(--color1);
    color: white;
}

/* ============================================
   ROZBAĽOVACIE MENU — obsah podľa toho, nad čím je myš
   (logo / škola / Novinky / Dokumenty). Výška sa animuje cez grid-rows.
   ============================================ */
.mega-header__expanded {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        visibility 0s linear 0.38s;
}

.mega-header__expanded.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        visibility 0s;
}

.mega-header__clip {
    min-height: 0;
    overflow: hidden;
}

.mega-header__expanded-inner {
    padding: 0 16px 14px;
    border-top: 1px solid var(--mh-line);
}

/* Panely ležia na sebe — pri prepnutí sa prelínajú bez skoku */
.mega-panes {
    display: grid;
    padding-top: 14px;
}

.mega-pane {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: minmax(250px, 0.85fr) minmax(0, 2fr);
    gap: 24px;
    align-items: stretch;
}

.mega-pane-enter {
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mega-pane-leave {
    transition: opacity 0.12s ease;
}

.mega-pane-from {
    opacity: 0;
    transform: translateY(6px);
}

/* Ľavá časť: logo, názov, krátky popis, prechod na web */
.mega-pane__intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 16px;
    background: var(--pane-tint);
}

.mega-pane__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mega-pane__logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.mega-pane__logo--icon {
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--mh-sheet);
    color: var(--pane-ink);
    font-size: 32px;
}

.mega-pane__title {
    margin: 0;
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mh-text);
}

.mega-pane__title span {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mh-muted);
}

.mega-pane__desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--mh-muted);
}

.mega-pane__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 9px 14px;
    border-radius: 10px;
    background: var(--mh-sheet);
    color: var(--pane-ink);
    font-family: var(--font-header);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.mega-pane__cta .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.mega-pane__cta:hover,
.mega-pane__cta:focus-visible {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.mega-pane__cta:hover .material-symbols-outlined {
    transform: translateX(3px);
}

/* Pravá časť: odkazy školy */
.mega-pane__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    align-content: start;
}

.mega-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    color: var(--mh-text);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
    animation: kssMegaIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 28ms);
}

.mega-tile:nth-child(2) { --i: 1; }
.mega-tile:nth-child(3) { --i: 2; }
.mega-tile:nth-child(4) { --i: 3; }
.mega-tile:nth-child(5) { --i: 4; }
.mega-tile:nth-child(6) { --i: 5; }
.mega-tile:nth-child(7) { --i: 6; }
.mega-tile:nth-child(8) { --i: 7; }
.mega-tile:nth-child(n+9) { --i: 8; }

.mega-tile:hover,
.mega-tile:focus-visible {
    background: var(--mh-fill);
}

.mega-tile__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--pane-tint);
    color: var(--pane-ink);
    font-size: 20px;
    transition: transform 0.2s ease;
}

.mega-tile:hover .mega-tile__icon {
    transform: scale(1.07);
}

.mega-tile__label {
    min-width: 0;
    line-height: 1.3;
}

.mega-tile__label small {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--mh-muted);
}

.mega-tile__ext {
    margin-left: auto;
    font-size: 16px;
    color: var(--mh-muted);
}

@keyframes kssMegaIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* Štítky škôl (filtre noviniek a dokumentov) */
.mega-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mega-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--mh-sheet);
    color: var(--mh-text);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease;
}

a.mega-chip:hover {
    transform: translateY(-1px);
}

.mega-chip--main { background: var(--color1-opacity); color: var(--color1); }
.mega-chip--ms { background: var(--color-ms-tint); color: var(--color-ms-ink); }
.mega-chip--zs { background: var(--color-zs-tint); color: var(--color-zs-ink); }
.mega-chip--wsos { background: var(--color-wsos-tint); color: var(--color-wsos-ink); }
.mega-chip--jedalen { background: var(--color-jedalen-tint); color: var(--color-jedalen-ink); }

/* Novinky */
.mega-news {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-content: start;
}

.mega-news__item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    color: var(--mh-text);
    text-decoration: none;
    transition: background-color 0.15s ease;
    animation: kssMegaIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mega-news__item:nth-child(2) { animation-delay: 50ms; }
.mega-news__item:nth-child(3) { animation-delay: 100ms; }

.mega-news__item:hover,
.mega-news__item:focus-visible {
    background: var(--mh-fill);
}

.mega-news__img {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    background: var(--mh-fill);
}

.mega-news__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mega-news__item:hover .mega-news__img img {
    transform: scale(1.05);
}

.mega-news__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px 4px;
}

.mega-news__school {
    align-self: flex-start;
}

.mega-news__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
}

.mega-news__date {
    font-size: 0.72rem;
    color: var(--mh-muted);
}

/* Dokumenty */
.mega-docs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-content: start;
}

.mega-docs__label {
    grid-column: 1 / -1;
    padding: 2px 10px 4px;
    font-family: var(--font-header);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mh-muted);
}

/* ============================================
   SPODNÝ RIADOK — „pilulky“
   ============================================ */
.mega-header__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding: 12px 2px 0;
    border-top: 1px solid var(--mh-line);
}

.mega-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mega-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    background: var(--mh-fill);
    border-radius: 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--mh-text);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.mega-pill .material-symbols-outlined {
    font-size: 16px;
    color: var(--mh-accent);
}

.mega-pill__label {
    margin-right: 2px;
    font-weight: 500;
    color: var(--mh-muted);
}

.mega-pill--link:hover,
.mega-pill--link:focus-visible {
    background: var(--mh-fill-hover);
}

.mega-pill--quiet {
    background: transparent;
    color: var(--mh-muted);
}

.mega-pill--quiet .material-symbols-outlined {
    color: inherit;
}

/* Počasie a zvonenie — jedna pilulka vedľa ikon, detaily v tooltipe */
.mh-status {
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--mh-fill);
}

.mh-status__item {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 7px;
    border-radius: 8px;
    font-family: var(--font-text);
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--mh-text);
    white-space: nowrap;
    cursor: default;
    transition: background-color 0.15s ease;
}

.mh-status__item:hover,
.mh-status__item:focus-visible {
    background: var(--mh-fill-hover);
    outline: none;
}

.mh-status__item .material-symbols-outlined {
    font-size: 18px;
    color: var(--mh-accent);
}

/* Ikona počasia plná a vo vlastnej farbe — v noci by obrysový mesiac
   splýval s prepínačom tmavého režimu hneď vedľa */
.mh-status__wx {
    font-variation-settings: 'FILL' 1;
}

.mh-status__item .mh-status__wx[data-kind="sun"] { color: #f59e0b; }
.mh-status__item .mh-status__wx[data-kind="night"] { color: #8b93f0; }
.mh-status__item .mh-status__wx[data-kind="cloud"] { color: #7c8aa5; }

.mh-status__sep {
    width: 1px;
    height: 16px;
    background: var(--mh-line);
}

/* ============================================
   RESPONSIVE
   ============================================ */
/* Užšie okno: v lište skratky škôl (MŠ, ZŠ, SOŠ, Jedáleň) */
@media (max-width: 1310px) {
    .mega-header__nav-full {
        display: none;
    }

    .mega-header__nav-short {
        display: inline;
    }

    .mega-pane__links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Úzka desktopová lišta: pilulka počasia a zvonenia sa nezmestí — tie sú v mobilnom menu */
@media (max-width: 1040px) {
    .mh-status {
        display: none;
    }
}

@media (max-width: 1080px) {
    .mega-pane {
        grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.5fr);
        gap: 16px;
    }

    .mega-news {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mega-news__item:nth-child(3) {
        display: none;
    }

    .mega-docs {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mega-header,
    .mega-header *,
    .mega-header__expanded {
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
}

@media (max-width: 900px) {

    .mega-header__nav,
    .mega-header__right,
    .mega-header__expanded {
        display: none;
    }

    .mega-header__mobile-toggle {
        display: flex;
    }

    .mega-header__top {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 600px) {
    .mega-header {
        display: none;
    }
}

/* ============================================
   MOBILE PANEL
   ============================================ */
.mobile-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.mobile-panel-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 340px;
    height: 100%;
    background: var(--mh-sheet);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-panel-overlay.is-open .mobile-panel {
    transform: translateX(0);
}

.mobile-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mh-line);
}

.mobile-panel__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mh-fill-strong);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.mobile-panel__content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.mobile-panel__section {
    margin-bottom: 20px;
}

.mobile-panel__section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--mh-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.mobile-panel__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 6px;
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mh-text);
    text-decoration: none;
    background: var(--mh-fill-strong);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-panel__link > :last-child {
    margin-left: auto;
}

.mobile-panel__link:hover {
    background: var(--color1);
    color: white;
}

/* Farebná bodka školy (namiesto ľavého pruhu) */
.mobile-panel__link--ms::before,
.mobile-panel__link--zs::before,
.mobile-panel__link--wsos::before,
.mobile-panel__link--jedalen::before {
    content: '';
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mobile-panel__link--ms::before { background: var(--color-ms); }
.mobile-panel__link--zs::before { background: var(--color-zs); }
.mobile-panel__link--wsos::before { background: var(--color-wsos); }
.mobile-panel__link--jedalen::before { background: var(--color-jedalen); }

/* ============================================
   MOBIL — plávajúca lišta (iOS 26): kapsula nad obsahom,
   rozmazané pozadie, jedna výplň, jemný tieň, logá škôl
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    padding: 6px;
    border-radius: 30px;
    background: var(--mh-surface);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 14px 34px -12px rgba(16, 24, 40, 0.28);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}

@media (max-width: 600px) {
    .mobile-bottom-nav {
        display: block;
    }
}

/* Keď je otvorené menu, lišta ustúpi pod panel */
html.kss-sheet-open .mobile-bottom-nav {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
    pointer-events: none;
}

.mobile-bottom-nav__main {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    gap: 2px;
}

.mobile-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 54px;
    border-radius: 24px;
    color: var(--mh-text);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav__item:active {
    transform: scale(0.94);
    background: var(--mh-fill);
}

.mobile-bottom-nav__item.is-active {
    background: var(--mh-fill-hover);
}

.mobile-bottom-nav__logo {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
}

.mobile-bottom-nav__logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-bottom-nav__logo .material-symbols-outlined {
    font-size: 24px;
}

.mobile-bottom-nav__label {
    font-family: var(--font-text);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Menu — okrúhle tlačidlo v kapsule, dve čiarky sa zmenia na krížik */
.mobile-bottom-nav__menu-btn {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color1);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(82, 95, 225, 0.6);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav__menu-btn:active {
    transform: scale(0.92);
}

.mobile-bottom-nav__burger {
    position: relative;
    display: block;
    width: 20px;
    height: 12px;
}

.mobile-bottom-nav__burger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.3s;
}

.mobile-bottom-nav__burger span:first-child { top: 1px; }
.mobile-bottom-nav__burger span:last-child { top: 9px; }

.mobile-bottom-nav__menu-btn.is-open .mobile-bottom-nav__burger span:first-child {
    top: 5px;
    transform: rotate(45deg);
}

.mobile-bottom-nav__menu-btn.is-open .mobile-bottom-nav__burger span:last-child {
    top: 5px;
    transform: rotate(-45deg);
}

/* ============================================
   MOBIL — menu ako panel na iPhone (detenty v kss-widgets.js mobileSheet)
   ============================================ */
html.kss-sheet-open {
    overflow: hidden;
}

.mobile-expanded-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 1001;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px));
    border-radius: 32px;
    background: var(--mh-sheet);
    box-shadow: 0 -2px 6px rgba(16, 24, 40, 0.04), 0 -18px 50px -16px rgba(16, 24, 40, 0.3);
    transform: translateY(calc(100% + 24px));
    /* zatvorený panel nesmie byť v poradí klávesnice ani pre čítačku */
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s linear 0.45s;
    will-change: transform;
}

.mobile-expanded-panel.is-open {
    visibility: visible;
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s;
}

/* Spodný panel patrí len k mobilnej spodnej lište */
@media (min-width: 601px) {
    .mobile-expanded-panel,
    .mobile-overlay {
        display: none;
    }
}

/* Úchyt a hlavička — za ne sa panel ťahá vždy */
.mobile-expanded-panel__grab {
    flex: none;
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-expanded-panel.is-dragging .mobile-expanded-panel__grab {
    cursor: grabbing;
}

.mobile-expanded-panel__handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
}

.mobile-expanded-panel__handle::before {
    content: '';
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: var(--mh-line);
    background: color-mix(in srgb, var(--mh-text) 22%, transparent);
}

.mobile-expanded-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 10px 22px;
}

.mobile-expanded-panel__title {
    font-family: var(--font-header);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mh-text);
}

.mobile-expanded-panel__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mh-fill-hover);
    color: var(--mh-text);
    cursor: pointer;
}

.mobile-expanded-panel__close .material-symbols-outlined {
    font-size: 20px;
}

/* Obsah: v polovičnej výške sa ťahá celý panel, na plnej výške sa obsah posúva */
.mobile-expanded-panel__content {
    flex: 1;
    min-height: 0;
    padding: 0 18px calc(20px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    touch-action: none;
}

.mobile-expanded-panel.is-large .mobile-expanded-panel__content {
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.mobile-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    margin-bottom: 16px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--mh-fill-hover);
    color: var(--mh-muted);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.mobile-search-btn .material-symbols-outlined {
    font-size: 22px;
}

.mobile-sheet__label {
    margin: 18px 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mh-muted);
}

/* School cards grid */
.mobile-schools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

.mobile-school-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--mh-fill-strong);
    border-radius: 20px;
    text-decoration: none;
    color: var(--mh-text);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.mobile-school-card:active {
    transform: scale(0.98);
}

.mobile-school-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 24px;
}

.mobile-school-card--ms .mobile-school-card__icon {
    background: var(--color-ms-tint);
    color: var(--color-ms-ink);
}

.mobile-school-card--zs .mobile-school-card__icon {
    background: var(--color-zs-tint);
    color: var(--color-zs-ink);
}

.mobile-school-card--wsos .mobile-school-card__icon {
    background: var(--color-wsos-tint);
    color: var(--color-wsos-ink);
}

.mobile-school-card--jedalen .mobile-school-card__icon {
    background: var(--color-jedalen-tint);
    color: var(--color-jedalen-ink);
}

.mobile-school-card__title {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

/* Quick links */
.mobile-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-quick-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--mh-fill-strong);
    border-radius: 10px;
    text-decoration: none;
    color: var(--mh-muted);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-quick-link:active {
    background: var(--color1);
    color: white;
}

.mobile-quick-link .material-symbols-outlined {
    font-size: 18px;
}

/* Action buttons */
.mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--mh-line);
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mobile-action-btn--edupage {
    background: #1a73e8;
    color: white;
}

.mobile-action-btn--login {
    background: var(--color1);
    color: white;
}

.mobile-action-btn:active {
    transform: scale(0.98);
}

.mobile-action-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* Mobile widgets row */
.mobile-widgets-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.mobile-widget {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--mh-fill-strong);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mh-text);
}

.mobile-widget--theme {
    flex: 0 0 auto;
    padding: 12px 16px;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.mobile-widget .material-symbols-outlined {
    font-size: 20px;
    color: var(--color1);
}

/* Mobile contacts */
.mobile-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.mobile-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--mh-fill-strong);
    border-radius: 12px;
    text-decoration: none;
    color: var(--mh-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-contact:active {
    background: var(--color1);
    color: white;
}

.mobile-contact .material-symbols-outlined {
    font-size: 20px;
    color: var(--color1);
}

.mobile-contact:active .material-symbols-outlined {
    color: white;
}

/* Mobile report link */
.mobile-report-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding: 10px;
    font-size: 0.75rem;
    color: var(--mh-muted);
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.mobile-report-link:hover,
.mobile-report-link:active {
    opacity: 1;
    color: var(--mh-text);
}

.mobile-report-link .material-symbols-outlined {
    font-size: 16px;
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Mobilný panel: logá škôl v kartách, skratka pri zvonení */
.mobile-school-card__icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.mobile-widget small {
    margin-right: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mh-muted);
}

.mobile-panel__header .kss-logo__text {
    height: 26px;
}

.mobile-panel__header .kss-logo__icon {
    width: 36px;
    height: 36px;
}
