/* ==========================================================================
   Portal — Sketchbook A1 design system (#303)
   Typography: Maven Pro (display) + Open Sans (body) + Caveat (hand accents)
   Palette: paper bg, ink text, gf* accents (Dana's palette)
   ========================================================================== */

/* Fonts are self-hosted in www/fonts/fonts.css, linked from every layout that loads this file (#282). */

/* A11y: skip navigation link (#255). Hidden off-screen until focused via Tab. */
html body a.skip-nav,
html body a.skip-nav:link,
html body a.skip-nav:visited {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	padding: 0.75rem 1rem;
	background: #1E1E1E;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-family: 'Maven Pro', system-ui, sans-serif;
	border-radius: 0 0 14px 0;
}

html body a.skip-nav:focus,
html body a.skip-nav:focus-visible {
	left: 0;
	color: #fff;
}

:root {
	--portal-font-display: 'Maven Pro', system-ui, sans-serif;
	--portal-font-body: 'Maven Pro', system-ui, sans-serif;
	--portal-font-hand: 'Caveat', cursive;

	/* Surfaces */
	--portal-paper: #FFFDF7;
	--portal-paper-85: rgba(255, 253, 247, 0.85);
	--portal-surface: #ffffff;

	/* Ink */
	--portal-ink: #1E1E1E;
	--portal-ink-soft: #4A4A4A;
	--portal-mute: #767676;
	--portal-line: #EBE4D6;
	--portal-line-soft: rgba(30, 30, 30, 0.06);

	/* Accent palette */
	--portal-yellow: #FFEB32;
	--portal-yellow-soft: #FDFCDE;
	--portal-green: #4EE6B3;
	--portal-green-soft: #E1FFEA;
	--portal-pink: #FFC8FF;
	--portal-pink-soft: #FCEAFE;
	--portal-blue: #428BFF;
	--portal-blue-soft: #EFF5FF;
	--portal-purple: #9B7CFF;
	--portal-purple-soft: #EFEBFF;

	/* Sidebar */
	--portal-side-bg: #EFF5FF;
	--portal-side-active: #CFE0FF;

	/* Status (kept for alerts) */
	--portal-success-ink: #1B6B3F;
	--portal-danger: #AE191B;
	--portal-danger-soft: #FFE1E1;

	/* Radii */
	--portal-r-sm: 10px;
	--portal-r: 14px;
	--portal-r-lg: 18px;
	--portal-r-xl: 24px;
	--portal-r-2xl: 28px;
	--portal-r-pill: 999px;

	/* Shadows */
	--portal-shadow-card: 0 2px 0 0 rgba(30, 30, 30, 0.06), 0 12px 28px -10px rgba(30, 30, 30, 0.10);
	--portal-shadow-card-hover: 0 2px 0 0 rgba(30, 30, 30, 0.08), 0 18px 36px -10px rgba(30, 30, 30, 0.16);
	--portal-shadow-pill: 0 2px 0 0 rgba(30, 30, 30, 0.18), 0 8px 16px -8px rgba(30, 30, 30, 0.25);
	--portal-shadow-dropdown: 0 2px 0 0 rgba(30, 30, 30, 0.06), 0 18px 36px -10px rgba(30, 30, 30, 0.20);
}

/* --------------------------------------------------------------------------
   Reset + base
   -------------------------------------------------------------------------- */

body.portal-app * {
	box-sizing: border-box;
}

/*
 * Metronic's style.bundle.css (loaded before portal.css) sets
 *   html, body { font-size: 13px !important; }
 * which collapses every rem-based size in the portal to ~81% of the
 * Sketchbook design. We restore the 16px base on portal pages only,
 * scoped via :has() so admin/Metronic pages aren't affected.
 */
html:has(body.portal-app),
body.portal-app {
	font-size: 16px !important;
}

body.portal-app {
	margin: 0;
	min-height: 100vh;
	background: var(--portal-paper);
	color: var(--portal-ink);
	font-family: var(--portal-font-body);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/*
 * Wrap the whole selector in :where() so total specificity is (0,0,0) —
 * any utility class (.tw-text-2xl, .portal-pill, etc.) can override
 * without !important. The visual defaults still apply when no class wins.
 */
:where(body.portal-app h1, body.portal-app h2, body.portal-app h3, body.portal-app h4) {
	font-family: var(--portal-font-display);
	font-weight: 700;
	color: var(--portal-ink);
	letter-spacing: -0.01em;
	margin: 0;
	line-height: 1.15;
}

:where(body.portal-app h1) { font-size: clamp(1.85rem, 2.4vw, 2.4rem); }
:where(body.portal-app h2) { font-size: 1.5rem; }
:where(body.portal-app h3) { font-size: 1.15rem; }
:where(body.portal-app h4) { font-size: 1rem; }

body.portal-app a {
	color: var(--portal-ink);
	text-decoration: none;
	transition: color 0.15s ease;
}

body.portal-app a:hover {
	color: var(--portal-ink);
	text-decoration: underline;
}

body.portal-app .portal-hand {
	font-family: var(--portal-font-hand);
}

/* --------------------------------------------------------------------------
   Layout shell
   -------------------------------------------------------------------------- */

.portal-main {
	min-height: calc(100vh - 56px);
}

.portal-main__inner {
	position: relative;
}

@media (min-width: 992px) {
	body.portal-app {
		padding-left: 260px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------------
   Topbar — sticky, paper/85 + backdrop blur
   -------------------------------------------------------------------------- */

.portal-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	position: sticky;
	top: 0;
	z-index: 30;
	min-height: 56px;
	flex-shrink: 0;
	padding: 0 16px;
	background: var(--portal-surface);
	border-bottom: 1px solid var(--portal-line);
	box-shadow: 0 2px 8px -2px rgba(30, 30, 30, 0.06);
}

@media (min-width: 992px) {
	.portal-topbar { padding: 0 32px; }
}

.portal-topbar__toggle {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-left: -8px;
	background: transparent;
	border: none;
	border-radius: var(--portal-r);
	color: var(--portal-ink);
	cursor: pointer;
	transition: background 0.15s ease;
}

.portal-topbar__toggle:hover { background: rgba(255, 255, 255, 0.6); }
.portal-topbar__toggle svg { width: 22px; height: 22px; stroke-width: 2.4; }

@media (min-width: 992px) {
	.portal-topbar__toggle { display: none; }
}

.portal-topbar__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none !important;
}

@media (min-width: 992px) {
	.portal-topbar__brand { display: none; }
}

.portal-topbar__breadcrumbs {
	display: none;
	align-items: center;
	gap: 12px;
	color: var(--portal-mute);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.875rem;
}

@media (min-width: 992px) {
	.portal-topbar__breadcrumbs { display: flex; }
}

body.portal-app .portal-topbar__breadcrumbs a { color: var(--portal-mute); text-decoration: none; }
body.portal-app .portal-topbar__breadcrumbs a:hover { color: var(--portal-ink); text-decoration: none; }
.portal-topbar__breadcrumbs strong { color: var(--portal-ink); font-weight: 700; }

.portal-topbar__spacer { flex: 1; }

.portal-topbar__icon-btn {
	position: relative;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	background: transparent;
	border: none;
	border-radius: var(--portal-r);
	color: var(--portal-ink);
	cursor: pointer;
	transition: background 0.15s ease;
}
.portal-topbar__icon-btn:hover { background: rgba(255, 255, 255, 0.6); }
.portal-topbar__icon-btn svg { width: 22px; height: 22px; stroke-width: 2.2; }

.portal-topbar__notif-dot {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 16px;
	height: 16px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-pink);
	color: #7B2A78;
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.6rem;
	display: grid;
	place-items: center;
	border: 2px solid var(--portal-paper);
	animation: portal-notif-pulse 2.4s ease-in-out infinite;
}

@keyframes portal-notif-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.15); }
}

.portal-topbar__user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px 4px 4px;
	background: transparent;
	border: none;
	border-radius: var(--portal-r-pill);
	color: var(--portal-ink);
	cursor: pointer;
	transition: background 0.15s ease;
}
.portal-topbar__user:hover { background: rgba(255, 255, 255, 0.6); }
.portal-topbar__user-name {
	display: none;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.875rem;
}
@media (min-width: 768px) { .portal-topbar__user-name { display: block; } }

/* --------------------------------------------------------------------------
   Sidebar — 260px, sideBg paper-cool
   -------------------------------------------------------------------------- */

.portal-sidebar {
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	width: 260px;
	padding: 24px 16px;
	background: var(--portal-side-bg);
	z-index: 40;
	display: flex;
	flex-direction: column;
	transform: translateX(-100%);
	transition: transform 0.25s ease;
}

.portal-sidebar.is-open,
body.portal-drawer-open .portal-sidebar {
	transform: translateX(0);
	box-shadow: 0 0 32px rgba(0, 0, 0, 0.18);
}

@media (min-width: 992px) {
	.portal-sidebar { transform: translateX(0); box-shadow: none; }
}

.portal-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 8px 12px 24px;
	text-decoration: none !important;
}

/* #979 — GAMICA wordmark (www/assets/portal/gamica-wordmark.png, 480×153, ~3× for retina). */
.portal-brand__wordmark {
	display: block;
	width: auto;
	height: 44px;
}

.portal-brand__wordmark--sm { height: 28px; }

.portal-brand__logo {
	width: 44px;
	height: 44px;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

.portal-nav {
	flex: 1;
	overflow-y: auto;
	margin: 0 -4px;
	padding: 0 4px;
}

.portal-nav-section {
	display: block;
	margin: 14px 0 4px 12px;
	font-weight: 700;
	font-size: 0.66rem;
	color: var(--portal-mute);
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

.portal-nav-section:first-child { margin-top: 4px; }

.portal-nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: var(--portal-r);
	color: var(--portal-ink-soft);
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
	user-select: none;
	transition: background 0.18s ease, color 0.18s ease;
	min-height: 36px;
}

.portal-nav-item:hover {
	background: rgba(255, 255, 255, 0.55);
	color: var(--portal-ink);
}

.portal-nav-item--active,
.portal-nav-item.portal-nav-item--active {
	background: var(--portal-side-active);
	color: #1B3A66;
	/* Keep font-weight identical to non-active state so text width does not
	   jump when navigation changes (#353 — PM reported sidebar items skáču). */
	font-weight: 500;
	box-shadow: inset 0 0 0 1px rgba(27, 58, 102, 0.08);
}

.portal-nav-item svg { width: 20px; height: 20px; stroke-width: 2.4; flex-shrink: 0; }

/* #787 — „Môj obsah" stojí v menu oddelene dole: knižnica hotového, nie krok tvorby.
   Oddeľuje sa linkou, nie vlastnou sekciou — sekcia by si pýtala nadpis, ktorý návrh nemá. */
.portal-nav-item--standalone {
	position: relative;
	margin-top: 22px;
}

/* Linka je pseudo-element, nie border na položke — border by sa pri aktívnom stave
   dostal dovnútra podfarbenej pilulky a zrezal jej horné rohy. */
.portal-nav-item--standalone::before {
	content: "";
	position: absolute;
	top: -11px;
	left: 12px;
	right: 12px;
	border-top: 1px solid var(--portal-line);
}

.portal-nav-item--disabled {
	color: var(--portal-mute);
	cursor: not-allowed;
	opacity: 0.7;
}
.portal-nav-item--disabled:hover { background: transparent; color: var(--portal-mute); }

.portal-nav-item__badge {
	margin-left: auto;
	flex-shrink: 0;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--portal-pink);
	color: #7B2A78;
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.portal-user {
	margin: 12px -4px 0;
	padding: 12px 14px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.6);
	display: flex;
	align-items: center;
	gap: 10px;
}

.portal-user__avatar {
	width: 32px;
	height: 32px;
	border-radius: var(--portal-r-pill);
	background: linear-gradient(135deg, var(--portal-pink), var(--portal-blue));
	color: #fff;
	display: grid;
	place-items: center;
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.85rem;
}

.portal-user__info { flex: 1; min-width: 0; }
/* #295 — the teacher's name in the sidebar and the top bar is the link to „Môj účet“. */
a.portal-user__info, a.portal-topbar__user { text-decoration: none; }
a.portal-user__info:hover .portal-user__name { text-decoration: underline; }
.portal-user__name {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--portal-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.portal-user__role {
	font-size: 0.7rem;
	color: var(--portal-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.portal-user__logout {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: var(--portal-r);
	color: var(--portal-mute);
	transition: background 0.15s ease, color 0.15s ease;
}
.portal-user__logout:hover { background: rgba(255, 255, 255, 0.6); color: var(--portal-ink); }
.portal-user__logout svg { width: 18px; height: 18px; stroke-width: 2; }

/* Backdrop for mobile drawer */
.portal-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 35;
	background: rgba(30, 30, 30, 0.4);
	opacity: 0;
	transition: opacity 0.2s ease;
}

body.portal-drawer-open .portal-backdrop {
	display: block;
	opacity: 1;
}

@media (min-width: 992px) {
	.portal-backdrop { display: none !important; }
}

/* Note: legacy `.portal-main` + `.portal-main__inner` duplicate block deleted (#303).
   Main layout is defined once earlier in this file (paper bg, body padding-left for sidebar).
   Templates use their own `<section class="tw-px-…">` for content padding, matching preview. */

.portal-page-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}
.portal-page-header h1 { font-family: var(--portal-font-display); font-weight: 800; }
.portal-page-header__subtitle { color: var(--portal-mute); font-size: 0.95rem; margin-top: 4px; }
.portal-page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Legacy page header support (old structure) */
.portal-page-header__text {
	min-width: 0;
}

.portal-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--portal-blue);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-bottom: 14px;
}

.portal-eyebrow::before {
	content: '';
	width: 24px;
	height: 2px;
	background: var(--portal-blue);
	border-radius: 2px;
}

.portal-page-title {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50, 'opsz' 72;
	font-weight: 500;
	font-size: clamp(36px, 5vw, 56px);
	line-height: 0.98;
	letter-spacing: -0.035em;
	color: var(--portal-ink);
	margin: 0;
}

.portal-page-subtitle {
	font-size: 16px;
	color: var(--portal-muted);
	margin-top: 12px;
	max-width: 560px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.portal-card {
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card);
	padding: 24px;
}

.portal-card--hover {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.portal-card--hover:hover {
	transform: translateY(-4px) rotate(-0.4deg);
	box-shadow: var(--portal-shadow-card-hover);
}
.portal-card--tilt-r.portal-card--hover:hover {
	transform: translateY(-4px) rotate(0.4deg);
}

.portal-card--tight  { padding: 16px; border-radius: var(--portal-r-xl); }
/* #978 — only for auth / account / legal cards. A window where the teacher enters an
   activity (generate / create / launch form) always spans the full content width —
   Dana: „Okno zadávania na celú šírku screenu – platí odteraz vždy." Do not add
   --narrow to those forms. */
.portal-card--narrow { max-width: 560px; }
.portal-card--soft   { background: var(--portal-yellow-soft); border-color: rgba(255, 235, 50, 0.2); }
.portal-card--empty  { text-align: center; color: var(--portal-mute); padding: 48px 24px; }
/* #753 — a module card whose prerequisite is gone (TTS without a guide). */
.portal-card--disabled { opacity: 0.5; cursor: not-allowed; }
.portal-card--selected {
	border-color: var(--portal-yellow);
	box-shadow: 0 0 0 3px var(--portal-yellow-soft);
	background: var(--portal-yellow-soft);
}

.portal-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.portal-card__title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.15rem;
	color: var(--portal-ink);
}

.portal-card__subtitle {
	margin-top: 4px;
	font-size: 0.875rem;
	color: var(--portal-mute);
}

/* --------------------------------------------------------------------------
   Dashboard stat cards
   -------------------------------------------------------------------------- */

.portal-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 22px;
	margin-bottom: 40px;
}

@media (max-width: 575px) {
	.portal-stats {
		grid-template-columns: 1fr;
		gap: 14px;
	}
}

.portal-stat {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-lg);
	padding: 28px 30px 26px;
	position: relative;
	overflow: hidden;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.portal-stat:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 40px rgba(26, 26, 46, 0.08);
	border-color: var(--portal-yellow-soft);
}

.portal-stat:hover .portal-stat__icon {
	background: var(--portal-yellow);
	color: var(--portal-surface);
	transform: rotate(-6deg) scale(1.05);
}

.portal-stat__icon {
	transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-stat__label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--portal-muted);
	margin-bottom: 10px;
}

.portal-stat__value {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50, 'opsz' 144;
	font-weight: 500;
	font-size: 72px;
	line-height: 0.95;
	color: var(--portal-ink);
	letter-spacing: -0.045em;
	margin-bottom: 24px;
}

.portal-stat__value--text {
	font-size: 32px;
}

.portal-stat__icon {
	position: absolute;
	top: 24px;
	right: 24px;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--portal-yellow-soft);
	display: grid;
	place-items: center;
	color: var(--portal-yellow);
}

.portal-stat__icon svg {
	width: 22px;
	height: 22px;
	stroke-width: 1.8;
}

.portal-stat__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.portal-stat__link {
	font-size: 13px;
	font-weight: 600;
	color: var(--portal-ink) !important;
	padding: 8px 14px;
	border-radius: var(--portal-r-sm);
	background: var(--portal-line-soft);
	text-decoration: none !important;
	transition: all 0.15s ease;
}

.portal-stat__link:hover {
	background: var(--portal-ink);
	color: var(--portal-surface) !important;
}

.portal-stat__link--accent {
	background: var(--portal-yellow);
	color: var(--portal-surface) !important;
}

.portal-stat__link--accent:hover {
	background: var(--portal-ink);
	color: var(--portal-surface) !important;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.portal-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.portal-form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
/* A row a script hides (e.g. "Upresnite svoju rolu" of the school enquiry, #336): `display: flex`
   above would otherwise win over the `hidden` attribute. */
.portal-form-row[hidden] { display: none; }

.portal-form-row > label,
.portal-form-row > .portal-form-label,
.portal-info-row > .portal-form-label,
.portal-form .portal-form-row > label {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--portal-ink);
}

.portal-form-row input[type="text"],
.portal-form-row input[type="email"],
.portal-form-row input[type="password"],
.portal-form-row input[type="number"],
.portal-form-row input[type="date"],
.portal-form-row input[type="tel"],
.portal-form-row input[type="search"],
.portal-form-row input[type="url"],
.portal-form-row select,
.portal-form-row textarea,
.portal-form input.portal-input,
.portal-form textarea.portal-input,
.portal-form select.portal-input {
	width: 100%;
	padding: 12px 16px;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	font-family: var(--portal-font-body);
	font-size: 0.95rem;
	color: var(--portal-ink);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-form-row input:focus,
.portal-form-row select:focus,
.portal-form-row textarea:focus,
.portal-form input.portal-input:focus,
.portal-form textarea.portal-input:focus,
.portal-form select.portal-input:focus {
	outline: none;
	border-color: var(--portal-blue);
	box-shadow: 0 0 0 4px var(--portal-blue-soft);
}

.portal-form-row textarea { min-height: 120px; resize: vertical; }

/* File upload (#733) — `~portalFileInput`: the box is a <label> drawn as a dashed drop zone with
   our own sketchbook-pill button and the chosen file name. The native input is only visually
   hidden (it keeps focus, `required` and its validation bubble): the browser writes its button
   text in the browser language, not in the language of the portal. */
.portal-file {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-width: 0;
	padding: 10px 16px 10px 10px;
	background: var(--portal-paper);
	border: 1.5px dashed var(--portal-line);
	border-radius: var(--portal-r-xl);
	font-family: var(--portal-font-body);
	font-size: 0.92rem;
	color: var(--portal-mute);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.portal-file:hover {
	border-color: var(--portal-ink);
	background: var(--portal-yellow-soft);
}
.portal-file:focus-within {
	border-color: var(--portal-ink);
	box-shadow: 0 0 0 4px var(--portal-yellow-soft);
}
.portal-file__input {
	position: absolute;
	left: 24px;
	bottom: 0;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}
.portal-file__button {
	flex-shrink: 0;
	padding: 8px 18px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-yellow);
	color: var(--portal-ink);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.9rem;
	box-shadow: var(--portal-shadow-pill);
	transition: filter 0.15s ease, transform 0.15s ease;
}
.portal-file:hover .portal-file__button {
	filter: saturate(1.1);
	transform: translateY(-1px);
}
.portal-file:active .portal-file__button {
	transform: translateY(1px);
}
.portal-file__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.portal-file--chosen .portal-file__name {
	color: var(--portal-ink);
}

.portal-form-help {
	font-size: 0.8rem;
	color: var(--portal-mute);
}

/* Shared text style: .portal-form-error (login box, its box styles are further down) and
   .portal-error = field error under an input (@form.latte, hand-laid-out portal forms, #2). */
.portal-form-error,
.portal-form-row .portal-form-error,
.portal-error {
	font-size: 0.8rem;
	color: var(--portal-danger);
	font-weight: 600;
}

.portal-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 8px;
}

/* Brand mark on the portal login card. */
.portal-login-logo {
	display: block;
	width: 200px;
	max-width: 60%;
	height: auto;
}

/* Text links inside a sentence — one look for the whole portal. Portal links have no underline by
   default, which inside a sentence makes them look like plain text. Login card layout (#336):
   "Zabudli ste heslo?", "Zaregistrovať sa", the privacy link. Page content (#514): links in
   paragraphs, class-less links in list items (component links in a <li> — schedule cell, pill —
   always carry a class) and flash links; buttons and pills keep their own look, the topbar, sidebar
   and breadcrumbs are outside .portal-main.
   !important: Metronic's `body a:hover, body a:active, body a:focus { text-decoration: none
   !important }` would drop the underline exactly on hover and keyboard focus. */
body.portal-app a.portal-auth-link,
body.portal-app--login .portal-form-help a,
body.portal-app--login .portal-form-error a,
body.portal-app .portal-main p a:not(.portal-btn, .portal-pill),
body.portal-app .portal-main li a:not([class]),
body.portal-app .portal-flash a:not(.portal-btn, .portal-pill) {
	font-weight: 600;
	text-decoration: underline 1px !important;
	text-underline-offset: 2px;
}

body.portal-app a.portal-auth-link:is(:hover, :focus-visible),
body.portal-app--login .portal-form-help a:is(:hover, :focus-visible),
body.portal-app--login .portal-form-error a:is(:hover, :focus-visible),
body.portal-app .portal-main p a:not(.portal-btn, .portal-pill):is(:hover, :focus-visible),
body.portal-app .portal-main li a:not([class]):is(:hover, :focus-visible),
body.portal-app .portal-flash a:not(.portal-btn, .portal-pill):is(:hover, :focus-visible) {
	text-decoration: underline 2px var(--portal-blue) !important;
}

/* Flash links keep their bolder weight (.portal-flash a). */
body.portal-app .portal-flash a:not(.portal-btn, .portal-pill) {
	font-weight: 700;
}

/* "alebo" separator between password form and Google login on portal login. */
.portal-login-sep {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0 16px;
	color: var(--portal-mute);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.portal-login-sep::before,
.portal-login-sep::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--portal-line);
}

.portal-google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--portal-line);
	background: #fff;
	color: var(--portal-ink) !important;
	text-decoration: none !important;
	font-family: var(--portal-font-display);
	font-weight: 600;
	font-size: 0.875rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.portal-google-btn:hover {
	background: #f7f7f7;
	border-color: var(--portal-ink-soft);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.portal-google-btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.portal-checkbox {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	cursor: pointer;
}
.portal-checkbox__input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	accent-color: var(--portal-blue);
}
.portal-checkbox__label {
	font-size: 0.9rem;
	color: var(--portal-ink-soft);
	flex: 1;
}

.portal-consent-label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 16px;
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	background: var(--portal-paper);
	font-size: 0.85rem;
	color: var(--portal-ink-soft);
}
.portal-consent-label input[type=checkbox] { margin-top: 3px; accent-color: var(--portal-blue); }

.portal-input-group { position: relative; }
.portal-input-group__toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: none;
	background: transparent;
	color: var(--portal-mute);
	cursor: pointer;
	border-radius: var(--portal-r);
}
.portal-input-group__toggle:hover { background: var(--portal-line-soft); color: var(--portal-ink); }

/* TinyMCE editor wrapper */
body.portal-app .tox.tox-tinymce {
	border: 1.5px solid var(--portal-line);
	border-radius: 10px;
	overflow: hidden;
}

body.portal-app .tox .tox-toolbar__primary {
	background: var(--portal-surface-warm, #f5efe3);
}

body.portal-app .tox .tox-tbtn {
	color: var(--portal-ink);
}

/* Legacy form field / select support */
.portal-field {
	display: grid;
	gap: 8px;
}
.portal-field[hidden] { display: none; }

.portal-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--portal-ink);
	letter-spacing: 0.005em;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.portal-required {
	color: var(--portal-danger);
	font-size: 15px;
	line-height: 0;
}

.portal-input,
.portal-select,
.portal-textarea {
	font-family: var(--portal-font-body);
	font-size: 16px;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-sm);
	padding: 14px 16px;
	color: var(--portal-ink);
	width: 100%;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
	appearance: none;
	-webkit-appearance: none;
}

.portal-input:hover,
.portal-select:hover,
.portal-textarea:hover {
	border-color: var(--portal-muted-soft);
}

.portal-input:focus,
.portal-select:focus,
.portal-textarea:focus {
	outline: none;
	border-color: var(--portal-blue);
	box-shadow: 0 0 0 4px var(--portal-blue-soft);
	background: var(--portal-surface);
}

.portal-input::placeholder {
	color: var(--portal-mute);
	opacity: 0.55;
}

/* Password toggle group (legacy) */
.portal-input-group .portal-input {
	padding-right: 52px;
}

.portal-input-group__icon-hide {
	display: none;
}

.portal-input-group--visible .portal-input-group__icon-show {
	display: none;
}

.portal-input-group--visible .portal-input-group__icon-hide {
	display: block;
}

.portal-select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2378706a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 18px;
	padding-right: 44px;
}

.portal-select[multiple] {
	background-image: none;
	padding-right: 16px;
	min-height: 140px;
	padding: 8px;
}

.portal-select[multiple] option {
	padding: 8px 12px;
	border-radius: var(--portal-r-sm);
}

/* --------------------------------------------------------------------------
   Select2 (multi-select) — themed to match portal palette
   -------------------------------------------------------------------------- */

body.portal-app .select2-container {
	font-family: var(--portal-font-body);
}

body.portal-app .select2-container .select2-selection--multiple {
	background: var(--portal-surface) !important;
	border: 1.5px solid var(--portal-line) !important;
	border-radius: var(--portal-r-sm) !important;
	min-height: 52px !important;
	padding: 6px 10px !important;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.portal-app .select2-container .select2-selection--multiple:hover {
	border-color: var(--portal-muted-soft) !important;
}

body.portal-app .select2-container--focus .select2-selection--multiple,
body.portal-app .select2-container--open .select2-selection--multiple {
	border-color: var(--portal-yellow) !important;
	box-shadow: 0 0 0 4px rgba(232, 93, 60, 0.14) !important;
}

body.portal-app .select2-container .select2-selection--multiple .select2-selection__rendered {
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

body.portal-app .select2-container .select2-selection--multiple .select2-selection__choice {
	background: var(--portal-yellow-soft) !important;
	border: 1px solid rgba(232, 93, 60, 0.25) !important;
	color: var(--portal-ink) !important;
	border-radius: 999px !important;
	padding: 6px 12px 6px 30px !important;
	margin: 0 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	position: relative;
	display: inline-flex;
	align-items: center;
}

body.portal-app .select2-container .select2-selection--multiple .select2-selection__choice__remove {
	position: absolute !important;
	left: 8px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	border: none !important;
	background: transparent !important;
	color: var(--portal-ink) !important;
	font-size: 16px !important;
	padding: 0 !important;
	margin: 0 !important;
	width: 16px;
	height: 16px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	transition: background 0.15s ease;
}

body.portal-app .select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
	background: var(--portal-yellow) !important;
	color: var(--portal-surface) !important;
}

body.portal-app .select2-container .select2-search--inline .select2-search__field {
	font-family: var(--portal-font-body) !important;
	font-size: 15px !important;
	color: var(--portal-ink) !important;
	margin-top: 4px !important;
	padding: 4px !important;
	min-height: 28px;
}

body.portal-app .select2-container .select2-search--inline .select2-search__field::placeholder {
	color: var(--portal-muted-soft) !important;
}

body.portal-app .select2-container .select2-selection--multiple .select2-selection__clear {
	margin-right: 8px !important;
	color: var(--portal-muted) !important;
	font-size: 18px !important;
	font-weight: 400 !important;
}

/* Dropdown panel */
body.portal-app .select2-dropdown {
	background: var(--portal-surface) !important;
	border: 1.5px solid var(--portal-line) !important;
	border-radius: var(--portal-r) !important;
	box-shadow: var(--portal-shadow-card-hover) !important;
	overflow: hidden;
	margin-top: 6px;
}

body.portal-app .select2-dropdown.select2-dropdown--above {
	margin-top: 0;
	margin-bottom: 6px;
}

body.portal-app .select2-search--dropdown .select2-search__field {
	background: var(--portal-yellow-soft) !important;
	border: 1.5px solid var(--portal-line) !important;
	border-radius: var(--portal-r-sm) !important;
	padding: 10px 14px !important;
	font-family: var(--portal-font-body) !important;
	font-size: 14px !important;
	color: var(--portal-ink) !important;
}

body.portal-app .select2-search--dropdown .select2-search__field:focus {
	outline: none !important;
	border-color: var(--portal-yellow) !important;
}

body.portal-app .select2-results__option {
	padding: 12px 16px !important;
	font-size: 14px !important;
	color: var(--portal-ink) !important;
	transition: background 0.12s ease;
}

body.portal-app .select2-results__option--highlighted[aria-selected],
body.portal-app .select2-container--default .select2-results__option--highlighted {
	background: var(--portal-yellow-soft) !important;
	color: var(--portal-ink) !important;
}

body.portal-app .select2-results__option[aria-selected="true"],
body.portal-app .select2-container--default .select2-results__option[aria-selected="true"] {
	background: var(--portal-line-soft) !important;
	color: var(--portal-ink) !important;
	font-weight: 600;
}

body.portal-app .select2-results__option[aria-selected="true"]::before {
	content: '✓';
	margin-right: 8px;
	color: var(--portal-yellow);
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.portal-pill,
.portal-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: none;
	border-radius: var(--portal-r-pill);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: 0.005em;
	color: var(--portal-ink);
	background: var(--portal-surface);
	cursor: pointer;
	text-decoration: none !important;
	box-shadow: var(--portal-shadow-pill);
	transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.portal-pill:hover,
.portal-btn:hover {
	transform: translateY(-1px);
	filter: saturate(1.1);
}
.portal-pill:active,
.portal-btn:active {
	transform: translateY(1px);
	box-shadow: 0 1px 0 rgba(30, 30, 30, 0.18);
}

/* #380 — double-click guard: a submitted form's buttons dim and show a spinner. Applies
   to ANY disabled submit control with .is-submitting, not just .portal-btn (some forms
   use bespoke button classes). */
button.is-submitting,
input.is-submitting {
	position: relative;
	opacity: 0.65;
	pointer-events: none;
	cursor: wait;
}
button.is-submitting::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	vertical-align: -2px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: portal-submit-spin 0.7s linear infinite;
}
@keyframes portal-submit-spin {
	to { transform: rotate(360deg); }
}

.portal-pill svg,
.portal-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }

.portal-pill--sm,
.portal-btn--sm  { padding: 6px 14px; font-size: 0.8rem; }
.portal-pill--lg,
.portal-btn--lg  { padding: 14px 28px; font-size: 1rem; }

.portal-pill--yellow,
.portal-btn--accent { background: var(--portal-yellow); color: var(--portal-ink); }
.portal-pill--green { background: var(--portal-green); color: var(--portal-ink); }
.portal-pill--pink  { background: var(--portal-pink);  color: #7B2A78; }
.portal-pill--blue  { background: var(--portal-blue);  color: #fff; }
.portal-pill--ink,
.portal-btn--ink    { background: var(--portal-ink);   color: #fff; }
.portal-pill--danger,
.portal-btn--danger { background: var(--portal-danger); color: #fff; }

.portal-pill--ghost,
.portal-btn--ghost {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--portal-line);
	color: var(--portal-ink);
}
.portal-pill--ghost:hover,
.portal-btn--ghost:hover {
	background: rgba(30, 30, 30, 0.04);
	box-shadow: inset 0 0 0 1.5px var(--portal-ink);
}

/* When a coloured pill/button is an <a>, `body.portal-app a` (color: ink) would
   otherwise win on specificity and render the label dark-on-dark (e.g. the active
   filter pills on /portal/marketplace). Restore each variant's intended colour. */
body.portal-app a.portal-pill--ink,
body.portal-app a.portal-btn--ink,
body.portal-app a.portal-pill--blue,
body.portal-app a.portal-btn--blue,
body.portal-app a.portal-pill--danger,
body.portal-app a.portal-btn--danger { color: #fff; }
body.portal-app a.portal-pill--pink,
body.portal-app a.portal-btn--pink { color: #7B2A78; }

/* --------------------------------------------------------------------------
   Data table (datagrid override)
   -------------------------------------------------------------------------- */

body.portal-app .datagrid {
	font-family: var(--portal-font-body);
	overflow-x: auto;
	max-width: 100%;
}

body.portal-app .datagrid::-webkit-scrollbar {
	height: 8px;
}

body.portal-app .datagrid::-webkit-scrollbar-track {
	background: var(--portal-line-soft);
	border-radius: 4px;
}

body.portal-app .datagrid::-webkit-scrollbar-thumb {
	background: var(--portal-muted-soft);
	border-radius: 4px;
}

body.portal-app .datagrid .table {
	background: var(--portal-surface);
	border-radius: var(--portal-r-lg);
	overflow: hidden;
	margin-bottom: 0;
	color: var(--portal-ink);
	border-collapse: separate;
	border-spacing: 0;
}

body.portal-app .datagrid thead th {
	background: var(--portal-yellow-soft) !important;
	color: var(--portal-ink) !important;
	font-weight: 600 !important;
	font-size: 12px !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 16px 20px !important;
	border: none !important;
	border-bottom: 1px solid var(--portal-line) !important;
	vertical-align: middle !important;
	white-space: nowrap;
}

body.portal-app .datagrid thead th > a,
body.portal-app .datagrid thead th[id^="datagrid-sort"] a,
body.portal-app .datagrid thead th .ajax {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	color: var(--portal-ink) !important;
	text-decoration: none !important;
}

body.portal-app .datagrid thead th .fa-sort,
body.portal-app .datagrid thead th .fa-sort-up,
body.portal-app .datagrid thead th .fa-sort-down {
	font-size: 11px;
	opacity: 0.45;
	transition: opacity 0.15s ease;
}

body.portal-app .datagrid thead th a:hover .fa-sort {
	opacity: 1;
}

body.portal-app .datagrid thead th .datagrid-column-header-additions {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	vertical-align: middle;
}

/* Filter row (second header row with inputs) */
body.portal-app .datagrid thead tr + tr th {
	background: var(--portal-yellow-soft) !important;
	padding: 0 20px 14px !important;
	border-bottom: 1px solid var(--portal-line) !important;
}

body.portal-app .datagrid tbody td {
	padding: 18px 20px !important;
	border: none !important;
	border-top: 1px solid var(--portal-line-soft) !important;
	vertical-align: middle;
	font-size: 14px;
}

body.portal-app .datagrid tbody tr:first-child td {
	border-top: none !important;
}

body.portal-app .datagrid tbody tr:hover td {
	background: var(--portal-yellow-soft) !important;
}

body.portal-app .datagrid .datagrid-row-buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: var(--portal-r-sm);
	margin: 0 2px;
	color: var(--portal-ink-soft);
	background: var(--portal-line-soft);
	transition: all 0.15s ease;
	text-decoration: none;
}

body.portal-app .datagrid .datagrid-row-buttons a:hover {
	background: var(--portal-yellow);
	color: var(--portal-surface);
}

body.portal-app .datagrid input.form-control,
body.portal-app .datagrid select.form-control,
body.portal-app .datagrid select.form-select,
body.portal-app .datagrid input[type="text"],
body.portal-app .datagrid input[type="number"] {
	background: var(--portal-surface) !important;
	border: 1.5px solid var(--portal-line) !important;
	border-radius: var(--portal-r-sm) !important;
	padding: 9px 12px !important;
	color: var(--portal-ink) !important;
	font-family: var(--portal-font-body) !important;
	font-size: 13px !important;
	box-shadow: none !important;
	height: auto !important;
	line-height: 1.4 !important;
}

body.portal-app .datagrid input.form-control:focus,
body.portal-app .datagrid select.form-control:focus,
body.portal-app .datagrid input:focus {
	outline: none !important;
	border-color: var(--portal-yellow) !important;
	box-shadow: 0 0 0 3px rgba(232, 93, 60, 0.14) !important;
}

body.portal-app .datagrid input.form-control::placeholder {
	color: var(--portal-muted-soft) !important;
}

body.portal-app .datagrid .pagination .page-link {
	border: 1.5px solid var(--portal-line);
	color: var(--portal-ink);
	background: var(--portal-surface);
	margin: 0 3px;
	border-radius: var(--portal-r-sm) !important;
	min-width: 38px;
	text-align: center;
	font-weight: 600;
}

body.portal-app .datagrid .pagination .page-item.active .page-link {
	background: var(--portal-ink);
	border-color: var(--portal-ink);
	color: var(--portal-surface);
}

/* Datagrid pagination footer */
body.portal-app .datagrid tfoot td.row-grid-bottom {
	background: var(--portal-yellow-soft) !important;
	border-top: 1px solid var(--portal-line) !important;
	padding: 18px 24px !important;
}

body.portal-app .datagrid .col-items small {
	color: var(--portal-muted) !important;
	font-size: 13px !important;
	font-weight: 500;
	letter-spacing: 0.02em;
}

body.portal-app .datagrid .col-per-page select.form-select {
	background: var(--portal-surface) !important;
	border: 1.5px solid var(--portal-line) !important;
	border-radius: var(--portal-r-sm) !important;
	padding: 8px 32px 8px 12px !important;
	color: var(--portal-ink) !important;
	font-family: var(--portal-font-body) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	box-shadow: none !important;
	width: auto !important;
	min-width: 80px;
}

/* Per-page submit button */
body.portal-app .datagrid .col-per-page button,
body.portal-app .datagrid .col-per-page input[type="submit"] {
	display: none !important;
}

body.portal-app .datagrid .btn-primary,
body.portal-app .datagrid .btn.btn-outline-primary {
	background: var(--portal-ink) !important;
	border-color: var(--portal-ink) !important;
	color: var(--portal-surface) !important;
	border-radius: var(--portal-r-sm) !important;
	font-weight: 600 !important;
	padding: 10px 16px !important;
}

body.portal-app .datagrid .btn-primary:hover {
	background: var(--portal-yellow) !important;
	border-color: var(--portal-yellow) !important;
}

/* Datagrid CSV export & filter buttons */
body.portal-app .datagrid .btn-default,
body.portal-app .datagrid .btn-secondary,
body.portal-app .datagrid .btn.btn-default.btn-secondary {
	background: var(--portal-surface) !important;
	border: 1.5px solid var(--portal-line) !important;
	color: var(--portal-ink-soft) !important;
	border-radius: var(--portal-r-sm) !important;
	font-weight: 600 !important;
	font-size: 12px !important;
	padding: 8px 14px !important;
	box-shadow: none !important;
	text-transform: none;
	letter-spacing: 0;
}

body.portal-app .datagrid .btn-default:hover,
body.portal-app .datagrid .btn-secondary:hover {
	background: var(--portal-line-soft) !important;
	border-color: var(--portal-ink-soft) !important;
	color: var(--portal-ink) !important;
}

/* Row action buttons (light-primary = edit, light-danger = delete) */
body.portal-app .datagrid .btn.btn-light-primary,
body.portal-app .datagrid .btn-xs.btn-light-primary {
	background: var(--portal-line-soft) !important;
	color: var(--portal-ink-soft) !important;
	border: none !important;
	border-radius: var(--portal-r-sm) !important;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 2px;
	transition: all 0.15s ease;
}

body.portal-app .datagrid .btn.btn-light-primary:hover {
	background: var(--portal-yellow) !important;
	color: var(--portal-surface) !important;
}

body.portal-app .datagrid .btn.btn-light-danger,
body.portal-app .datagrid .btn-xs.btn-light-danger {
	background: var(--portal-line-soft) !important;
	color: var(--portal-ink-soft) !important;
	border: none !important;
	border-radius: var(--portal-r-sm) !important;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 2px;
	transition: all 0.15s ease;
}

body.portal-app .datagrid .btn.btn-light-danger:hover {
	background: var(--portal-danger) !important;
	color: var(--portal-surface) !important;
}

body.portal-app .datagrid .datagrid-row-sort-column .sort {
	color: var(--portal-muted);
}

body.portal-app .datagrid-empty {
	padding: 60px 24px !important;
	text-align: center;
	font-size: 15px;
	color: var(--portal-muted);
	background: var(--portal-surface);
}

body.portal-app .datagrid-empty::before {
	content: '';
	display: block;
	width: 60px;
	height: 60px;
	margin: 0 auto 16px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23a39e98' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3e%3crect x='3' y='3' width='18' height='18' rx='2'/%3e%3cpath d='M3 9h18M9 21V9'/%3e%3c/svg%3e");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */

.portal-flashes {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 24px;
}

.portal-flash {
	display: flex;
	gap: 12px;
	padding: 14px 18px;
	border-radius: var(--portal-r-xl);
	border: 1.5px solid var(--portal-line-soft);
	background: var(--portal-yellow-soft);
	color: var(--portal-ink);
	font-size: 0.9rem;
}
.portal-flash svg { width: 22px; height: 22px; flex-shrink: 0; stroke-width: 2.2; }
.portal-flash a { color: var(--portal-blue); font-weight: 700; }
/* #611 — follow-up links carried by a flash (publish-time near-duplicate warning). */
.portal-flash__links { display: inline; }
.portal-flash__links a { white-space: nowrap; }
/* #408 (screen 04) — the teacher sample strip above an editor: the badge with the price and the
   text on the left, „Zdieľať so žiakmi" on the right (under the text on a narrow screen). */
.portal-teacher-sample { flex-wrap: wrap; align-items: center; justify-content: space-between; }
.portal-teacher-sample__body { flex: 1 1 320px; min-width: 0; }
.portal-teacher-sample__body .portal-badge { margin-right: 6px; vertical-align: 1px; }
.portal-teacher-sample__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-flash .portal-teacher-sample__actions .portal-pill { color: var(--portal-ink); }

.portal-flash--success { background: var(--portal-green-soft); }
/* #380 — success flashes fade out after a few seconds (JS adds .is-leaving). */
.portal-flash { transition: opacity 0.5s ease, transform 0.5s ease; }
.portal-flash.is-leaving { opacity: 0; transform: translateY(-6px); }
.portal-flash--info    { background: var(--portal-blue-soft); }
.portal-flash--warning { background: var(--portal-yellow-soft); }
.portal-flash--error,
.portal-flash--danger  { background: var(--portal-danger-soft); }

/* Floating toast for live async-generation completions on the journey builder (#528). */
.portal-toast-stack {
	position: fixed;
	top: 18px;
	right: 18px;
	z-index: 1200;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: min(380px, calc(100vw - 36px));
	pointer-events: none;
}

.portal-toast {
	align-items: flex-start;
	pointer-events: auto;
	text-decoration: none;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.portal-toast.is-in { opacity: 1; transform: translateY(0); }

.portal-toast__body { display: flex; flex-direction: column; gap: 2px; }
.portal-toast__body strong { font-weight: 800; }

a.portal-toast:hover { filter: brightness(0.98); }

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */

body.portal-app--login {
	display: grid;
	place-items: center;
	padding: 40px 20px;
	background: var(--portal-paper);
	background-image:
		radial-gradient(ellipse 60% 50% at 15% 20%, rgba(232, 93, 60, 0.08) 0%, transparent 70%),
		radial-gradient(ellipse 50% 40% at 85% 80%, rgba(15, 118, 110, 0.06) 0%, transparent 70%);
}

.portal-login {
	width: 100%;
	max-width: 460px;
}

.portal-login-card {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	padding: 48px 44px;
	box-shadow: var(--portal-shadow-card-hover);
	position: relative;
}

.portal-login-card::before {
	content: '';
	position: absolute;
	top: -1px;
	left: 20%;
	right: 20%;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--portal-yellow), transparent);
	border-radius: 3px;
}

.portal-login-brand {
	text-align: center;
	margin-bottom: 36px;
}

.portal-login-title {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50, 'opsz' 72;
	font-weight: 500;
	font-size: 40px;
	letter-spacing: -0.035em;
	line-height: 1;
	margin: 0 0 10px;
	color: var(--portal-ink);
}

.portal-login-subtitle {
	color: var(--portal-muted);
	font-size: 15px;
	margin: 0;
}

.portal-login-footer {
	text-align: center;
	margin-top: 28px;
	font-size: 13px;
	color: var(--portal-muted);
}

/* --------------------------------------------------------------------------
   Empty states / misc
   -------------------------------------------------------------------------- */

.portal-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	background: var(--portal-line-soft);
	color: var(--portal-ink-soft);
	border: 1px solid var(--portal-line);
}

.portal-chip--accent {
	background: var(--portal-yellow-soft);
	color: var(--portal-ink);
	border-color: rgba(232, 93, 60, 0.2);
}

.portal-chip--success {
	background: var(--portal-green-soft);
	color: var(--portal-success-ink);
	border-color: rgba(15, 118, 110, 0.2);
}

/* --------------------------------------------------------------------------
   A11y & motion preferences
   -------------------------------------------------------------------------- */

body.portal-app *:focus-visible {
	outline: 2.5px solid var(--portal-yellow);
	outline-offset: 3px;
	border-radius: 4px;
}

body.portal-app .portal-input:focus-visible,
body.portal-app .portal-select:focus-visible,
body.portal-app .portal-textarea:focus-visible {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	body.portal-app *,
	body.portal-app *::before,
	body.portal-app *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ═══════════════════════════════════════════════════════════════
   Learning Journey — Teacher-side styles
   ═══════════════════════════════════════════════════════════════ */

/* Journey detail layout */
.portal-journey-detail {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* QR card */
.portal-journey-qr-card {
	overflow: hidden;
}

.portal-journey-qr-inner {
	display: flex;
	gap: 28px;
	align-items: flex-start;
}

.portal-journey-qr-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.portal-journey-qr-img {
	width: 160px;
	height: 160px;
	border-radius: var(--p-radius, 14px);
	border: 1.5px solid var(--p-line, #ebe4d6);
	display: block;
}

.portal-journey-qr-hint {
	font-size: 11px;
	color: var(--p-muted, #78706a);
	text-align: center;
}

.portal-journey-qr-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.portal-journey-qr-code-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--p-muted, #78706a);
	margin-bottom: 4px;
}

.portal-journey-qr-code-value {
	display: block;
	font-family: 'Courier New', Courier, monospace;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: .2em;
	color: var(--portal-yellow);
	line-height: 1;
}

.portal-journey-qr-link {
	font-size: 13px;
	color: var(--portal-yellow);
	word-break: break-all;
}

.portal-journey-guide-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--p-bg-alt, #f5efe3);
	border-radius: 10px;
}

.portal-journey-guide-emoji {
	font-size: 22px;
	line-height: 1;
}

.portal-journey-guide-text {
	font-size: 14px;
	color: var(--p-ink-soft, #3e3e50);
}

.portal-journey-desc {
	font-size: 14px;
	color: var(--p-ink-soft, #3e3e50);
	line-height: 1.6;
	padding: 10px 14px;
	border-left: 3px solid var(--p-line, #ebe4d6);
	border-radius: 0 8px 8px 0;
}

@media (max-width: 600px) {
	.portal-journey-qr-inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
	.portal-journey-qr-info {
		width: 100%;
	}
}

/* Card header with badge — see unified .portal-card__header/.portal-card__title above */

.portal-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: var(--portal-yellow-soft);
	color: var(--portal-yellow);
	border-radius: 99px;
	font-size: 11px;
	font-weight: 700;
}

/* Phase list */
.portal-phase-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.portal-phase-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1.5px solid var(--p-line-soft, #f3ede0);
	background: var(--p-surface-raised, #fefcf7);
	transition: border-color .15s, background .15s;
}

.portal-phase-item:hover {
	border-color: var(--p-line, #ebe4d6);
	background: var(--p-surface, #fff);
}

.portal-phase-item__number {
	width: 24px;
	height: 24px;
	background: var(--p-line, #ebe4d6);
	border-radius: 50%;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--p-muted, #78706a);
	flex-shrink: 0;
}

.portal-phase-item__icon {
	font-size: 18px;
	flex-shrink: 0;
}

.portal-phase-item__info {
	flex: 1;
	min-width: 0;
}

.portal-phase-item__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--p-ink, #1a1a2e);
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.portal-phase-item__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.portal-phase-chip {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 99px;
}

.portal-phase-chip--intro   { background: #e0f2fe; color: #0369a1; }
.portal-phase-chip--learn   { background: #dcfce7; color: #15803d; }
.portal-phase-chip--quiz    { background: #fef3c7; color: #b45309; }
.portal-phase-chip--results { background: var(--portal-yellow-soft); color: var(--portal-yellow); }

.portal-phase-meta-text {
	font-size: 12px;
	color: var(--p-muted, #78706a);
}

.portal-phase-action-link {
	font-size: 12px;
	font-weight: 600;
	color: var(--portal-yellow);
	text-decoration: none;
}

.portal-phase-action-link:hover { text-decoration: underline; }

.portal-phase-item__delete {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px; height: 28px;
	border-radius: 6px;
	color: var(--p-muted, #78706a);
	transition: color .15s, background .15s;
	flex-shrink: 0;
	text-decoration: none;
}

.portal-phase-item__delete:hover {
	color: var(--portal-danger);
	background: var(--p-danger-soft, #fee2e2);
}

.portal-phase-item__delete svg { width: 14px; height: 14px; }

.portal-phase-item__actions {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

.portal-phase-item__move {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px; height: 28px;
	border-radius: 6px;
	color: var(--portal-muted, #78706a);
	transition: color .15s, background .15s;
	text-decoration: none;
}

.portal-phase-item__move:hover {
	color: var(--portal-yellow);
	background: var(--portal-yellow-soft);
}

.portal-phase-item__move svg { width: 16px; height: 16px; }

.portal-phase-item__move--disabled {
	pointer-events: none;
	opacity: .25;
}

/* Quiz question list (inline in phases) */
.portal-question-list {
	margin: 4px 0 4px 52px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.portal-question-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--p-bg-alt, #f5efe3);
	font-size: 13px;
}

.portal-question-item__num {
	font-size: 11px;
	font-weight: 700;
	color: var(--p-muted, #78706a);
	width: 16px;
	flex-shrink: 0;
	text-align: right;
}

.portal-question-item__text {
	flex: 1;
	color: var(--p-ink-soft, #3e3e50);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.portal-question-item__correct {
	font-size: 11px;
	font-weight: 700;
	color: var(--p-success, #0f766e);
	flex-shrink: 0;
}

.portal-question-item__edit,
.portal-question-item__delete {
	font-size: 11px;
	color: var(--portal-muted, #78706a);
	text-decoration: none;
	flex-shrink: 0;
	padding: 2px 4px;
	border-radius: 4px;
	transition: color .12s, background .12s;
}

.portal-question-item__edit:hover {
	color: var(--portal-yellow);
	background: var(--portal-yellow-soft);
}

.portal-question-item__delete:hover {
	color: var(--portal-danger);
	background: var(--p-danger-soft, #fee2e2);
}

/* Empty state */
.portal-empty {
	text-align: center;
	padding: 32px 20px;
}

.portal-empty__icon { font-size: 36px; margin-bottom: 12px; }

.portal-empty__text {
	font-size: 14px;
	color: var(--p-muted, #78706a);
}

/* Code inline */
.portal-code {
	display: inline-block;
	padding: 4px 10px;
	background: var(--portal-yellow-soft);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r);
	font-family: ui-monospace, "SF Mono", Menlo, monospace;
	font-size: 0.9rem;
	color: var(--portal-ink);
}

/* ── Student progress table ── */
.portal-progress-table-wrap { overflow-x: auto; }

.portal-progress-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.portal-progress-table th {
	text-align: left;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--p-muted, #78706a);
	border-bottom: 1.5px solid var(--p-line, #e8e0d5);
}

.portal-progress-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--p-line-soft, #f0ebe3);
	vertical-align: middle;
}

.portal-progress-table tbody tr:last-child td { border-bottom: none; }

.portal-progress-row--done td { background: #f9fdf7; }

.portal-progress-name {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	color: var(--p-ink, #1a1a2e);
}

.portal-progress-avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--portal-yellow);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
	text-transform: uppercase;
}

.portal-progress-score {
	font-weight: 600;
	color: var(--p-ink, #1a1a2e);
}

.portal-progress-bar-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 120px;
}

.portal-progress-bar {
	height: 6px;
	border-radius: 3px;
	flex: 1;
	transition: width .4s ease;
}

.portal-progress-bar-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--p-ink, #1a1a2e);
	min-width: 32px;
}

.portal-progress-date {
	font-size: 12px;
	color: var(--p-muted, #78706a);
	white-space: nowrap;
}

/* ─────────────────────────────────────────────
   LIVE SESSION — Teacher view
───────────────────────────────────────────── */

.session-live-layout {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 24px;
	align-items: start;
}

@media (max-width: 900px) {
	.session-live-layout {
		grid-template-columns: 1fr;
	}
}

.session-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.session-qr-card {
	text-align: center;
	padding: 24px;
}

.session-qr-img {
	width: 180px;
	height: 180px;
	border-radius: 12px;
	margin: 0 auto 16px;
	display: block;
}

.session-join-code {
	font-size: 36px;
	font-weight: 800;
	letter-spacing: .12em;
	color: var(--portal-yellow);
	font-family: monospace;
	margin-bottom: 6px;
}

.session-qr-hint {
	font-size: 13px;
	color: var(--p-muted, #78706a);
}

.session-btn-start {
	width: 100%;
	justify-content: center;
	gap: 8px;
	font-size: 16px;
	padding: 16px;
}

.session-btn-finish {
	width: 100%;
	justify-content: center;
	color: var(--portal-danger);
	border-color: var(--portal-danger);
}

/* Status badges */
.session-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	border-radius: 99px;
	font-size: 13px;
	font-weight: 600;
}

.session-status-badge--lobby {
	background: #fef3c7;
	color: #92400e;
}

.session-status-badge--active {
	background: #dcfce7;
	color: #166534;
}

.session-status-badge--done {
	background: #f0fdf4;
	color: #4d7c0f;
}

/* Lobby participants list */
.session-lobby-card {
	min-height: 320px;
}

.session-lobby-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.session-lobby-participant {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: var(--p-surface-warm, #fefcf7);
	border: 1px solid var(--p-line, #ebe4d6);
	border-radius: 10px;
	animation: fade-up .3s both;
}

.session-lobby-avatar {
	width: 32px;
	height: 32px;
	background: var(--portal-yellow-soft);
	color: var(--portal-yellow);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
}

.session-lobby-name {
	font-weight: 600;
	font-size: 14px;
	flex: 1;
}

.session-lobby-time {
	font-size: 11px;
	color: var(--p-muted, #78706a);
}

/* Leaderboard */
.session-leaderboard-card {
	min-height: 320px;
}

.session-leaderboard {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.session-lb-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: var(--p-surface, #fff);
	border: 1.5px solid var(--p-line, #ebe4d6);
	border-radius: 12px;
	animation: fade-up .3s both;
	transition: background .2s;
}

.session-lb-row--done {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.session-lb-pos {
	font-size: 20px;
	min-width: 28px;
	text-align: center;
}

.session-rank-num {
	font-size: 14px;
	font-weight: 700;
	color: var(--p-muted, #78706a);
}

.session-lb-avatar {
	width: 34px;
	height: 34px;
	background: var(--p-line, #ebe4d6);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
}

.session-lb-name {
	font-weight: 600;
	font-size: 15px;
	flex: 1;
}

.session-lb-score {
	font-size: 16px;
	font-weight: 800;
	color: var(--portal-yellow);
	min-width: 60px;
	text-align: right;
}

.session-lb-done {
	font-size: 16px;
	color: #16a34a;
	margin-left: 6px;
}

.session-lb-pending {
	font-size: 14px;
	color: var(--p-muted, #78706a);
	margin-left: 6px;
}

@keyframes fade-up {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Dashboard action tiles
   -------------------------------------------------------------------------- */

.portal-dashboard {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.portal-tile-section__title {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50;
	font-size: 22px;
	font-weight: 500;
	color: var(--portal-ink);
	margin: 0 0 18px;
}

.portal-tile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}

.portal-tile-grid--compact {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
}

@media (max-width: 575px) {
	.portal-tile-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.portal-tile-grid--compact { grid-template-columns: repeat(2, 1fr); }
}

.portal-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 22px 20px;
	border-radius: 18px;
	border: 1.5px solid var(--portal-line);
	background: var(--portal-surface);
	text-decoration: none;
	color: var(--portal-ink);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	min-height: 128px;
}

.portal-tile:hover:not(.portal-tile--disabled) {
	transform: translateY(-3px);
	box-shadow: 0 14px 32px rgba(26, 26, 46, 0.1);
	border-color: currentColor;
}

.portal-tile__icon {
	font-size: 32px;
	line-height: 1;
	margin-bottom: 8px;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-tile:hover:not(.portal-tile--disabled) .portal-tile__icon {
	transform: rotate(-8deg) scale(1.1);
}

.portal-tile__title {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50;
	font-size: 19px;
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--portal-ink);
}

.portal-tile__hint {
	font-size: 13px;
	color: var(--portal-muted);
	line-height: 1.4;
}

.portal-tile__badge {
	position: absolute;
	top: 16px;
	right: 16px;
	background: rgba(26, 26, 46, 0.08);
	color: var(--portal-ink);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
}

.portal-tile__coming {
	margin-top: auto;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--portal-muted);
	padding-top: 10px;
}

.portal-tile--disabled {
	opacity: 0.65;
	cursor: not-allowed;
	background: var(--portal-surface-warm, #f5efe3);
}

/* Tile color variants — left-side accent bar */
.portal-tile--ember { background: linear-gradient(135deg, #fff4ee, var(--portal-surface)); }
.portal-tile--ember .portal-tile__title { color: #c04a2e; }

.portal-tile--mint { background: linear-gradient(135deg, #e8f5f0, var(--portal-surface)); }
.portal-tile--mint .portal-tile__title { color: #0f766e; }

.portal-tile--sky { background: linear-gradient(135deg, #e6f0fa, var(--portal-surface)); }
.portal-tile--sky .portal-tile__title { color: #1e3a8a; }

.portal-tile--peach { background: linear-gradient(135deg, #fdf0e0, var(--portal-surface)); }
.portal-tile--peach .portal-tile__title { color: #9a3412; }

.portal-tile--lavender { background: linear-gradient(135deg, #efe6fa, var(--portal-surface)); }
.portal-tile--lavender .portal-tile__title { color: #5b21b6; }

.portal-tile--rose { background: linear-gradient(135deg, #fbe6ec, var(--portal-surface)); }
.portal-tile--rose .portal-tile__title { color: #9f1239; }

/* Quickstat row */
.portal-quickstats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 14px;
}

.portal-quickstats--narrow {
	grid-template-columns: repeat(3, 1fr);
	max-width: 640px;
	margin-bottom: 28px;
}

@media (max-width: 575px) {
	.portal-quickstats { grid-template-columns: repeat(2, 1fr); }
	.portal-quickstats--narrow { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.portal-quickstat {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 14px;
	padding: 18px 20px 16px;
	text-align: left;
}

.portal-quickstat__value {
	font-family: var(--portal-font-display);
	font-variation-settings: 'SOFT' 50;
	font-size: 38px;
	font-weight: 500;
	line-height: 1;
	color: var(--portal-ink);
	letter-spacing: -0.03em;
	margin-bottom: 4px;
}

.portal-quickstat__value--live {
	color: #059669;
	position: relative;
}

.portal-quickstat__value--live::after {
	content: '●';
	display: inline-block;
	color: #10b981;
	font-size: 14px;
	margin-left: 8px;
	animation: live-pulse 1.6s ease-in-out infinite;
	vertical-align: middle;
}

@keyframes live-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.portal-quickstat__label {
	font-size: 12px;
	color: var(--portal-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 8px;
}

.portal-quickstat__link {
	font-size: 13px;
	color: var(--portal-yellow);
	text-decoration: none;
	font-weight: 600;
}

.portal-quickstat__link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Principal — teacher overview cards
   -------------------------------------------------------------------------- */

.portal-teacher-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 18px;
}

.portal-teacher-card {
	padding: 22px 24px 20px;
}

.portal-teacher-card__header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.portal-teacher-card__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--portal-yellow-soft);
	color: var(--portal-yellow);
	font-size: 20px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.portal-teacher-card__name {
	font-family: var(--portal-font-display);
	font-size: 18px;
	font-weight: 500;
	color: var(--portal-ink);
	line-height: 1.2;
}

.portal-teacher-card__role {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--portal-muted);
	margin-top: 2px;
}

.portal-teacher-card__stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	padding-top: 16px;
	border-top: 1px solid var(--portal-line);
}

.portal-teacher-card__stats > div {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.portal-teacher-card__stat-value {
	font-family: var(--portal-font-display);
	font-size: 24px;
	font-weight: 500;
	color: var(--portal-ink);
	line-height: 1;
}

.portal-teacher-card__stat-value--live {
	color: #059669;
}

.portal-teacher-card__stat-label {
	font-size: 11px;
	color: var(--portal-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Achievement badges
   -------------------------------------------------------------------------- */

.portal-achievement {
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-xl);
	padding: 16px;
	box-shadow: var(--portal-shadow-card);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.portal-achievement:hover { transform: translateY(-3px); box-shadow: var(--portal-shadow-card-hover); }
.portal-achievement--common    { background: var(--portal-paper); }
.portal-achievement--rare      { background: var(--portal-blue-soft);   border-color: rgba(66, 139, 255, 0.2); }
.portal-achievement--legendary { background: var(--portal-yellow-soft); border-color: rgba(255, 235, 50, 0.3); }

.portal-achievement__icon { font-size: 2rem; }
.portal-achievement__title {
	font-family: var(--portal-font-display);
	font-weight: 700;
	color: var(--portal-ink);
}
.portal-achievement__rarity {
	font-family: var(--portal-font-display);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--portal-mute);
}

.portal-achievement-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ── Quiz question form (add/edit) ── */
.portal-type-fields {
	display: none;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px dashed var(--portal-line);
}

.portal-type-fields--active { display: block; }

.portal-help-inline {
	color: var(--portal-muted);
	font-weight: 400;
	font-size: 12px;
}

.portal-alt-answers {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.portal-alt-answer {
	display: flex;
	gap: 8px;
	align-items: center;
}
.portal-alt-answer__input { flex: 1; }
.portal-alt-answer__remove {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: var(--portal-r);
	background: transparent;
	border: 1.5px solid var(--portal-line);
	color: var(--portal-mute);
	cursor: pointer;
	transition: all 0.15s ease;
}
.portal-alt-answer__remove:hover { background: var(--portal-danger-soft); color: var(--portal-danger); border-color: var(--portal-danger); }
.portal-alt-answer__remove svg { width: 16px; height: 16px; stroke-width: 2.4; }
.portal-alt-answers__add {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 8px 14px;
	background: var(--portal-yellow-soft);
	border: 1.5px dashed var(--portal-line);
	border-radius: var(--portal-r-pill);
	color: var(--portal-ink-soft);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
}
.portal-alt-answers__add:hover { background: var(--portal-yellow); color: var(--portal-ink); }
.portal-alt-answers__add svg { width: 16px; height: 16px; stroke-width: 2.4; }

.portal-radio-list { display: flex; flex-direction: column; gap: 8px; }

/* ============ Parent portal ============ */

.portal-app--parent::before { content: none; }

.portal-login-card--wide { max-width: 560px; }

.portal-form-error {
	padding: 12px 16px;
	background: #fff3f2;
	border: 1px solid var(--portal-yellow);
	border-radius: 10px;
	color: #8f2619;
	font-size: 14px;
	margin-bottom: 16px;
}

.portal-form-error div + div { margin-top: 4px; }

.portal-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 575px) {
	.portal-field-row { grid-template-columns: 1fr; }
}

/* Parent dashboard */

.portal-child-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card);
	transition: transform 0.2s ease, box-shadow 0.25s ease;
	text-decoration: none !important;
	color: inherit;
}
.portal-child-card:hover { transform: translateY(-3px); box-shadow: var(--portal-shadow-card-hover); }
.portal-child-card__head { display: flex; gap: 12px; align-items: center; }
.portal-child-card__avatar { width: 48px; height: 48px; }
.portal-child-card__name {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.05rem;
}
.portal-child-card__stats { font-size: 0.85rem; color: var(--portal-mute); }
.portal-child-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* .portal-card--empty, .portal-card--soft, .portal-card--narrow — see unified versions above */

.portal-pending-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid #f1e6d2;
}

.portal-pending-row:last-child { border-bottom: 0; }

.portal-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
}

.portal-table th,
.portal-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid #ece5da;
}

.portal-table th {
	font-size: 13px;
	text-transform: uppercase;
	color: #6a5f50;
	letter-spacing: .04em;
}

/* Pairing / QR */

.portal-pair-qr {
	text-align: center;
	padding: 32px;
}

.portal-pair-qr__image {
	max-width: 320px;
	width: 100%;
	height: auto;
	margin: 0 auto 16px;
	display: block;
}

.portal-pair-qr__fallback {
	margin-top: 20px;
	padding: 16px;
	background: #faf5ed;
	border-radius: 12px;
}

.portal-pair-qr__url {
	display: inline-block;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #ece5da;
	border-radius: 8px;
	font-family: monospace;
	font-size: 13px;
	word-break: break-all;
	max-width: 100%;
}

/* Permissions toggles */

.portal-permissions-toggles { display: flex; flex-direction: column; gap: 8px; }

.portal-permission-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #ece5da;
	border-radius: 12px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.portal-permission-row:hover { border-color: var(--portal-yellow); }

.portal-permission-row input[type=checkbox] { flex-shrink: 0; }

/* Chips */

.portal-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	margin: 2px;
}

.portal-chip--on { background: #d4ecdb; color: #176f30; }
.portal-chip--off { background: #f1e6d2; color: #8a6b2f; }

.portal-chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Student home's parents card: .student-home-parent in Play/@layout.latte (#678). */

/* .portal-btn--sm and .portal-btn--danger — see unified versions above */

.portal-legal-body {
	font-size: 15px;
	line-height: 1.65;
	color: #4a4238;
}

.portal-legal-body p { margin: 12px 0; }

.portal-legal-body ul { padding-left: 20px; }


/* ─── Standalone Quiz (#274) — AI-generated tests ────────────────────── */

/* #978 — teacher input window: full width, no max-width. */
.portal-quiz-form-wrap { margin: 0 0 32px; }

.portal-quiz-form {
	background: #ffffff;
	padding: 32px;
	border-radius: 16px;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
	border: 1px solid #f0e8df;
}

.portal-quiz-form__field { margin-bottom: 24px; }

.portal-quiz-form__label {
	display: block;
	font-weight: 600;
	font-size: 16px;
	color: #2c2018;
	margin-bottom: 8px;
}

.portal-quiz-form__optional { color: #94867d; font-weight: 400; font-size: 14px; }

.portal-quiz-form input[type="text"],
.portal-quiz-form textarea,
.portal-quiz-form__select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #e3d5c7;
	border-radius: 10px;
	font-size: 15px;
	font-family: inherit;
	background: #fdf9f5;
	color: #2c2018;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-quiz-form input[type="text"]:focus,
.portal-quiz-form textarea:focus,
.portal-quiz-form__select:focus {
	outline: none;
	border-color: #d97706;
	box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.portal-quiz-form__select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 40px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	cursor: pointer;
}

.portal-quiz-form textarea { min-height: 96px; resize: vertical; }

.portal-quiz-form__hint {
	display: block;
	color: #8b7d72;
	font-size: 13px;
	margin-top: 6px;
}

.portal-quiz-form input[type="range"] {
	width: 100%;
	height: 6px;
	margin: 12px 0 8px;
	-webkit-appearance: none;
	appearance: none;
	background: #f1e6d2;
	border-radius: 999px;
	outline: none;
}

.portal-quiz-form input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #d97706;
	cursor: pointer;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px #d97706;
}

.portal-quiz-form input[type="range"]::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #d97706;
	cursor: pointer;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px #d97706;
}

.portal-quiz-form__slider-meta {
	display: flex;
	justify-content: space-between;
	color: #8b7d72;
	font-size: 13px;
}

.portal-quiz-form__slider-value strong {
	color: #d97706;
	font-size: 18px;
	margin-right: 4px;
}

.portal-quiz-form__checkboxes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.portal-quiz-form__check {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: #fdf9f5;
	border: 1px solid #e3d5c7;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	font-size: 14px;
}

.portal-quiz-form__check:hover { background: #f8efe2; }
.portal-quiz-form__check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.portal-quiz-form__error {
	color: #c1393b;
	font-size: 13px;
	margin-top: 6px;
}

.portal-quiz-form__submit {
	display: block;
	width: 100%;
	padding: 14px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.1s, box-shadow 0.15s;
	margin-top: 12px;
}

.portal-quiz-form__submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(217, 119, 6, 0.25);
}

.portal-quiz-form__submit:active { transform: translateY(0); }

.portal-quiz-form__loading-hint {
	text-align: center;
	color: #8b7d72;
	font-size: 13px;
	margin: 12px 0 0;
}

/* My quizzes list */

.portal-quiz-list { display: grid; gap: 10px; max-width: 720px; }

.portal-quiz-list__item {
	display: block;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, transform 0.1s;
}

.portal-quiz-list__item:hover { border-color: #d97706; transform: translateX(2px); }

.portal-quiz-list__title { font-weight: 600; color: #2c2018; }
.portal-quiz-list__meta { color: #8b7d72; font-size: 13px; margin-top: 2px; }
.portal-quiz-list__meta code {
	background: #f1e6d2;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 12px;
}

/* Quiz detail page (teacher) */

.portal-quiz-detail { max-width: 860px; margin: 0 auto; }

/* The old bespoke share box (`.portal-quiz-detail__share*`, 200px QR) was removed
   with #786 — the quiz detail now includes the unified `_studentShare.latte`
   block and styles it via `.portal-share*` below. */

.portal-quiz-detail__questions h2 { font-size: 18px; margin: 0 0 16px; }

.portal-quiz-detail__question {
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 12px;
}

.portal-quiz-detail__question-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	color: #8b7d72;
	font-size: 13px;
}

.portal-quiz-detail__qnum { font-weight: 700; color: #2c2018; }
.portal-quiz-detail__qtype { flex: 1; }
.portal-quiz-detail__qdel { color: #c1393b; text-decoration: none; font-size: 12px; }
.portal-quiz-detail__qdel:hover { text-decoration: underline; }

.portal-quiz-detail__qtext { font-weight: 500; margin-bottom: 12px; line-height: 1.4; }

.portal-quiz-detail__options { list-style: none; padding: 0; margin: 0; }

.portal-quiz-detail__option {
	padding: 8px 12px;
	margin-bottom: 4px;
	border-radius: 6px;
	background: #fdf9f5;
	font-size: 14px;
}

.portal-quiz-detail__option--correct {
	background: #e8f5e9;
	color: #1b5e20;
}

.portal-quiz-detail__check { float: right; font-weight: 600; font-size: 12px; }

.portal-quiz-detail__answer {
	background: #e8f5e9;
	color: #1b5e20;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
}

/* #487 — editing a question and adding one, folded under a toggle so the list stays readable.
   A save lands on the question's #q-<id> anchor; the margin keeps it below the sticky editor bar. */
.portal-quiz-detail__question,
.portal-quiz-detail__add { scroll-margin-top: 220px; }
.portal-quiz-detail__edit { margin-top: 12px; }
.portal-quiz-detail__edit-toggle {
	display: inline-block;
	cursor: pointer;
	color: #d97706;
	font-size: 13px;
	font-weight: 600;
	list-style: none;
}
.portal-quiz-detail__edit-toggle::-webkit-details-marker { display: none; }
.portal-quiz-detail__edit-toggle:hover { text-decoration: underline; }
.portal-quiz-detail__edit-body {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #f0e8df;
}

.portal-quiz-detail__add {
	background: #fff;
	border: 1px dashed #e5d8ca;
	border-radius: 12px;
	padding: 18px 20px;
	margin-top: 16px;
}
.portal-quiz-detail__add h3 { font-size: 16px; margin: 0 0 4px; }

.portal-quiz-detail__actions {
	display: flex;
	justify-content: space-between;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid #f0e8df;
}

.portal-quiz-detail__back { color: #d97706; text-decoration: none; }
.portal-quiz-detail__back:hover { text-decoration: underline; }
.portal-quiz-detail__delete-quiz { color: #c1393b; text-decoration: none; font-size: 14px; }
.portal-quiz-detail__delete-quiz:hover { text-decoration: underline; }

/* Quiz play (student view) */

.portal-quiz-play { max-width: 720px; margin: 0 auto; }

.portal-quiz-play__question {
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 14px;
	padding: 22px;
	margin-bottom: 16px;
}

.portal-quiz-play__head {
	display: flex;
	gap: 12px;
	color: #8b7d72;
	font-size: 13px;
	margin-bottom: 8px;
}

.portal-quiz-play__qnum {
	background: #d97706;
	color: #fff;
	padding: 2px 10px;
	border-radius: 10px;
	font-weight: 600;
}

.portal-quiz-play__qtext { font-weight: 500; font-size: 17px; margin-bottom: 16px; line-height: 1.4; }

.portal-quiz-play__options { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

.portal-quiz-play__option {
	display: block;
	width: 100%;
	text-align: left;
	padding: 12px 16px;
	border: 1px solid #e3d5c7;
	background: #fdf9f5;
	border-radius: 10px;
	cursor: pointer;
	font-size: 15px;
	transition: background 0.15s, border-color 0.15s;
}

.portal-quiz-play__option:hover { background: #f8efe2; border-color: #d97706; }
.portal-quiz-play__option.is-correct { background: #c8e6c9; border-color: #2e7d32; color: #1b5e20; }
.portal-quiz-play__option.is-wrong { background: #ffcdd2; border-color: #c62828; color: #b71c1c; }

.portal-quiz-play__open {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #e3d5c7;
	border-radius: 10px;
	font-size: 15px;
	background: #fdf9f5;
	margin-bottom: 10px;
}

.portal-quiz-play__check-btn {
	padding: 10px 20px;
	background: #d97706;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
}

.portal-quiz-play__tokens {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.portal-quiz-play__token {
	padding: 6px 12px;
	background: #fdf9f5;
	border: 1px solid #e3d5c7;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}

.portal-quiz-play__token:disabled { opacity: 0.4; cursor: default; }

.portal-quiz-play__sentence {
	min-height: 36px;
	padding: 8px 12px;
	background: #f1e6d2;
	border-radius: 8px;
	margin-bottom: 10px;
	font-size: 15px;
}

.portal-quiz-play__feedback {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	font-weight: 500;
}

.portal-quiz-play__feedback.is-correct { background: #c8e6c9; color: #1b5e20; }
.portal-quiz-play__feedback.is-wrong { background: #ffcdd2; color: #b71c1c; }

/* ─── Generate Content hub (#274) ─────────────────────────────────────── */

.portal-content-hub { max-width: 1120px; margin: 0 auto 40px; }
.portal-content-hub__grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.portal-content-tile {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	text-decoration: none !important;
	color: inherit;
}
.portal-content-tile:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: var(--portal-shadow-card-hover); }
.portal-content-tile__icon { font-size: 2rem; }
.portal-content-tile__title { font-family: var(--portal-font-display); font-weight: 800; font-size: 1.05rem; color: var(--portal-ink); }
.portal-content-tile__hint  { color: var(--portal-ink-soft); font-size: 0.9rem; line-height: 1.5; flex: 1; }
.portal-content-tile__cta   {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--portal-blue);
	margin-top: auto;
}
.portal-content-tile--presentation { background: var(--portal-yellow-soft); }
.portal-content-tile--disabled { opacity: 0.55; cursor: not-allowed; }
.portal-content-tile--disabled:hover { transform: none; }
.portal-content-tile__coming {
	font-family: var(--portal-font-display);
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--portal-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* Slide detail (teacher view) extras */

.portal-slide-detail__bullets { padding-left: 20px; margin: 8px 0; }
.portal-slide-detail__bullets li { margin: 4px 0; color: #2c2018; }

.portal-slide-detail__fun {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	border-left: 4px solid #d97706;
	padding: 10px 14px;
	border-radius: 8px;
	margin: 8px 0;
	font-size: 14px;
}

.portal-slide-detail__activity {
	background: #ecfdf5;
	border-left: 4px solid #059669;
	padding: 10px 14px;
	border-radius: 8px;
	margin: 8px 0;
	font-size: 14px;
}

.portal-slide-detail__notes {
	margin-top: 10px;
	padding: 8px 12px;
	background: #f8efe2;
	border-radius: 8px;
}

.portal-slide-detail__notes summary {
	cursor: pointer;
	font-weight: 500;
	color: #5e5147;
	font-size: 13px;
}

.portal-slide-detail__notes-body {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #e3d5c7;
	color: #2c2018;
	line-height: 1.6;
	white-space: pre-wrap;
}

/* ─── Slide edit (inline edit form on detail page) ─── */

.slide-edit__actions {
	margin-left: auto;
	display: flex;
	gap: 8px;
}

.slide-edit__toggle,
.slide-edit__cancel,
.slide-edit__save {
	background: #fff;
	border: 1px solid #d0bfae;
	color: #2c2018;
	padding: 4px 12px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
}

.slide-edit__toggle:hover,
.slide-edit__cancel:hover { background: #faf5ed; }
.slide-edit__save { background: #d97706; color: #fff; border-color: #d97706; font-weight: 600; }
.slide-edit__save:hover { background: #b45309; }

.slide-edit__delete {
	color: #c1393b;
	text-decoration: none;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 16px;
	line-height: 1;
}
.slide-edit__delete:hover { background: rgba(193,57,59,0.1); }

.slide-edit__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 0 0;
}

.slide-edit__form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #5e5147;
}

.slide-edit__form input,
.slide-edit__form textarea {
	font: inherit;
	font-weight: 400;
	color: #2c2018;
	padding: 8px 10px;
	border: 1px solid #d0bfae;
	border-radius: 6px;
	background: #fff;
}

.slide-edit__form textarea { font-family: inherit; line-height: 1.5; resize: vertical; }
.slide-edit__form input:focus,
.slide-edit__form textarea:focus { outline: none; border-color: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }

.slide-edit__form-actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
}

/* ─── Per-slide AI ilustrace (#274) ─── */

.portal-slide-detail__deco-block {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 12px;
	padding: 12px 14px;
	background: #faf5ed;
	border: 1px solid #ead9c1;
	border-radius: 10px;
}

.portal-slide-detail__deco-img {
	display: block;
	max-width: 200px;
	max-height: 200px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid #ead9c1;
}

.portal-slide-detail__deco-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.portal-slide-detail__deco-form label,
.portal-slide-detail__deco-form > span {
	font-size: 13px;
	font-weight: 600;
	color: #5e5147;
}

.portal-slide-detail__deco-form input[type="text"] {
	flex: 1 1 240px;
	min-width: 180px;
	height: 36px;
	font: inherit;
	color: #2c2018;
	padding: 7px 10px;
	border: 1px solid #d0bfae;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
}

.portal-slide-detail__deco-form input[type="text"]:focus {
	outline: none;
	border-color: #d97706;
	box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
}

.portal-slide-detail__deco-form button[type="submit"] {
	background: #d97706;
	color: #fff;
	border: 1px solid #d97706;
	padding: 7px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.portal-slide-detail__deco-form button[type="submit"]:hover {
	background: #b45309;
}

.portal-slide-detail__deco-form--empty {
	flex-direction: column;
	align-items: stretch;
}

.portal-slide-detail__deco-form--empty > label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #5e5147;
}

.portal-slide-detail__deco-form--empty > label input[type="text"] {
	flex: 0 1 auto;
	width: 100%;
	max-width: 480px;
}

.portal-slide-detail__deco-form--empty button[type="submit"] {
	align-self: flex-start;
}

.portal-slide-detail__deco-form--empty small {
	color: #8a7968;
	font-size: 12px;
}

.portal-slide-detail__deco-delete {
	color: #c1393b;
	text-decoration: none;
	font-size: 13px;
	padding: 6px 10px;
	border-radius: 6px;
}

.portal-slide-detail__deco-delete:hover {
	background: rgba(193,57,59,0.1);
}

/* ─── Slide deck (full-screen presentation viewer) ─── */

.slide-deck {
	position: fixed;
	inset: 0;
	background: #1a1108;
	z-index: 999;
	overflow: hidden;
}

.slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
	padding: 60px 80px;
}

.slide.is-active { opacity: 1; pointer-events: auto; }

.slide__inner {
	max-width: 1100px;
	width: 100%;
	color: #fff;
	font-family: 'Cabin', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Right-side AI decoration (#274) — když má slide vygenerovanou ilustraci,
   text se zúží na levou polovinu a dekorace dosedne do pravé.
   Image je v "polaroid" kartě (white bg + soft shadow) → funguje na libovolném
   slide gradientu, žádný mix-blend-mode hack. */
.slide.slide--has-deco .slide__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
	gap: 48px;
	align-items: center;
}
.slide__deco {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
/* #830 §4 — origin badge sits under the picture it describes, never in a
   credits list at the end: a pupil must not be able to mistake an AI
   illustration for a real historical source. */
.image-origin {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	white-space: nowrap;
}
.image-origin--real {
	background: rgba(23, 85, 46, 0.14);
	color: #2f8f57;
	border: 1px solid rgba(47, 143, 87, 0.5);
}
.image-origin--ai {
	background: rgba(107, 74, 158, 0.16);
	color: #b39ae0;
	border: 1px dashed rgba(179, 154, 224, 0.6);
}
/* #609 — a teacher's own upload: neither a verified source nor an AI illustration. */
.image-origin--upload {
	background: rgba(71, 85, 105, 0.12);
	color: #64748b;
	border: 1px solid rgba(100, 116, 139, 0.45);
}
/* #9 — AI transparency label (_aiLabel.latte): next to the name of an AI character, or on a page
   whose text the AI wrote. Same violet as the AI image badge, so "AI" reads as one thing. The
   Play layout keeps its own copy because it does not load this file. */
.ai-label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	line-height: 1.4;
	white-space: nowrap;
	vertical-align: middle;
	text-transform: none;
	background: rgba(124, 58, 237, .12);
	color: #6d28d9;
	border: 1px solid rgba(124, 58, 237, .35);
}
h1 .ai-label { font-size: 13px; margin-left: 10px; }
/* A teacher's editor shows the origin badge in a narrow column — there it may wrap. */
.image-origin-wrap .image-origin { white-space: normal; }
.ai-content-notice {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 12px;
}
.ai-character-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: 12px;
	background: rgba(124, 58, 237, .07);
	border: 1px solid rgba(124, 58, 237, .25);
	color: #3b2a63;
	font-size: 14px;
}
/* #609 — the historical-figure label is longer than „AI postava"; on a phone it may wrap. */
.ai-label--historical { white-space: normal; }
/* #609 — label + sentence on an AI evaluation (_aiEvaluationNotice.latte) and on an AI voice
   (_aiAudioNotice.latte, directly under the player). */
.ai-evaluation-notice {
	margin: 8px 0 12px;
	padding: 8px 12px;
	border-radius: 10px;
	background: rgba(124, 58, 237, .07);
	border: 1px solid rgba(124, 58, 237, .25);
	color: #3b2a63;
	font-size: 13px;
}
.ai-evaluation-notice__text { margin: 4px 0 0; }
.ai-audio-notice {
	margin: 6px 0 0;
	color: #5b4a86;
	font-size: 12px;
	line-height: 1.4;
}
.slide__deco img {
	max-width: 100%;
	max-height: 70vh;
	width: auto;
	height: auto;
	object-fit: contain;
	background: #fff;
	padding: 18px;
	border-radius: 16px;
	box-shadow:
		0 1px 0 rgba(255,255,255,0.25) inset,
		0 12px 32px rgba(0,0,0,0.35),
		0 4px 12px rgba(0,0,0,0.18);
}
@media (max-width: 900px) {
	.slide.slide--has-deco .slide__inner {
		grid-template-columns: 1fr;
	}
	.slide__deco img { max-height: 35vh; }
}

.slide__type-badge {
	display: inline-block;
	padding: 6px 16px;
	background: rgba(255,255,255,0.15);
	border-radius: 999px;
	font-size: 14px;
	letter-spacing: 0.04em;
	margin-bottom: 28px;
	text-transform: uppercase;
	font-weight: 600;
}

.slide__icon { font-size: 96px; margin-bottom: 24px; }

/* Sprievodca card on the presentation title slide */
.slide__guide {
	display: inline-flex;
	align-items: center;
	gap: 18px;
	padding: 14px 26px 14px 14px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	margin-bottom: 32px;
	backdrop-filter: blur(6px);
}
.slide__guide-avatar {
	width: 96px;
	height: 96px;
	border-radius: 999px;
	object-fit: cover;
	object-position: center top;
	border: 3px solid rgba(255, 255, 255, 0.85);
}
.slide__guide-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	color: #fff;
	text-align: left;
}
.slide__guide-label {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	opacity: 0.7;
	margin-bottom: 4px;
}
.slide__guide-name {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 26px;
	line-height: 1.1;
}
.slide__guide--summary {
	margin-bottom: 28px;
}
.slide__guide-quote {
	margin: 0 0 28px;
	padding: 20px 28px;
	border-left: 6px solid rgba(255, 255, 255, 0.85);
	background: rgba(255, 255, 255, 0.10);
	border-radius: 12px;
	font-size: 30px;
	line-height: 1.4;
	font-style: italic;
	color: #fff;
}

.slide__title { font-size: 64px; font-weight: 700; line-height: 1.1; margin: 0 0 18px; }
.slide__subtitle { font-size: 28px; opacity: 0.8; margin: 0 0 32px; }
.slide__hint { font-size: 16px; opacity: 0.5; margin-top: 40px; }
.slide__headline { font-size: 56px; font-weight: 700; line-height: 1.2; margin: 0 0 32px; }

.slide__bullets {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 26px;
	line-height: 1.6;
}

.slide__bullets li {
	padding: 12px 0;
	padding-left: 36px;
	position: relative;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.slide__bullets li::before {
	content: '→';
	position: absolute;
	left: 0;
	font-weight: 700;
	color: rgba(255,255,255,0.6);
}

.slide__fun-fact {
	margin-top: 32px;
	padding: 24px 28px;
	background: rgba(252,211,77,0.2);
	border-left: 6px solid #fcd34d;
	border-radius: 12px;
	font-size: 22px;
	line-height: 1.5;
}

.slide__fun-fact-label {
	display: block;
	font-weight: 700;
	color: #fcd34d;
	margin-bottom: 8px;
	font-size: 14px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.slide__activity {
	margin-top: 32px;
	padding: 24px 28px;
	background: rgba(110,231,183,0.18);
	border-left: 6px solid #6ee7b7;
	border-radius: 12px;
}

.slide__activity-label {
	font-weight: 700;
	color: #6ee7b7;
	margin-bottom: 8px;
	font-size: 14px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Per-type backgrounds */

.slide--title { background: linear-gradient(135deg, #2c1810 0%, #5b2c20 100%); }
.slide--end { background: linear-gradient(135deg, #2c1810 0%, #5b2c20 100%); }
.slide--intro { background: linear-gradient(135deg, #1e3a8a 0%, #3b0764 100%); }
.slide--content { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }
.slide--fun-fact { background: linear-gradient(135deg, #92400e 0%, #b45309 100%); }
.slide--activity { background: linear-gradient(135deg, #064e3b 0%, #134e4a 100%); }
.slide--quiz { background: linear-gradient(135deg, #581c87 0%, #831843 100%); }
.slide--recap { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); }
.slide--checkpoint { background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%); }
.slide--podcast { background: linear-gradient(135deg, #4c1d95 0%, #7e22ce 100%); }
.slide--guide-summary { background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%); }
.slide--closing { background: linear-gradient(135deg, #be185d 0%, #9f1239 100%); }
.slide--sources { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }

/* #923 — Fantastický podcast slide: player + transcript, read from the projector.
   The transcript is the only scrollable region in the deck, so it gets its own max height
   instead of letting a long episode push the player off the screen. */
.slide__body--podcast { display: flex; flex-direction: column; align-items: stretch; gap: 16px; width: 100%; }
.slide__podcast-disclaimer { font-size: 16px; opacity: 0.85; display: flex; align-items: center; gap: 8px; }
.slide__podcast-audio { width: 100%; max-width: 640px; }
.slide__podcast-pending { font-size: 18px; opacity: 0.85; }
.slide__podcast-transcript {
	max-height: 38vh;
	overflow-y: auto;
	text-align: left;
	font-size: 17px;
	line-height: 1.55;
	padding: 16px 20px;
	border-radius: 16px;
	background: rgba(0, 0, 0, 0.22);
}
.slide__podcast-phase { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 14px; opacity: 0.85; margin: 14px 0 6px; }
.slide__podcast-phase:first-child { margin-top: 0; }
.slide__podcast-line { margin: 0 0 10px; }
.slide__podcast-line strong { opacity: 0.95; }

/* #923 — mini Quizmajster call-to-action on the end slide (owner only) */
.slide__mini-quiz { margin-top: 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.slide__mini-quiz-title { font-size: 22px; font-weight: 700; opacity: 0.9; }
.slide__mini-quiz-cta {
	display: inline-block;
	padding: 14px 28px;
	border-radius: 999px;
	background: #FDE047;
	color: #1E1E1E;
	font-weight: 800;
	font-size: 20px;
	text-decoration: none;
}
.slide__mini-quiz-cta:hover { background: #FACC15; }

/* HUD (controls) */

.slide-deck__hud {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 12px;
	align-items: center;
	background: rgba(0,0,0,0.5);
	backdrop-filter: blur(12px);
	border-radius: 999px;
	padding: 8px 16px;
	z-index: 1000;
}

.slide-deck__nav {
	background: transparent;
	color: #fff;
	border: none;
	font-size: 22px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s;
}

.slide-deck__nav:hover { background: rgba(255,255,255,0.15); }

.slide-deck__counter {
	color: #fff;
	font-size: 14px;
	min-width: 70px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.slide-deck__progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: rgba(255,255,255,0.1);
	z-index: 1001;
}

.slide-deck__progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #d97706, #fcd34d);
	transition: width 0.3s;
	width: 0;
}

/* Loading overlay shown during AI lesson-plan generation (#353).
   Full-screen fixed cover with spinner + 4-stage indicator so the teacher
   knows the click registered and that the wait is normal. */
.portal-loading {
	position: fixed;
	inset: 0;
	background: rgba(247, 244, 234, 0.96);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 10000;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.portal-loading.is-visible { opacity: 1; }

.portal-loading__panel {
	background: #fff;
	border-radius: 24px;
	max-width: 480px;
	width: 100%;
	padding: 40px 32px;
	text-align: center;
	box-shadow: 0 24px 48px rgba(30, 30, 30, 0.12);
	border: 1px solid rgba(30, 30, 30, 0.06);
}

.portal-loading__spinner {
	width: 64px;
	height: 64px;
	margin: 0 auto 24px;
	position: relative;
}

.portal-loading__spinner-arc {
	position: absolute;
	inset: 0;
	border: 5px solid #FDFCDE;
	border-top-color: #FFEB32;
	border-right-color: #FFEB32;
	border-radius: 50%;
	animation: portal-loading-spin 1.1s cubic-bezier(0.6, 0.1, 0.4, 0.9) infinite;
}

@keyframes portal-loading-spin { to { transform: rotate(360deg); } }

.portal-loading__title {
	font-family: var(--portal-font-display, 'Maven Pro', sans-serif);
	font-weight: 800;
	font-size: 1.6rem;
	color: var(--portal-ink, #1E1E1E);
	margin: 0 0 8px;
}

.portal-loading__sub {
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--portal-ink-soft, #4a4a4a);
	margin: 0 0 24px;
}

.portal-loading__steps {
	list-style: none;
	padding: 0;
	margin: 0;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.portal-loading__steps li {
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 0.9rem;
	color: var(--portal-mute, #8a8580);
	background: rgba(0, 0, 0, 0.03);
	position: relative;
	padding-left: 32px;
	transition: background 0.3s ease, color 0.3s ease;
}

.portal-loading__steps li::before {
	content: '○';
	position: absolute;
	left: 12px;
	top: 8px;
	font-size: 0.85rem;
}

.portal-loading__steps li.is-active {
	background: #FDFCDE;
	color: var(--portal-ink, #1E1E1E);
	font-weight: 600;
}

.portal-loading__steps li.is-active::before {
	content: '●';
	color: #d97706;
	animation: portal-loading-pulse 1.2s ease-in-out infinite;
}

@keyframes portal-loading-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* Audio play button on play view slides (#353, #506) — sits inline next to the
   slide-type badge (or guide signature) above the headline, so its position is
   independent of headline length and it's impossible to miss. Prominent accent
   circle. Only visible to the owner-teacher. */
.slide__meta-row {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 28px;
}

.slide__meta-row .slide__type-badge,
.slide__meta-row .slide__guide,
.slide__meta-row .slide__guide--summary { margin-bottom: 0; }

/* Scoped under .slide__meta-row to win over the base `.tts-button` rules
   (defined later in this file with equal specificity) — without this, the
   shared 28px `.tts-button` size would override and the icon stays tiny. */
.slide__meta-row .slide__audio {
	position: relative;
	flex: 0 0 auto;
	width: 84px;
	height: 84px;
	margin-left: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 3px solid var(--portal-blue, #1B6B3F);
	border-radius: 999px;
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.slide__meta-row .slide__audio:hover {
	transform: scale(1.08);
	background: #f0fdf4;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}
.slide__audio.tts-button--loading { opacity: 0.6; cursor: wait; }
.slide__audio.tts-button--loading::after {
	content: '';
	position: absolute;
	inset: -2px;
	border: 2px solid transparent;
	border-top-color: var(--portal-blue, #1B6B3F);
	border-radius: 999px;
	animation: slide-audio-spin 0.8s linear infinite;
}

@keyframes slide-audio-spin {
	to { transform: rotate(360deg); }
}

/* ─── Speaker notes (printable) ─── */

.speaker-notes { max-width: 900px; margin: 0 auto; }

.speaker-notes__slide {
	display: grid;
	grid-template-columns: 60px 1fr 1.5fr;
	gap: 16px;
	margin-bottom: 16px;
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 12px;
	padding: 18px;
}

@media (max-width: 800px) {
	.speaker-notes__slide { grid-template-columns: 1fr; }
}

.speaker-notes__num {
	font-size: 32px;
	font-weight: 700;
	color: #d97706;
	text-align: center;
}

.speaker-notes__preview {
	border-radius: 10px;
	padding: 16px;
	color: #fff;
	min-height: 140px;
}

.speaker-notes__preview-type {
	font-size: 11px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.7;
	margin-bottom: 6px;
}

.speaker-notes__preview-headline { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.speaker-notes__preview-bullets { padding-left: 18px; font-size: 13px; opacity: 0.85; margin: 0; }
.speaker-notes__preview-bullets li { margin: 2px 0; }
.speaker-notes__preview-fact { background: rgba(252,211,77,0.25); padding: 6px 10px; border-radius: 6px; font-size: 12px; margin-top: 8px; }
.speaker-notes__preview-activity { background: rgba(110,231,183,0.25); padding: 6px 10px; border-radius: 6px; font-size: 12px; margin-top: 8px; }

.speaker-notes__notes {
	background: #fef3c7;
	border-left: 4px solid #d97706;
	padding: 12px 16px;
	border-radius: 0 10px 10px 0;
}

.speaker-notes__notes-label {
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #92400e;
	margin-bottom: 6px;
}

.speaker-notes__notes-body { color: #2c2018; line-height: 1.6; white-space: pre-wrap; font-size: 14px; }

@media print {
	.portal-app__sidebar, .portal-app__topbar, .portal-page-header, .portal-quiz-detail__back { display: none !important; }
	.speaker-notes__slide { break-inside: avoid; page-break-inside: avoid; }
}

/* Force slide deck text to be white — global h1/h2 styles otherwise leak in. */
.slide-deck .slide__title,
.slide-deck .slide__headline,
.slide-deck .slide__subtitle,
.slide-deck .slide__inner * { color: #fff !important; }
.slide-deck .slide__bullets li::before { color: rgba(255,255,255,0.6) !important; }
.slide-deck .slide__fun-fact-label { color: #fcd34d !important; }
.slide-deck .slide__activity-label { color: #6ee7b7 !important; }

/* --------------------------------------------------------------------------
   Chip — filter / category
   -------------------------------------------------------------------------- */

.portal-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border-radius: var(--portal-r-pill);
	border: 1.5px solid rgba(30, 30, 30, 0.10);
	background: var(--portal-surface);
	color: var(--portal-ink-soft);
	font-family: var(--portal-font-display);
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none !important;
}
.portal-chip:hover { border-color: var(--portal-ink); color: var(--portal-ink); }
.portal-chip--active,
.portal-chip--on { background: var(--portal-ink); color: #fff; border-color: var(--portal-ink); }
.portal-chip--off    { background: var(--portal-yellow-soft); color: #8a6b2f; }
.portal-chip--accent { background: var(--portal-pink-soft); color: #7B2A78; border-color: transparent; }
.portal-chip--success { background: var(--portal-green-soft); color: var(--portal-success-ink); border-color: transparent; }

.portal-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   Badge — uppercase pill label
   -------------------------------------------------------------------------- */

.portal-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: var(--portal-r-pill);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--portal-yellow);
	color: var(--portal-ink);
}
.portal-badge--green { background: var(--portal-green-soft); color: var(--portal-success-ink); }
.portal-badge--pink  { background: var(--portal-pink-soft);  color: #7B2A78; }
.portal-badge--blue  { background: var(--portal-blue-soft);  color: #1B3A66; }
.portal-badge--ink   { background: var(--portal-ink);        color: #fff; }
.portal-badge--soft  { background: var(--portal-line);       color: var(--portal-ink-soft); }

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */

.portal-avatar {
	width: 36px;
	height: 36px;
	border-radius: var(--portal-r-pill);
	display: grid;
	place-items: center;
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.85rem;
	color: #fff;
	flex-shrink: 0;
	background: linear-gradient(135deg, var(--portal-pink), var(--portal-blue));
}
.portal-avatar--sm { width: 28px; height: 28px; font-size: 0.75rem; }
.portal-avatar--lg { width: 56px; height: 56px; font-size: 1.15rem; }
.portal-avatar--yellow { background: linear-gradient(135deg, var(--portal-yellow), var(--portal-green)); color: var(--portal-ink); }
.portal-avatar--purple { background: linear-gradient(135deg, var(--portal-purple), var(--portal-pink)); }

/* --------------------------------------------------------------------------
   Decorations — doodles, yellow highlight, torn divider
   -------------------------------------------------------------------------- */

.portal-doodle {
	position: absolute;
	pointer-events: none;
	opacity: 0.7;
	user-select: none;
}

@media (max-width: 991px) {
	.portal-doodle { display: none; }
}

.portal-hl-yellow {
	position: relative;
	display: inline-block;
	z-index: 0;
}
.portal-hl-yellow::after {
	content: '';
	position: absolute;
	left: -2%;
	right: -2%;
	bottom: 0;
	height: 12px;
	background: var(--portal-yellow);
	z-index: -1;
	border-radius: 6px;
	transform: skewX(-2deg);
}

.portal-torn {
	height: 18px;
	width: 100%;
	opacity: 0.08;
	margin: 32px 0;
	background-image: radial-gradient(circle at 4px 12px, var(--portal-ink) 1.2px, transparent 1.5px);
	background-size: 14px 18px;
}

/* --------------------------------------------------------------------------
   Sprievodca — floating guide (only on Dashboard)
   -------------------------------------------------------------------------- */

.portal-guide {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 50;
	width: 78px;
	height: 78px;
	border-radius: var(--portal-r-pill);
	background: linear-gradient(135deg, var(--portal-pink-soft) 0%, var(--portal-pink) 100%);
	box-shadow: 0 12px 32px -8px rgba(219, 136, 215, 0.55),
	            0 4px 12px rgba(30, 30, 30, 0.10),
	            inset 0 0 0 3px #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	border: none;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.portal-guide:hover { transform: translateY(-4px) rotate(-4deg); }

.portal-guide__initials {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.7rem;
	color: #8A4D8A;
	letter-spacing: -0.02em;
}

.portal-guide__avatar {
	width: 72px;
	height: 72px;
	border-radius: var(--portal-r-pill);
	object-fit: cover;
	object-position: center top;
	display: block;
}

.portal-guide__dot {
	position: absolute;
	right: 6px;
	bottom: 8px;
	width: 16px;
	height: 16px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-green);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px rgba(78, 230, 179, 0.4);
}

.portal-guide__tooltip {
	position: absolute;
	right: 92px;
	bottom: 50%;
	transform: translateY(50%);
	background: var(--portal-ink);
	color: #fff;
	padding: 8px 14px;
	border-radius: 12px;
	font-family: var(--portal-font-display);
	font-weight: 600;
	font-size: 0.85rem;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.portal-guide__tooltip::after {
	content: '';
	position: absolute;
	right: -6px;
	top: 50%;
	transform: translateY(-50%);
	border-style: solid;
	border-width: 6px 0 6px 6px;
	border-color: transparent transparent transparent var(--portal-ink);
}
.portal-guide:hover .portal-guide__tooltip { opacity: 1; transform: translateY(50%) translateX(-4px); }

/* Inline help tooltip (ℹ️ icon next to a heading) */
.portal-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin-left: 6px;
	vertical-align: middle;
	cursor: help;
}
.portal-tip__icon { font-size: 0.7em; line-height: 1; opacity: 0.65; }
.portal-tip__bubble {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%);
	width: max-content;
	max-width: 280px;
	background: var(--portal-ink);
	color: #fff;
	padding: 8px 12px;
	border-radius: 10px;
	font-family: var(--portal-font-display);
	font-weight: 500;
	font-size: 0.8rem;
	line-height: 1.4;
	white-space: normal;
	text-align: left;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease;
	z-index: 30;
}
.portal-tip__bubble::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-style: solid;
	border-width: 6px 6px 0 6px;
	border-color: var(--portal-ink) transparent transparent transparent;
}
.portal-tip:hover .portal-tip__bubble,
.portal-tip:focus .portal-tip__bubble,
.portal-tip:focus-within .portal-tip__bubble { opacity: 1; }

/* ─── #990 — ⓘ: vysvetlenie na požiadanie (_infoTip.latte) ─────────────────
   <details>, takže sa otvára ťuknutím aj klávesnicou — hover na mobile nie je.
   Na desktope bublina pod ikonou, na úzkom displeji spodný panel cez celú šírku,
   aby nikdy nevytiekla mimo obrazovky pri ikone na pravom okraji. */
.portal-info {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}
.portal-info__btn {
	list-style: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1.5px solid var(--portal-line);
	background: var(--portal-surface);
	color: var(--portal-ink-soft);
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	font-weight: 700;
	font-size: 0.8rem;
	line-height: 1;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.portal-info__btn::-webkit-details-marker { display: none; }
.portal-info__btn::marker { content: ''; }
.portal-info__btn:hover,
.portal-info[open] > .portal-info__btn {
	background: var(--portal-ink);
	border-color: var(--portal-ink);
	color: #fff;
}
.portal-info__btn:focus-visible {
	outline: 2px solid var(--portal-ink);
	outline-offset: 2px;
}
.portal-info__body {
	position: absolute;
	top: calc(100% + 8px);
	left: -8px;
	width: max-content;
	max-width: min(320px, calc(100vw - 32px));
	background: var(--portal-ink);
	color: #fff;
	padding: 10px 14px;
	border-radius: 12px;
	font-family: var(--portal-font-body);
	font-weight: 400;
	font-style: normal;
	font-size: 0.85rem;
	line-height: 1.45;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	box-shadow: var(--portal-shadow-card-hover);
	z-index: 40;
}
.portal-info--end .portal-info__body {
	left: auto;
	right: -8px;
}
@media (max-width: 640px) {
	.portal-info__body,
	.portal-info--end .portal-info__body {
		position: fixed;
		top: auto;
		left: 16px;
		right: 16px;
		bottom: 16px;
		width: auto;
		max-width: none;
		/* Nad plávajúcim tlačidlom sprievodcu aj nad modálmi portálu (60). */
		z-index: 80;
	}
}

/* Nadpis/label a jeho ⓘ na jednom riadku. */
.portal-info-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

/* Sprievodca placeholder modal */
.portal-guide-modal {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: rgba(30, 30, 30, 0.5);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.portal-guide-modal.is-open { display: flex; }

.portal-guide-modal__panel {
	background: var(--portal-surface);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card-hover);
	padding: 32px;
	max-width: 420px;
	text-align: center;
}
.portal-guide-modal__panel h3 {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.25rem;
	margin-bottom: 8px;
}
.portal-guide-modal__panel p { color: var(--portal-ink-soft); margin-bottom: 20px; }

/* Onboarding picker cards (3 personas) */
.portal-guide-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 18px 14px 14px;
	background: #fff;
	border-radius: var(--portal-r-xl);
	border: 2px solid #E5E0D5;
	text-decoration: none;
	color: var(--portal-ink);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.portal-guide-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--portal-shadow-card);
	text-decoration: none;
	color: var(--portal-ink);
}
.portal-guide-card--current {
	border-color: var(--portal-yellow);
	box-shadow: 0 0 0 3px var(--portal-yellow-soft), var(--portal-shadow-card-hover);
	background: var(--portal-yellow-soft);
}
.portal-guide-card__avatar {
	width: 96px;
	height: 96px;
	border-radius: var(--portal-r-pill);
	object-fit: cover;
	object-position: center top;
	margin-bottom: 12px;
	background: var(--portal-surface);
}
/* #753 — "Bez sprievodcu" card: same 96px slot as a persona photo, but the
   avatar is a glyph, so it needs the centering an <img> gets from object-fit. */
.portal-guide-card__avatar--none {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.4rem;
	line-height: 1;
	border: 2px dashed #E5E0D5;
}
.portal-guide-card__name {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.05rem;
	margin-bottom: 4px;
}
.portal-guide-card__tagline {
	font-size: 0.85rem;
	color: var(--portal-ink-soft);
	line-height: 1.35;
	margin-bottom: 12px;
	min-height: 2.4em;
}
.portal-guide-card__pick {
	display: inline-block;
	padding: 6px 16px;
	border-radius: var(--portal-r-pill);
	color: #fff;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.02em;
}
/* Persona cards paint the pill with the persona accent colour inline; the
   "Bez sprievodcu" card has no persona, so it takes a neutral tone. */
.portal-guide-card__pick--none {
	background: var(--portal-ink-soft);
}

/* #978 — the Quest „Žáner" picker in the wizard reuses the persona card; the round photo becomes
   a 4:3 preview of the scenery's illustrated background. */
.portal-guide-card--scenery { padding: 10px 10px 12px; cursor: pointer; }
.portal-guide-card__preview {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--portal-r-lg);
	margin-bottom: 10px;
	background: var(--portal-surface);
}

/* "Pripravil pre teba <persona>" signature on presentation cheat-sheet */
.portal-guide-signature {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px 8px 8px;
	background: #fff;
	border: 2px solid #E5E0D5;
	border-radius: var(--portal-r-pill);
	font-family: var(--portal-font-display);
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--portal-ink);
}
.portal-guide-signature__avatar {
	width: 36px;
	height: 36px;
	border-radius: var(--portal-r-pill);
	object-fit: cover;
	object-position: center top;
}
.portal-guide-signature__label {
	color: var(--portal-ink-soft);
	font-weight: 500;
	margin-right: 4px;
}

/* --------------------------------------------------------------------------
   AI chat panel (#536) — opens from the floating sprievodca button
   -------------------------------------------------------------------------- */
.portal-chat {
	position: fixed;
	right: 28px;
	bottom: 120px;
	z-index: 55;
	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: min(70vh, 560px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--portal-paper);
	border: 2px solid #E5E0D5;
	border-radius: var(--portal-r-lg);
	box-shadow: var(--portal-shadow-dropdown);
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.portal-chat[hidden] { display: none; }
.portal-chat.is-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* Docked beside an activity editor (#804). The chat script sets html.portal-chat-docked
   only on editor pages, and only when its geometry check confirms that nothing of the
   editor ends up under the panel. The page reserves the panel's width, so the topbar,
   the sticky editor bar and sticky cards shrink with the content instead of being
   covered. Where the editor does not fit, the panel stays the floating overlay above. */
:root { --portal-chat-dock-w: 360px; }
html.portal-chat-docked body.portal-app { padding-right: var(--portal-chat-dock-w); }
html.portal-chat-docked .portal-chat {
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--portal-chat-dock-w);
	max-width: none;
	max-height: none;
	border-width: 0 0 0 2px;
	border-radius: 0;
	box-shadow: none;
	transform: translateX(12px);
	transform-origin: center right;
}
html.portal-chat-docked .portal-chat.is-open { transform: none; }
/* The round launcher would sit under the docked panel; the panel has its own close button. */
html.portal-chat-docked .portal-guide { display: none; }
html.portal-chat-docked .portal-toast-stack { right: calc(18px + var(--portal-chat-dock-w)); }
/* The page's „Nahlásiť obsah" (_contentReport.latte, fixed beside the launcher) would land on
   the panel's message field (#442) — it moves to the editor's corner, next to the panel.
   20 px matches the button's own bottom offset (the toasts above keep their 18 px). */
html.portal-chat-docked .cr-fab { right: calc(20px + var(--portal-chat-dock-w)); }
/* An activity's game board (#485, PortalTemplate::$gameBoard) has its „Skontrolovať" and „Späť na
   nastavenia" in the bottom right corner. Leonardo is not on the board (@layout.latte), so the „?"
   of _howToPlay.latte comes down into the corner, „Nahlásiť obsah" stands left of it
   (20 px + 52 px „?" + 12 px gap, vertically centred on it), and the page ends with a strip as
   tall as both, so the scrolled-down board keeps its buttons above them. */
body.portal-game-board .htp .htp__help { bottom: 20px; }
body.portal-game-board .cr-fab { right: 84px; bottom: 32px; }
body.portal-game-board .portal-main__inner { padding-bottom: 84px; }
/* #632 — the board fills the whole screen, so it looks like Slepá mapa (which has its own
   @whiteboardLayout.latte; set activities stay in this layout, see whiteboard-game-pattern.md):
   no sidebar, no topbar (breadcrumbs, credits, avatar) and no room kept for them. The game's own
   „Ukončiť hru" is the way back. Hidden, not left out of the markup: the layout's scripts look for
   these parts. The facilitation players (_facilitationPlayer.latte) hide the same parts themselves. */
body.portal-game-board .portal-sidebar,
body.portal-game-board .portal-topbar,
body.portal-game-board .portal-backdrop { display: none; }
body.portal-game-board .portal-main { min-height: 100vh; }
@media (min-width: 992px) {
	body.portal-game-board { padding-left: 0; }
}
/* The editor frame (parent of ~portalEditorBar, marked by the chat script) gives up most
   of its side padding, and a main + side-card split stacks, so the fields keep a usable
   width next to the panel. */
html.portal-chat-docked [data-editor-frame] { padding-left: 32px; padding-right: 32px; }
/* The narrower topbar gets its small-screen form: clipped breadcrumbs and, until there is
   room for it, no user name. */
html.portal-chat-docked .portal-topbar__breadcrumbs { min-width: 0; overflow: hidden; white-space: nowrap; }
@media (max-width: 1599px) {
	html.portal-chat-docked .portal-topbar__user-name { display: none; }
	html.portal-chat-docked .portal-editor-split { grid-template-columns: minmax(0, 1fr); }
	html.portal-chat-docked .portal-editor-split > aside { position: static; }
	/* Same as its own ≤ 860 px rule — the docked panel takes that width away. */
	html.portal-chat-docked .portal-student-share { grid-template-columns: 1fr; }
}
@media (max-width: 1279px) {
	/* Presentation slide: text + 180 px illustration column no longer fit side by side. */
	html.portal-chat-docked .slide-edit__view { grid-template-columns: minmax(0, 1fr); }
}

.portal-chat__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	background: linear-gradient(135deg, var(--portal-blue-soft) 0%, #fff 100%);
	border-bottom: 2px solid #ECE7DC;
}
.portal-chat__avatar {
	width: 40px;
	height: 40px;
	border-radius: var(--portal-r-pill);
	object-fit: cover;
	object-position: center top;
	flex: 0 0 auto;
}
.portal-chat__id {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	margin-right: auto;
	min-width: 0;
}
.portal-chat__name {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--portal-ink);
}
.portal-chat__status {
	font-size: 0.72rem;
	color: var(--portal-ink-soft);
}
.portal-chat__icon-btn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	border: none;
	border-radius: var(--portal-r-pill);
	background: transparent;
	color: var(--portal-ink-soft);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.portal-chat__icon-btn:hover { background: rgba(30, 30, 30, 0.06); color: var(--portal-ink); }
.portal-chat__icon-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* Conversation history overlay (#551) — covers the chat body below the header
   while picking a past conversation; hides again once one is opened. */
.portal-chat__history {
	position: absolute;
	left: 0;
	right: 0;
	top: 66px;
	bottom: 0;
	z-index: 3;
	background: var(--portal-paper);
	border-top: 1px solid #ECE7DC;
	overflow-y: auto;
	padding: 12px 14px;
}
.portal-chat__history[hidden] { display: none; }
.portal-chat__history-title {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--portal-ink-soft);
	margin-bottom: 8px;
}
.portal-chat__history-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.portal-chat__history-item {
	display: block;
	width: 100%;
	text-align: left;
	border: none;
	background: var(--portal-blue-soft);
	color: var(--portal-ink);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 0.86rem;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}
.portal-chat__history-item:hover { background: var(--portal-blue); color: #fff; }
.portal-chat__history-empty {
	font-size: 0.86rem;
	color: var(--portal-ink-soft);
	padding: 8px 2px;
}

/* #609 — the AI notice above the messages, compact for the narrow panel; the label itself is
   already next to the name in the header. */
.portal-chat__notice { flex: none; padding: 8px 12px 0; }
.portal-chat__notice .ai-character-notice { margin: 0; padding: 6px 10px; font-size: 11.5px; line-height: 1.35; }
.portal-chat__messages {
	flex: 1 1 auto;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 14px;
}
.portal-chat__msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 16px;
	font-size: 0.9rem;
	line-height: 1.4;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.portal-chat__msg--bot {
	align-self: flex-start;
	background: var(--portal-yellow-soft);
	color: var(--portal-ink);
	border-bottom-left-radius: 5px;
}
.portal-chat__msg--bot a {
	color: var(--portal-blue);
	font-weight: 600;
	text-decoration: underline;
}
.portal-chat__msg--user {
	align-self: flex-end;
	background: var(--portal-blue);
	color: #fff;
	border-bottom-right-radius: 5px;
}
.portal-chat__typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}
.portal-chat__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--portal-ink-soft);
	opacity: 0.5;
	animation: portalChatBlink 1.2s infinite ease-in-out;
}
.portal-chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.portal-chat__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes portalChatBlink {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 0.9; transform: translateY(-3px); }
}

.portal-chat__input {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 2px solid #ECE7DC;
	background: #fff;
}
/* #785 — Leonardo prompt bar on Domov shares the chat panel's send button (grouped
   selectors below) so the bar and the panel read as one surface; only the size
   differs. The bar itself is `.portal-home__prompt` (#567). */
.portal-chat__field {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 14px;
	border: 2px solid #E5E0D5;
	border-radius: var(--portal-r-pill);
	background: var(--portal-paper);
	font-family: inherit;
	font-size: 0.9rem;
	color: var(--portal-ink);
	outline: none;
	transition: border-color 0.15s ease;
}
.portal-chat__field:focus { border-color: var(--portal-blue); }

.portal-chat__send,
.portal-prompt-bar__send {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: none;
	border-radius: var(--portal-r-pill);
	background: var(--portal-blue);
	color: #fff;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}
.portal-chat__send:hover,
.portal-prompt-bar__send:hover { filter: brightness(1.05); transform: translateY(-1px); }
.portal-chat__send svg,
.portal-prompt-bar__send svg { width: 18px; height: 18px; stroke-width: 2; }

.portal-prompt-bar__send { width: 48px; height: 48px; }

/* --------------------------------------------------------------------------
   Domov (#567) — Dana's design: greeting, one prompt line, next lesson card,
   „Leonardove tipy". Centred column; the blobs and doodles are decoration only.
   -------------------------------------------------------------------------- */
/* At least one screen tall, so the corner blob sits in the corner of the window
   instead of being cut off by the end of the section. */
.portal-home { isolation: isolate; min-height: calc(100vh - 56px); }

.portal-home__blob {
	position: absolute;
	z-index: -1;
	pointer-events: none;
}
.portal-home__blob--blue {
	top: 40px;
	left: 50%;
	width: 460px;
	height: 400px;
	margin-left: -60px;
	background: #DCEAFF;
	border-radius: 58% 42% 46% 54% / 52% 58% 42% 48%;
	opacity: 0.75;
}
.portal-home__blob--yellow {
	top: 300px;
	left: 50%;
	width: 640px;
	height: 200px;
	margin-left: -260px;
	background: var(--portal-yellow-soft);
	border-radius: 60% 40% 55% 45% / 70% 60% 40% 30%;
	transform: rotate(-8deg);
}
.portal-home__blob--corner {
	bottom: -120px;
	right: -80px;
	width: 380px;
	height: 300px;
	background: var(--portal-blue-soft);
	border-radius: 50% 50% 40% 60% / 60% 50% 50% 40%;
}

.portal-home__dot {
	display: block;
	border-radius: var(--portal-r-pill);
	background: #A9C8FF;
}

.portal-home__inner {
	position: relative;
	max-width: 780px;
	margin: 0 auto;
	text-align: center;
}

.portal-home__greeting {
	font-weight: 800;
	color: var(--portal-ink);
	line-height: 1.05;
	font-size: clamp(2.2rem, 5vw, 3.4rem);
}
.portal-home__name {
	position: relative;
	display: inline-block;
	color: #2F6FE4;
}
.portal-home__underline {
	position: absolute;
	left: 4%;
	bottom: -6px;
	width: 92%;
}
.portal-home__subheading {
	max-width: 16ch;
	margin: 20px auto 0;
	font-weight: 700;
	color: var(--portal-ink);
	line-height: 1.25;
	font-size: clamp(1.25rem, 2.6vw, 1.75rem);
}

.portal-home__prompt-wrap { margin-top: 48px; }
.portal-home__prompt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 8px 8px 20px;
	background: var(--portal-surface);
	border: 2px solid transparent;
	border-radius: var(--portal-r-pill);
	box-shadow: var(--portal-shadow-card);
	transition: border-color 0.15s ease;
}
.portal-home__prompt:focus-within { border-color: var(--portal-blue); }
.portal-home__sparkle { flex: 0 0 auto; width: 30px; height: 30px; }
.portal-home__prompt-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: 1.05rem;
	color: var(--portal-ink);
	outline: none;
}
.portal-home__prompt-field::placeholder { color: var(--portal-mute); }
.portal-home__prompt-send { width: 56px; height: 56px; }
.portal-home__prompt-send svg { width: 22px; height: 22px; }

/* Shared round white arrow of the next lesson card and the tip cards. */
.portal-home__arrow {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-surface);
	color: #2F6FE4;
	box-shadow: 0 2px 6px rgba(30, 30, 30, 0.08);
	transition: transform 0.15s ease;
}
.portal-home__arrow svg { width: 18px; height: 18px; }

.portal-home__next {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	margin-top: 32px;
	padding: 14px 18px 14px 14px;
	max-width: 100%;
	text-align: left;
	text-decoration: none;
	color: var(--portal-ink);
	background: var(--portal-blue-soft);
	border: 1.5px solid #D6E5FF;
	border-radius: var(--portal-r-lg);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.portal-home__next:hover,
.portal-home__tip:hover { transform: translateY(-2px); box-shadow: var(--portal-shadow-card-hover); }
.portal-home__next:hover .portal-home__arrow,
.portal-home__tip:hover .portal-home__arrow { transform: translateX(2px); }
.portal-home__next-icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border-radius: var(--portal-r-pill);
	background: #C9F5E4;
	color: var(--portal-ink);
}
.portal-home__next-icon svg { width: 32px; height: 32px; }
.portal-home__next-text { display: flex; flex-direction: column; min-width: 0; margin-right: 24px; }
.portal-home__next-label { font-size: 0.85rem; color: var(--portal-ink-soft); }
.portal-home__next-title { font-weight: 800; font-size: 1.3rem; line-height: 1.2; }
.portal-home__next-when { font-size: 0.95rem; color: var(--portal-ink-soft); }
.portal-home__next-empty { margin-top: 28px; color: var(--portal-ink-soft); }
.portal-home__next-empty a { color: var(--portal-ink); text-decoration: underline; }

.portal-home__tips {
	position: relative;
	max-width: 980px;
	margin: 32px auto 0;
}
.portal-home__tips-title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-weight: 800;
	font-size: 1.35rem;
	color: var(--portal-ink);
}
.portal-home__hat { width: 48px; height: 40px; }
.portal-home__tips-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin-top: 16px;
}
.portal-home__tip {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--portal-ink);
	background: var(--portal-blue-soft);
	border-radius: var(--portal-r-lg);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.portal-home__tip-icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border-radius: var(--portal-r-pill);
	background: #D6E5FF;
	color: #2F6FE4;
}
.portal-home__tip-icon svg { width: 34px; height: 34px; }
.portal-home__tip-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.portal-home__tip--simulacne_laboratorium { background: #FFF5D6; }
.portal-home__tip--simulacne_laboratorium .portal-home__tip-icon { background: #FFE9A8; color: #1E5A9E; }
.portal-home__tip--vyskumna_misia { background: var(--portal-purple-soft); }
.portal-home__tip--vyskumna_misia .portal-home__tip-icon { background: #DCD2FF; color: #6B4BD8; }

@media (max-width: 860px) {
	.portal-home__tips-grid { grid-template-columns: minmax(0, 1fr); max-width: 420px; margin-inline: auto; }
}
@media (max-width: 991px) {
	.portal-home__blob--corner { display: none; }
}
@media (max-width: 560px) {
	.portal-home__blob--blue { width: 300px; height: 280px; margin-left: -150px; }
	.portal-home__blob--yellow { width: 360px; margin-left: -180px; }
	.portal-home__prompt { padding-left: 14px; gap: 8px; }
	.portal-home__sparkle { width: 24px; height: 24px; }
	.portal-home__prompt-send { width: 48px; height: 48px; }
	.portal-home__next { display: flex; }
	.portal-home__next-text { margin-right: auto; }
	.portal-chat {
		right: 12px;
		left: 12px;
		bottom: 104px;
		width: auto;
		max-width: none;
		max-height: 65vh;
	}
}

/* --------------------------------------------------------------------------
   Notification dropdown
   -------------------------------------------------------------------------- */

.portal-notif-wrapper { position: relative; }

.portal-notif-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 360px;
	max-width: calc(100vw - 24px);
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-xl);
	box-shadow: var(--portal-shadow-dropdown);
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 40;
}
.portal-notif-panel.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.portal-notif-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	border-bottom: 1px solid var(--portal-line);
}
.portal-notif-panel__head h4 {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1rem;
	color: var(--portal-ink);
}
.portal-notif-panel__head .sub { font-size: 0.75rem; color: var(--portal-mute); margin-top: 2px; }
.portal-notif-panel__mark {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--portal-blue-soft);
	color: var(--portal-blue) !important;
	text-decoration: none !important;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.75rem;
	border: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}
.portal-notif-panel__mark:hover {
	background: var(--portal-blue);
	color: #fff !important;
}

/* Browser-permission opt-in banner inside the notif dropdown. */
.portal-notif-banner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: var(--portal-yellow-soft);
	border-bottom: 1px solid var(--portal-line);
	font-size: 0.8125rem;
	color: var(--portal-ink);
	flex-wrap: wrap;
}
.portal-notif-banner[hidden] { display: none !important; }
.portal-notif-banner > span { flex: 1 1 140px; min-width: 0; }
.portal-notif-banner > button {
	padding: 4px 12px;
	border-radius: 999px;
	border: none;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.75rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}
.portal-notif-banner > [data-portal-notif-banner-accept] {
	background: var(--portal-blue);
	color: #fff;
}
.portal-notif-banner > [data-portal-notif-banner-accept]:hover {
	background: var(--portal-ink);
}
.portal-notif-banner > [data-portal-notif-banner-dismiss] {
	background: transparent;
	color: var(--portal-mute);
}
.portal-notif-banner > [data-portal-notif-banner-dismiss]:hover {
	color: var(--portal-ink);
}

/* Empty state inside the notif list. */
.portal-notif-empty {
	padding: 28px 20px;
	text-align: center;
	font-size: 0.875rem;
	color: var(--portal-mute);
}

/* Unread items get a subtle accent + bolder text — read items are visually quieter. */
.portal-notif-item--unread {
	background: var(--portal-blue-soft);
}
.portal-notif-item--unread .portal-notif-item__title::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--portal-blue);
	margin-left: 8px;
	vertical-align: middle;
}
.portal-notif-item__text {
	font-size: 0.8125rem;
	color: var(--portal-ink-soft);
	margin-top: 2px;
	line-height: 1.35;
}

.portal-notif-panel__list { max-height: 380px; overflow-y: auto; }

.portal-notif-item {
	display: flex;
	gap: 12px;
	padding: 14px 20px;
	border-left: 4px solid var(--portal-green);
	text-decoration: none !important;
	color: inherit;
	transition: background 0.15s ease;
}
.portal-notif-item:hover { background: rgba(253, 252, 222, 0.5); }
.portal-notif-item--yellow { border-left-color: var(--portal-yellow); }
.portal-notif-item--pink   { border-left-color: var(--portal-pink); }
.portal-notif-item--blue   { border-left-color: var(--portal-blue); }

.portal-notif-item__icon {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--portal-green-soft);
	color: #1B6B3F;
	flex-shrink: 0;
}
/* #1024 — failed generation / fact check: red cross instead of the green tick. */
.portal-notif-item__icon--failed {
	background: var(--portal-danger-soft);
	color: var(--portal-danger);
}
.portal-notif-item__icon svg { width: 18px; height: 18px; stroke-width: 2.6; }

.portal-notif-item__body { flex: 1; }
.portal-notif-item__title {
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--portal-ink);
}
.portal-notif-item__meta { font-size: 0.75rem; color: var(--portal-mute); margin-top: 4px; }
/* #18 — the title of a row with buttons links to the waiting room itself. */
a.portal-notif-item__title { display: block; text-decoration: underline; }
/* #18 — buttons of a row (a failed generation: „Skúsiť znova" / „Vybrať inú aktivitu"). */
.portal-notif-item__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.portal-notif-item__action {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	border: 1.5px solid var(--portal-ink);
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--portal-ink);
	text-decoration: none !important;
	background: #fff;
}
.portal-notif-item__action:hover { background: var(--portal-yellow); }
.portal-notif-item__action--primary { background: var(--portal-yellow); }

.portal-notif-panel__foot {
	display: block;
	text-align: center;
	padding: 12px;
	border-top: 1px solid var(--portal-line);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--portal-blue);
	text-decoration: none !important;
}
.portal-notif-panel__foot:hover { background: var(--portal-blue-soft); }

/* --------------------------------------------------------------------------
   Class cover — sketch SVG background
   -------------------------------------------------------------------------- */

.portal-class-cover {
	position: relative;
	overflow: hidden;
	border-radius: var(--portal-r-lg);
	aspect-ratio: 16 / 9;
	background: var(--portal-yellow-soft);
}
.portal-class-cover > svg.portal-class-cover__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.portal-class-cover__label {
	position: absolute;
	left: 16px;
	bottom: 12px;
	padding: 4px 10px;
	background: var(--portal-surface);
	border-radius: var(--portal-r-pill);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--portal-ink);
}

.portal-class-cover--green  { background: var(--portal-green-soft); }
.portal-class-cover--pink   { background: var(--portal-pink-soft); }
.portal-class-cover--blue   { background: var(--portal-blue-soft); }
.portal-class-cover--purple { background: var(--portal-purple-soft); }

/* TTS button + toolbar (#286) — 🔊 ikonka v taháku */
.tts-button {
	background: rgba(255,255,255,0.7);
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	width: 28px;
	height: 28px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1;
	margin-left: 8px;
	transition: background 0.2s, transform 0.15s;
	vertical-align: middle;
	padding: 0;
}
.tts-button:hover { background: #fef3c7; }
.tts-button:active { transform: scale(0.92); }
.tts-button:disabled { opacity: 0.5; cursor: wait; }
.tts-button--loading { animation: tts-pulse 0.8s infinite; }
@keyframes tts-pulse { 50% { background: #fde68a; } }

.tts-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 14px;
	color: #92400e;
	margin: 16px 0;
}
.tts-toolbar__label { font-weight: 600; }
.tts-toolbar__sep { color: #d6b769; }
.tts-toolbar label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
@media print { .tts-toolbar, .tts-button { display: none !important; } }

/* --------------------------------------------------------------------------
   Contributte DataGrid integration (portal scope)
   -------------------------------------------------------------------------- */

body.portal-app .datagrid {
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card);
	padding: 20px;
}

body.portal-app .datagrid table {
	border: none;
	width: 100%;
}

body.portal-app .datagrid table thead th {
	background: var(--portal-paper);
	border-bottom: 2px solid var(--portal-line);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--portal-mute);
	padding: 12px 14px;
}

body.portal-app .datagrid table tbody td {
	border-top: 1px solid var(--portal-line);
	padding: 14px;
	font-size: 0.95rem;
	color: var(--portal-ink);
	background: var(--portal-surface);
}

body.portal-app .datagrid table tbody tr:hover td { background: var(--portal-yellow-soft); }

body.portal-app .datagrid .btn,
body.portal-app .datagrid button[type="button"],
body.portal-app .datagrid input[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-pill);
	background: var(--portal-surface);
	color: var(--portal-ink);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.8rem;
	cursor: pointer;
}
body.portal-app .datagrid .btn-primary,
body.portal-app .datagrid input[type="submit"].btn-primary {
	background: var(--portal-yellow);
	border-color: var(--portal-yellow);
}
body.portal-app .datagrid .btn-danger { background: var(--portal-danger); color: #fff; border-color: var(--portal-danger); }

body.portal-app .datagrid .form-control,
body.portal-app .datagrid select.form-control {
	padding: 8px 12px;
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r);
	font-family: var(--portal-font-body);
	font-size: 0.9rem;
	background: var(--portal-surface);
	color: var(--portal-ink);
}

body.portal-app .datagrid .pagination a,
body.portal-app .datagrid .pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: var(--portal-r);
	color: var(--portal-ink-soft);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.85rem;
	text-decoration: none !important;
}
body.portal-app .datagrid .pagination .active a,
body.portal-app .datagrid .pagination .active span { background: var(--portal-ink); color: #fff; }

/* --------------------------------------------------------------------------
   Stats — SVG charts, leaderboard avatar
   -------------------------------------------------------------------------- */

.portal-stats-avatar {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	display: inline-grid;
	place-items: center;
	color: #fff;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.8rem;
	flex-shrink: 0;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.portal-chart__axis {
	font-family: var(--portal-font-display);
	font-size: 11px;
	fill: var(--portal-mute);
	font-weight: 700;
}
.portal-chart__peak {
	font-family: var(--portal-font-hand, "Caveat", system-ui, cursive);
	font-size: 14px;
	fill: var(--portal-ink);
	font-weight: 700;
}

/* Inline monospace code chip (used by DataGrid renderers, e.g. Journey kód) */
.portal-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: #F5EFE3;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 0.88em;
}

/* --------------------------------------------------------------------------
   Stats chart entrance animations (bars grow, donut segments draw)
   Honour prefers-reduced-motion at the bottom of the rule block.
   -------------------------------------------------------------------------- */

@keyframes portal-grow-bar {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}
.portal-bar {
	transform-origin: left;
	animation: portal-grow-bar 1s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes portal-donut-draw {
	from { stroke-dasharray: 0 999; }
}
.portal-donut-seg {
	animation: portal-donut-draw 1.2s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes portal-grow-bar-vertical {
	from { transform: scaleY(0); }
	to   { transform: scaleY(1); }
}
.portal-bar-vertical {
	animation: portal-grow-bar-vertical 0.9s cubic-bezier(.22, 1, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
	.portal-bar,
	.portal-bar-vertical,
	.portal-donut-seg {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
   Marketplace-style content card (Journey list + Marketplace catalog)
   -------------------------------------------------------------------------- */

.portal-mkt-card {
	background: #fff;
	border-radius: 24px;
	overflow: hidden;
	border: 1px solid rgba(235, 228, 214, 0.7);
	box-shadow: var(--portal-shadow-card);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	display: flex;
	flex-direction: column;
}
.portal-mkt-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--portal-shadow-card-hover);
}
.portal-mkt-card__cover {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}
.portal-mkt-card__tag {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.85);
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--portal-ink);
}
.portal-mkt-card__lang {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--portal-ink);
	color: #fff;
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.65rem;
	letter-spacing: 0.04em;
}
.portal-mkt-card__body {
	padding: 20px;
	flex: 1;
}
.portal-mkt-card__footer {
	border-top: 1px solid rgba(235, 228, 214, 0.7);
	padding-top: 12px;
}

/* --------------------------------------------------------------------------
   Confirm modal (delete journey, delete class, etc.)
   -------------------------------------------------------------------------- */

.portal-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 20px;
}
.portal-modal[hidden] { display: none; }
.portal-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(30, 30, 30, 0.45);
	backdrop-filter: blur(2px);
}
.portal-modal__panel {
	position: relative;
	background: #fff;
	border-radius: 20px;
	padding: 28px;
	max-width: 460px;
	width: 100%;
	box-shadow: 0 24px 60px -16px rgba(30, 30, 30, 0.35);
	animation: portal-modal-in 0.18s cubic-bezier(.22, 1, .36, 1) both;
}

/* --------------------------------------------------------------------------
   Class card (Class:list)
   -------------------------------------------------------------------------- */

.portal-class-card {
	background: #fff;
	border-radius: 24px;
	overflow: hidden;
	border: 1px solid rgba(235, 228, 214, 0.7);
	box-shadow: var(--portal-shadow-card);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	color: inherit;
}
.portal-class-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--portal-shadow-card-hover);
}

.portal-class-card__cover {
	position: relative;
	min-height: 120px;
	padding: 16px;
	overflow: hidden;
}
.portal-class-card__cover-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}
.portal-class-card__cover-header {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}
.portal-class-card__name {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.875rem;
	color: var(--portal-ink);
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.portal-class-card__name--inverted {
	color: #fff;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.portal-class-card__cover-icon {
	position: absolute;
	right: 12px;
	bottom: 12px;
}

.portal-class-card__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
}

.portal-class-card--empty {
	background: transparent;
	border: 2px dashed rgba(235, 228, 214, 0.9);
	box-shadow: none;
	padding: 32px;
	min-height: 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	transition: border-color 0.18s ease, background 0.18s ease;
}
.portal-class-card--empty:hover {
	border-color: rgba(30, 30, 30, 0.4);
	background: var(--portal-paper);
	transform: none;
}
.portal-class-card__plus {
	width: 64px;
	height: 64px;
	border-radius: 999px;
	background: var(--portal-yellow-soft);
	display: grid;
	place-items: center;
	margin-bottom: 16px;
}
@keyframes portal-modal-in {
	from { transform: translateY(8px) scale(.98); opacity: 0; }
	to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.portal-modal__panel { animation: none; }
}

/* #328 — Môj rozvrh weekly grid cells */
.portal-schedule-cell {
	display: block;
	padding: 10px 12px;
	border-radius: 10px;
	min-height: 84px;
	text-decoration: none;
	color: var(--portal-ink);
	background: #F1F5F9;
	border-left: 4px solid transparent;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	position: relative;
}
.portal-schedule-cell--filled {
	padding: 0;
}
/* #802 — the cell body is a <button> opening the lesson detail (it used to be
   an <a> straight into the generator), so it has to shed the UA button chrome
   and lay out like the block it replaced. */
.portal-schedule-cell__main {
	display: block;
	width: 100%;
	padding: 10px 12px 12px;
	text-align: left;
	text-decoration: none;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: inherit;
	font: inherit;
	cursor: pointer;
}
button.portal-schedule-cell__main:hover,
button.portal-schedule-cell__main:focus-visible {
	background: rgba(255, 255, 255, 0.35);
}
.portal-schedule-cell--filled:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(20, 20, 20, 0.08);
}
.portal-schedule-cell__remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	border: none;
	background: rgba(255, 255, 255, 0.85);
	color: #6B7280;
	cursor: pointer;
	display: grid;
	place-items: center;
	opacity: 0;
	transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.14s ease;
	z-index: 2;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.portal-schedule-cell--filled:hover .portal-schedule-cell__remove,
.portal-schedule-cell__remove:focus-visible {
	opacity: 1;
}
.portal-schedule-cell__remove:hover {
	background: #DC2626;
	color: #fff;
	transform: scale(1.08);
}
.portal-schedule-cell__remove svg {
	display: block;
}
.portal-schedule-cell--add {
	background: transparent;
	border: 1px dashed rgba(20, 20, 20, 0.18);
	color: rgba(20, 20, 20, 0.4);
	display: grid;
	place-items: center;
	min-height: 84px;
	border-radius: 10px;
	width: 100%;
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.portal-schedule-cell--add:hover,
.portal-schedule-cell--add:focus-visible {
	border-color: var(--portal-ink);
	border-style: solid;
	background: rgba(244, 180, 0, 0.08);
	color: var(--portal-ink);
}
.portal-schedule-cell__plus {
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
	display: block;
}
.portal-schedule-cell__add-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-top: 4px;
	display: block;
	opacity: 0;
	transition: opacity 0.14s ease;
}
.portal-schedule-cell--add:hover .portal-schedule-cell__add-label,
.portal-schedule-cell--add:focus-visible .portal-schedule-cell__add-label {
	opacity: 1;
}
.portal-schedule-cell__subject {
	font-family: 'Maven Pro', sans-serif;
	font-weight: 800;
	font-size: 14px;
	line-height: 1.2;
	margin-bottom: 4px;
}
.portal-schedule-cell__class {
	font-size: 12px;
	color: var(--portal-ink-soft);
	margin-bottom: 6px;
}
.portal-schedule-cell__state {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 600;
	color: var(--portal-ink-soft);
}
.portal-schedule-cell__dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #CBD5E1;
	display: inline-block;
}
.portal-schedule-cell__state.is-ready {
	color: #15803D;
}
.portal-schedule-cell__state.is-ready .portal-schedule-cell__dot {
	background: #22C55E;
}

/* #560 — vertical/horizontal orientation toggle (segmented control) */
.portal-schedule-toggle {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	border-radius: 999px;
	background: #F1F5F9;
	border: 1px solid rgba(20, 20, 20, 0.08);
}
.portal-schedule-toggle__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	color: var(--portal-ink-soft);
	text-decoration: none;
	transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.portal-schedule-toggle__btn svg {
	display: block;
}
.portal-schedule-toggle__btn:hover {
	color: var(--portal-ink);
}
.portal-schedule-toggle__btn.is-active {
	background: #fff;
	color: var(--portal-ink);
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* #560 — compact cells for the horizontal layout so all nine periods fit. */
.portal-schedule-grid--horizontal .portal-schedule-cell,
.portal-schedule-grid--horizontal .portal-schedule-cell--add {
	min-height: 60px;
	padding: 6px 8px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell--filled {
	padding: 0;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__main {
	padding: 8px 8px 9px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__subject {
	font-size: 13px;
	margin-bottom: 2px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__class {
	font-size: 11px;
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__state {
	font-size: 10px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__remove {
	width: 26px;
	height: 26px;
	top: 3px;
	right: 3px;
}

/* #563 — highlight today's column (vertical) / row (horizontal) so the
   teacher can orient at a glance. Header gets a soft tint; every cell in the
   day gets a yellow ring matching the "Dnes" badge palette. */
.portal-schedule-grid__head--today {
	background: #FFF7DD;
	border-radius: 8px;
}
.portal-schedule-grid__cell--today .portal-schedule-cell {
	box-shadow: 0 0 0 2px #FFCE3A;
}
.portal-schedule-grid__cell--today .portal-schedule-cell--filled:hover {
	box-shadow: 0 0 0 2px #FFCE3A, 0 6px 18px rgba(20, 20, 20, 0.08);
}

/* #561 — manage-schedules modal list */
.portal-schedule-manage-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.portal-schedule-manage-item {
	display: flex;
	align-items: center;
	gap: 8px;
}
.portal-schedule-manage-rename {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	margin: 0;
}
.portal-schedule-manage-rename .portal-form-input,
.portal-schedule-manage-create .portal-form-input {
	flex: 1;
	min-width: 0;
}
.portal-schedule-manage-create {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding-top: 12px;
	border-top: 1px solid rgba(20, 20, 20, 0.08);
}
.portal-schedule-manage-delete {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	color: #6B7280;
	flex-shrink: 0;
	transition: background 0.14s ease, color 0.14s ease;
}
.portal-schedule-manage-delete:hover {
	background: #DC2626;
	color: #fff;
}

/* #328 — Add-lesson modal */
.portal-schedule-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 20px;
}
.portal-schedule-modal[hidden] {
	display: none;
}
.portal-schedule-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.4);
}
.portal-schedule-modal__panel {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	width: 100%;
	max-width: 480px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
	animation: portal-modal-in 0.18s ease-out;
}
.portal-schedule-modal__close {
	border: none;
	background: transparent;
	font-size: 22px;
	font-weight: 700;
	color: var(--portal-ink-soft);
	cursor: pointer;
	line-height: 1;
	padding: 4px 8px;
}
.portal-schedule-modal__close:hover {
	color: var(--portal-ink);
}
body.portal-modal-open {
	overflow: hidden;
}

/* #328 — Attached content list inside a filled cell.
   #802: the list is no longer a collapsed <details> ("Nalepený obsah") but a
   plain always-visible list, so a lesson with two activities shows both
   without a click. */
.portal-schedule-cell__activities {
	list-style: none;
	margin: 0 12px;
	padding: 8px 0 0;
	border-top: 1px dashed rgba(20, 20, 20, 0.12);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.portal-schedule-cell__attached-item {
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.55);
	border-radius: 8px;
	padding: 4px 6px;
}
.portal-schedule-cell__attached-link {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
	text-decoration: none;
	color: var(--portal-ink);
	font-size: 12px;
	line-height: 1.2;
	padding: 4px 2px;
}
.portal-schedule-cell__attached-link:hover {
	text-decoration: underline;
}
.portal-schedule-cell__attached-icon {
	font-size: 14px;
	line-height: 1;
	flex-shrink: 0;
}
.portal-schedule-cell__attached-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}
.portal-schedule-cell__attached-unpair {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	color: var(--portal-ink-soft);
	text-decoration: none;
	flex-shrink: 0;
	transition: background 0.12s ease, color 0.12s ease;
}
.portal-schedule-cell__attached-unpair:hover {
	background: #FEE2E2;
	color: #B91C1C;
}

/* #802 — explicit "Pridať (ďalšiu) aktivitu" button at the bottom of a filled
   cell. This is now the ONLY way into the generator from the grid; the cell
   itself opens the lesson detail. */
.portal-schedule-cell__add-activity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 8px 12px 10px;
	padding: 6px 8px;
	border: 1px dashed rgba(20, 20, 20, 0.22);
	border-radius: 8px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--portal-ink-soft);
	background: rgba(255, 255, 255, 0.5);
	transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.portal-schedule-cell__add-activity:hover,
.portal-schedule-cell__add-activity:focus-visible {
	border-color: var(--portal-ink);
	border-style: solid;
	background: rgba(244, 180, 0, 0.16);
	color: var(--portal-ink);
}
.portal-schedule-cell__add-activity-plus {
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__activities {
	margin: 0 8px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__add-activity {
	margin: 6px 8px 8px;
	font-size: 10px;
	padding: 5px 6px;
}
.portal-schedule-grid--horizontal .portal-schedule-cell__attached-link {
	font-size: 11px;
}

/* ── Journey Builder (#391) ─────────────────────────────────────────────── */

/* Settings panel — collapsible above the editor */
.jb-settings-panel[hidden] { display: none; }

/* Dĺžka storky + odhad z modulov + slová sprievodcu (#922), nad osnovou (#245) */
.jb-length-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 10px;
	font-size: 13px;
}

.jb-length-band {
	font-weight: 700;
	color: var(--portal-ink, #1f2430);
}

.jb-length-estimate--ok { color: #15803d; }
.jb-length-estimate--off { color: #b45309; }

.jb-length-row__guide { margin-left: auto; }

.jb-card__type-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: var(--portal-r-pill);
	width: fit-content;
	font-family: var(--portal-font-display);
}

.jb-card__type-badge--text    { background: var(--portal-green-soft);  color: var(--portal-success-ink); }
.jb-card__type-badge--youtube { background: #FFE5E5; color: #B91C1C; }

/* ── Stepper šablóny (#245, ~portalTemplateSteps) ── */
.portal-steps {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 0;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}
.portal-steps__item { display: flex; align-items: center; }
.portal-steps__line {
	width: 56px;
	height: 1px;
	margin: 0 14px;
	background: var(--portal-line);
}
.portal-steps__step {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--portal-mute);
	font-family: var(--portal-font-display);
	font-weight: 700;
}
.portal-steps__num {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--portal-line-soft);
	font-size: 13px;
}
.portal-steps__item--current .portal-steps__step { color: var(--portal-ink); }
.portal-steps__item--current .portal-steps__num { background: var(--portal-ink); color: #fff; }
.portal-steps__item--done .portal-steps__num { background: var(--portal-green-soft); color: var(--portal-success-ink); }
/* #244 — a step the page switches in place (the podcast editor) */
.portal-steps__step--button {
	padding: 4px 2px;
	border: 0;
	background: none;
	font: inherit;
	font-family: var(--portal-font-display);
	font-weight: 700;
	cursor: pointer;
}
.portal-steps__step--button:disabled { cursor: default; opacity: .55; }
.portal-steps__step--button:not(:disabled):hover .portal-steps__label { text-decoration: underline; }

/* ── Fantastický podcast V2 (#244): príprava a editor podľa Daninho návrhu ──
   Visual only: the setup form and the editor keep their fields and signals. The grids use
   auto-fit / auto-fill, so they follow the width the page really has — also with the Leonardo
   panel (#804) beside the editor — and never push the page sideways. */
.pc-podcast-page,
.pc-podcast-editor { max-width: 1000px; margin: 0 auto; }
/* The scripts toggle `hidden` on elements with their own display (the guest fallback row is a grid,
   the editor form's save button is a .portal-btn); the preflight `[hidden]` has the same specificity
   and loads first, so it would lose. */
.pc-podcast-page [hidden],
.pc-podcast-editor [hidden] { display: none; }

.pc-setup__title {
	margin: 0 0 4px;
	font-family: var(--portal-font-display);
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--portal-ink);
}
.pc-setup__lead { margin: 0 0 20px; color: var(--portal-ink-soft); max-width: 62ch; }
.pc-setup__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
	align-items: start;
	gap: 0 20px;
}
.pc-setup__divider { margin: 28px 0; border: 0; border-top: 1px solid var(--portal-line); }
.pc-setup__more { margin: 4px 0 0; }
.pc-setup__more > summary,
.pc-podcast-details > summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--portal-success-ink);
	width: fit-content;
}
.pc-setup__more-body { margin-top: 16px; }
.pc-setup__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--portal-line);
}
.pc-setup__footer .portal-help { margin: 0; }

/* Kto sa stretne v tvojom podcaste? — two slots, then the hosts as cards */
.pc-guests__slots {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
	gap: 12px;
}
.pc-guest-slot {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-paper);
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.pc-guest-slot.is-active { background: var(--portal-green-soft); border-color: var(--portal-success-ink); }
.pc-guest-slot__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.pc-guest-slot__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.pc-guest-slot__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--portal-mute); }
.pc-guest-slot__name { font-weight: 700; color: var(--portal-ink); overflow-wrap: anywhere; }
.pc-guest-slot__action {
	flex: none;
	padding: 4px 12px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-pill);
	background: var(--portal-surface);
	font-size: 13px;
	color: var(--portal-ink);
}
.pc-guests__status { margin: 8px 0 0; font-size: 13px; color: var(--portal-success-ink); }
.pc-guests__group {
	margin: 24px 0 12px;
	font-family: var(--portal-font-display);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--portal-ink);
}
.pc-guests__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: 12px;
}
.pc-guest {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 14px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-surface);
}
.pc-guest.is-picked { border-color: var(--portal-ink); box-shadow: inset 0 0 0 1px var(--portal-ink); }
.pc-guest__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pc-guest__avatar {
	width: 52px;
	height: 52px;
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	background: color-mix(in srgb, var(--guest-accent, #4EE6B3) 22%, #fff);
}
.pc-guest__titles { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pc-guest__name { margin: 0; font-family: var(--portal-font-display); font-size: 1rem; font-weight: 700; color: var(--portal-ink); }
.pc-guest__badge {
	padding: 1px 8px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-green-soft);
	font-size: 12px;
	font-weight: 700;
	color: var(--portal-success-ink);
}
.pc-guest__tagline { margin: 0; flex: 1 1 auto; font-size: 14px; color: var(--portal-ink-soft); }
.pc-guest__pick {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-pill);
	background: var(--portal-yellow-soft);
	font: inherit;
	font-size: 14px;
	color: var(--portal-ink);
	cursor: pointer;
}
.pc-guest__pick:hover { border-color: var(--portal-ink); }
.pc-guest__pick.is-picked { background: var(--portal-green-soft); border-color: var(--portal-success-ink); color: var(--portal-success-ink); font-weight: 700; }

/* Editor: Názov, hostia a vzhľad · Dialóg / Otázky · Schváliť · Audio a zdieľanie */
/* One column: the hosts moved into „Názov, hostia a vzhľad" (the storka keeps its side panel). */
.jb-podcast-composer.pc-podcast-composer { display: block; }
.pc-podcast-details { margin-bottom: 20px; }
.pc-podcast-details__body {
	margin-top: 12px;
	padding: 18px 18px 4px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-surface);
}
.pc-podcast-tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 12px;
}
.pc-podcast-tabs__list { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-podcast-tabs__tab {
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: var(--portal-r-pill);
	background: none;
	font: inherit;
	font-size: 14px;
	color: var(--portal-ink-soft);
	cursor: pointer;
}
.pc-podcast-tabs__tab.is-active { border-color: var(--portal-line); background: var(--portal-surface); color: var(--portal-ink); font-weight: 700; }
.pc-podcast-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--portal-ink-soft); }
.pc-podcast-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.pc-podcast-legend__item:empty { display: none; }
.pc-podcast-legend__item::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--portal-green); }
.pc-podcast-legend__item--2::before { background: var(--portal-purple); }
.pc-podcast-add {
	display: block;
	width: 100%;
	padding: 12px;
	border: 1px dashed var(--portal-line);
	border-radius: var(--portal-r);
	background: none;
	font: inherit;
	font-size: 14px;
	color: var(--portal-success-ink);
	cursor: pointer;
}
.pc-podcast-add:hover { border-color: var(--portal-success-ink); background: var(--portal-paper); }
.pc-podcast-approve {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-top: 24px;
	padding: 20px 24px;
	border-radius: var(--portal-r-lg);
	background: var(--portal-green-soft);
}
.pc-podcast-approve__text { flex: 1 1 280px; min-width: 0; }
.pc-podcast-approve__text p { margin: 0; font-size: 14px; color: var(--portal-ink-soft); }
.pc-podcast-approve__title { margin: 0 0 4px; font-family: var(--portal-font-display); font-size: 1.1rem; font-weight: 700; color: var(--portal-ink); }
.pc-podcast-approve__action { flex: 0 1 auto; max-width: 100%; }
.pc-podcast-approve__action .portal-btn { white-space: normal; }
.pc-podcast-approve__note { flex: 1 1 280px; margin: 0; font-size: 14px; color: var(--portal-ink-soft); }
.pc-podcast-audio__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.pc-podcast-audio__ready {
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-green-soft);
	font-size: 13px;
	font-weight: 700;
	color: var(--portal-success-ink);
}
.pc-podcast-audio__title { margin: 0 0 4px; font-family: var(--portal-font-display); font-size: 1.25rem; font-weight: 800; color: var(--portal-ink); }
.pc-podcast-audio__player {
	padding: 18px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-paper);
}
.pc-podcast-audio__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pc-podcast-audio__icon {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: none;
	border-radius: var(--portal-r-sm);
	background: var(--portal-green-soft);
	font-size: 20px;
}
.pc-podcast-audio__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ── Editor storky (#245): osnova | slajd | pohľad žiaka ──
   Both snippets are `display: contents`, so the meta row, the outline, the slide and the phone
   are cells of one grid. Wide: three columns as in Dana's design; medium: the phone moves under
   the outline (it is narrow anyway); phone: one column. The columns follow the width the page
   really has (a container query): the Leonardo panel (#804) opens beside the editor and takes
   a third of the screen, which a viewport media query would not see. The wrapper holds nothing
   fixed-positioned, so its containment cannot move a modal.
   Breakpoints (PR #657 review): a notebook with Leonardo open leaves 600–720 px, so two columns
   start at 560 px (the slide column is then at least as wide as on a phone) and three at 1000 px
   (the slide column keeps 440 px). One column is left for phones only; there the outline list
   gets a height of its own, so the open slide is not under all fourteen slides.
   --jb-sticky-top is set by detail.latte to the bottom of the sticky editor bar (#803). */
.jb-workspace-wrap { container-type: inline-size; }
.jb-workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "meta" "outline" "slide" "preview";
	gap: 20px;
	align-items: start;
}
.jb-workspace__part { display: contents; }
.jb-meta { grid-area: meta; margin-bottom: 0; }
.jb-outline { grid-area: outline; }
.jb-slide { grid-area: slide; }
.jb-preview { grid-area: preview; }
.jb-outline__list { max-height: min(300px, 45vh); overflow-y: auto; overscroll-behavior: contain; }

@container (min-width: 560px) {
	.jb-workspace {
		grid-template-columns: clamp(190px, 32%, 240px) minmax(0, 1fr);
		grid-template-areas: "meta meta" "outline slide" "preview slide";
	}
	.jb-outline__list { max-height: none; overflow-y: visible; }
	.jb-preview {
		position: sticky;
		top: var(--jb-sticky-top, 72px);
		max-height: calc(100vh - var(--jb-sticky-top, 72px) - 16px);
		overflow-y: auto;
	}
}

@container (min-width: 1000px) {
	.jb-workspace {
		grid-template-columns: 240px minmax(0, 1fr) 280px;
		grid-template-areas: "meta meta meta" "outline slide preview";
	}
}

.jb-meta { color: var(--portal-ink-soft); }
.jb-meta__facts, .jb-meta__count { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.jb-meta__settings {
	border: 0;
	background: none;
	padding: 0;
	color: var(--portal-ink);
	font-family: var(--portal-font-display);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.jb-meta .jb-length-row__guide { margin-left: auto; }

/* Shared card look of the three columns */
.jb-outline, .jb-slide, .jb-preview {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-lg);
	box-shadow: var(--portal-shadow-card);
}

/* Outline */
.jb-outline { padding: 18px 16px; }
.jb-outline__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jb-outline__title { margin: 0; font-family: var(--portal-font-display); font-size: 1rem; font-weight: 800; color: var(--portal-ink); }
.jb-outline__count {
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: var(--portal-r-pill);
	background: var(--portal-line-soft);
	font-size: 12px;
	font-weight: 700;
	color: var(--portal-mute);
}
.jb-outline__hint { margin: 4px 0 12px; font-size: 12px; color: var(--portal-mute); }
.jb-outline__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.jb-outline__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px;
	border: 1px solid transparent;
	border-radius: var(--portal-r);
	transition: background 0.12s ease;
}
.jb-outline__item:hover { background: var(--portal-paper); }
.jb-outline__item.is-active { background: var(--portal-green-soft); border-color: var(--portal-success-ink); }
.jb-outline__item.sortable-ghost { opacity: 0.4; }
.jb-outline__num {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: var(--portal-r-sm);
	background: var(--portal-line-soft);
	font-size: 12px;
	font-weight: 700;
	color: var(--portal-mute);
	cursor: grab;
}
.jb-outline__item.is-active .jb-outline__num { background: var(--portal-ink); color: #fff; }
.jb-outline__link { flex: 1 1 auto; min-width: 0; color: var(--portal-ink); text-decoration: none; }
.jb-outline__link:hover { text-decoration: none; }
.jb-outline__name { display: block; font-family: var(--portal-font-display); font-weight: 700; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.jb-outline__meta { display: block; margin-top: 2px; font-size: 11px; color: var(--portal-mute); }
.jb-outline__add { margin-top: 14px; }
.jb-outline__add-btn {
	display: flex;
	justify-content: center;
	padding: 10px 12px;
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r);
	font-family: var(--portal-font-display);
	font-weight: 700;
	color: var(--portal-ink);
	cursor: pointer;
	list-style: none;
}
.jb-outline__add-btn::-webkit-details-marker { display: none; }
.jb-outline__add-btn:hover, .jb-outline__add[open] .jb-outline__add-btn { background: var(--portal-yellow-soft); }
.jb-outline__add .jb-type-tiles { margin-top: 10px; }

/* Type tiles — „Čo chcete pridať", empty storka, outline „Pridať slajd" */
.jb-type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.jb-type-tiles--compact { grid-template-columns: 1fr 1fr; }
.jb-type-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 64px;
	padding: 8px 6px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-surface);
	color: var(--portal-ink);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background 0.12s ease, border-color 0.12s ease;
}
.jb-type-tile:hover { background: var(--portal-yellow-soft); border-color: var(--portal-ink); text-decoration: none; }
.jb-type-tile__icon { font-size: 18px; line-height: 1; }

/* The open slide. A container, so the composers built for the wide modal (podcast with its
   guide column) stack when the column is narrow rather than when the viewport is. */
.jb-slide { padding: 20px 24px 24px; container-type: inline-size; min-width: 0; }
.jb-slide__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	padding-bottom: 14px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--portal-line);
}
.jb-slide__where { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jb-slide__pos { font-family: var(--portal-font-display); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--portal-mute); }
.jb-slide__tools { display: flex; align-items: center; gap: 4px; }
.jb-slide__tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	border-radius: var(--portal-r-sm);
	color: var(--portal-ink-soft);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.jb-slide__tool:hover { background: var(--portal-line-soft); color: var(--portal-ink); text-decoration: none; }
.jb-slide__tool--danger { color: var(--portal-danger); }
.jb-slide__tool--danger:hover { background: var(--portal-danger-soft); color: var(--portal-danger); }
.jb-slide__body { display: flex; flex-direction: column; gap: 16px; }
.jb-slide__add {
	margin-top: 20px;
	padding: 18px;
	border: 1.5px dashed var(--portal-line);
	border-radius: var(--portal-r);
	background: var(--portal-paper);
}
.jb-slide__add-title { margin: 0; font-family: var(--portal-font-display); font-size: 1rem; font-weight: 800; color: var(--portal-ink); }
.jb-slide__add-hint { margin: 4px 0 12px; font-size: 13px; color: var(--portal-mute); }
.jb-slide__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--portal-line);
}
.jb-slide__prev { font-size: 13px; font-weight: 600; color: var(--portal-ink-soft); text-decoration: none; }
.jb-slide__prev.is-disabled { color: var(--portal-mute); opacity: .6; }
.jb-slide--empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; }
.jb-slide--empty .jb-type-tiles { width: 100%; max-width: 560px; }

@container (max-width: 640px) {
	.jb-podcast-composer { flex-direction: column; }
	.jb-podcast-composer__speakers { flex: none; width: 100%; order: -1; }
}

/* Pupil's view: a phone with the slide as Play/module.latte shows it */
.jb-preview { padding: 18px 16px; }
.jb-preview__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.jb-preview__title { margin: 0; font-family: var(--portal-font-display); font-size: 1rem; font-weight: 800; color: var(--portal-ink); }
.jb-preview__live { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--portal-mute); }
.jb-preview__hint { margin: 12px 0; font-size: 12px; color: var(--portal-mute); }
.jb-preview__walk { width: 100%; justify-content: center; }
.jb-phone {
	max-width: 250px;
	margin: 0 auto;
	padding: 8px;
	border-radius: 30px;
	background: var(--portal-ink);
}
.jb-phone__screen {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 420px;
	max-height: 560px;
	overflow-y: auto;
	padding: 14px 14px 12px;
	border-radius: 23px;
	background: var(--portal-paper);
	font-size: 12px;
	line-height: 1.5;
	color: var(--portal-ink-soft);
	scrollbar-width: thin;
}
.jb-phone__progress { display: flex; gap: 3px; }
.jb-phone__seg { flex: 1 1 0; height: 3px; border-radius: 2px; background: var(--portal-line); }
.jb-phone__seg.is-done { background: var(--portal-ink); }
.jb-phone__eyebrow { display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--portal-mute); }
.jb-phone__chip { align-self: flex-start; padding: 2px 8px; border-radius: var(--portal-r-pill); background: var(--portal-green-soft); color: var(--portal-success-ink); font-size: 10px; font-weight: 700; }
.jb-phone__title { margin: 0; font-family: var(--portal-font-display); font-size: 17px; font-weight: 800; line-height: 1.25; color: var(--portal-ink); overflow-wrap: anywhere; }
.jb-phone__img { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--portal-r-sm); }
.jb-phone__body { display: flex; flex-direction: column; gap: 8px; }
.jb-phone__text p { margin: 0 0 8px; }
.jb-phone__text ul, .jb-phone__text ol { margin: 0 0 8px; padding-left: 18px; }
.jb-phone__caption { margin: 0; }
.jb-phone__empty { margin: 0; font-style: italic; color: var(--portal-mute); }
.jb-phone__note { margin: 0; font-size: 11px; color: var(--portal-mute); }
.jb-phone__video {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	border-radius: var(--portal-r-sm);
	background: var(--portal-ink);
	color: #fff;
	font-size: 22px;
}
.jb-phone__tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-sm);
	background: var(--portal-surface);
	color: var(--portal-ink);
}
.jb-phone__tile-img { width: 100%; height: auto; border-radius: 6px; }
.jb-phone__speakers { display: flex; gap: 4px; }
.jb-phone__speakers img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.jb-phone__card {
	display: grid;
	place-items: center;
	min-height: 90px;
	padding: 12px;
	border-radius: var(--portal-r-sm);
	background: var(--portal-yellow-soft);
	border: 1px solid var(--portal-line);
	font-weight: 700;
	text-align: center;
	color: var(--portal-ink);
}
.jb-phone__question { margin: 0; font-weight: 700; color: var(--portal-ink); }
.jb-phone__options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.jb-phone__options li { padding: 6px 8px; border: 1px solid var(--portal-line); border-radius: 8px; background: var(--portal-surface); }
.jb-phone__guide {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin-top: auto;
	padding: 8px;
	border-radius: var(--portal-r-sm);
	background: var(--portal-green-soft);
	font-size: 11px;
}
.jb-phone__guide strong { display: block; color: var(--portal-ink); }
.jb-phone__guide-avatar { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; }
.jb-phone__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--portal-mute); }

/* TEXT module editor layout: fields → "Vygenerovať cez AI" (under the prompt) →
   image picker → "Uložiť" (very bottom). The shared @form.latte renders both
   submit buttons together in one action bar, so we make the form AND the action
   bar display:contents — their children join this flex flow (gap preserved here)
   — and order the two buttons individually around the picker (#469). */
.jb-text-editor {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.jb-text-editor > .portal-form,
.jb-text-editor > .portal-form > .portal-form-actions {
	display: contents;
}

.jb-text-editor .portal-form-actions .portal-btn {
	align-self: flex-start;
}

.jb-text-editor .portal-form-actions [name="generate"] {
	order: 1;
}

.jb-text-editor .jb-module-image {
	order: 2;
}

.jb-text-editor .portal-form-actions [name="save"] {
	order: 3;
}

/* Purple pill used for AI button */
.portal-pill--purple {
	background: var(--portal-purple);
	color: #fff;
}

.portal-pill--purple:hover {
	opacity: 0.88;
	text-decoration: none;
}

/* Module form while AI is generating — dim + block the action buttons so the
   teacher sees it's working and can't re-submit. */
.jb-form--generating { cursor: wait; }
.jb-form--generating .portal-btn {
	opacity: 0.6;
	pointer-events: none;
}

/* ── End Journey Builder (#391) ─────────────────────────────────────────── */

/* ── Game Picker — Journey Builder (#392) ───────────────────────────────── */
.jb-gamepicker__filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.jb-gamepicker__select, .jb-gamepicker__search { padding:6px 10px; border:1px solid var(--portal-line); border-radius:var(--portal-r); }
.jb-gamepicker__ai { display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.jb-gamepicker__ai-reason { font-size:13px; color:var(--portal-mute); }
.jb-gamepicker__ai [data-jb-suggest].is-loading { opacity:.65; pointer-events:none; cursor:wait; }
.jb-gamepicker__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; max-height:50vh; overflow-y:auto; margin:12px 0; }
.jb-gamecard { position:relative; text-align:left; border:2px solid var(--portal-line); border-radius:var(--portal-r); padding:8px; background:#fff; cursor:pointer; display:flex; flex-direction:column; gap:6px; }
.jb-gamecard.is-selected { border-color:var(--portal-blue,#428BFF); }
.jb-gamecard.is-suggested { box-shadow:0 0 0 2px var(--portal-purple); }
.jb-gamecard__img { width:100%; height:80px; object-fit:cover; border-radius:6px; }
.jb-gamecard__name { font-weight:700; font-size:13px; }
.jb-gamecard__tags { display:flex; flex-wrap:wrap; gap:3px; }
.jb-gamecard__tag { font-size:10px; background:#f0f0f5; border-radius:4px; padding:1px 5px; }
.jb-gamecard__check { display:none; position:absolute; top:6px; right:6px; color:var(--portal-blue,#428BFF); font-weight:700; }
.jb-gamecard.is-selected .jb-gamecard__check { display:inline; }
.jb-gamecard.is-hidden { display:none; }
/* ── End Game Picker (#392) ─────────────────────────────────────────────── */

/* ── Quiz Rogue builder picker (#393) ── */
.jb-quizpicker__hint { color: #767676; margin-bottom: 12px; }
.jb-quizpicker__ai { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.jb-quizpicker__topic { flex: 1 1 12rem; min-width: 0; padding: 8px 12px; border: 2px solid #1E1E1E; border-radius: 10px; }
.jb-quizpicker__sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.jb-quizpicker__actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.jb-quizpicker__empty { color: #767676; font-style: italic; }
.jb-quizpicker__title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.jb-quizpicker__title-input { flex: 1; padding: 8px 12px; border: 2px solid #1E1E1E; border-radius: 10px; font-weight: 700; }
.jb-quizpicker__form { display: flex; flex-direction: column; }
.jb-quizcard { position: relative; text-align: left; padding: 12px; border: 2px solid #1E1E1E; border-radius: 12px; background: #fff; cursor: pointer; box-shadow: 3px 3px 0 0 #1E1E1E; }
.jb-quizcard:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 #1E1E1E; }
.jb-quizcard.is-selected { background: #4EE6B3; }
.jb-quizcard__name { display: block; font-weight: 700; }
.jb-quizcard__sub { display: block; font-size: .8rem; color: #767676; }
.jb-quizcard__check { position: absolute; top: 8px; right: 10px; opacity: 0; }
.jb-quizcard.is-selected .jb-quizcard__check { opacity: 1; }
/* ── End Quiz Rogue builder picker (#393) ── */

/* Quiz Rogue student-play styles (.play-quiz*) live inline in Play/@layout.latte
   — the play screen has its own play-* design system and does NOT load portal.css. */

/* ── Quiz Rogue per-question editor (#393) ── */
.qr-editor__level { margin: 28px 0 8px; }
.qr-editor__level-title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 4px;
	padding-bottom: 12px;
	border-bottom: 2px solid #ECECEC;
}
.qr-editor__level-badge {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	background: #428BFF;
	color: #fff;
}
.qr-editor__bucket {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin: 24px 0 12px;
	padding-left: 12px;
	border-left: 4px solid #C9C9C9;
}
.qr-editor__bucket--easy { border-left-color: #4EE6B3; }
.qr-editor__bucket--hard { border-left-color: #FFB23E; }
.qr-editor__bucket--boss { border-left-color: #9B7CFF; }
.qr-editor__bucket-count {
	font-size: 12px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: #767676;
}

.qr-editor__q {
	background: #fff;
	border: 1px solid #E6E6E6;
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.qr-editor__q-head { display: flex; align-items: flex-start; gap: 12px; }
.qr-editor__q-num {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #F0F0F0;
	font-weight: 700;
	font-size: 14px;
	margin-top: 4px;
}
.qr-editor__q-text { flex: 1 1 auto; font-weight: 600; }

.qr-editor__choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 14px 0 0 42px;
}
.qr-editor__choice {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 10px;
}
.qr-editor__choice.is-correct {
	border-color: #4EE6B3;
	background: #EFFFF8;
}
.qr-editor__choice-letter {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #1E1E1E;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
}
.qr-editor__choice.is-correct .qr-editor__choice-letter { background: #1B9E6B; }
.qr-editor__choice-input { flex: 1 1 auto; }

.qr-editor__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 16px 0 0 42px;
}
.qr-editor__meta-field { display: flex; flex-direction: column; gap: 6px; }
.qr-editor__meta-field--correct { flex: 0 0 140px; }
.qr-editor__meta-field--fact { flex: 1 1 280px; }
.qr-editor__meta-field .portal-label { font-size: 13px; font-weight: 700; }

.qr-editor__q-del {
	flex: 0 0 auto;
	margin-top: 4px;
	width: 34px;
	height: 34px;
	border: 1px solid #E6E6E6;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	transition: background .15s, border-color .15s;
}
.qr-editor__q-del:hover { background: #FFECEC; border-color: #FFB3B3; }

.qr-editor__add {
	margin: 4px 0 8px 42px;
	padding: 9px 16px;
	border: 1.5px dashed #C9C9C9;
	border-radius: 10px;
	background: transparent;
	color: #428BFF;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.qr-editor__add:hover { border-color: #428BFF; background: #EFF5FF; }

.qr-editor__actions {
	position: sticky;
	bottom: 0;
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 24px;
	padding: 16px 0;
	background: linear-gradient(to top, var(--portal-bg, #FBFAF7) 70%, transparent);
}

@media (max-width: 640px) {
	.qr-editor__choices { grid-template-columns: 1fr; margin-left: 0; }
	.qr-editor__meta { margin-left: 0; }
	.qr-editor__add { margin-left: 0; }
}
/* ── End Quiz Rogue per-question editor (#393) ── */

/* ── Tahanie lana per-question editor (#601) ── */
.tow-editor__errors {
	margin: 0 0 24px;
	padding: 16px 18px;
	border: 1px solid #FFB3B3;
	border-radius: 12px;
	background: #FFECEC;
	color: #8A1F1F;
}
.tow-editor__errors-title { font-weight: 800; margin: 0 0 8px; }
.tow-editor__errors ul { margin: 0; padding-left: 20px; }
.tow-editor__errors li { margin: 2px 0; }

.tow-editor__q {
	background: #fff;
	border: 1px solid #E6E6E6;
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.tow-editor__q-head { display: flex; align-items: flex-start; gap: 12px; }
.tow-editor__q-num {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #F0F0F0;
	font-weight: 700;
	font-size: 14px;
	margin-top: 4px;
}
.tow-editor__q-text { flex: 1 1 auto; font-weight: 600; }

.tow-editor__choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 14px 0 0 42px;
}
.tow-editor__choice {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 10px;
}
.tow-editor__choice.is-correct {
	border-color: #4EE6B3;
	background: #EFFFF8;
}
.tow-editor__choice-letter {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #1E1E1E;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
}
.tow-editor__choice.is-correct .tow-editor__choice-letter { background: #1B9E6B; }
.tow-editor__choice-input { flex: 1 1 auto; }

.tow-editor__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 16px 0 0 42px;
}
.tow-editor__meta-field { display: flex; flex-direction: column; gap: 6px; }
.tow-editor__meta-field--correct { flex: 0 0 160px; }
.tow-editor__meta-field--explanation { flex: 1 1 280px; }
.tow-editor__meta-field .portal-label { font-size: 13px; font-weight: 700; }

.tow-editor__q-del {
	flex: 0 0 auto;
	margin-top: 4px;
	width: 34px;
	height: 34px;
	border: 1px solid #E6E6E6;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	transition: background .15s, border-color .15s;
}
.tow-editor__q-del:hover { background: #FFECEC; border-color: #FFB3B3; }

.tow-editor__add {
	margin: 4px 0 8px 42px;
	padding: 9px 16px;
	border: 1.5px dashed #C9C9C9;
	border-radius: 10px;
	background: transparent;
	color: #428BFF;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.tow-editor__add:hover { border-color: #428BFF; background: #EFF5FF; }

.tow-editor__actions {
	position: sticky;
	bottom: 0;
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 24px;
	padding: 16px 0;
	background: linear-gradient(to top, var(--portal-bg, #FBFAF7) 70%, transparent);
}

@media (max-width: 640px) {
	.tow-editor__choices { grid-template-columns: 1fr; margin-left: 0; }
	.tow-editor__meta { margin-left: 0; }
	.tow-editor__add { margin-left: 0; }
}
/* ── End Tahanie lana per-question editor (#601) ── */

/* ── #431 — Free image search modal ── */
.image-search-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; }
.image-search-modal[hidden] { display: none; }
.image-search-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.image-search-modal__dialog { position: relative; background: #fff; border-radius: 16px; padding: 20px; width: min(900px, 92vw); max-height: 88vh; overflow: auto; }
.image-search-modal__head { display: flex; align-items: center; justify-content: space-between; }
.image-search-modal__close { background: none; border: 0; font-size: 20px; cursor: pointer; }
.image-search-modal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.image-search-card { border: 1px solid #e5e5e5; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.image-search-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f5f5f5; }
.image-search-card__meta { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: #666; padding: 6px 8px; }
.image-search-card__pick { margin: 0 8px 8px; }
/* ── End #431 free image search modal ── */

/* ── #431 — Zdroje obrázkov attribution slide ── */
.slide--sources .slide__sources-list { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.8; max-width: 70ch; }
.slide--sources .slide__sources-list a { text-decoration: underline; }
/* ── End #431 attribution slide ── */

/* ── #435 — Active-job placeholder cards (Môj obsah) ── */
.portal-card--generating {
	border-style: dashed;
	border-color: rgba(244, 180, 0, 0.5);
	background: var(--portal-yellow-soft, #FDFCDE);
	opacity: 0.85;
}

.portal-generating-spinner {
	display: inline-block;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(244, 180, 0, 0.25);
	border-top-color: #F4B400;
	border-radius: 50%;
	animation: portal-generating-spin 1s linear infinite;
}

@keyframes portal-generating-spin {
	to { transform: rotate(360deg); }
}
/* ── End #435 active-job placeholder cards ── */

/* ── Marketplace share dropdown on content cards (#474) ── */
.portal-share {
	position: relative;
	flex: 0 0 auto;
}
.portal-share__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--portal-r-pill);
	color: var(--portal-mute);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.portal-share__trigger::-webkit-details-marker { display: none; }
.portal-share__trigger { list-style: none; }
.portal-share__trigger:hover {
	background: var(--portal-line-soft);
	color: var(--portal-ink);
}
.portal-share__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 20;
	min-width: 200px;
	padding: 6px;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	box-shadow: var(--portal-shadow-card-hover);
}
.portal-share__item {
	display: block;
	padding: 9px 12px;
	border-radius: 12px;
	color: var(--portal-ink);
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease;
}
.portal-share__item:hover { background: var(--portal-green-soft); }
.portal-share__item--danger { color: #B42318; }
.portal-share__item--danger:hover { background: #FEE4E2; }
/* #1139 — why a material made from the teacher's own source has no share links. */
.portal-share__note {
	margin: 0;
	padding: 9px 12px;
	max-width: 260px;
	color: var(--portal-mute);
	font-size: 13px;
	line-height: 1.4;
}
/* #471 — „Zdieľať všetkým" with the publishing rules, licence and the consent checkbox. */
.portal-share__consent {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 280px;
	margin: 0;
	padding: 10px 12px;
	border-top: 1px solid var(--portal-line);
	font-size: 12px;
	line-height: 1.4;
}
.portal-share__consent-heading {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--portal-mute);
}
.portal-share__consent p { margin: 0; color: var(--portal-mute); }
.portal-share__consent label { display: flex; gap: 6px; align-items: flex-start; color: var(--portal-ink); }
.portal-share__consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
/* ── End marketplace share dropdown (#474) ── */

/* ── Hover preview (#654): first slide/question peek on Môj obsah cards ── */
.portal-preview-host { position: relative; }
.portal-preview-host::after {
	content: attr(data-preview);
	position: absolute;
	left: 0;
	top: calc(100% + 6px);
	z-index: 60;
	max-width: 420px;
	padding: 10px 14px;
	background: #1E1E1E;
	color: #fff;
	font-size: 0.8rem;
	line-height: 1.45;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	white-space: pre-line;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity .15s ease .35s, transform .15s ease .35s;
}
.portal-preview-host:hover::after {
	opacity: 1;
	transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Lesson-plan wizard (#711)
   Multi-step layout + persistent summary for /portal/generate-content/lesson-plan.
   Panels are visible by default and only get hidden once the JS controller boots,
   so without JS the page degrades to the scrollable one-pager it used to be.
   -------------------------------------------------------------------------- */

.portal-wizard {
	display: grid;
	gap: 24px;
	align-items: start;
}

@media (min-width: 1024px) {
	.portal-wizard {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 32px;
	}
}

.portal-wizard__main {
	min-width: 0;
}

/* ── Step rail ───────────────────────────────────────────────────────────── */

/* #167 — čipy krokov sú v jednom riadku aj pri šírke 1480 px (Danin návrh): menšie písmo,
   odsadenie a medzery a žiadne zalomenie popisu vnútri čipu. */
.portal-wizard__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
}

.portal-wizard__step {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px 5px 5px;
	border: 1.5px solid var(--portal-line);
	border-radius: 999px;
	background: var(--portal-surface);
	color: var(--portal-mute);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.78rem;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.portal-wizard__step:disabled {
	cursor: default;
	opacity: 0.55;
}

.portal-wizard__step.is-done {
	color: var(--portal-ink);
	border-color: var(--portal-line);
}

.portal-wizard__step.is-active {
	background: var(--portal-yellow-soft);
	border-color: var(--portal-yellow);
	color: var(--portal-ink);
}

.portal-wizard__step-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 999px;
	background: var(--portal-line);
	color: var(--portal-ink);
	font-size: 0.75rem;
}

.portal-wizard__step.is-active .portal-wizard__step-no {
	background: var(--portal-yellow);
}

/* Completed steps swap the number for a checkmark — font-size:0 hides the
   digit, the pseudo-element restores a readable size for the tick. */
.portal-wizard__step.is-done .portal-wizard__step-no {
	font-size: 0;
	background: var(--portal-green);
}

.portal-wizard__step.is-done .portal-wizard__step-no::after {
	content: '✓';
	font-size: 0.75rem;
}

@media (max-width: 640px) {
	.portal-wizard__step-label {
		display: none;
	}
}

/* ── Panels ──────────────────────────────────────────────────────────────── */

.portal-wizard__panel + .portal-wizard__panel {
	margin-top: 32px;
}

.portal-wizard--stepped .portal-wizard__panel + .portal-wizard__panel {
	margin-top: 0;
}

.portal-wizard__lead {
	color: var(--portal-ink-soft);
	font-size: 0.95rem;
	margin: 0 0 20px;
	max-width: 60ch;
}

/* #990 — voliteľné upresnenie témy sa ukáže až po „+ Upresniť". */
.portal-wizard__reveal {
	align-self: flex-start;
	margin-top: 12px;
}

/* #735 — druhá sekcia v rámci jedného kroku (napr. "Zdroje" pod výberom
   sprievodcu). Menšia ako .portal-wizard__section-title, aby ostala otázka kroku
   vizuálne hlavná, ale dosť výrazná, aby sa sekcia nestratila pod kartami. */
.portal-wizard__subhead {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.05rem;
	line-height: 1.2;
	color: var(--portal-ink);
	margin: 0 0 8px;
	padding-top: 20px;
	border-top: 1px solid var(--portal-line);
}

/* ─── #167 — wizard podľa Daninho návrhu ──────────────────────────────────
   Názov kroku je hlavný nadpis nad čipmi; v kroku sú sekcie s ikonou, nadpisom
   a podnadpisom; voľby sú kartičky s ikonou a popisom priamo na nich (nie pod ⓘ). */
.portal-wizard__title-block {
	margin: 0 0 20px;
}
.portal-wizard__title-row {
	flex-wrap: nowrap;
	align-items: flex-start;
}
.portal-wizard__title-row > .portal-info {
	margin-top: 12px;
}
.portal-wizard__title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: clamp(1.9rem, 3.2vw, 2.6rem);
	line-height: 1.1;
	color: var(--portal-ink);
	margin: 0;
}
/* S predvybranou šablónou z Katalógu je hlavný nadpis jej názov; krok je o stupeň menší. */
.portal-wizard__title--secondary {
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}
.portal-wizard__title-lead {
	color: var(--portal-ink-soft);
	font-size: 1.05rem;
	margin: 8px 0 0;
	max-width: 60ch;
}

.portal-wizard__section {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--portal-line);
}
.portal-wizard__section-head {
	gap: 10px;
	flex-wrap: nowrap;
	align-items: center;
	margin: 0 0 4px;
}
.portal-wizard__section-title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.2rem;
	line-height: 1.25;
	color: var(--portal-ink);
	margin: 0;
}
.portal-wizard__section-icon {
	display: inline-flex;
	flex: none;
	color: var(--portal-ink-soft);
}
.portal-wizard__section-lead {
	color: var(--portal-ink-soft);
	font-size: 0.95rem;
	margin: 0 0 16px;
	max-width: 60ch;
}
/* Podnadpis začína pod textom nadpisu, nie pod ikonou (24 px ikona + 10 px medzera). */
.portal-wizard__section-head:has(.portal-wizard__section-icon) + .portal-wizard__section-lead {
	padding-left: 34px;
}

.portal-wizard__choices {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}
@media (min-width: 640px) {
	.portal-wizard__choices {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.portal-wizard__choice {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 20px;
	text-align: left;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.portal-wizard__choice:hover {
	box-shadow: var(--portal-shadow-card-hover);
}
.portal-wizard__choice:has(input:checked) {
	background: var(--portal-yellow-soft);
	border-color: var(--portal-yellow);
}
.portal-wizard__choice:has(input:focus-visible) {
	outline: 2px solid var(--portal-ink);
	outline-offset: 2px;
}
.portal-wizard__choice > input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
}
.portal-wizard__choice--wide {
	grid-column: 1 / -1;
}
.portal-wizard__choice-icon {
	display: inline-flex;
	flex: none;
	color: var(--portal-ink-soft);
}
/* Účel hodiny: ikona v pravom rohu kartičky (Danin návrh). */
.portal-wizard__choice--icon-end .portal-wizard__choice-icon {
	order: 3;
	margin-left: auto;
}
.portal-wizard__choice-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 0;
}
.portal-wizard__choice-body > [hidden] {
	display: none;
}
.portal-wizard__choice-title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	line-height: 1.25;
	color: var(--portal-ink);
}
.portal-wizard__choice-desc {
	color: var(--portal-ink-soft);
	font-size: 0.92rem;
	line-height: 1.4;
}
.portal-wizard__choice-note {
	font-size: 0.85rem;
	margin-top: 4px;
}

/* Farby ikon z Daninho návrhu; svetlé tokeny (žltá, ružová) by na bielej kartičke zanikli. */
.portal-wizard__choice-icon--yellow,
.portal-wizard__section-icon--yellow { color: #E0AE00; }
.portal-wizard__choice-icon--purple { color: #7B4FE0; }
.portal-wizard__choice-icon--blue { color: var(--portal-blue); }
.portal-wizard__choice-icon--pink { color: #E0479E; }
.portal-wizard__section-icon--orange { color: #F0962A; }

/* ─── #1004 — posuvník dĺžky nad Daninými zastávkami ──────────────────────
   Každá zastávka (5 · 10 · 15 · 30 · 45 · 60 · 90) je rovnako široká, lebo je
   to jedno časové pásmo, nie lineárna os minút. Natívny range nesie index
   voľby; stopa sa kreslí pozadím podľa --minutes-fill (vybrané) a
   --minutes-allowed (za touto hranicou sú zastávky neaktívne, #800). */
.portal-time-slider {
	position: relative;
	padding-top: 40px;
	margin-top: 8px;
}
.portal-time-slider__bubble {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	padding: 4px 10px;
	border-radius: 8px;
	background: var(--portal-yellow-soft);
	border: 1px solid var(--portal-yellow);
	font-size: .85rem;
	white-space: nowrap;
	pointer-events: none;
}
.portal-time-slider__range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 6px;
	margin: 0;
	border-radius: 999px;
	background: linear-gradient(to right,
		var(--portal-yellow) 0 var(--minutes-fill, 0%),
		var(--portal-line) var(--minutes-fill, 0%) var(--minutes-allowed, 100%),
		var(--portal-line-soft) var(--minutes-allowed, 100%) 100%);
	cursor: pointer;
}
.portal-time-slider__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--portal-yellow);
	border: 2px solid var(--portal-ink);
}
.portal-time-slider__range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--portal-yellow);
	border: 2px solid var(--portal-ink);
}
.portal-time-slider__range:focus-visible {
	outline: 2px solid var(--portal-ink);
	outline-offset: 4px;
}
/* Popisky sedia pod stredmi zastávok (left z šablóny = poloha zastávky na stope);
   prvá a posledná sú zarovnané ku krajom, aby nepretiekli mimo formulára. */
.portal-time-slider__stops {
	position: relative;
	height: 1.6em;
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	font-size: .8rem;
	color: var(--portal-mute);
}
.portal-time-slider__stops li {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	white-space: nowrap;
	cursor: pointer;
}
.portal-time-slider__stops li:first-child { transform: none; }
.portal-time-slider__stops li:last-child { transform: translateX(-100%); }
.portal-time-slider__stops li.is-passed { color: var(--portal-ink); }
/* Na úzkom mobile by sa „60 min" a „90 min" prekrývali — jednotku nesie bublina. */
@media (max-width: 480px) {
	.portal-time-slider__unit { display: none; }
}
.portal-time-slider__stops li.is-disabled {
	color: var(--portal-mute);
	opacity: .45;
	cursor: not-allowed;
}

/* ─── #756 — krok Zdroje: dve samostatné karty ────────────────────────────
   Dana zo stand-upu: „tie svoje zdroje by som oddelila." Predtým bol výber
   z knižnice a nahrávanie jeden splynutý blok (druhá polovica navyše
   zabalená v <details>), takže nebolo poznať, čo je čo. Teraz sú to dve
   karty s vlastným nadpisom, medzi nimi delič „alebo".

   Karta na nahrávanie je sesterský element formulára wizardu (vnorené
   formuláre sú nevalidné HTML), preto sedí pod panelom kroku a nie vedľa
   prvej karty — delič drží obe polovice čitateľne pohromade. */
.portal-sources__card {
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line-soft);
	border-radius: var(--portal-r-xl);
	padding: 20px;
}

.portal-sources__title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 0.98rem;
	line-height: 1.2;
	color: var(--portal-ink);
	margin-bottom: 10px;
}

.portal-sources__hint {
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--portal-ink-soft);
	margin: 8px 0 0;
}

.portal-sources__empty {
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--portal-ink-soft);
	margin: 0;
}

/* Delič „alebo" — vodorovná linka s textom uprostred. */
.portal-sources__or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	color: var(--portal-ink-soft);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.portal-sources__or::before,
.portal-sources__or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--portal-line);
}

/* Nahrávacia karta nesie akcentový pruh, aby bola na prvý pohľad odlíšená od
   karty s výberom z knižnice. Podklad zámerne neutrálny — file input má vlastný
   prerušovaný drop-zone rámik a farebná karta pod ním len robí šum. */
.portal-sources__card--upload {
	border-left: 4px solid var(--portal-yellow);
}
.portal-sources__card--upload .portal-form-actions {
	justify-content: flex-end;
}
/* #1004 — s JS je karta jedno tlačidlo „Vybrať súbor"; výber súboru formulár odošle sám. */
.portal-sources__card--upload .portal-form-actions[hidden] {
	display: none;
}

.portal-sources__card--upload.is-uploading {
	opacity: 0.6;
	cursor: progress;
	pointer-events: none;
}

/* @form.latte dáva každému poľu spodný odstup; posledné pole pred tlačidlami
   ho tu už nepotrebuje, karta je krátka. */
.portal-sources__card--upload .portal-form {
	margin-top: 12px;
}

.portal-wizard__derived {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: var(--portal-r-xl);
	background: var(--portal-blue-soft);
	color: var(--portal-ink);
	font-size: 0.9rem;
}

.portal-wizard__derived-label {
	display: block;
	color: var(--portal-mute);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	margin-bottom: 2px;
}

/* #710 — ŠVP panel on the "Trieda" step. Deliberately quieter than the form
   controls next to it: it is reference material the teacher reads, not a field
   they fill, and it must not read as something that has changed their input. */
/* #755 — the panel sits above the trieda form now, not under it: it is the answer the
   step is really about, and under the inline "nová trieda" fields it was below the fold.
   Above the form, though, every change of its height moves the controls the teacher is
   working with — so the height is reserved by a slot instead of being left to the
   content. The slot is the full height from the first paint of the step and never
   changes: the panel filling in, growing by štandardy and citácie, or failing outright
   all happen inside it, and nothing below ever moves. Compensating the scroll position
   in JS was tried first and cannot work — the reveal alone needed 84px of scroll that a
   page this short does not have. */
.portal-wizard__svp-slot {
	/* #990 — menší panel: Dana nechce „záplavu informácií hneď po výbere triedy". */
	height: 240px;
	margin: 16px 0 20px;
}

/* #1004 — a one-sentence answer (ŠVP found nothing, or the lookup failed) sizes to its
   text; see svpCompact() in lessonPlan.latte. Two classes, so it also beats the mobile height below. */
.portal-wizard__svp-slot.portal-wizard__svp-slot--compact {
	height: auto;
}

.portal-wizard__svp {
	/* Fills the reservation exactly. Content taller than the slot scrolls inside the
	   panel rather than pushing the form down. */
	height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 18px;
	border-radius: var(--portal-r-xl);
	border: 1px solid var(--portal-line, #E6E6E6);
	background: #FBFBF8;
	font-size: 0.9rem;
	color: var(--portal-ink);
}

/* #167 — Dana's design: badge on its own line, then „ŠVP na túto tému hovorí toto:", the
   štandardy as one quotation on a soft blue field and the source sentence under it. */
.portal-wizard__svp-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--portal-blue-soft);
	color: var(--portal-ink);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.portal-wizard__svp-status {
	margin: 10px 0 0;
	color: var(--portal-ink);
	font-size: 0.95rem;
	line-height: 1.45;
}

.portal-wizard__svp-quote {
	margin: 10px 0 0;
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--portal-blue-soft);
	font-size: 1rem;
	line-height: 1.55;
}

.portal-wizard__svp-quote ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.portal-wizard__svp-quote li + li {
	margin-top: 8px;
}

.portal-wizard__svp-source {
	margin: 10px 0 0;
	font-size: 0.82rem;
	color: var(--portal-mute);
}

/* The sentence links to the ŠVP document; underline and weight come from the shared in-text link
   rule (#514). The colour stays the quiet grey of the design: this beats the ink of
   `body.portal-app a` and, being later with the same specificity, also of its :hover. */
body.portal-app .portal-wizard__svp-source a {
	color: inherit;
}

.portal-wizard__svp-subhead {
	display: block;
	margin: 0 0 6px;
	font-size: 0.9rem;
	color: var(--portal-ink);
	font-weight: 700;
}

/* #741 — zameranie hodiny: one štandard picked from the quotation above. #167 — kept under the
   source sentence (Dana's design has no select), separated by a line so it reads as a choice,
   not as part of the quotation. */
.portal-wizard__svp-focus {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--portal-line);
}

.portal-wizard__svp-focus select {
	width: 100%;
	max-width: 100%;
	text-overflow: ellipsis;
}

.portal-wizard__svp-focus-hint {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: var(--portal-mute);
}

.portal-wizard__svp-note {
	margin: 10px 0 0;
	font-size: 0.8rem;
	color: var(--portal-mute);
	line-height: 1.45;
}

@media (max-width: 640px) {
	/* A phone cannot spare 320px of reserved panel above the class picker. The
	   reservation shrinks; the overflow scrolls inside the panel exactly as it does on
	   desktop, so the guarantee that nothing below moves is unchanged. */
	.portal-wizard__svp-slot {
		height: 200px;
	}
}

/* ── #782: vzdelávacie ciele ───────────────────────────────────────────────
   Not part of the ŠVP panel above, and deliberately not styled like it: the panel is
   read-only evidence with a citation under it, this is a form field the teacher owns.
   It sits at the END of the class step because its height changes every time a row is
   added or removed — the one thing #755 reserved the panel slot to prevent happening
   above the controls in use. At the bottom nothing is below it to push. */
.portal-wizard__objectives {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--portal-line, #E6E6E6);
}

.portal-wizard__objectives .portal-form-hint {
	margin-bottom: 10px;
}

/* #990 — stav návrhu cieľov píše JS; kým nemá čo povedať, riadok nezaberá miesto. */
.portal-wizard__objectives .portal-form-hint:empty {
	display: none;
}

.portal-wizard__objective-rows {
	display: grid;
	gap: 8px;
}

/* #167 — každý cieľ je vlastná kartička s úchytom, poľom a košom (Danin návrh). */
.portal-wizard__objective {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px 10px 8px;
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-lg);
	background: var(--portal-surface);
}
.portal-wizard__objective[hidden] {
	display: none;
}

.portal-wizard__objective .portal-form-input {
	flex: 1 1 auto;
	min-width: 0;
}

.portal-wizard__objective-drag {
	flex: none;
	width: 24px;
	height: 32px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--portal-mute);
	cursor: grab;
	touch-action: none;
	transition: color 0.12s ease, background 0.12s ease;
}

/* `display: grid` vyššie by prebil atribút hidden — bez JS musí byť úchyt skrytý. */
.portal-wizard__objective-drag[hidden] {
	display: none;
}

.portal-wizard__objective-drag:hover,
.portal-wizard__objective-drag:focus-visible {
	color: var(--portal-ink);
	background: var(--portal-line-soft);
}

.portal-wizard__objective-drag svg {
	width: 16px;
	height: 16px;
}

/* #1004 — jeden cieľ nie je čo presúvať; úchyt drží miesto, aby riadok neposkočil. */
[data-objectives-single] .portal-wizard__objective-drag {
	visibility: hidden;
}

/* SortableJS: riadok na mieste, kam ho učiteľ pustí. */
.portal-wizard__objective.sortable-ghost {
	opacity: 0.4;
}

.portal-wizard__objective-remove {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--portal-mute);
	cursor: pointer;
	transition: color .12s ease, background .12s ease;
}

.portal-wizard__objective-remove[hidden] {
	display: none;
}

.portal-wizard__objective-remove:hover,
.portal-wizard__objective-remove:focus-visible {
	color: var(--portal-danger);
	background: var(--portal-danger-soft);
}

.portal-wizard__objective-add {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 22px;
	border: 1.5px dashed var(--portal-mute);
	border-radius: var(--portal-r-lg);
	background: transparent;
	color: var(--portal-ink);
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background .12s ease, border-color .12s ease;
}

.portal-wizard__objective-add[hidden] {
	display: none;
}

.portal-wizard__objective-add:hover,
.portal-wizard__objective-add:focus-visible {
	background: var(--portal-yellow-soft);
	border-color: var(--portal-ink);
}

/* Whole sentences, so the summary cell stacks them instead of running them together. */
.portal-wizard__summary-objectives {
	margin: 0;
	padding-left: 16px;
}

.portal-wizard__summary-objectives li {
	margin-bottom: 2px;
}

.portal-wizard__error {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: var(--portal-r-xl);
	background: #FFE1E1;
	color: #AE191B;
	font-size: 0.9rem;
	font-weight: 600;
}

/* ── Actions ─────────────────────────────────────────────────────────────── */

.portal-wizard__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.portal-wizard__cancel {
	margin-right: auto;
	color: var(--portal-mute);
	font-size: 0.9rem;
	text-decoration: underline;
}

/* ── Advisory (age ↔ medium, #711) ───────────────────────────────────────── */

.portal-advisory {
	margin: 0;
	padding: 12px 16px;
	border-radius: var(--portal-r-xl);
	background: #FFF6E0;
	border: 1.5px solid #F2C94C;
	color: #7A4E00;
	font-size: 0.88rem;
	line-height: 1.45;
}

.portal-advisory--inline {
	margin-top: 12px;
	padding: 8px 10px;
	font-size: 0.78rem;
	border-radius: 10px;
}

/* ── Persistent summary ──────────────────────────────────────────────────── */

.portal-wizard__summary {
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r-2xl);
	box-shadow: var(--portal-shadow-card);
	padding: 20px;
}

@media (min-width: 1024px) {
	.portal-wizard__summary {
		position: sticky;
		top: 24px;
	}
}

.portal-wizard__summary-title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--portal-ink);
	margin: 0 0 12px;
}

.portal-wizard__summary-list {
	margin: 0;
	display: grid;
	gap: 10px;
}

.portal-wizard__summary-row {
	cursor: pointer;
	border-radius: 10px;
	padding: 6px 8px;
	margin: 0 -8px;
	transition: background .15s ease;
}

.portal-wizard__summary-row:hover {
	background: var(--portal-yellow-soft);
}

.portal-wizard__summary-row dt {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--portal-mute);
	font-weight: 700;
}

.portal-wizard__summary-row dd {
	margin: 2px 0 0;
	font-size: 0.92rem;
	color: var(--portal-ink);
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.portal-wizard__summary-empty {
	color: var(--portal-mute);
}

/* ─── #736: three-branch class step in the generation wizard ─────────────
   Own classes / a class declared inline / a colleague's class. Styled as
   radio "tabs" rather than a select so the active branch is visible without
   opening anything — and so the branch survives with JS off. */
.portal-branch__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.portal-branch__tab {
	flex: 1 1 180px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 2px solid var(--portal-line);
	border-radius: 14px;
	background: var(--portal-paper);
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.portal-branch__tab:hover {
	border-color: var(--portal-ink);
}

.portal-branch__tab.is-active {
	border-color: var(--portal-yellow);
	box-shadow: 0 0 0 3px var(--portal-yellow-soft);
	background: var(--portal-yellow-soft);
}

/* The radio stays in the DOM (it is the posted value and the a11y control),
   but the whole card is the target — so it is hidden visually, not removed. */
.portal-branch__tab input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.portal-branch__tab:focus-within {
	border-color: var(--portal-ink);
	box-shadow: 0 0 0 3px var(--portal-line-soft);
}

.portal-branch__tab-title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	color: var(--portal-ink);
}

.portal-branch__tab-note {
	font-size: .85rem;
	color: var(--portal-mute);
}

/* ---------------------------------------------------------------------------
   Unified "share with students" block — QR + copyable link (#786).
   One set of rules for the dedicated share screen and for the inline
   (--compact) variant on content detail pages, replacing the per-page share
   markup each content type used to carry.
   --------------------------------------------------------------------------- */

.portal-student-share {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 32px;
	align-items: start;
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 16px;
	padding: 24px;
}

@media (max-width: 860px) {
	.portal-student-share { grid-template-columns: 1fr; }
}

.portal-student-share__heading {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 800;
}

.portal-student-share--compact .portal-student-share__heading { font-size: 18px; }

.portal-student-share__hint {
	color: var(--portal-mute, #5e5147);
	margin: 0 0 16px;
}

.portal-student-share__hint--muted { font-style: italic; }

.portal-student-share__code-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .16em;
	color: var(--portal-mute, #5e5147);
	font-weight: 700;
}

/* Sized for projection: readable from the back of the room next to the QR. */
.portal-student-share__code {
	font-family: ui-monospace, monospace;
	font-weight: 800;
	font-size: clamp(2rem, 5vw, 3.25rem);
	letter-spacing: .12em;
	line-height: 1.1;
	margin: 4px 0 16px;
}

.portal-student-share__url-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
	flex-wrap: wrap;
}

.portal-student-share__url {
	flex: 1 1 260px;
	min-width: 0;
	background: #f1e6d2;
	border: 1px solid #e6d8bf;
	padding: 10px 14px;
	border-radius: 8px;
	font-family: ui-monospace, monospace;
	font-size: 13px;
	color: #3f3830;
}

.portal-student-share__qr { text-align: center; }

.portal-student-share__qr-box {
	background: #fff;
	border: 1px solid #f0e8df;
	border-radius: 12px;
	padding: 8px;
	display: inline-block;
	line-height: 0;
}

.portal-student-share__qr-box svg {
	display: block;
	width: 100%;
	height: auto;
	max-width: 320px;
}

.portal-student-share--compact .portal-student-share__qr-box svg { max-width: 200px; }

.portal-student-share__project { margin-top: 12px; }

/* Fullscreen projection overlay — the QR alone, as large as the screen allows. */
.portal-student-share-projector {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 24px;
}

.portal-student-share-projector svg {
	width: min(72vh, 72vw);
	height: auto;
	display: block;
}

.portal-student-share-projector__url {
	font-family: ui-monospace, monospace;
	font-size: clamp(1rem, 2.4vw, 1.75rem);
	color: #3f3830;
	text-align: center;
	word-break: break-all;
	max-width: 90vw;
}

.portal-student-share-projector__close {
	position: absolute;
	top: 24px;
	right: 24px;
	font-size: 18px;
	background: #f1e6d2;
	border: 1px solid #e6d8bf;
	border-radius: 999px;
	padding: 10px 20px;
	cursor: pointer;
	font-weight: 700;
}

/* ── Krok 3: dvojriadková mriežka odporúčaných šablón (#797) ──────────────
   Dva riadky, nie zoznam: hore naše čisté šablóny, dole ku každej práve jedna
   hotová aktivita (#795). Riadky drží grid rodič — stĺpec je `display: contents`,
   takže obe kartičky sedia priamo v mriežke a druhý riadok je zarovnaný aj keď
   je jedna kartička vyššia. Bez toho by každý stĺpec skákal podľa dĺžky popisu.
   Rozbaľovanie do šírky je zamietnuté (stand-up 09-04), preto pevné 3 stĺpce
   a pod 720px stohovanie, nie horizontálny scroll. */
.activity-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: auto auto;
	gap: 12px;
	align-items: stretch;
}
.activity-grid__col { display: contents; }
.activity-grid__more { margin-top: 16px; font-size: 14px; }
.activity-grid__more a { text-decoration: underline; }

@media (max-width: 720px) {
	.activity-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
	.activity-grid__col { display: block; margin-bottom: 12px; }
}

.activity-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	grid-row: 1;
}
.activity-card__visual {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: #f1e6d2;
}
.activity-card__visual img { width: 100%; height: 100%; object-fit: cover; }
/* Zástupný vizuál pre šablónu bez obrázka (#1021: Na stope, Mestská expedícia) — nie prázdna diera. */
.activity-card__visual--placeholder {
	font-family: inherit;
	font-size: 36px;
	font-weight: 800;
	color: #b08b4f;
	background: linear-gradient(135deg, #f7efdd 0%, #ecdcbd 100%);
}
.activity-card__name { font-size: 16px; }
.activity-card__reasons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.activity-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	font-size: 12px;
	color: #7a6a52;
	margin-top: auto;
}
.activity-card__meta span + span::before { content: '· '; }
.activity-card__more {
	align-self: flex-start;
	background: none;
	border: 0;
	padding: 0;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
}

/* ── Krok 5: karta šablóny podľa Daninho mock-upu (#1006) ──────────────────
   Veľký obrázok, názov + veta, tri riadky s ikonami (čas / spôsob práce / predmet),
   jeden tlmený riadok dôvodov a žlté CTA cez celú šírku. Prvá karta je jediná s odznakom
   „Odporúčame" a zvýrazneným rámikom. Katalóg (#794) tieto triedy nepoužíva. */
.activity-card--recommended { border: 2px solid var(--portal-yellow); }
.activity-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	/* #1021 — nad ilustráciou potrebuje odznak oddelenie od pozadia a nesmie sa zalomiť
	   na dva riadky, inak v úzkom stĺpci kroku 5 zakryje väčšinu obrázka. */
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	white-space: nowrap;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--portal-yellow);
	color: var(--portal-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}
/* #1021 — krok 5 má vedľa seba panel „Tvoja hodina", takže pri šírke okolo 1280 px má
   obrázok karty len ~110 px. Odznak sa vtedy zmenší a pod 160 px ostane iba hviezdička;
   slovo zostáva pre čítačky (rámik karty zvýraznenie nesie tak či tak). */
.activity-card__visual { container-type: inline-size; }
@container (max-width: 240px) {
	.activity-card__badge { top: 6px; left: 6px; padding: 2px 8px; font-size: 11px; }
}
@container (max-width: 160px) {
	.activity-card__badge-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}
/* #31 — cena v kreditoch: biela bublina vpravo hore, oproti odznaku „Odporúčame". */
.activity-card__credits {
	position: absolute;
	top: 10px;
	right: 10px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	white-space: nowrap;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff;
	color: var(--portal-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}
@container (max-width: 240px) {
	.activity-card__credits { top: 6px; right: 6px; padding: 2px 8px; font-size: 11px; }
}
/* #31 — cena a zostatok nad formulárom, ktorý aktivitu vytvorí (_creditCost.latte). */
.portal-credit-cost {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	margin-bottom: 16px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--portal-yellow-soft, #fff6d6);
	color: var(--portal-ink);
	font-size: 14px;
}
.portal-credit-cost__label { color: var(--portal-ink-soft, #5b5b6b); }
.portal-credit-cost__sep { color: var(--portal-ink-soft, #5b5b6b); }
/* #307 — učiteľská ukážka vo Free: poznámka za cenou. */
.portal-credit-cost__sample { color: var(--portal-ink-soft, #5b5b6b); font-weight: 600; }
.portal-credit-summary {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 16px;
	margin: 0;
}
.portal-credit-summary dt { color: var(--portal-ink-soft, #5b5b6b); }
.portal-credit-summary dd { margin: 0; font-weight: 700; color: var(--portal-ink); }
/* #31 — vyčerpaný balík kreditov školy (Moja škola). */
.portal-card--warning { box-shadow: inset 0 0 0 2px #f3b4ae; background: #fff7f6; }
/* #31 — kredity v hornej lište. */
.portal-topbar__credits {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--portal-yellow-soft, #fff6d6);
	color: var(--portal-ink);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.portal-topbar__credits--empty { background: #fde2e1; }
/* #628 — SK / EN switch left of the credits. */
.portal-topbar__lang {
	display: inline-flex;
	align-items: center;
	padding: 3px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(0, 0, 0, 0.08);
	flex: none;
}
.portal-topbar__lang .lang-switch__item {
	padding: 3px 9px;
	border-radius: 999px;
	color: var(--portal-ink-soft, #5b5347);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none;
	line-height: 1.4;
}
.portal-topbar__lang .lang-switch__item:hover { color: var(--portal-ink); background: rgba(0, 0, 0, 0.05); }
.portal-topbar__lang .lang-switch__item--current,
.portal-topbar__lang .lang-switch__item--current:hover { background: var(--portal-ink, #1d1b16); color: #fff; }
.activity-card__detail-trigger { cursor: pointer; }
button.activity-card__name {
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	font-size: 18px;
	color: inherit;
}
button.activity-card__name:hover { text-decoration: underline; }
.activity-card__facts {
	list-style: none;
	margin: auto 0 0;
	padding: 10px 0 0;
	border-top: 1px solid rgba(0, 0, 0, .08);
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
	color: var(--portal-ink-soft, #5b5347);
}
.activity-card__fact { display: flex; align-items: flex-start; gap: 10px; }
.activity-card__fact-icon { flex: 0 0 18px; display: inline-flex; margin-top: 1px; color: var(--portal-ink); }
/* #11 — the display of a media row in the ink colour, so two channels read as two ways of running it. */
.activity-card__fact--media strong { font-weight: 700; color: var(--portal-ink); }
/* #16 — the topics row: two lines at most, the whole list is in the modal. */
.activity-card__fact--clamp > span:last-child {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.activity-card__reasons-line { margin: 0; font-size: 12px; line-height: 1.4; color: #7a6a52; }
/* #566 — a template that does not use the picked „Moje zdroje" says so on its card. */
.activity-card__source-note {
	margin: 0;
	padding: 6px 8px;
	border-radius: 8px;
	background: var(--portal-yellow-soft);
	font-size: 12px;
	line-height: 1.4;
	color: #92400e;
}
.activity-card__source-note[hidden] { display: none; }
.activity-card__reasons-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 13px;
	height: 13px;
	margin-right: 5px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 9px;
	font-style: italic;
	font-weight: 700;
	line-height: 1;
	vertical-align: -1px;
}
.activity-card__cta {
	display: block;
	width: 100%;
	margin-top: 4px;
	text-align: center;
	font-weight: 700;
}

/* Slovné dôvody namiesto percent (#797, otázka 18). */
.portal-badge--fit { background: #e6f4ea; color: #1b6b3f; }

/* Druhý riadok (#795) — najlepšie hodnotená hotová aktivita od iného učiteľa pod
   šablónou. Prázdne políčko je platný stav: nič sa nezobrazí a nič sa nedopĺňa náhodne,
   ale bunka v mriežke ostane, aby stĺpce nesklzli pod cudziu šablónu. */
.activity-reuse { grid-row: 2; }

/* Katalóg — záložka „Šablóny GAMICA" (#794). Tie isté kartičky ako krok 7, ale bez druhého
   riadku: mriežka má ľubovoľne veľa riadkov a bunka je obal filtra, nie kartička. */
.activity-grid--catalog { grid-template-rows: none; }
.activity-grid--catalog > * { min-width: 0; }
.activity-grid--catalog .activity-card { height: 100%; color: inherit; }

/* ── Katalóg podľa Daninho návrhu (#207, docs/design/207-katalog.png) ───────
   Filtre: štyri farebné dlaždice v jednom bielom paneli. <select> leží cez celú dlaždicu
   (opacity nie — text hodnoty je jeho vlastný), ikona, popisok a šípka sú pod ním len
   na pohľad a klik prepúšťajú. Pod 1420 px 2×2 (užšie štyri dlaždice by skracovali hodnotu
   „Akákoľvek technológia"), pod 640 px pod sebou. Technika má najdlhšiu hodnotu, preto
   je jej stĺpec širší — ako v návrhu. */
.catalog-lead { max-width: 75ch; }
.catalog-filters {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1.25fr) minmax(0, 1.05fr);
	gap: 12px;
	padding: 12px;
	margin-bottom: 24px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgba(30, 30, 30, .06), 0 8px 24px rgba(30, 30, 30, .04);
}
@media (max-width: 1419px) { .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .catalog-filters { grid-template-columns: minmax(0, 1fr); } }
.catalog-filter {
	position: relative;
	display: block;
	min-height: 68px;
	border-radius: 14px;
	color: var(--portal-ink);
	cursor: pointer;
	margin: 0;
}
.catalog-filter--blue { background: var(--portal-blue-soft); }
.catalog-filter--yellow { background: var(--portal-yellow-soft); }
.catalog-filter--green { background: var(--portal-green-soft); }
.catalog-filter--purple { background: var(--portal-purple-soft); }
.catalog-filter__icon,
.catalog-filter__label,
.catalog-filter__chevron { position: absolute; pointer-events: none; }
.catalog-filter__icon { left: 18px; top: 50%; transform: translateY(-50%); display: inline-flex; }
.catalog-filter__label { left: 56px; top: 13px; font-size: 12px; line-height: 1.2; color: var(--portal-ink-soft); }
.catalog-filter__chevron { right: 16px; top: 50%; transform: translateY(-50%); display: inline-flex; }
.catalog-filter__select {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 68px;
	margin: 0;
	padding: 30px 40px 10px 56px;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: var(--portal-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
}
.catalog-filter__select:focus-visible { outline: 2px solid var(--portal-ink); outline-offset: 2px; }

/* Karta: väčší názov, dva riadky popisu, čipy s ikonou, „Detail šablóny →". */
/* Najviac tri stĺpce ako v návrhu, ale karta nie užšia ako 290 px — pod tým sa mriežka
   prepne na dva stĺpce, potom na jeden (inak sa čipy stláčajú pod seba). */
.activity-grid--catalog {
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(290px, calc((100% - 40px) / 3))), 1fr));
}
.catalog-card { gap: 10px; padding: 14px 14px 18px; }
.catalog-card .activity-card__name { font-size: 22px; line-height: 1.2; margin-top: 4px; }
/* #408 (screen 03) — Základná aktivita / Učiteľská ukážka under the name, for a teacher on Free. */
.catalog-card__free { align-self: flex-start; }
.catalog-card__description {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--portal-ink-soft);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Čipy v jednom riadku ako v návrhu, kým sa zmestia celé. Čas a ročník majú svoju prirodzenú
   šírku, technika si vezme zvyšok riadku; keď sa doň nezmestí celá, prejde na vlastný riadok
   cez celú šírku karty, namiesto toho aby sa stláčala do troch-štyroch riadkov. Žiadny čip
   nie je širší ako karta a text sa láme vnútri čipu (#207 — karta nesmie pretiecť). */
.catalog-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: auto 0 0;
	padding: 6px 0 0;
	min-width: 0;
}
.catalog-chip {
	flex: 0 0 auto;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 10px;
	border-radius: 10px;
	background: #F6F6F8;
	font-size: 12px;
	line-height: 1.25;
	color: var(--portal-ink-soft);
}
.catalog-chip--technology { flex: 1 1 auto; }
.catalog-chip > span { min-width: 0; overflow-wrap: anywhere; }
.catalog-chip svg { flex: 0 0 auto; color: var(--portal-ink); }
.catalog-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--portal-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.activity-reuse--empty { min-height: 0; }
.activity-reuse--card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px;
	cursor: pointer;
}
.activity-reuse__label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #9a8b73;
}
.activity-reuse__name { font-size: 15px; }

/* ── Zdieľaný modal detailu (#797; použije ho aj #794 a #795) ───────────── */
.activity-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; }
.activity-modal[hidden] { display: none; }
.activity-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.activity-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 24px;
	padding: 10px 10px 28px;
	width: min(880px, 94vw);
	max-height: 90vh;
	overflow: auto;
}
/* #207 — obsah pod ilustráciou má vlastný okraj, ilustrácia ide takmer po hranu dialógu. */
.activity-modal__dialog > :not(.activity-modal__visual):not(.activity-modal__close) { margin-left: 24px; margin-right: 24px; }
.activity-modal__close {
	position: absolute;
	top: 22px;
	right: 22px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	border: 0;
	color: var(--portal-ink);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	cursor: pointer;
}
.activity-modal__visual {
	aspect-ratio: 3 / 1;
	border-radius: 18px;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #f7efdd 0%, #ecdcbd 100%);
	font-size: 56px;
	font-weight: 800;
	color: #b08b4f;
	margin-bottom: 20px;
}
.activity-modal__visual[hidden] { display: none; }
.activity-modal__visual img { width: 100%; height: 100%; object-fit: cover; }
.activity-modal__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.activity-modal__title { font-size: 34px; line-height: 1.1; font-weight: 800; margin: 0; padding-right: 8px; }
.activity-modal__credits {
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--portal-yellow-soft);
	color: var(--portal-ink);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}
.activity-modal__reasons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}
.activity-modal__eyebrow {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--portal-mute);
}
.activity-modal__lead { margin: 0; color: var(--portal-ink-soft); font-size: 16px; line-height: 1.65; }
/* #16 — principle, what the pupils do and the topics: three short blocks one under another. A hidden
   block still counts as a sibling, so the gap goes only to a visible block after another visible one. */
.activity-modal__what:not([hidden]) ~ .activity-modal__what:not([hidden]) { margin-top: 16px; }
.activity-modal__text { margin: 0; color: var(--portal-ink-soft); font-size: 15px; line-height: 1.6; }
/* #11 — „Ako aktivita prebieha": the display as a bold term, who operates it and how the class works under it. */
.activity-modal__media { margin: 0; color: var(--portal-ink-soft); font-size: 15px; line-height: 1.6; }
.activity-modal__media dt { font-weight: 700; color: var(--portal-ink); }
.activity-modal__media dt:not(:first-child) { margin-top: 10px; }
.activity-modal__media dd { margin: 0; }
.activity-modal__media-label { font-weight: 600; }
.activity-modal__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
	margin: 20px 0 16px;
}
.activity-modal__fact {
	margin: 0;
	padding: 14px 16px;
	border-radius: 16px;
	background: #F6F6F8;
}
.activity-modal__fact[hidden] { display: none; }
/* Dlaždica s ikonou vľavo; ikona je v <dt>, aby <dl> ostal platný. */
.activity-modal__fact--icon { position: relative; padding-left: 62px; display: flex; flex-direction: column; justify-content: center; min-height: 72px; }
.activity-modal__fact-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--portal-ink); }
.activity-modal__fact dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--portal-mute); }
.activity-modal__fact dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--portal-ink); }
.activity-modal__when {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 12px;
}
.activity-modal__when[hidden],
.activity-modal__when-box[hidden] { display: none; }
.activity-modal__when-box {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 20px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.6;
}
.activity-modal__when-box p { margin: 0; color: var(--portal-ink); }
.activity-modal__when-box--yes { background: #EEF7F0; }
.activity-modal__when-box--no { background: #FDEFEF; }
.activity-modal__when-icon {
	flex: 0 0 32px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: #fff;
}
.activity-modal__when-icon svg { stroke-width: 2.6; }
.activity-modal__when-box--yes .activity-modal__when-icon { background: #3E9A5C; }
.activity-modal__when-box--no .activity-modal__when-icon { background: #CC4B55; }
.activity-modal__when-title { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.activity-modal__when-box--yes .activity-modal__when-title { color: #2F7D49; }
.activity-modal__when-box--no .activity-modal__when-title { color: #B23A44; }
.activity-modal__footer { margin-top: 16px; border-top: 1px solid #efe4cf; padding-top: 12px; }
.activity-modal__footer-title { font-size: 12px; color: #9a8b73; margin-bottom: 8px; }
/* Horizontálny scroll je tu zámerný — je to spodná lišta modalu, nie mriežka kroku. */
.activity-modal__strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.activity-modal__strip-item {
	flex: 0 0 auto;
	border: 1px solid #e6d8bf;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 13px;
	white-space: nowrap;
}
.activity-modal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 24px; }
/* .portal-pill má vlastný display, globálne [hidden] z output.css by ho neskrylo (sekundárne CTA, #795). */
.activity-modal__actions [hidden] { display: none; }
/* #207 — „Späť na výber" vľavo, „Použiť túto šablónu →" vpravo. */
.activity-modal__back { margin-right: auto; }
.activity-modal__actions .portal-pill { padding-top: 14px; padding-bottom: 14px; font-size: 1.05rem; }
.activity-modal__cta { padding-left: 28px; padding-right: 28px; }
.activity-modal__cta::after {
	content: '';
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 640px) {
	.activity-modal__dialog > :not(.activity-modal__visual):not(.activity-modal__close) { margin-left: 12px; margin-right: 12px; }
	.activity-modal__visual { aspect-ratio: 16 / 9; }
	.activity-modal__title { font-size: 26px; }
	.activity-modal__facts { grid-template-columns: minmax(0, 1fr); }
	.activity-modal__actions > * { flex: 1 1 100%; justify-content: center; }
	.activity-modal__back { margin-right: 0; }
}
/* #206 — „Toto dostaneš": the result samples of a template. */
.activity-modal__samples[hidden],
.activity-modal__sample-stage[hidden],
.activity-modal__sample-thumbs[hidden],
.activity-modal__sample-audio[hidden] { display: none; }
.activity-modal__samples { margin-top: 16px; border-top: 1px solid #efe4cf; padding-top: 12px; }
.activity-modal__samples-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.activity-modal__samples-title { font-size: 15px; font-weight: 800; margin: 0; }
.activity-modal__sample-stage { margin: 0; }
.activity-modal__sample-stage a { display: block; border: 1px solid #e6d8bf; border-radius: 12px; overflow: hidden; background: #faf5ea; }
.activity-modal__sample-stage img { display: block; width: 100%; height: auto; }
.activity-modal__sample-stage figcaption,
.activity-modal__sample-audio figcaption { font-size: 12px; color: #9a8b73; margin-top: 6px; }
.activity-modal__sample-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.activity-modal__sample-thumb {
	flex: 0 0 auto;
	width: 104px;
	aspect-ratio: 16 / 10;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: #faf5ea;
	cursor: pointer;
}
.activity-modal__sample-thumb[aria-pressed="true"] { border-color: #b08b4f; }
.activity-modal__sample-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.activity-modal__sample-audio { margin-top: 10px; }
.activity-modal__sample-audio figure { margin: 0; }
.activity-modal__sample-audio audio { width: 100%; }
.activity-modal__samples-note { font-size: 12px; color: #7a6a52; margin: 10px 0 0; }

/* ─────────────────────────────────────────────────────────────────────────────
   #446 — „Spoločný úvod s náhľadmi" at the top of every template's page.
   Markup: app/PortalModule/Presenters/templates/_templateIntro.latte.
   Dana's layout (text left, numbered tiles over one big preview right), our colours.
   ───────────────────────────────────────────────────────────────────────────── */
.template-intro {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 32px;
	align-items: center;
	background: var(--portal-green-soft);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	padding: 32px;
	margin-bottom: 24px;
}
.template-intro--text-only,
.template-intro.is-collapsed { grid-template-columns: minmax(0, 1fr); }
.template-intro.is-collapsed { padding-block: 18px; }
.template-intro.is-collapsed .template-intro__more,
.template-intro.is-collapsed .template-intro__previews { display: none; }
.template-intro__toggle {
	position: absolute;
	top: 14px;
	right: 16px;
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 13px;
	font-weight: 700;
	color: var(--portal-ink-soft);
	cursor: pointer;
}
.template-intro__toggle:hover { color: var(--portal-ink); border-color: var(--portal-ink-soft); }
.template-intro__eyebrow {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--portal-mute);
	margin: 0 0 8px;
	padding-right: 120px;
}
.template-intro__title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; color: var(--portal-ink); line-height: 1.15; margin: 0; }
.template-intro__more { margin-top: 14px; }
.template-intro__lead { font-size: 17px; color: var(--portal-ink-soft); line-height: 1.55; margin: 0 0 10px; max-width: 60ch; }
.template-intro__pupils { font-size: 15px; color: var(--portal-ink-soft); line-height: 1.55; margin: 0 0 10px; max-width: 60ch; }
.template-intro__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.template-intro__chip {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 14px;
	color: var(--portal-ink);
}
.template-intro__previews { padding-top: 28px; min-width: 0; }
.template-intro__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.template-intro__tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
	background: var(--portal-surface);
	border: 2px solid var(--portal-line);
	border-radius: var(--portal-r);
	padding: 8px;
	cursor: pointer;
	color: var(--portal-ink);
}
.template-intro__tile[aria-pressed="true"] { border-color: var(--portal-ink); }
.template-intro__tile-thumb { display: block; aspect-ratio: 16 / 7; border-radius: 8px; overflow: hidden; background: var(--portal-paper); }
.template-intro__tile-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.template-intro__tile-no { font-size: 13px; font-weight: 800; }
.template-intro__tile-caption { font-size: 13px; line-height: 1.3; color: var(--portal-ink-soft); }
.template-intro__stage { margin: 0; }
.template-intro__stage a {
	display: block;
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-lg);
	overflow: hidden;
	padding: 10px;
}
.template-intro__stage img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; }
.template-intro__clip { margin: 12px 0 0; }
.template-intro__clip audio { width: 100%; }
.template-intro__clip figcaption { font-size: 12px; color: var(--portal-mute); margin-top: 4px; }
.template-intro__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 10px; font-size: 13px; color: var(--portal-mute); }
.template-intro__note { font-size: 12px; color: var(--portal-mute); text-align: center; margin: 6px 0 0; }
@media (max-width: 900px) {
	.template-intro { grid-template-columns: minmax(0, 1fr); padding: 24px 18px; gap: 20px; }
	.template-intro__previews { padding-top: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   „Ako viesť aktivitu" (#15) — the template's guide for the teacher, under the
   editor bar and above the activity. Markup: _activityGuide.latte. Same card as
   the intro of a template's page (#446), in the yellow of the teacher's tips.
   ───────────────────────────────────────────────────────────────────────────── */
.activity-guide {
	background: var(--portal-yellow-soft);
	border: 1px solid var(--portal-line);
	border-radius: var(--portal-r-xl);
	padding: 24px 32px;
	margin-bottom: 28px;
}
.activity-guide__summary {
	position: relative;
	display: block;
	list-style: none;
	cursor: pointer;
	padding-right: 120px;
}
.activity-guide__summary::-webkit-details-marker { display: none; }
.activity-guide__eyebrow {
	display: block;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--portal-mute);
	margin-bottom: 6px;
}
.activity-guide__title { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 800; color: var(--portal-ink); line-height: 1.2; margin: 0; }
.activity-guide__toggle {
	position: absolute;
	top: 0;
	right: 0;
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 13px;
	font-weight: 700;
	color: var(--portal-ink-soft);
}
.activity-guide__summary:hover .activity-guide__toggle { color: var(--portal-ink); border-color: var(--portal-ink-soft); }
.activity-guide__facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.activity-guide__fact {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 14px;
	color: var(--portal-ink);
}
.activity-guide__fact span { color: var(--portal-mute); }
.activity-guide__sections {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 32px;
	margin-top: 20px;
}
.activity-guide__section--steps { grid-row: span 3; }
.activity-guide__label {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--portal-mute);
	margin: 0 0 4px;
}
.activity-guide__section p { font-size: 15px; line-height: 1.55; color: var(--portal-ink-soft); margin: 0; max-width: 65ch; }
.activity-guide__steps,
.activity-guide__items { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.55; color: var(--portal-ink-soft); }
.activity-guide__steps { list-style: decimal; }
.activity-guide__items { list-style: disc; }
.activity-guide__steps li + li,
.activity-guide__items li + li { margin-top: 4px; }
@media (max-width: 900px) {
	.activity-guide { padding: 20px 18px; }
	.activity-guide__sections { grid-template-columns: minmax(0, 1fr); }
	.activity-guide__section--steps { grid-row: auto; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Editor frame (#803) — one top bar for every content type with an editor.
   Markup: app/PortalModule/Latte/Widgets/portalEditorBar.latte (~portalEditorBar).
   The student view hides every sibling of the bar inside its wrapper, so the
   per-type editor body never needs to know about the toggle.
   ───────────────────────────────────────────────────────────────────────────── */
.portal-editor-bar {
	background: var(--portal-surface);
	border: 1px solid var(--portal-line);
	border-radius: 16px;
	box-shadow: 0 6px 18px -12px rgba(30, 30, 30, 0.25);
	padding: 14px 18px;
	margin-bottom: 28px;
}
@media (min-width: 992px) {
	/* Sticky under the 56 px portal topbar; on phones it would eat the screen. */
	.portal-editor-bar { position: sticky; top: 68px; z-index: 20; }
}
.portal-editor-bar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
}
.portal-editor-bar__titles { min-width: 0; flex: 1 1 280px; }
.portal-editor-bar__type {
	display: block;
	font-family: var(--portal-font-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--portal-mute);
}
.portal-editor-bar__title {
	font-family: var(--portal-font-display);
	font-weight: 800;
	font-size: clamp(1.3rem, 2.4vw, 1.75rem);
	line-height: 1.15;
	color: var(--portal-ink);
	margin: 2px 0 0;
	overflow-wrap: anywhere;
}
.portal-editor-bar__meta { font-size: 13px; color: var(--portal-mute); margin-top: 4px; }
.portal-editor-bar__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* #804 — Leonardo toggle: hidden until the chat widget is live; "on" while the panel is open. */
.portal-editor-bar__guide[hidden] { display: none; }
.portal-editor-bar__guide.is-active { background: var(--portal-ink); color: #fff; }
.portal-editor-bar__views {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: rgba(30, 30, 30, 0.06);
}
.portal-editor-bar__view {
	border: 0;
	background: transparent;
	border-radius: 999px;
	padding: 6px 14px;
	font-family: var(--portal-font-display);
	font-weight: 700;
	font-size: 13px;
	color: var(--portal-mute);
	cursor: pointer;
	white-space: nowrap;
}
.portal-editor-bar__view.is-active {
	background: var(--portal-surface);
	color: var(--portal-ink);
	box-shadow: 0 1px 4px rgba(30, 30, 30, 0.15);
}
.portal-editor-bar__saved {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 600;
	color: #2f7a4b;
	white-space: nowrap;
}
.portal-editor-bar__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--portal-line);
}
.portal-editor-frame--student > :not(.portal-editor-bar):not(.portal-editor-preview) { display: none !important; }
.portal-editor-preview__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 12px;
	font-size: 14px;
	color: var(--portal-mute);
}
.portal-editor-preview__frame {
	display: block;
	width: 100%;
	height: min(78vh, 820px);
	border: 1px solid var(--portal-line);
	border-radius: 16px;
	background: #fff;
}

/* Checkbox rows that carry their own caption (#918). Nette renders a checkbox as
   <label><input>caption</label> and drops any class passed to {input}, so the switches are styled
   from the container instead of from the control. */
.portal-switches { gap: 8px; }

.portal-switches > label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: var(--portal-ink);
}

.portal-switches > label > input[type="checkbox"] {
	width: 20px;
	height: 20px;
	flex: none;
}

/* #8 — pupil data box: retention notice + "delete pupil data" button (widget portalStudentData) */
.portal-student-data {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin: 24px 0;
	padding: 16px 24px;
}
.portal-student-data__notice {
	margin: 0;
	color: var(--portal-ink-soft);
	font-size: 14px;
	flex: 1 1 320px;
}

/*
	#408 — Môj účet a Moja škola podľa prototypu predplatného: z prototypu rozloženie (eyebrow nad
	veľkým nadpisom, záložky ako podčiarknutá navigácia, dva stĺpce, sekcie 07 s popisom vľavo),
	vizuál zostáva portálový — len existujúce farby, karty a tlačidlá.
*/
.portal-account-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}
.portal-account-head__eyebrow {
	font-family: var(--portal-font-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--portal-mute);
}
/* Veľký nadpis záložky (prototyp: „Predplatné a kredity“ cez celú hlavičku). */
.portal-account-head__title {
	margin: 4px 0 0;
	font-size: clamp(28px, 3.2vw, 40px);
	line-height: 1.1;
}
.portal-account-head__lead {
	margin: 4px 0 0;
	color: var(--portal-ink-soft);
}
/* Linka pod záložkami je vnútorný tieň, nie border: overflow-x: auto orezáva obsah na okraji
   paddingu, takže záložka siahajúca do borderu by vytvorila zvislý posuvník (#644).
   Podčiarknutie aktívnej záložky (3px) prekryje linku (1.5px) a zostane celé viditeľné. */
.portal-account-tabs {
	display: flex;
	gap: 24px;
	margin-bottom: 24px;
	box-shadow: inset 0 -1.5px 0 var(--portal-line);
	overflow-x: auto;
	overflow-y: hidden;
}
.portal-account-tab {
	padding: 10px 0;
	border-bottom: 3px solid transparent;
	font-family: var(--portal-font-display);
	font-weight: 700;
	color: var(--portal-ink-soft);
	white-space: nowrap;
	text-decoration: none;
}
.portal-account-tab:hover { color: var(--portal-ink); }
.portal-account-tab--active {
	color: var(--portal-ink);
	border-bottom-color: var(--portal-ink);
}
/* Dva stĺpce: vľavo kredity a história, vpravo plán a ďalšie karty; na mobile pod sebou. */
.portal-account-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}
@media (min-width: 1024px) {
	.portal-account-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.portal-account-col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}
/* Obrazovka 07: vľavo nadpis a popis sekcie, vpravo karta s formulárom. */
.portal-account-section {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px 32px;
	padding: 24px 0;
	border-top: 1.5px solid var(--portal-line);
}
.portal-account-tabs + .portal-account-section { border-top: none; padding-top: 0; }
@media (min-width: 1024px) {
	.portal-account-section { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.portal-account-section__text { margin: 4px 0 0; color: var(--portal-ink-soft); }
/* #627 — náhľad „Informácia pre rodičov“: odseky a zoznam listu (Tailwind preflight im berie okraje a odrážky). */
.portal-parent-info__letter {
	margin-top: 12px;
	padding: 16px 20px;
	border: 1.5px solid var(--portal-line);
	border-radius: 12px;
	background: #fff;
	color: var(--portal-ink);
	font-size: 0.95rem;
	line-height: 1.55;
}
.portal-parent-info__letter p { margin: 0 0 10px; }
.portal-parent-info__letter ul { margin: 0 0 10px; padding-left: 20px; list-style: disc; }
.portal-parent-info__letter li { margin-bottom: 6px; }
.portal-parent-info__letter a { overflow-wrap: anywhere; }
.portal-parent-info__preview > summary { cursor: pointer; font-weight: 700; }
/* Veľké číslo kreditov („2 zo 4 kreditov“) a ukazovateľ zostatku. */
.portal-credit-big {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.portal-credit-big__value {
	font-family: var(--portal-font-display);
	font-size: 44px;
	font-weight: 800;
	line-height: 1;
	color: var(--portal-ink);
}
.portal-credit-big__of { color: var(--portal-ink-soft); }
.portal-meter {
	height: 8px;
	margin: 12px 0 16px;
	border-radius: 999px;
	background: var(--portal-line);
	overflow: hidden;
}
.portal-meter__fill {
	height: 100%;
	border-radius: inherit;
	background: var(--portal-ink);
}
/* História kreditov: čo sa stalo vľavo, + / − vpravo. */
.portal-credit-history {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
}
.portal-credit-history li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid var(--portal-line);
}
.portal-credit-history__meta { display: block; font-size: 13px; color: var(--portal-mute); }
.portal-credit-history__amount { font-weight: 800; white-space: nowrap; }
.portal-credit-history__amount--plus { color: var(--portal-success-ink); }
/* Hlavná akcia karty cez celú šírku („Vybrať aktivitu“, „Požiadať o zmenu balíka“). */
.portal-btn--block { width: 100%; justify-content: center; }
/* Obrazovka 02 (karta plánu) a dialóg balíkov: riadky „popis — hodnota“ oddelené čiarou. */
.portal-rows {
	margin: 12px 0 0;
	padding: 0;
	border: 0;
	min-width: 0;
}
.portal-rows > div,
.portal-rows > label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid var(--portal-line);
}
.portal-rows dt { color: var(--portal-ink-soft, #5b5b6b); }
.portal-rows dd { margin: 0; font-weight: 700; color: var(--portal-ink); text-align: right; }
/* Dialóg „Naša ponuka školských balíkov“: zvolený balík zvýraznený. */
.portal-modal__panel--wide { max-width: 520px; }
.portal-package-row { cursor: pointer; border-radius: 12px; padding-left: 8px !important; padding-right: 8px !important; }
.portal-package-row:has(input:checked) { background: var(--portal-yellow-soft, #fff8d6); }
.portal-package-row__name { display: flex; align-items: baseline; gap: 10px; }
.portal-package-row__name input { accent-color: var(--portal-ink); }
.portal-package-row__price { text-align: right; white-space: nowrap; font-weight: 700; color: var(--portal-ink); }
@media (max-width: 480px) {
	.portal-package-row { flex-wrap: wrap; }
	.portal-package-row__price { text-align: left; padding-left: 26px; }
}
/* Obrazovka 11: nová žiadosť ako zvýraznená karta, akcie vpravo. */
.portal-request-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

/* #378 — the terms of use and the privacy policy (Gamica layout): a readable column with the
   paragraph and list spacing the long legal text needs. */
.legal-doc {
	max-width: 760px;
	width: 100%;
	padding: 32px;
	line-height: 1.6;
}
.legal-doc h1 { font-size: 28px; font-weight: 700; line-height: 1.25; margin: 0 0 12px; }
.legal-doc h2 { margin: 32px 0 12px; }
.legal-doc h3 { margin: 24px 0 8px; font-weight: 700; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul,
.legal-doc ol { margin: 0 0 12px; padding-left: 24px; }
.legal-doc ul { list-style: disc; }
.legal-doc ol { list-style: decimal; }
.legal-doc li { margin: 0 0 6px; }
@media (max-width: 600px) { .legal-doc { padding: 20px; } }

/* #619 — „Škola" with suggestions from the register of schools (~schoolPickerScript). The script
   wraps the input in .portal-school-picker; the list hangs right under it, over the fields below. */
.portal-school-picker { position: relative; }
.portal-school-picker__list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 40;
	margin: 4px 0 0;
	padding: 4px;
	list-style: none;
	max-height: 320px;
	overflow-y: auto;
	background: var(--portal-surface);
	border: 1.5px solid var(--portal-line);
	border-radius: var(--portal-r);
	box-shadow: var(--portal-shadow-dropdown);
}
.portal-school-picker__option {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 12px;
	border-radius: var(--portal-r-sm);
	cursor: pointer;
}
.portal-school-picker__option strong { font-weight: 600; color: var(--portal-ink); }
.portal-school-picker__option span,
.portal-school-picker__empty,
.portal-school-picker__address { font-size: 0.8rem; color: var(--portal-mute); }
.portal-school-picker__option:hover,
.portal-school-picker__option.is-active { background: var(--portal-blue-soft); }
.portal-school-picker__empty { padding: 8px 12px; }
.portal-school-picker__home { margin-top: 10px; }
