/* Session Replay Viewer — shell: menu panel (context card, search, favourites, shortcuts, collapsible
   sections with counters), topbar (global search, notifications), floating help. Reads the --kt-* tokens
   from app.css. */

/* ── section colour themes (KidsTime menu-section themes): bar/icon colour, text-safe ink, tint, hover ── */
.ktm .theme-blue   { --section-color: #3794F5; --section-ink: var(--kt-blue-ink);   --section-bg: var(--kt-blue-bg);   --section-hover: #F0F7FF; }
.ktm .theme-green  { --section-color: #2CC09C; --section-ink: var(--kt-green-text); --section-bg: var(--kt-green-bg);  --section-hover: #F0FBF7; }
.ktm .theme-coral  { --section-color: #E11D48; --section-ink: var(--kt-red-text);   --section-bg: var(--kt-red-bg);    --section-hover: #FFF5F7; }
.ktm .theme-amber  { --section-color: #D97706; --section-ink: var(--kt-yellow-ink); --section-bg: #FFF8EB;             --section-hover: #FFFBF2; }
.ktm .theme-purple { --section-color: #832D9B; --section-ink: var(--kt-purple-ink); --section-bg: var(--kt-purple-bg); --section-hover: #FAF5FC; }
.ktm .theme-grey   { --section-color: var(--kt-icon-muted); --section-ink: var(--kt-grey-ink); --section-bg: var(--kt-grey-bg); --section-hover: var(--kt-surface-hover); }
html[data-theme="dark"] .ktm .theme-blue   { --section-color: #4BA0F7; --section-hover: rgba(75, 160, 247, .10); }
html[data-theme="dark"] .ktm .theme-green  { --section-color: #2CC09C; --section-hover: rgba(44, 192, 156, .10); }
html[data-theme="dark"] .ktm .theme-coral  { --section-color: #FF6B81; --section-hover: rgba(255, 107, 129, .10); }
html[data-theme="dark"] .ktm .theme-amber  { --section-color: #F2A33A; --section-bg: var(--kt-yellow-bg); --section-hover: rgba(242, 163, 58, .10); }
html[data-theme="dark"] .ktm .theme-purple { --section-color: #D08BE3; --section-hover: rgba(208, 139, 227, .10); }

/* ── menu panel (KidsTime institution menu panel, "catalog" layout) ── */
.kt-menu.ktm { width: 264px; padding: 0; scrollbar-width: thin; }
@media (min-width: 1200px) {
    .kt-shell.has-menu .kt-body { margin-left: 360px; }
}

.ktm-context { padding: 16px 16px 12px; border-bottom: 1px solid var(--kt-border); margin-bottom: 8px; }
.ktm-context-row { display: flex; align-items: flex-start; gap: 8px; }
.ktm-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--kt-ink); line-height: 1.3; overflow-wrap: anywhere; }
.ktm-switch {
    width: 32px; height: 32px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--kt-surface); border: 1px solid var(--kt-border); color: var(--kt-action-text); font-size: 12px; text-decoration: none;
}
.ktm-switch:hover { background: var(--kt-tonal); color: var(--kt-action-text); }
.ktm-sub { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--kt-muted); margin-top: 6px; }
.ktm-sub i { font-size: 11px; }
.ktm-chip {
    display: inline-flex; align-items: center; margin-top: 10px; padding: 3px 12px; min-height: 24px; border-radius: 999px;
    background: var(--kt-tonal); color: var(--kt-ink); font-size: 12px; font-weight: 600; text-decoration: none;
}
.ktm-chip:hover { background: var(--kt-tonal-pressed); color: var(--kt-ink); }

.ktm-search { position: relative; margin: 2px 12px 8px; }
.ktm-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--kt-icon-muted); pointer-events: none; }
.ktm-search-input {
    width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--kt-border); border-radius: 19px;
    background: var(--kt-tonal); color: var(--kt-ink); font: 500 13px "Poppins", sans-serif; outline: none;
    transition: border-color .15s ease, background-color .15s ease;
}
.ktm-search-input::placeholder { color: var(--kt-muted); opacity: 1; }
.ktm-search-input:focus { border-color: var(--kt-focus); background: var(--kt-bg); }

.ktm-section { border-bottom: 1px solid var(--kt-border); }
.ktm-section.ktm-flat { border-bottom: 0; padding: 2px 0 8px; }
.ktm-head { display: flex; align-items: center; border-left: 4px solid var(--section-color); padding-right: 8px; }
.ktm-head-main {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 6px 5px 12px;
    border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--kt-ink); font: inherit;
}
.ktm-head-main:focus-visible, .ktm-link:focus-visible { outline-offset: -2px; }
.ktm-ico {
    width: 26px; height: 26px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--section-color); background: var(--section-bg);
}
.ktm-head-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.2; }
.ktm-count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--section-bg); color: var(--section-ink); font-size: 11px; font-weight: 700;
}
.ktm-chevron { color: var(--kt-muted); font-size: 11px; transition: transform .25s ease; width: 16px; text-align: center; }
.ktm-chevron.collapsed { transform: rotate(-90deg); }
.ktm-head-action {
    width: 28px; height: 28px; flex: none; border: 0; border-radius: 999px; background: transparent; color: var(--kt-muted);
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer;
}
.ktm-head-action:hover { background: var(--kt-tonal); color: var(--kt-ink); }
.ktm-head-action[aria-pressed="true"] { background: var(--kt-tonal); color: var(--kt-ink); }

.ktm-item { display: flex; align-items: center; gap: 4px; padding-right: 8px; border-left: 3px solid transparent; transition: background-color .15s ease; }
.ktm-item:hover { background: var(--section-hover); }
.ktm-item.active { background: var(--section-hover); border-left-color: var(--section-color); }
.ktm-link {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 4px 6px 20px;
    border: 0; background: transparent; cursor: pointer; text-align: left; text-decoration: none; color: var(--kt-ink); font: 500 13px "Poppins", sans-serif;
}
.ktm-link:hover { color: var(--kt-ink); }
.ktm-link > i { width: 20px; text-align: center; flex: none; font-size: 14px; color: var(--section-color); }
.ktm-item.active .ktm-link { font-weight: 600; }
.ktm-label { flex: 1; min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.ktm-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    background: var(--kt-red); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}
.ktm-star {
    width: 28px; height: 28px; flex: none; border: 0; border-radius: 999px; background: transparent; color: var(--kt-icon-muted);
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; opacity: 0; transition: opacity .15s ease;
}
.ktm-item:hover .ktm-star, .ktm-item:focus-within .ktm-star, .ktm-star.is-fav, .ktm-item.editing .ktm-star { opacity: 1; }
.ktm-star:hover { background: var(--kt-tonal); color: var(--kt-ink); }
.ktm-star.is-fav { color: var(--kt-action-text); }
@media (hover: none) { .ktm-star { opacity: 1; } }
.ktm-hint { padding: 2px 16px 12px 20px; font-size: 12px; line-height: 1.4; color: var(--kt-muted); }

.ktm-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 2px 12px 10px; }
.ktm-shortcut {
    position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 4px 8px; border-radius: 9px;
    background: var(--kt-tonal); color: var(--kt-ink); font-size: 12px; font-weight: 600; line-height: 1.2; text-decoration: none;
    border: 1px solid transparent; transition: border-color .15s ease;
}
.ktm-shortcut:hover, .ktm-shortcut.active { border-color: var(--section-color); color: var(--kt-ink); }
.ktm-shortcut.active { background: var(--kt-surface); }
.ktm-shortcut i { width: 16px; text-align: center; flex: none; color: var(--section-color); font-size: 13px; }
.ktm-shortcut span { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ktm-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--kt-red); color: #fff; font-size: 9.5px; font-weight: 700; }

.ktm-heading { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px 16px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--kt-muted); }
.ktm-heading i { font-size: 11px; }

/* Labelled global links: only inside the phone drawer (the rail has them on wider screens). */
.ktm-general { display: none; border-bottom: 0; }
.ktm-general.ktm-signout { margin-top: auto; border-top: 1px solid var(--kt-border); }
@media (max-width: 767.98px) {
    .kt-shell.nav-open .ktm-general { display: block; }
}

/* ── topbar: search trigger, status, tiles ── */
.kt-topbar .kt-user { gap: 10px; }
.kt-status { border-radius: 10px; min-height: 40px; padding: 6px 14px; font-size: 13px; color: var(--kt-ink); }
.kt-tile-btn {
    position: relative; width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--kt-border); background: var(--kt-surface);
    color: var(--kt-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer;
}
.kt-tile-btn:hover { background: var(--kt-surface-hover); border-color: var(--kt-border-strong); }
.kts-trigger {
    display: inline-flex; align-items: center; gap: 10px; height: 40px; min-width: 220px; padding: 0 8px 0 14px; border-radius: 10px;
    border: 1px solid var(--kt-border); background: var(--kt-surface); color: var(--kt-muted); font: 500 13px "Poppins", sans-serif; cursor: pointer; text-align: left;
}
.kts-trigger:hover { border-color: var(--kt-border-strong); }
.kts-trigger i { color: var(--kt-ink); font-size: 14px; }
.kts-trigger-text { flex: 1; }
.kts-kbd, .kts-foot kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
    background: var(--kt-tonal); color: var(--kt-muted); font: 600 11px "Poppins", sans-serif;
}

/* ── global search dialog ── */
.kts-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(11, 16, 32, .5); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 12px 12px; }
.kts-dialog {
    width: min(640px, 100%); max-height: 78vh; display: flex; flex-direction: column; background: var(--kt-surface); color: var(--kt-ink);
    border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-shadow-pop); overflow: hidden; text-align: left;
}
.kts-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--kt-border); }
.kts-input-row > i { color: var(--kt-muted); font-size: 16px; }
.kts-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--kt-ink); font: 500 16px "Poppins", sans-serif; }
.kts-input::placeholder { color: var(--kt-muted); opacity: 1; }
.kts-esc { border: 0; border-radius: 6px; min-height: 28px; padding: 0 8px; background: var(--kt-tonal); color: var(--kt-muted); font: 600 11px "Poppins", sans-serif; cursor: pointer; }
.kts-results { overflow-y: auto; padding: 6px 8px 8px; }
.kts-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--kt-muted); }
.kts-result { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--kt-ink); }
.kts-result:hover { color: var(--kt-ink); }
.kts-result.active { background: var(--kt-tonal); }
.kts-result-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--kt-tonal); color: var(--kt-ink); }
.kts-result-ico.tone-blue { background: var(--kt-blue-bg); color: var(--kt-blue-ink); }
.kts-result-ico.tone-green { background: var(--kt-green-bg); color: var(--kt-green-text); }
.kts-result-ico.tone-coral { background: var(--kt-red-bg); color: var(--kt-red-text); }
.kts-result-ico.tone-amber { background: var(--kt-yellow-bg); color: var(--kt-yellow-ink); }
.kts-result-ico.tone-purple { background: var(--kt-purple-bg); color: var(--kt-purple-ink); }
.kts-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kts-result-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kts-result-sub { font-size: 12px; color: var(--kt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kts-empty { padding: 28px 16px; text-align: center; color: var(--kt-muted); font-size: 14px; }
.kts-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--kt-border); font-size: 12px; color: var(--kt-muted); }
.kts-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ── notifications bell ── */
.ktn { position: relative; flex: none; }
.ktn-badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--kt-red); color: #fff; font-size: 10px; font-weight: 700; border: 2px solid var(--kt-bg);
}
.ktn-backdrop, .kth-backdrop { position: fixed; inset: 0; z-index: 1390; border: 0; padding: 0; background: transparent; cursor: default; }
.ktn-pop {
    position: absolute; z-index: 1400; top: 48px; right: 0; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; text-align: left;
    background: var(--kt-surface); border: 1px solid var(--kt-border); border-left: 4px solid var(--kt-red); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-shadow-pop); padding: 6px;
}
.ktn-pop-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; font-size: 16px; font-weight: 600; color: var(--kt-ink); }
.ktn-pop-head i { color: var(--kt-action-text); }
.ktn-pop-head span:first-of-type { flex: 1; }
.ktn-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 10px; text-decoration: none; color: var(--kt-ink); }
.ktn-row:hover { background: var(--kt-surface-hover); color: var(--kt-ink); }
.ktn-row-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--kt-red-bg); color: var(--kt-red-text); }
.ktn-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ktn-row-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ktn-row-sub { font-size: 12px; color: var(--kt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ktn-row-go { color: var(--kt-muted); font-size: 11px; }
.ktn-empty { display: flex; align-items: center; gap: 8px; padding: 10px 12px 14px; color: var(--kt-muted); font-size: 14px; }
.ktn-empty i { color: var(--kt-green-text); }
.ktn-foot { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px 6px; border-top: 1px solid var(--kt-border); margin-top: 4px; }
.ktn-foot a { font-size: 13px; font-weight: 600; color: var(--kt-action-text); text-underline-offset: 3px; }

/* ── floating help (KidsTime chat tile) ── */
.kt-main { padding-bottom: 104px; }
.kth { position: fixed; right: 24px; bottom: 24px; z-index: 1100; }
.kth.open { z-index: 1400; }
.kth-btn {
    position: relative; z-index: 1400; width: 56px; height: 56px; border: 0; border-radius: 16px; background: var(--kt-navy); color: #fff; font-size: 22px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(11, 32, 76, .28);
}
html[data-theme="dark"] .kth-btn { background: var(--kt-brand-fill); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.kth-btn:hover { filter: brightness(1.12); }
.kth-pop {
    position: absolute; z-index: 1400; right: 0; bottom: 68px; width: 320px; max-width: calc(100vw - 32px); padding: 6px; text-align: left;
    background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-shadow-pop);
}
.kth-pop-head { padding: 10px 12px 6px; font-size: 16px; font-weight: 600; color: var(--kt-ink); }
.kth-row {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 12px; border: 0; border-radius: 10px; background: transparent;
    text-align: left; text-decoration: none; color: var(--kt-ink); font: inherit; cursor: pointer;
}
.kth-row:hover { background: var(--kt-surface-hover); color: var(--kt-ink); }
.kth-row b { display: block; font-size: 13.5px; font-weight: 600; }
.kth-row small { display: block; font-size: 12px; color: var(--kt-muted); }
.kth-ico { width: 32px; height: 32px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--kt-tonal); color: var(--kt-ink); font-size: 13px; }

/* ── responsive ── */
@media (max-width: 1399.98px) {
    .kts-trigger { min-width: 160px; }
}
@media (max-width: 1199.98px) {
    .kt-shell.nav-open .kt-menu.ktm { width: min(300px, calc(100vw - 72px)); }
    .kt-shell .kt-burger { display: inline-flex; }
}
@media (max-width: 959.98px) {
    .kt-topbar .kt-status { display: none; }
}
@media (max-width: 767.98px) {
    .kt-topbar .kt-user { gap: 6px; }
    .kts-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
    .kts-trigger-text, .kts-kbd { display: none; }
    .kt-greeting p { display: none; }
    .ktn { position: static; }
    .ktn-pop { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; max-width: none; }
    .kts-overlay { padding-top: 12px; }
    .kts-foot { display: none; }
    .kth { right: 16px; bottom: 16px; }
    .kth-btn { width: 52px; height: 52px; }
}
.ktm-meta { flex: none; padding-right: 6px; font-size: 11px; font-weight: 600; color: var(--kt-muted); font-variant-numeric: tabular-nums; }

/* Product mark: the Session Replay icon (KidsTime cat with a wrench badge) in place of the yellow tile. */
.kt-logo.kt-logo-img, .kt-rail .kt-logo.kt-logo-img, .kt-rail .kt-logo.kt-logo-img:hover { background: transparent; box-shadow: none; border-radius: 0; width: 48px; height: 48px; }
.kt-auth-brand .kt-logo.kt-logo-img, .kt-login-card .kt-logo.kt-logo-img { width: 56px; height: 56px; }
.kt-logo.kt-logo-img img { width: 100%; height: 100%; display: block; }
