/* revotly base stylesheet — no framework, CSS custom properties as theme tokens */

:root {
    --color-bg: #f7f8fc;
    --color-surface: #ffffff;
    --color-text: #1e2235;
    --color-text-muted: #5b6178;
    --color-primary: #4650dd;
    --color-primary-dark: #3a43be;
    --color-accent-teal: #0fa3a3;
    --color-accent-amber: #e8a13c;
    --color-accent-rose: #d5568c;
    --color-border: #e3e6f0;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(30, 34, 53, 0.07);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding-inline: 20px;
}

main.container { flex: 1; }
/* The editor a bit wider than the other pages: all seven layouts of a
   content slide fit on one line (7 × 96px + gaps in the details pane). */
body:has(main > .editor) .container { max-width: 1180px; } /* header and footer alike, so the edges line up */

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    display: inline-flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text);
}
.logo__icon { width: 27px; height: 27px; display: block; margin-right: 9px; }
.logo span { color: var(--color-primary); }
.logo:hover { text-decoration: none; }
.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.btn--primary:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}
.btn--small { padding: 7px 16px; font-size: 0.92rem; }

/* Hero */
.hero {
    text-align: center;
    padding: 64px 0 40px;
}
.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}
.hero__subtitle {
    max-width: 620px;
    margin: 0 auto 32px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}
.join-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.join-form input {
    width: 180px;
    padding: 10px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1.15rem;
    text-align: center;
    letter-spacing: 0.15em;
}
.join-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Feature cards */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 24px 0 64px;
}
.feature-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border-top: 4px solid var(--color-primary);
}
.feature-card--slides { border-top-color: var(--color-accent-teal); }
.feature-card--norace { border-top-color: var(--color-accent-amber); }
.feature-card--discussion { border-top-color: var(--color-accent-rose); }
.feature-card h2 { font-size: 1.15rem; margin: 0 0 8px; }
.feature-card p { margin: 0; color: var(--color-text-muted); }

/* Slanted banner between hero and features */
.hero-banner-wrap { text-align: center; margin: -4px 0 36px; }
.hero-banner {
    display: inline-block;
    transform: rotate(-2.5deg);
    background: var(--color-primary);
    color: #fff;
    font-size: clamp(1.15rem, 2.6vw, 1.5rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 12px 36px;
    margin: 0;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: transform 0.35s ease;
}
.hero-banner:hover { transform: rotate(2.5deg); }

/* Trust band: privacy selling points */
.trust { text-align: center; padding: 8px 0 56px; }
.trust__title { margin: 0 0 24px; font-size: 1.5rem; }
.trust__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    text-align: left;
}
.trust__item h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    padding-left: 26px;
    position: relative;
}
.trust__item h3::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: -1px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    line-height: 19px;
    text-align: center;
}
.trust__item p { margin: 0; padding-left: 26px; color: var(--color-text-muted); font-size: 0.95rem; }
.trust__more { margin: 24px 0 0; font-size: 0.95rem; }
/* «Your data belongs to you»: same list, as a highlighted card before the privacy band */
.trust--data {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--color-primary);
    padding: 32px 28px;
    margin-bottom: 56px;
}

/* Teacher call-to-action band on the home page */
.home-cta {
    text-align: center;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 24px;
    margin-bottom: 64px;
}
.home-cta h2 { margin: 0 0 8px; }
.home-cta p { margin: 0 auto 20px; max-width: 520px; color: var(--color-text-muted); }
.home-cta__buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Admin statistics (/admin/stats) */
.admin-stats { padding: 24px 0 48px; }
.admin-stats__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.admin-stats__head h1 { margin: 0; }
.admin-stats__periods { display: flex; gap: 6px; }
.admin-stats__periods a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--color-text-muted); }
.admin-stats__periods a.is-active { background: var(--color-primary); color: #fff; }
.admin-stats__note { color: var(--color-text-muted); font-size: 0.9rem; margin: 6px 0 20px; }
.admin-stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.admin-stats .account-card { margin-bottom: 20px; }
.admin-stats h3 { font-size: 1rem; margin: 0 0 8px; }
.admin-stats__kpis { display: flex; gap: 28px; margin: 0; }
.admin-stats__kpis dt { color: var(--color-text-muted); font-size: 0.85rem; }
.admin-stats__kpis dd { margin: 0; font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.admin-table th, .admin-table td { padding: 5px 8px; border-bottom: 1px solid var(--color-border); text-align: left; white-space: nowrap; }
.admin-table th { font-weight: 600; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .muted, .admin-stats .muted { color: var(--color-text-muted); }
.admin-table .alert { color: #c0392b; font-weight: 700; }
.admin-table--daily thead th { font-size: 0.78rem; white-space: normal; vertical-align: bottom; }
.admin-table__scroll { overflow-x: auto; }
.admin-stats__recent { margin-top: 16px; }
.admin-stats__recent summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }

/* Admin page: the accounts (/admin) */
.admin-users__search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; max-width: 560px; }
.admin-users__search input { flex: 1; min-width: 0; }
.admin-users__filter { margin: 0 0 14px; }
.admin-users .admin-table th, .admin-users .admin-table td { padding: 8px 10px; vertical-align: middle; }
.admin-users__account { min-width: 200px; white-space: normal; }
.admin-users__account strong, .admin-users__account .muted { display: block; overflow-wrap: anywhere; }
.admin-users .pill + .muted { margin-left: 6px; font-size: 0.85rem; }
.admin-users__actions, .admin-users__grant { display: flex; align-items: center; gap: 8px; }
.admin-users__grant input[type=date] { width: auto; padding: 6px 10px; }
.admin-users__row--unverified { background: #fdf6e3; }
.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--color-border);
}
.pill--pro { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pill--unverified { background: #fbefcf; border-color: #ecd79a; color: #7a5a12; }
.btn--danger { background: #fff; color: #c0392b; border: 1px solid #e0b4ae; }
.btn--danger:hover { background: #fbeeec; text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pricing page */
.pricing { text-align: center; padding: 40px 0 24px; }
.pricing__title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 8px; }
.pricing__subtitle { color: var(--color-text-muted); margin: 0 0 40px; }
.pricing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
    justify-content: center;
    gap: 24px;
    align-items: stretch;
}
.price-card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.price-card--pro { border-color: var(--color-primary); }
.price-card__badge {
    position: absolute;
    top: -13px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 999px;
}
.price-card__name { margin: 0 0 12px; font-size: 1.3rem; }
.price-card__price { font-size: 3rem; font-weight: 800; line-height: 1; }
.price-card__currency { font-size: 0.95rem; font-weight: 600; color: var(--color-text-muted); margin-left: 6px; }
.price-card__period { color: var(--color-text-muted); margin-top: 4px; }
.price-card__alt { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 2px; }
.price-card__features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
    flex: 1;
}
.price-card__features li {
    padding: 6px 0 6px 26px;
    position: relative;
}
.price-card__features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}
.price-card__buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.price-card__current { font-weight: 700; color: var(--color-primary); }
.price-card__expiry, .price-card__soon { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 6px; }
.pricing__note { max-width: 640px; margin: 32px auto 0; color: var(--color-text-muted); font-size: 0.9rem; }

/* Account page */
.account { max-width: 640px; margin: 0 auto; padding: 24px 0 48px; }
.account h1 { margin-bottom: 20px; }
.account-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.account-card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.account-card__list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.account-card__list dt { color: var(--color-text-muted); }
.account-card__list dd { margin: 0; }
.account-card__plan { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.account-card__badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--color-border);
    font-weight: 700;
}
.account-card__badge--pro { background: var(--color-primary); color: #fff; }
.account-card__expiry { color: var(--color-text-muted); }
.app-version {
    margin: 40px 0 0;
    text-align: right;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.account-card__hint { margin: 12px 0 0; color: var(--color-text-muted); font-size: 0.9rem; }
.account-card__hint--top { margin: 0 0 16px; }
.slide-defaults__row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
}
.slide-defaults__row legend { float: left; width: 140px; padding: 0; font-weight: 600; }
.slide-defaults__options { display: flex; gap: 18px; flex-wrap: wrap; }
.slide-defaults__option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.slide-defaults .btn { margin-top: 8px; }

/* Legal page */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 0 48px; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.3rem; margin-top: 36px; }
.legal h3 { font-size: 1.05rem; margin-top: 24px; }
.legal p { line-height: 1.6; }
.legal mark { background: #ffe9a8; padding: 0 3px; border-radius: 3px; }

/* Forms / auth cards */
.auth-card {
    max-width: 420px;
    margin: 48px auto;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.auth-card__intro { color: var(--color-text-muted); margin-top: 0; }
.auth-card label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    margin: 16px 0 4px;
}
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.auth-card .btn--block { margin-top: 20px; }
.auth-card__alt {
    margin-top: 20px;
    font-size: 0.92rem;
    color: var(--color-text-muted);
}
.auth-card__resend { margin-top: 12px; }
.btn--block { display: block; width: 100%; }
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-primary);
    font-family: var(--font);
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: underline;
}
.field-error {
    color: #c0392b;
    font-size: 0.88rem;
    margin: 4px 0 0;
}
.form-error {
    background: #fdecea;
    color: #c0392b;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

/* Library */
.library { padding: 32px 0 48px; }
.library__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.library__header h1 { margin: 0; }
.library__create { display: flex; align-items: center; gap: 10px; }
/* «＋ Neu»: a big button, the form drops down below it */
.library__new { position: relative; }
.library__new-btn { list-style: none; cursor: pointer; font-size: 1rem; }
.library__new-btn::-webkit-details-marker { display: none; }
.library__new-form {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: 320px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(30, 34, 53, 0.14);
}
.library__new-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.library__new-form input,
.library__new-form select,
.library__search,
.library__sort {
    padding: 7px 10px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 400;
}
.library__new-form input:focus,
.library__search:focus { outline: none; border-color: var(--color-primary); }
/* Folders on the left, search / sort / view on the right */
.library__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 24px 0 18px;
}
.library__toolbar .folder-chips { margin: 0; }
.library__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.library__search { width: 200px; }
.site-nav__logout { display: contents; }
.site-nav .btn-link { color: var(--color-primary); text-decoration: none; font-size: inherit; }
.site-nav .btn-link:hover { text-decoration: underline; }
.library__new-plus { font-size: 1.25em; font-weight: 800; line-height: 1; margin-right: 2px; }
.quiz-item[hidden] { display: none; } /* search hides items; .quiz-item is flex */
.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-form input[type="text"],
.inline-form select {
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.95rem;
}
.inline-form input[type="text"]:focus { outline: none; border-color: var(--color-primary); }

.library__import.is-busy .library__import-btn { pointer-events: none; opacity: 0.85; }
.library__import.is-busy .library__import-btn::before {
    content: '';
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 8px;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.library__import-btn { cursor: pointer; line-height: normal; } /* a label, not a button: body line height otherwise */
.btn--secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    /* 2px Rand + 8/20px Padding = gleiche Aussenmasse wie .btn--primary */
    padding: 8px 20px;
}
.btn--secondary:hover { background: #eef0fd; text-decoration: none; }

.folder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.folder-chip {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.92rem;
}
.folder-chip:hover { text-decoration: none; border-color: var(--color-primary); }
.folder-new { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.folder-new[open] .folder-chip--new { border-color: var(--color-primary); }
.folder-chip--new {
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    color: var(--color-primary);
    border: 1px dashed color-mix(in srgb, var(--color-primary) 50%, transparent);
}
.folder-chip--new::-webkit-details-marker { display: none; }
.folder-new .inline-form input[type="text"] { padding: 5px 10px; }
.folder-chip--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}
.folder-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}
.folder-actions summary { cursor: pointer; color: var(--color-primary); }
.btn-link--danger { color: #c0392b; }

.quiz-list { list-style: none; margin: 0; padding: 0; }
.quiz-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 20px;
    margin-bottom: 10px;
}
.quiz-item__title { font-weight: 600; font-size: 1.05rem; color: var(--color-text); }
.quiz-item--archived { opacity: 0.75; }
.quiz-item--archived .quiz-item__actions { display: flex; align-items: center; gap: 14px; }
.library-archive { margin-top: 36px; }
.library-archive summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-soft, #666);
}
.library-archive__hint { color: var(--color-text-soft, #666); font-size: 0.92rem; margin: 10px 0 14px; }
.quiz-item__desc {
    margin: 2px 0;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.quiz-item__meta {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.quiz-item__more { position: relative; }
.quiz-item__more summary {
    cursor: pointer;
    list-style: none;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-weight: 700;
}
.quiz-item__more summary::-webkit-details-marker { display: none; }
.quiz-item__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(30, 34, 53, 0.14);
    padding: 8px;
    display: flex;
    flex-direction: column;
    width: 300px;
    max-width: calc(100vw - 32px);
}
/* Context menu: two small fields on top, then one-click actions as rows. */
.qmenu__field { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; }
.qmenu__label { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.qmenu__row { display: flex; gap: 6px; }
.qmenu__row .btn { padding: 5px 12px; }
.qmenu__field input[type="text"],
.qmenu__field select {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.95rem;
}
.qmenu__field input[type="text"]:focus,
.qmenu__field select:focus { outline: none; border-color: var(--color-primary); }
.qmenu__sep { border: none; border-top: 1px solid var(--color-border); margin: 6px 0; }
.qmenu__item {
    display: block;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}
.qmenu__item:hover { background: var(--color-bg); }
.qmenu__item--danger { color: #c0392b; }
.qmenu__item--danger:hover { background: #fdecea; }
.qmenu__check { display: flex; align-items: center; gap: 6px; padding: 0 8px 6px; font-size: 0.85rem; color: var(--color-text-muted); cursor: pointer; }
.library__empty {
    color: var(--color-text-muted);
    padding: 32px 0;
}

/* Library views (library.js): tiles with a big cover, or a compact list
   with a small one; the cover is the quiz's first real slide as a mini
   slide in its own design (like the presenter strip). */
.view-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.view-toggle__btn {
    padding: 4px 12px;
    border: none;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 1.05rem;
    cursor: pointer;
}
.view-toggle__btn + .view-toggle__btn { border-left: 1px solid var(--color-border); }
.view-toggle__btn[aria-pressed="true"] { background: var(--color-primary); color: #fff; }
.quiz-item__cover { display: block; flex: none; overflow: hidden; }
.quiz-cover {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    container-type: size;
    align-items: safe center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    /* a 1920 px beamer scaled down, as the design panel's stage */
    padding: calc((24 + var(--stage-mt, 0)) * 100% / 1920) calc((24 + var(--stage-mx, 0)) * 100% / 1920) calc(24 * 100% / 1920);
}
.quiz-cover .player-slider,
.quiz-cover .slide-preview__sliderinfo { display: none; } /* native inputs don't scale down */
.quiz-cover a { pointer-events: none; } /* the whole cover opens the editor, not a link in the mini slide */
.quiz-item__actions { display: flex; align-items: center; gap: 10px; }
.quiz-item__present { white-space: nowrap; }
.qmenu__info { margin: 2px 8px 6px; font-size: 0.8rem; color: var(--color-text-muted); }

.quiz-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.quiz-list--grid .quiz-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    transition: box-shadow 0.15s, transform 0.15s;
}
.quiz-list--grid .quiz-item:hover { box-shadow: 0 6px 20px rgba(30, 34, 53, 0.14); transform: translateY(-1px); }
/* The transform makes the hovered tile a stacking context, so the «⋯» menu's
   z-index only counts inside the tile and the next tile's cover (a container,
   also a stacking context) would paint over it: lift the tile with the open
   menu above its siblings (grid items take a z-index). */
.quiz-item:has(.quiz-item__more[open]) { position: relative; z-index: 2; }
.quiz-list--grid .quiz-item__cover { aspect-ratio: 16 / 9; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--color-border); }
.quiz-list--grid .quiz-item__main { flex: 1; padding: 12px 16px 6px; }
.quiz-list--grid .quiz-item__actions { justify-content: space-between; padding: 6px 16px 14px; }

.quiz-list--list .quiz-item { padding: 10px 16px 10px 10px; }
.quiz-list--list .quiz-item__cover { width: 136px; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--color-border); }
.quiz-list--list .quiz-item__main { flex: 1; min-width: 0; }
@media (max-width: 600px) {
    .quiz-list--list .quiz-item { flex-wrap: wrap; }
    .quiz-list--list .quiz-item__cover { width: 96px; }
}

/* Editor */
.editor { padding: 20px 0 48px; }
.editor__topbar {
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.editor__back { white-space: nowrap; }
.editor__title { margin: 0; font-size: 1.4rem; flex: 1; }
.editor__settings { position: relative; }
.editor__settings summary,
.editor__design summary { cursor: pointer; color: var(--color-primary); list-style: none; }
.editor__settings summary::-webkit-details-marker,
.editor__design summary::-webkit-details-marker { display: none; }

/* Design panel: a drawer on the right, the slide list stays usable. */
.design-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(460px, 100vw);
    overflow: hidden; /* head and stage stay, the settings below scroll */
    background: var(--color-surface);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
    padding: 16px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.design-drawer__head { display: flex; align-items: center; gap: 10px; }
.design-drawer__head strong { font-size: 1.1rem; }
.design-drawer__status { flex: 1; color: var(--color-text-muted); font-size: 0.85rem; }
.design-drawer__close {
    border: none;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px 8px;
}
.design-drawer__close:hover { color: var(--color-text); }
/* A 1920×1080 beamer in small: the base padding scales too, unlike on the
   real stages where it is a fixed 24px. */
.design-drawer__stage {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 16 / 9;
    container-type: size;
    display: flex;
    align-items: safe center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: calc((24 + var(--stage-mt, 0)) * 100% / 1920) calc((24 + var(--stage-mx, 0)) * 100% / 1920) calc(24 * 100% / 1920);
}
.design-drawer__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.design-drawer__foot .btn:disabled { opacity: 0.45; cursor: default; }
.design-drawer__hint { margin: 0; color: var(--color-text-muted); font-size: 0.82rem; }
.design-drawer__form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-right: -10px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.design-drawer__form fieldset {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0;
    padding: 10px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.design-drawer__form fieldset.editor__settings-margins { flex-direction: row; }
.design-drawer__form legend {
    padding: 0 6px 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.editor__settings-form {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    width: min(680px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-height: calc(100vh - 120px);
    overflow: auto;
}
@media (max-width: 760px) {
    .editor__settings-form { grid-template-columns: 1fr; }
}
.editor__settings-form label,
.design-drawer__form label { font-size: 0.92rem; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.editor__settings-form input[type="text"],
.editor__settings-form textarea,
.editor__settings-form select,
.design-drawer__form input[type="number"],
.design-drawer__form select {
    padding: 8px 10px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 400;
}
.editor__settings-check { flex-direction: row !important; align-items: center; }
.editor__settings-margins { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.editor__settings-margins legend { flex-basis: 100%; }
.editor__settings-margins label { flex: 1 1 8em; }
.editor__settings-margins input { width: 100%; }
.editor__settings-hint { flex-basis: 100%; color: var(--color-text-muted); font-size: 0.82rem; }
/* The quiz settings in four groups, each a pastel field with a stronger
   left edge: general (grey), flow (blue), points (amber), participants (teal). */
.settings-group {
    --group-color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 10px 12px 12px;
    border: none;
    border-left: 4px solid var(--group-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--group-color) 9%, #fff);
    min-width: 0;
}
.settings-group legend {
    float: left; /* inside the field, not on its border */
    width: 100%;
    padding: 0;
    margin-bottom: 2px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--group-color);
}
.settings-group--general { --group-color: #6b7280; }
.settings-group--flow { --group-color: var(--color-primary); }
.settings-group--points { --group-color: var(--color-accent-amber); }
.settings-group--players { --group-color: var(--color-accent-teal); }
.settings-group legend + * { clear: both; }
.settings-group .editor__settings-hint { margin: 0; }
.settings-group input[type="number"] { width: 100%; padding: 8px 10px; border: 2px solid var(--color-border); border-radius: 8px; font-family: var(--font); font-size: 0.95rem; }
.settings-group__body { display: flex; flex-direction: column; gap: 10px; }
/* Points off: the values stay visible but clearly inactive */
.settings-group--off .settings-group__body { opacity: 0.45; }
.editor__settings-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
/* The groups fill the two columns: general and flow left, points and participants right */
.settings-group--general { grid-column: 1; grid-row: 1; }
.settings-group--flow { grid-column: 1; grid-row: 2; }
.settings-group--points { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.settings-group--players { grid-column: 1 / -1; grid-row: 3; }
@media (max-width: 760px) {
    .settings-group--general, .settings-group--flow, .settings-group--points, .settings-group--players { grid-column: 1; grid-row: auto; }
}
.editor-points .editor-check { font-weight: 400; margin: 4px 0; }
.editor-points .editor-form__grid { margin-top: 4px; }
.editor-points > .options-editor__hint { margin-top: 4px; font-weight: 400; }

.editor__layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 720px) {
    .editor__layout { grid-template-columns: 1fr; }
}
.editor__sidebar {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    /* Stays in view while the form scrolls; the slide list scrolls on its
       own, the add buttons stay at the bottom. */
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
}
.slide-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    flex: 0 1 auto;
    min-height: 120px;
    overflow-y: auto;
    overscroll-behavior: contain; /* the end of the list doesn't scroll the page */
}
@media (max-width: 720px) {
    .editor__sidebar { position: static; max-height: none; }
    .slide-list { overflow: visible; }
}
.slide-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
}
.slide-list__item:hover { background: var(--color-bg); }
.slide-list__item--active { background: #eef0fd; font-weight: 600; }
/* Choice question symbol (list, add buttons): empty without a marked right
   answer, filled with one (editor.js typeIcon). Emoji-sized. */
.qicon {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.12em;
    border: 2px solid var(--color-text-muted);
    border-radius: 3px;
    background: var(--color-surface);
    position: relative;
}
.qicon--radio { border-radius: 50%; }
.qicon--on { border-color: var(--color-primary); }
.qicon--radio.qicon--on { background: radial-gradient(circle, var(--color-primary) 0 42%, var(--color-surface) 46%); }
.qicon--check.qicon--on { background: var(--color-primary); }
.qicon--check.qicon--on::after {
    content: '';
    position: absolute;
    left: 28%;
    top: 6%;
    width: 30%;
    height: 58%;
    border: solid var(--color-surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.slide-list__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.slide-list__item { position: relative; justify-content: flex-start; }
.slide-list__grip {
    flex: none;
    color: var(--color-text-muted);
    opacity: 0.4;
    cursor: grab;
    font-size: 0.85rem;
}
.slide-list__item:hover .slide-list__grip { opacity: 1; }
.slide-list__item--dragging { opacity: 0.4; }
.slide-list__item--drop-before::before,
.slide-list__item--drop-after::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-primary);
    pointer-events: none;
}
.slide-list__item--drop-before::before { top: -2px; }
.slide-list__item--drop-after::after { bottom: -2px; }
.slide-add { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slide-add__label { grid-column: 1 / -1; font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; }
.slide-add__btn--paste { grid-column: 1 / -1; }
.slide-add__btn {
    text-align: left;
    padding: 6px 7px;
    min-width: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    background: none;
    font-family: var(--font);
    font-size: 0.84rem;
    cursor: pointer;
}
.slide-add__btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

.editor__main {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    min-height: 380px;
}
.editor__hint { color: var(--color-text-muted); }
.editor-form__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.editor-form__type { font-weight: 700; white-space: nowrap; }
/* Single ↔ multiple choice: the type as a select that looks like the label */
.editor-form__type-select {
    font: inherit;
    font-weight: 700;
    color: inherit;
    padding: 4px 8px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
}
.editor-form__type-select:hover,
.editor-form__type-select:focus { border-color: var(--color-primary); outline: none; }
.editor-form__head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.editor-form__head-actions > * { white-space: nowrap; }
.editor-form__copy-actions { margin-left: auto; display: flex; gap: 10px; }
.editor-form__copy-actions > * { white-space: nowrap; }

/* Slide preview overlay (renders with the beamer styles from game.css) */
/* Detached preview window (second monitor) */
.preview-window {
    position: relative;
    height: 100vh; /* fixed height: a size container gets none from min-height */
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--stage-mt, 0) * 100% / 1920) calc(24px + var(--stage-mx, 0) * 100% / 1920) 24px; /* margins as on the beamer, see .host__stage */
    container-type: size; /* slides scale with it, see .host-slide */
}
.preview-window__stage {
    width: 100%;
    align-self: stretch; /* full height, so a slide can sit at the top or bottom */
    display: flex;
    align-items: safe center;
    justify-content: center;
}
.preview-window__nav {
    position: fixed;
    z-index: 2;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    opacity: 0.35;
    transition: opacity 0.15s;
}
.preview-window__nav:hover { opacity: 1; }
.preview-window__waiting { color: var(--color-text-muted); font-size: 1.1rem; }

.slide-preview {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
}
.slide-preview__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.slide-preview__hint { color: var(--color-text-muted); font-size: 0.92rem; }
.slide-preview__nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.slide-preview__navbtn {
    border: none;
    background: var(--color-bg);
    border-radius: 10px;
    padding: 4px 14px;
    font-size: 1.4rem;
    line-height: 1.2;
    font-weight: 700;
    cursor: pointer;
}
.slide-preview__navbtn:hover:not(:disabled) { background: var(--color-border); }
.slide-preview__navbtn:disabled { opacity: 0.35; cursor: default; }
.slide-preview__pos { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.slide-preview__areabtn[aria-pressed="true"] { background: #e0389b; color: #fff; }
.slide-preview__areabtn[aria-pressed="true"]:hover { background: #c22a84; }
/* Content area guide: the box a slide may fill on the beamer, i.e. the
   stage minus its 24px padding, at most 1100px wide (.host-slide). */
.slide-preview__stage { position: relative; container-type: size; }
.preview-area::after {
    content: '';
    position: absolute;
    top: 24px;
    margin-top: calc(var(--stage-mt, 0) * 100% / 1920); /* % of the width, like the stage padding */
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(100cqw, 170cqh); /* the .host-slide box */
    border: 2px dashed #e0389b;
    pointer-events: none;
    z-index: 1;
}
.slide-preview__close {
    border: none;
    background: var(--color-bg);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.slide-preview__close:hover { background: #fdecea; color: #c0392b; }
.slide-preview__stage {
    flex: 1;
    display: flex;
    align-items: safe center;
    justify-content: center;
    padding: calc(24px + var(--stage-mt, 0) * 100% / 1920) calc(24px + var(--stage-mx, 0) * 100% / 1920) 24px; /* margins as on the beamer, see .host__stage */
    overflow: auto;
}
.slide-preview__sliderinfo {
    margin-top: 1.5em;
    font-size: 1.15em;
    color: var(--color-text-muted);
}
/* The participants' slider, scaled like the rest of the slide. */
.host-slide .player-slider {
    max-width: 30em;
    margin: 1.75em auto 0;
}
.host-slide .player-slider__value {
    font-size: 2.4em;
    width: 5.2em;
    padding: 0.15em 0.25em;
    border-radius: 0.3em;
}
.host-slide .player-slider input[type="range"] {
    width: 100%;
    margin-top: 1em;
}
.host-options__item--correct { outline: 3px solid var(--color-correct, #14764a); }
.editor-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    font-weight: 600;
}
.editor-field input,
.editor-field textarea,
.editor-field select {
    padding: 9px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
}
.editor-field input:focus,
.editor-field textarea:focus { outline: none; border-color: var(--color-primary); }

/* --- Rich text editor (content slide body) -------------------------- */
.rte {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface, #fff);
}
.rte:focus-within { border-color: var(--color-primary); }
.rte__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--color-border);
}
.rte__btn {
    min-width: 32px;
    height: 30px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}
.rte__btn:hover { background: var(--color-border); }
.rte__btn--active,
.rte__btn--active:hover {
    background: var(--color-primary);
    color: #fff;
}
.rte__sep {
    width: 1px;
    height: 20px;
    margin: 0 5px;
    background: var(--color-border);
}
.rte__area {
    min-height: 140px;
    max-height: 420px;
    overflow-y: auto;
    padding: 9px 12px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}
.rte__area:focus { outline: none; }
.rte__area p { margin: 0 0 0.4em; }
.rte__area ul,
.rte__area ol { margin: 0.3em 0; padding-left: 1.5em; }
/* Compact variant for the question: same line spacing and default
   alignment (centered) as on the slide */
.rte--compact .rte__area { min-height: 70px; text-align: center; }
.rte--compact .rte__area p { margin: 0; }
.rte--compact .rte__area ul,
.rte--compact .rte__area ol { display: inline-block; text-align: left; }
/* Step-by-step text: a pin in the left gutter marks «always visible» lines. */
.rte--pins .rte__area { padding-left: 34px; }
.rte--pins .rte__area > p.step-pin,
.rte--pins .rte__area > ul > li.step-pin,
.rte--pins .rte__area > ol > li.step-pin { position: relative; }
.rte--pins .rte__area > p.step-pin::before,
.rte--pins .rte__area > ul > li.step-pin::before,
.rte--pins .rte__area > ol > li.step-pin::before {
    content: '📌';
    position: absolute;
    left: -28px;
    top: 0.1em;
    font-size: 0.85em;
    line-height: 1.5;
}
.rte--pins .rte__area > ul > li.step-pin::before,
.rte--pins .rte__area > ol > li.step-pin::before { left: calc(-28px - 1.5em); } /* the list's own indent */
.rte__btn svg { display: block; margin: 0 auto; }
.rte__btn:disabled { opacity: 0.35; cursor: default; background: none; }
.rte__btn--source { margin-left: auto; font-family: monospace; }
.rte [hidden] { display: none !important; } /* beats display rules of the parts */
.rte .rte__source {
    display: block;
    width: 100%;
    min-height: 140px;
    max-height: 420px;
    padding: 9px 12px;
    border: 0;
    border-radius: 0 0 8px 8px;
    background: transparent;
    color: inherit;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    tab-size: 2;
}
.rte .rte__source:focus { outline: none; }
.rte--compact .rte__source { min-height: 100px; }

/* Paragraph alignment from the rich text toolbar (editor and all slide
   views); overrides the field's default alignment */
.ta-left { text-align: left; }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.editor-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.editor-form__saverow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}
.editor-form__status { color: var(--color-text-muted); }

/* Design presets: one-click token combinations in the settings form */
.editor__presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.editor__presets-label { flex-basis: 100%; font-size: 0.92rem; font-weight: 600; }
.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.92rem;
    cursor: pointer;
}
.preset-btn:hover { border-color: var(--color-primary); }
.preset-btn--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(70, 80, 221, 0.18);
    font-weight: 600;
}
.preset-btn--active::after { content: ' ✓'; color: var(--color-primary); font-weight: 700; }
.preset-btn__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* Layout picker: schematic mini-slides (PowerPoint-style) */
.lpick { display: flex; gap: 10px; flex-wrap: wrap; }
.lpick__item {
    width: 96px;
    height: 64px;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
}
.lpick__item:hover { border-color: var(--color-text-muted); }
.lpick__item--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(70, 80, 221, 0.18);
}
.lpick__bar { height: 6px; width: 62%; border-radius: 2px; background: var(--color-text); opacity: 0.75; flex: none; }
.lpick__line { height: 3px; border-radius: 2px; background: var(--color-text-muted); opacity: 0.55; }
.lpick__img { flex: 1; min-height: 10px; border-radius: 3px; background: var(--color-primary); opacity: 0.35; }
.lpick__row { flex: 1; display: flex; gap: 6px; min-height: 0; }
.lpick__row .lpick__img { flex: 1; }
.lpick__col { flex: 1; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.lpick__item > .lpick__col { flex: 1; }
.lpick__bar--center { align-self: center; }
.lpick__bar--full { width: 100%; }
.lpick__line--short { width: 60%; }
.lpick__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}
.lpick__col--center { align-items: center; }
.lpick__col--center .lpick__bar { width: 100%; }

/* Single-line input with alignment buttons (content slide heading) */
.aligned-input { display: flex; align-items: center; gap: 4px; }
.aligned-input input { flex: 1; min-width: 0; margin-right: 6px; }
/* Vertical position picker: smaller mini-slides, text block moves */
.lpick__item--valign { width: 64px; height: 48px; padding: 6px 8px; gap: 4px; align-items: center; }
.lpick__item--valign .lpick__bar { width: 70%; height: 5px; }
.lpick__item--valign .lpick__line { width: 100%; }
.lpick__item--valign .lpick__line--short { width: 60%; }
.lpick__item--valign-top { justify-content: flex-start; }
.lpick__item--valign-center { justify-content: center; }
.lpick__item--valign-bottom { justify-content: flex-end; }

.image-slots { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.image-slots > .image-picker { flex: 1 1 240px; min-width: 0; }
/* An image field is a drop zone: always lightly outlined; clicked, it is
   the target for Ctrl+V and shows it (stronger) until the focus moves on. */
.image-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
    border: 2px dashed color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.image-picker:hover { border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border)); }
.image-picker:focus,
.image-picker:focus-within {
    outline: none;
    border-color: var(--color-primary);
    border-style: solid;
    background: color-mix(in srgb, var(--color-primary) 7%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.image-drop { outline: 2px dashed var(--color-primary); outline-offset: 2px; background: color-mix(in srgb, var(--color-primary) 7%, transparent); }
.image-picker.image-drop { outline: none; border-color: var(--color-primary); }
.image-picker__caption { font-size: 0.92rem; font-weight: 600; }
.image-picker__zone {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.image-picker__zone img {
    max-width: 100%;
    max-height: 170px;
    border-radius: 8px;
    display: block;
}
.image-picker__prompt { font-size: 0.85rem; color: var(--color-text-muted); max-width: 26em; line-height: 1.4; }
.image-picker--empty .image-picker__prompt::before { content: '🖼'; display: block; font-size: 1.8rem; opacity: 0.5; margin-bottom: 4px; }
.image-picker__actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.image-picker__status { font-size: 0.88rem; color: var(--color-text-muted); }
.options-editor { margin-bottom: 14px; }
/* Picture of an answer option: 🖼 to choose, or the thumbnail (click = replace) with ✕ */
.options-editor__image { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.options-editor__image .image-picker__status { font-size: 0.8rem; }
.options-editor__addimage,
.options-editor__unimage {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 7px;
    line-height: 1;
}
.options-editor__addimage { opacity: 0.6; }
.options-editor__addimage:hover { opacity: 1; }
.options-editor__unimage { border: 0; background: none; color: var(--color-text-muted); padding: 4px; }
.options-editor__thumb { border: 1px solid var(--color-border); border-radius: 6px; padding: 0; background: none; cursor: pointer; line-height: 0; }
.options-editor__thumb img { height: 38px; width: auto; max-width: 70px; object-fit: contain; border-radius: 5px; display: block; }
.options-editor__row.image-drop { border-radius: 8px; }
/* Two text columns (content layout «two-text») */
.editor-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.editor-twocol > .editor-field { min-width: 0; }
.editor-twocol__head { display: flex; gap: 6px; margin-bottom: 6px; }
.editor-twocol__head input { flex: 1; min-width: 0; }
.editor-twocol__pin {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    cursor: pointer;
    padding: 0 8px;
    opacity: 0.45;
}
.editor-twocol__pin--active { opacity: 1; border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
@media (max-width: 900px) {
    .editor-twocol { grid-template-columns: 1fr; }
}
.options-editor__hint { font-size: 0.88rem; color: var(--color-text-muted); margin: 0 0 8px; }
.options-editor__row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.options-editor__row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
}
.options-editor__unmarked {
    font-size: 0.88rem;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff4e0;
    color: #7a4b00;
}
.options-editor__unmarked[hidden] { display: none; }
.options-editor .options-editor__letter { width: 30px; height: 30px; border-radius: 7px; font-size: 0.95rem; }
/* Collapsible parts of the slide form (layout & co., notes) */
.editor-section {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}
.editor-section__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.editor-section__summary::-webkit-details-marker { display: none; }
.editor-section__summary::before {
    content: '▸';
    color: var(--color-text-muted);
    transition: transform 0.15s;
}
.editor-section[open] > .editor-section__summary::before { transform: rotate(90deg); }
.editor-section__title { font-weight: 700; white-space: nowrap; }
.editor-section__info {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.editor-section[open] .editor-section__info { display: none; }
.editor-section__body { padding-top: 14px; } /* fields bring their own margin */
/* Layout & co.: pickers and selects side by side where they fit */
.editor-section--design > .editor-section__body { display: flex; flex-wrap: wrap; column-gap: 28px; }
.editor-section--design > .editor-section__body > .editor-field { flex: 1 1 14em; }
.editor-section--design > .editor-section__body > .editor-field:has(.lpick) { flex: 0 1 auto; }
/* The layouts get a line of their own, the vertical position comes below them */
.editor-section--design > .editor-section__body > .editor-field:has(.lpick__item:not(.lpick__item--valign)) { flex-basis: 100%; }
.editor-section--design > .editor-section__body > .editor-field:has(.editor-check) { flex-basis: 100%; }
.editor-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.editor-check + .options-editor__hint { margin: 2px 0 0 26px; font-weight: 400; }
.options-editor__row button {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
}
.options-editor__row button:hover:not(:disabled) { color: #c0392b; }

/* Flash messages */
.flash {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
}
.flash--success { background: #e6f7ef; color: #14764a; }
.flash--error { background: #fdecea; color: #c0392b; }

/* Error pages */
.error-page {
    text-align: center;
    padding: 80px 0;
}
.error-page h1 { margin-bottom: 8px; }
.error-page p { color: var(--color-text-muted); margin-bottom: 24px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
    padding: 18px 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.site-footer__links { display: flex; gap: 16px; }
.site-footer__links a { color: var(--color-text-muted); }
.lang-switch { display: flex; gap: 12px; }
.lang-switch__current { font-weight: 700; color: var(--color-text); }

/* Print view (/quiz/{id}/print): slides as 16:9 pages for print / PDF.
   On screen the pages are stacked with a toolbar above; printed, one
   slide per page and nothing else (page size: @page, set by print.js). */
.print-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 12px 20px;
    background: var(--color-surface);
    box-shadow: var(--shadow);
    font-size: 0.92rem;
}
.print-toolbar label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.print-toolbar select {
    padding: 6px 8px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
}
.print-toolbar__title { flex: 1; min-width: 10em; font-size: 1.05rem; }
.print-toolbar__count { color: var(--color-text-muted); }
.print-toolbar__hint { flex-basis: 100%; margin: 0; color: var(--color-text-muted); font-size: 0.85rem; }
.print-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 12px 48px;
    background: #d9dde5;
}
.print-page {
    flex-shrink: 0;
    width: 297mm;
    height: 167.0625mm;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    break-after: page;
    print-color-adjust: exact; /* theme backgrounds without the «background graphics» option */
    -webkit-print-color-adjust: exact;
}
.print-pages--notes .print-page { height: 210mm; }
/* Like the design panel's stage: a 1920 px beamer scaled, base padding included */
.print-page__stage {
    position: relative;
    flex: 0 0 167.0625mm;
    container-type: size;
    display: flex;
    align-items: safe center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg);
    padding: calc((24 + var(--stage-mt, 0)) * 100% / 1920) calc((24 + var(--stage-mx, 0)) * 100% / 1920) calc(24 * 100% / 1920);
}
.print-page__badge {
    position: absolute;
    top: 3mm;
    right: 4mm;
    padding: 1mm 3mm;
    border-radius: 999px;
    background: var(--color-correct, #14764a);
    color: #fff;
    font: 700 9pt var(--font);
}
.print-page__notes {
    flex: 1;
    padding: 5mm 12mm;
    border-top: 1px solid #d0d5dd;
    color: #1f2937;
    font: 10.5pt/1.4 var(--font);
    overflow: hidden;
}
.print-page__notes p { margin: 1mm 0 0; white-space: pre-wrap; }
.print-page .slide-preview__sliderinfo { font-size: 1.6em; }
@media print {
    .print-toolbar { display: none; }
    .print-pages { display: block; padding: 0; background: none; }
    .print-page { box-shadow: none; }
}

.editor__pdf { white-space: nowrap; }
